Atomic::cmpxchg_ptr code duplication

Paul Hohensee Paul.Hohensee at Sun.COM
Thu Apr 2 08:07:13 PDT 2009

Sometimes compilers don't inline all the way through a call stack,
i.e., they may have limits on inlining depth.  It's not a matter for
the preprocessor, since we're talking methods, not macros.

Assembly code template are things like gcc asm statements or
.il functions.  Doesn't matter which.  What matters is whether the
compiler actually inlines the asm code where you want it.


Christian Thalinger wrote:
> On Thu, 2009-04-02 at 09:54 -0400, Paul Hohensee wrote:
>> If the platform-dependent versions are assembly code templates, then
>> it's likely at some point that the C++ compiler(s) didn't inline
>> properly
>> using your suggested code.  I haven't looked in awhile, but I'm pretty
>> sure there
>> are some places that use your style of code and others that don't for
>> because of that.
> Hmm, not sure I understand.  AFAIK it makes no difference for inlining
> in what header file the inline is defined, as long as both are included
> and the compiler (preprocessor) finds it.  Or do you mean something
> different by "assembly code templates", like .il files?
> -- Christian

More information about the hotspot-dev mailing list