aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java/expr.c')
-rw-r--r--gcc/java/expr.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index ff0a327..5481289 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -1845,9 +1845,18 @@ build_invokevirtual (dtable, method)
method_index = size_binop (PLUS_EXPR, method_index, size_int (2));
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));
+
func = fold (build (PLUS_EXPR, nativecode_ptr_ptr_type_node, dtable,
convert (nativecode_ptr_ptr_type_node, method_index)));
- func = build1 (INDIRECT_REF, nativecode_ptr_type_node, func);
+
+ if (TARGET_VTABLE_USES_DESCRIPTORS)
+ func = build1 (NOP_EXPR, nativecode_ptr_type_node, func);
+ else
+ func = build1 (INDIRECT_REF, nativecode_ptr_type_node, func);
return func;
}