CodeHeap

Andrew Dinn adinn at redhat.com
Mon Mar 14 09:50:26 UTC 2016


On 14/03/16 09:07, kirk.pepperdine at gmail.com wrote:
> Thanks for the response. I’ve been lurking about watching the change
> as much as I could. The work it’s self is well done. It is the
> deviation from the naming convention that I was curious about. Are
> these segmented regions heaps? Or are these really just different
> segments of the code cache?

If you /look at the code/ you can see that each CodeHeap is a separate
memory region. That region contains a sequence of contiguous blocks into
which code is written plus a sequence of contiguous segment descriptors
which identify links backwards from any address in a given code block to
the first block for the associated method.

That's much the same setup as before except there are now N such
CodeHeap memory regions instead of one. As a consequence class CodeCache
now contains a growable array of pointers to CodeHeap (new field _heaps)
rather than a pointer to a single CodeHeap (old field _heap).

Also, note that all N code heaps are still carved out of one larger
region. So, there is still a unique lower and upper bound which can be
used to identify whether a PC is in codeheap space rather than in, say,
native code space. Obviously you can also use the codeheap lower and
upper bounds to identify whether a PC is an interpreter address, stub
address, JITted method address etc.

regards,


Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in UK and Wales under Company Registration No. 3798903
Directors: Michael Cunningham (US), Michael O'Neill (Ireland), Paul
Argiry (US)


More information about the hotspot-dev mailing list