A question about bytecodes
John Rose
John.Rose at Sun.COM
Sat Jan 10 14:27:58 PST 2009
On Jan 10, 2009, at 1:00 PM, Florian Weimer wrote:
> * John Rose:
>
>> The only way to tell for certain whether the optimizer has performed
>> escape analysis (or any other desired optimization) is to examine the
>> assembly code. See:
>> http://wikis.sun.com/display/HotSpotInternals/PrintAssembly
>
> Is there a reason why PrintOptoAssembly appears to be deprecated?
> Doesn't it contain additional type information which might be useful
> for debugging purposes (or just figuring out what's going on)?
I don't get "appears deprecated". Do you mean that
the .hotspot_compiler directive "print" is now called
"printOptoAssembly", while "print" uses the PrintAssembly plugin if
available?
PrintOptoAssembly still works and there are no plans for removing
it. It is a useful tool if you want a dump from the late stages of
the server compiler. It is not a true disassembler, however. It
prints scheduled machine-level graph nodes, not true assembly code.
Try PrintAssembly; it prints the real machine code as emitted after
the compiler has finished. It includes many interesting annotations,
and it would be easy to add more. If there is some type annotation
in POA missing from PA, let's add it.
Caveat: PrintAssembly requires you to create a separate module,
based on Gnu binutils or an equivalent, which Sun people can't build
for you, because the OpenJDK has to stay arms-length from any GPL-ed
code that Sun do not own the rights to. Some civic-minded non-Sun
webmaster could build and host suitable PrintAssembly plugins, but
Sun can't. Alternatively, someone could cobble together an
implementation of the plugin (for x86) which does not depend on
binutils and contribute it to OpenJDK. The plugin interface is
beautifully simple, IMHO. But that seems like more trouble than it's
worth, given that binutils is freely available.
Best,
-- John
More information about the hotspot-dev
mailing list