Understanding templateInterpreter

Ivan Krylov ivan at azulsystems.com
Tue Aug 11 21:20:53 UTC 2015


On 11/08/2015 16:23, Manas Thakur wrote:
> Hello all,
>
> I am trying to understand the working of HotSpot, and I am stuck with the template interpreter.
>
> I was wondering if there a document available on the detailed working of template interpreter. The main thing I want to find out is that once the templates for different byte codes are generated during startup, where is the code that is responsible to select the templates by scanning over the bytecode?
>
> Regards,
> Manas Thakur
>
>
You can print the assembly code for each bytecode using 
-XX:+PrintAssembly. You need to (build and) add the hotspot disassembler 
hsdis-<cpu>.so/.dll/.dylib to your LD_LIBRARY_PATH/PATH.
Once you see the assembly you will notice the same pattern for the most 
bytecodes:

   0x000000010a59a8b0: movzbl 0x1(%r13),%ebx
   0x000000010a59a8b5: inc    %r13
   0x000000010a59a8b8: movabs $0x10a0f5e00,%r10
   0x000000010a59a8c2: jmpq   *(%r10,%rbx,8)


That's AT&T syntax. That code is reading the next bytecode and jumping 
to right place in the table for executing that next bytecode.

Hope this helps,

Ivan


More information about the hotspot-dev mailing list