Newbie hsdis questions

Christian Thalinger Christian.Thalinger at Sun.COM
Tue Dec 1 08:28:57 PST 2009


On Tue, 2009-12-01 at 16:08 +0000, Ben Evans wrote:
> 
> Hi, 
> 
> I have some newbie questions about the output of the HS disassembler.
> It's possible that some of these are really more general x86-64
> assembler questions, and if so, a pointer to a good reference would be
> much appreciated. 
> 
> I'm running 6u18-b05 on x64 with these options:  -XX:+PrintCompilation
> -XX:+PrintAssembly -XX:+PrintSignatureHandlers -XX:+PrintNMethods 
> 
> Here's a chunk of output I'm interested in: 
> 
> 384115 Compiled (c2) 496   nmethod com.db.e.d.m.p.TP::doExecute (833
> bytes) 
>  384116  total in heap  [0x00007fc3911f2a50,0x00007fc391208120] =
> 87760 
>  384117  relocation     [0x00007fc3911f2b58,0x00007fc3911f3630] =
> 2776 
>  384118  main code      [0x00007fc3911f3640,0x00007fc3911fc140] =
> 35584 
>  384119  stub code      [0x00007fc3911fc140,0x00007fc3911fc6c7] =
> 1415 
>  384120  constants      [0x00007fc3911fc6c7,0x00007fc3911fc6c8] = 1 
>  384121  scopes data    [0x00007fc3911fc6c8,0x00007fc391205598] =
> 36560 
>  384122  scopes pcs     [0x00007fc391205598,0x00007fc391206948] =
> 5040 
>  384123  dependencies   [0x00007fc391206948,0x00007fc3912069d0] = 136 
>  384124  handler table  [0x00007fc3912069d0,0x00007fc391207a68] =
> 4248 
>  384125  nul chk table  [0x00007fc391207a68,0x00007fc391207e08] = 928 
>  384126  oops           [0x00007fc391207e08,0x00007fc391208120] = 792 
>  384127 Decoding compiled method 0x00007fc3911f2a50: 
>  384128 Code: 
>  384129 [Disassembling for mach='i386:x86-64'] 
>  384130 [Entry Point] 
>  384131   0x00007fc3911f3640: cmp    0x8(%rsi),%rax 
>  384132   0x00007fc3911f3644: jne    0x00007fc3910405e0  ;
> {runtime_call} 
>  384133   0x00007fc3911f364a: xchg   %ax,%ax 
>  384134   0x00007fc3911f364c: nopl   0x0(%rax) 
>  384135 [Verified Entry Point] 
>  384136   0x00007fc3911f3650: mov    %eax,-0x6000(%rsp) 
>  384137   0x00007fc3911f3657: push   %rbp 
> 
> First of, I'm assuming that the proximity of line 384115 to line
> 384116 is a guarantee that the 2 lines are referring to the
> compilation of the same method, and that what follows is all about
> com.db.e.d.m.p.TP::doExecute. If not, how do I map back from an
> address to a nmethod name? 

Yes, the following lines are from this compile.

> Main questions: 
> 
> 1) What do the entries in the table in lines 384116-384126 represent? 

Addresses and sizes of the various sections of an nmethod (see
nmethod.hpp).

> 2) Lines 384131-384134 are presumably the x64 representation of a
> monomorphic call guard. Why are the xchg and nopl instructions (which
> are surely both effectively no-ops) present? 

These are required for code patching, e.g. when the method becomes
deoptimized.

> 3) The addresses for lines 384131-384134 look strange to me, eg why
> isn't there at least 8 bytes required for the jne instruction? Is
> there a good reference for instruction lengths somewhere? 

http://mail.openjdk.java.net/pipermail/hotspot-dev/2009-November/002430.html

> I have some questions which are more pertinent to my actual perf
> anomaly, but I want to make sure I understand the basics fully, and do
> my own investigations first - and try to conserve the group's time. 

Please also consider to read the following thread:

http://mail.openjdk.java.net/pipermail/hotspot-dev/2009-November/002349.html

-- Christian



More information about the hotspot-dev mailing list