JVM Interpreter

Andrew Haley aph at redhat.com
Sun Aug 26 22:07:26 UTC 2018


On 08/25/2018 07:39 PM, mr rupplin wrote:

> I am presuming the JVM interpreter is defined/implemented in the the
> hotspot module since this is a JVM implementation.

That's right.

> I cannot seem to find *any* instruction in it that gets called by a
> simple "./java -ea Class" call.  We are stumped.

On the "teach a man to fish" priniple, here goes. On most systems the
interpreter is written in assembly language and generated at runtime.

Put a GDB breakpoint here in javaCalls.cpp::

      StubRoutines::call_stub()(
        (address)&link,
        // (intptr_t*)&(result->_value), // see NOTE above (compiler problem)
        result_val_address,          // see NOTE above (compiler problem)
        result_type,
        method(),
        entry_point,
        args->parameters(),
        args->size_of_parameters(),
        CHECK
      );

Step in from the call stub.  You'll need to use "si" rather than
"step", because this is not C++, it's pure hand-crafted assembly
language: the real thing.  You'll see the registers saved, the
parameters copied into the interpreter stack, and the interpreter
entered.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the core-libs-dev mailing list