What is the reason for the additional indirection in Handle?
Tom Rodriguez
Thomas.Rodriguez at Sun.COM
Mon Sep 8 14:08:33 PDT 2008
I think you are misunderstanding the structure of the handle. A
Handle contains a pointer to a piece of memory containing the pointer
to the oop. The pointer to the oop may change as a result of garbage
collection but the pointer contained in the handle does not. The
handle itself is just a value object so it always come for the stack.
The piece of memory used in a handle comes from a special per thread
arena called the handle area tha can quickly scanned and updated by
the garbage collector. So the GC doesn't actually scan the handle, it
scans the handle area.
tom
On Sep 8, 2008, at 9:11 AM, Ramón García wrote:
>> Like Keith said, it does both [tracking that pointer is being used
>> and updating the references if the pointer is moved].
>
> Then there is something that I do not understand.
>
> If one is inside a member function of, say, KlassHandle. That
> functions receive the value of this as the first (hidden) parameter,
> like any C++ method. If the address of KlassHandle changes, how can
> this be handled? If it is imposible, why?
More information about the hotspot-runtime-dev
mailing list