Adding fields to object_type_node
Dachuan Yu
dachuan.yu@yale.edu
Tue Oct 9 10:00:00 GMT 2001
Bryce McKinlay wrote:
> Firstly, why do you need to change object_type_node? It should be
> sufficient to just add a new field to java.lang.Class (class_type_node),
> containing a pointer to the otable. The compiled code will refer to the
> otable directly, of course, but the runtime would use the class pointer
> to fill out the otable at initialization time.
Sorry that I have to come back to the old question of last week. Could you
please give an example how the compiled code refers to the fields in
java.lang.Class? I think I'm confused about the relationship between the
fields in java.lang.Class and the fields in class_type_node.
> When you add a field to object_type_node or class_type_node, you need to
> mirror the change in java/lang/Object.h or java/lang/Class.h
> respectively. The new field must be in exactly the same order that it is
> declared in the compiler.
I still don't quite understand what the relationship between these two
things is. When adding new fields in Class.h, it seems that I'm modifying
java.lang.Class. While when adding new fields in class_type_node, it seems
that every tree constructed as "class_type_node" would involve the added
new fields. But how are they related? I guess I can't understand what's
going on without looking at the code which connects these two things. And I
can't find that piece of code.
I can't thank you enough for all your help!
Dachuan
More information about the Java
mailing list