summaryrefslogtreecommitdiffstats
path: root/gcc/java/expr.c
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-10 16:21:08 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-10 16:21:08 +0000
commiteab4ad60e30f2629eb357673b3b2dd0084bbd12e (patch)
tree3371d9b0ed0043b145595a1f169b8e3a0f013876 /gcc/java/expr.c
parente161d1a33f33dd457c94a584e39ffcb8250afbf6 (diff)
downloadppe42-gcc-eab4ad60e30f2629eb357673b3b2dd0084bbd12e.tar.gz
ppe42-gcc-eab4ad60e30f2629eb357673b3b2dd0084bbd12e.zip
2004-05-10 Andrew Haley <aph@redhat.com>
* parse.y (create_class): Set TYPE_VFIELD. * decl.c (java_init_decl_processing): Likewise. * expr.c (build_invokevirtual): Remove DECL_VINDEX offset adjustment. * class.c (make_method_value): Replace DECL_VINDEX with call to get_method_index(). (get_dispatch_vector): Likewise. (layout_class_method): Likewise. Replace set of DECL_VINDEX with call to set_method_index(). (set_method_index): New function. (get_method_index): New function. * java-tree.h (set_method_index): New function decl. (get_method_index): New function decl. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81672 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/expr.c')
-rw-r--r--gcc/java/expr.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 839480b5b64..11f6c94643c 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -1905,18 +1905,13 @@ build_invokevirtual (tree dtable, tree method)
}
else
{
- method_index = convert (sizetype, DECL_VINDEX (method));
-
- if (TARGET_VTABLE_USES_DESCRIPTORS)
- /* Add one to skip bogus descriptor for class and GC descriptor. */
- method_index = size_binop (PLUS_EXPR, method_index, size_int (1));
- else
- /* Add 1 to skip "class" field of dtable, and 1 to skip GC descriptor. */
- method_index = size_binop (PLUS_EXPR, method_index, size_int (2));
-
+ /* We fetch the DECL_VINDEX field directly here, rather than
+ using get_method_index(). DECL_VINDEX is the true offset
+ from the vtable base to a method, regrdless of any extra
+ words inserted at the start of the vtable. */
+ method_index = DECL_VINDEX (method);
method_index = size_binop (MULT_EXPR, method_index,
TYPE_SIZE_UNIT (nativecode_ptr_ptr_type_node));
-
if (TARGET_VTABLE_USES_DESCRIPTORS)
method_index = size_binop (MULT_EXPR, method_index,
size_int (TARGET_VTABLE_USES_DESCRIPTORS));
OpenPOWER on IntegriCloud