When might a CodeBuffer be moved?
Thomas.Rodriguez at Sun.COM
Thu Jun 11 17:56:50 PDT 2009
You wouldn't want to just build a CodeBuffer and keep it around.
Normally we use BufferBlobs for any piece of code that we want to
generate but which doesn't need to be relocatable. The interpreter
for instance is constructed this way as are a lot of helper snippers
of various kinds. You wouldn't want to just build a CodeBuffer and
keep it around. The preferred way would be the make a BufferBlob and
then build a CodeBuffer on top of it to use for code generation.
You'd just drop the CodeBuffer onces you were done with code
generation and build a new one if you needed it.
On Jun 11, 2009, at 2:18 AM, Gary Benson wrote:
> Oh, that's excellent news. Now to figure out if I can use it! ;)
> Tom Rodriguez wrote:
>> CodeBlobs are never moved automatically by anything. CodeBuffers
>> have support for resizing the code generation buffer by moving the
>> instructions from one CodeBlob to a new larger one but you have to
>> ask for that using maybe_expand_to_ensure_remaining. nmethod can
>> be reclaimed by the sweeper once they are no longer referenced as
>> a result of being made not entrant or zombie.
>> On Jun 10, 2009, at 6:55 AM, Gary Benson wrote:
>>> Hi all,
>>> I know CodeBuffers aren't moved by the garbage collector, but can
>>> they move at all? I remember someone (Steve Goldman?) telling me
>>> about a code compactor once, but can't remember the details. Can
>>> a code buffer move at any safepoint?
More information about the hotspot-dev