This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Java: Debug info
- From: Andrew Haley <aph at redhat dot com>
- To: java-patches at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 10 May 2004 16:23:07 +0100
- Subject: Java: Debug info
TYPE_VFIELD(type) points to the field that is the vtable of the first
base class in a superclass chain. In Java, every class inherits its
sole vtable from java.lang.Object.
Andrew.
2004-05-10 Andrew Haley <aph@redhat.com>
* parse.y (create_class): Set TYPE_VFIELD.
* decl.c (java_init_decl_processing): Likewise.
Index: gcc/java/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/decl.c,v
retrieving revision 1.179
diff -p -2 -c -r1.179 decl.c
*** gcc/java/decl.c 20 Apr 2004 01:38:43 -0000 1.179
--- gcc/java/decl.c 10 May 2004 15:18:14 -0000
*************** java_init_decl_processing (void)
*** 639,642 ****
--- 639,645 ----
PUSH_FIELD (object_type_node, field, "vtable", dtable_ptr_type);
+ DECL_FCONTEXT (field) = object_type_node;
+ TYPE_VFIELD (object_type_node) = field;
+
/* This isn't exactly true, but it is what we have in the source.
There is an unresolved issue here, which is whether the vtable
Index: gcc/java/parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.475
diff -p -2 -c -r1.475 parse.y
*** gcc/java/parse.y 16 Apr 2004 16:27:14 -0000 1.475
--- gcc/java/parse.y 10 May 2004 15:18:19 -0000
*************** create_class (int flags, tree id, tree s
*** 4021,4024 ****
--- 4021,4029 ----
add_superinterfaces (decl, interfaces);
+ /* TYPE_VFIELD' is a compiler-generated field used to point to
+ virtual function tables. In gcj, every class has a common base
+ virtual function table in java.lang.object. */
+ TYPE_VFIELD (TREE_TYPE (decl)) = TYPE_VFIELD (object_type_node);
+
/* Add the private this$<n> field, Replicate final locals still in
scope as private final fields mangled like val$<local_name>.