How to inspect hotspot compiler results? hsdis binaries for Windows?

Vladimir Kozlov Vladimir.Kozlov at Sun.COM
Fri Nov 20 12:01:37 PST 2009


Ulf Zibis wrote:
 >> -Xcomp -XX:CompileOnly=class::method
 >>
 >> But it will not do any inlining since called methods should not be
 >> compiled.
 >
 > How can I choose e.g. 3 methods at 1 time?

Specify separate options -XX:CompileOnly=cl::m1 -XX:CompileOnly=cl::m2

 >
 > E.g. CompileCommand=print,java.lang.System::print
 > How to distinguish between methods of same name, but different signature ?
 >

Unfortunately, you can not distinguish different signatures.

>> Ulf Zibis wrote:
>>> P.S.: Is there any documentation, how to read the special 
>>> key-letters/words, printed from CompileCommand?
>>
>> What do you mean? Please, give example.

I will only give short explanations.

> 
> I mean things like:
> -   Could not load hsdis-i386.dll; library not loadable; PrintAssembly 
> is disabled  // PrintAssembly was not in option list
>     PrintAssembly request changed to PrintOptoAssembly

As it said, you don't have hsdis-i386.dll so there will be no normal
assembler output, only output from PrintOptoAssembly

> -    char[int:>=0]:exact *

Exact type is know during JIT compilation.

> -   #r051

Virtual register and how Register Allocator maps it to real registers and stack slots.

> -   N559:

Ignore, it is first node index.

> -   #        B1 <- BLOCK HEAD IS JUNK   Freq: 1

The generated code is divided by blocks. Each block ends with branch
or next block could be entered from several blocks.

First (as B0) block is unverified method entry which checks that
method is called for correct class.
"BLOCK HEAD IS JUNK" - there is no predecessor blocks.

"Freq: 1" - Normalized estimated frequency of a block execution.
It is defined by probability of taking branch to this block.
Used by Register Allocator.

> -   B1:
> -   B2: #        B34 B3 <- B1  Freq: 1

B1 is predecessor block and there is branch to B34 at the block end,
so execution can go to B3 or B34.

> -   P=0.000000 C=1471261.000000
P= is calculated on taken/not_taken counters from bytecode profiling information.
    it == 0. if not_taken == 0.
C= is total counter

> -   precise klass sun/nio/cs/ext/EUC_TW_C_d_b_codeToBuffer4$Decoder: 
> 0x03d4c448:Constant:exact *]

Object's klass address in permgen.

> -   Constant:exact *

Address in permgen known statically. For example, object's klasses, string constants.

> -   P=0.517169 C=1471261.000000

see above

> -   wrapper for: uncommon_trap(reason='range_check' 
> action='make_not_entrant')

This compiled method will be deoptimized (execution will go into interpreter)
if range check failed.

> -   sun.nio.cs.ext.EUC_TW_C_d_b_codeToBuffer4$Decoder::decode @ bci:58

For which bytecode range check is executed.

> -   L[0]=_ L[1]=_ L[2]=_ L[3]=esp + #48 L[4]=esp + #36 L[5]=esp + #40 
> L[6]=esp + #44 L[7]=esp + #0 L[8]=_ STK[0]=EBP STK[1]=esp + #48

Values for restoring interpreter frame (locals, expression stack, monitors)
during deoptimization.

> -   OopMap{ebp=Oop [36]=Oop [40]=Oop off=492}

Information for GC that EBP, esp + #36, esp + #40 contain oops
to adjust them during GC.

> -   INT3   ; ShouldNotReachHere

There is no return from uncommon_trap.

> -   Freq: 1.01327e-006  // what does such small value especially mean ?

We optimistically assuming that uncommon_trap code should not
be executed so we set very low frequency for it.

> -   B36: #        B28 <- B35  Freq: 1.75827e-006
>             # Block is sole successor of call

It says.

> -   TEST   EBX,EBX

zeroing EBX

>          Je,s
> -   # Destroy frame
> -   JMP    rethrow_stub

Rethrow execption.

> -   Compiled (c2)  38   nmethod (2)

c2 is name of Server JIT compiler (-server option or default on multicores),
other c1 is Client lightweight compiler.

> -   PcDesc(pc=0xc18650 offset=210):
>        java.lang.String::charAt  @31  reexecute=false
>        sun.nio.cs.ext.EUC_TW_C_d_b_codeToBuffer4$Decoder::decode  @61  
> reexecute=false

 From pcDesc.hpp:
// PcDescs map a physical PC (given as offset from start of nmethod) to
// the corresponding source scope and byte code index.

> -   #0
>     OopMap{ebp=Oop [36]=Oop [40]=Oop off=492}
>     #1
>     OopMap{[36]=Oop [40]=Oop [4]=Oop off=528}
>     #2
>     OopMap{ebp=Oop [36]=Oop [40]=Oop off=572}
>     #3
>     OopMap{[40]=Oop off=584}
>     #4
>     OopMap{ebp=Oop [40]=Oop off=608}
>     #5
>     OopMap{off=628}

List of all oopmaps for this compiled code.

> -     interpreter_invocation_count:  8847362

Times the method called in interpreter.

>       invocation_counter:               9129
>       backedge_counter:                    1
> -     16  bci: 9    BranchData          taken(0) displacement(48)

It is bytecode profiling information.

> 
> Items of extra special interest are marked red.

Vladimir

> 
> -Ulf
> 
> 
>>
>>>>> -Xcomp
>>>>> What is this ? There is no docu on 
>>>>> jdk1.7.0/docs/technotes/tools/windows/java.html
>>>>
>>>> We use it for stress testing out JIT compiler when all called methods
>>>> are immediately compiled without reaching threshold.
>>>> Note: the program execution will be very slow and generated code
>>>> for compiled methods could be very different from normal execution
>>>> since no profiling information is collected for executed bytecode.
>>>
>>> Thanks.
>>> Can this option be specified for single methods ?
>>
>> -Xcomp -XX:CompileOnly=class::method
>>
>> But it will not do any inlining since called methods should not be 
>> compiled.
> 
> Thanks.
> How can I choose e.g. 3 methods at 1 time?
> 
> E.g. CompileCommand=print,java.lang.System::print
> How to distinguish between methods of same name, but different signature ?
> 
> -Ulf
> 


More information about the hotspot-dev mailing list