Structure of the HotSpot Interpreter

Julian Waters tanksherman27 at gmail.com
Fri May 31 12:24:18 UTC 2024


Hi Andrew,

Thanks for the overview. I unfortunately can't do +PrintInterpreter at
the moment since my JDK is experiencing compilation failures
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, 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?

best regards,
Julian

On Thu, May 30, 2024 at 9:47 PM Julian Waters <tanksherman27 at gmail.com> wrote:
>
> Hi all,
>
> I've recently been trying to learn more about HotSpot and studying its
> internals, but the structure of the Interpreter seems to elude me
> still. I'm aware that HotSpot doesn't use a traditional switch case
> (Well, at least not usually, looking at you Zero Port), but how it
> functions is more or less still a black box to me. What kind of
> dispatch mechanism does it use, for instance? Is it Direct Threaded,
> Indirect Threaded, Token Threaded, or something else entirely? Is
> there somewhere I can learn about how everything connects together?
> I've tried reading the HotSpot documentation online but there doesn't
> seem to be an in-depth explanation in them for how it all fits
> together, I'd greatly appreciate if someone points me in the right
> direction
>
> best regards,
> Julian


More information about the hotspot-dev mailing list