Adding fields to object_type_node
Bryce McKinlay
bryce@waitaki.otago.ac.nz
Thu Oct 4 15:25:00 GMT 2001
On Friday, October 5, 2001, at 07:51 AM, Dachuan Yu wrote:
> Per Bothner wrote:
>>> Did you also modify the runtime library, specifically (at least)
>> libjava/java/lang/Object.h?
>> But, why do I not see a corresponding "vtable" field in the
> Object.h? What's the idea/invariance/intention... of these things?
The vtable pointer in C++ is implicit. All C++ objects (with virtual
methods) have it, so we don't need to add it explicitly. There are some
tricks to get at it when we need to access though - eg the "union
_Jv_Self" in Class.h that the primitive class constructor uses to
manipulate its own vtable pointer, or in boehm.cc where we set the
vtable for a newly allocated object.
regards
Bryce.
More information about the Java
mailing list