Structure of the HotSpot Interpreter
Andrew Haley
aph-open at littlepinkcloud.com
Sat Jun 1 10:13:41 UTC 2024
On 5/31/24 13:24, Julian Waters wrote:
> Thanks for the overview. I unfortunately can't do +PrintInterpreter at
> the moment since my JDK is experiencing compilation failures
That doesn't matter: the Java you're using as a bootstrap compiler will
do it.
> everywhere (It's in a bit of a mess right now), but I will try doing
> that once I've gotten everything fixed. However, I've been digging
> through the code a little, and I think I see a bit of a pattern. The
> methods in the Template Table files are all geared towards emitting
> the executable code into memory, and each of their methods are passed
> as a pointer to the corresponding bytecode definition to actually emit
> code into memory. The dispatch mechanism is still a bit of a mystery
> to me,
Why? It's the four instructions that I quoted last time:
0x0000ffff785428cc: ldrb w8, [x22, #1]! ;; 403: __ dispatch_epilog(tos_out, step);
Offset to the dispatch table:
0x0000ffff785428d0: add w9, w8, #0x500
Load the address of the next action, and jump to it:
0x0000ffff785428d4: ldr x9, [x21, w9, uxtw #3]
0x0000ffff785428d8: br x9
> but from what I can see the code that dispatches to the next
> bytecode is emitted by dispatch_next. Did I get all of that right, or
> is there anything I am missing?
By the dispatch_XXX methods, yes.
--
Andrew Haley (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the hotspot-dev
mailing list