summaryrefslogtreecommitdiff
path: root/gcc/java/parse.y
diff options
context:
space:
mode:
authorTom Tromey <tromey@gcc.gnu.org>2004-11-25 03:47:08 +0000
committerTom Tromey <tromey@gcc.gnu.org>2004-11-25 03:47:08 +0000
commit367390404d26b7bfc400d77893579e83e2a19fb9 (patch)
tree477abdf83653e20b0e74447d6ca47eb67b0511b8 /gcc/java/parse.y
parentec0641f612862498e829fdaf040a201c0ba68762 (diff)
downloadgcc-367390404d26b7bfc400d77893579e83e2a19fb9.tar.gz
* Merged gcj-abi-2-dev-branch to trunk.
(Actual changes too large to list in the commit message; see ChangeLog.) From-SVN: r91270
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r--gcc/java/parse.y22
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 1c1a686d727..91776c6f7f5 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -9690,8 +9690,8 @@ strip_out_static_field_access_decl (tree node)
tree call = TREE_OPERAND (op1, 0);
if (TREE_CODE (call) == CALL_EXPR
&& TREE_CODE (TREE_OPERAND (call, 0)) == ADDR_EXPR
- && TREE_OPERAND (TREE_OPERAND (call, 0), 0)
- == soft_initclass_node)
+ && (TREE_OPERAND (TREE_OPERAND (call, 0), 0)
+ == soft_initclass_node))
return TREE_OPERAND (op1, 1);
}
else if (JDECL_P (op1))
@@ -11025,7 +11025,7 @@ patch_invoke (tree patch, tree method, tree args)
if (TREE_CODE (original_call) == NEW_CLASS_EXPR)
{
tree class = DECL_CONTEXT (method);
- tree c1, saved_new, size, new;
+ tree c1, saved_new, new;
tree alloc_node;
if (flag_emit_class_files || flag_emit_xref)
@@ -11035,7 +11035,6 @@ patch_invoke (tree patch, tree method, tree args)
}
if (!TYPE_SIZE (class))
safe_layout_class (class);
- size = size_in_bytes (class);
alloc_node =
(class_has_finalize_method (class) ? alloc_object_node
: alloc_no_finalizer_node);
@@ -11109,11 +11108,20 @@ invocation_mode (tree method, int super)
if (DECL_CONSTRUCTOR_P (method))
return INVOKE_STATIC;
- if (access & ACC_FINAL || access & ACC_PRIVATE)
+ if (access & ACC_PRIVATE)
return INVOKE_NONVIRTUAL;
- if (CLASS_FINAL (TYPE_NAME (DECL_CONTEXT (method))))
- return INVOKE_NONVIRTUAL;
+ /* Binary compatibility: just because it's final today, that doesn't
+ mean it'll be final tomorrow. */
+ if (! flag_indirect_dispatch
+ || DECL_CONTEXT (method) == object_type_node)
+ {
+ if (access & ACC_FINAL)
+ return INVOKE_NONVIRTUAL;
+
+ if (CLASS_FINAL (TYPE_NAME (DECL_CONTEXT (method))))
+ return INVOKE_NONVIRTUAL;
+ }
if (CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (method))))
return INVOKE_INTERFACE;