summaryrefslogtreecommitdiff
path: root/gcc/java/parse.y
diff options
context:
space:
mode:
authorjsturm <jsturm@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-23 19:42:09 +0000
committerjsturm <jsturm@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-23 19:42:09 +0000
commitdeff3a7fa78048cc09415ce94a8170935730bda2 (patch)
tree8de2de732a2a531c035647c360acaa01a32c9d78 /gcc/java/parse.y
parent3aedf6d6df4e84b7b35ef8eeadd4d3f4454b546c (diff)
downloadgcc-deff3a7fa78048cc09415ce94a8170935730bda2.tar.gz
* class.c (build_static_field_ref): Check FIELD_FINAL.
* constants.c (alloc_class_constant): Use TYPE_CPOOL_DATA_REF instead of current_constant_pool_data_ref. * java-tree.h (current_constant_pool_data_ref): Undefine. (JTI_CURRENT_CONSTANT_POOL_DATA_REF): Remove. * jcf-parse.c (init_outgoing_cpool): Don't initialize current_constant_pool_data_ref. * except.c (prepare_eh_table_type ): Use DECL_NAME of class type, not build_internal_class_name. * parse.y (patch_incomplete_class_ref): Always emit `class$' method. Use it when class ref isn't certain to be compiled. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60448 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r--gcc/java/parse.y16
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index b68eb158ab6..f22863095bd 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -14073,7 +14073,16 @@ patch_incomplete_class_ref (node)
if (!(ref_type = resolve_type_during_patch (type)))
return error_mark_node;
- if (!flag_emit_class_files || JPRIMITIVE_TYPE_P (ref_type)
+ /* Generate the synthetic static method `class$'. (Previously we
+ deferred this, causing different method tables to be emitted
+ for native code and bytecode.) */
+ if (!TYPE_DOT_CLASS (current_class))
+ build_dot_class_method (current_class);
+
+ /* If we're not emitting class files and we know ref_type is a
+ compiled class, build a direct reference. */
+ if ((! flag_emit_class_files && is_compiled_class (ref_type))
+ || JPRIMITIVE_TYPE_P (ref_type)
|| TREE_CODE (ref_type) == VOID_TYPE)
{
tree dot = build_class_ref (ref_type);
@@ -14084,10 +14093,7 @@ patch_incomplete_class_ref (node)
}
/* If we're emitting class files and we have to deal with non
- primitive types, we invoke (and consider generating) the
- synthetic static method `class$'. */
- if (!TYPE_DOT_CLASS (current_class))
- build_dot_class_method (current_class);
+ primitive types, we invoke the synthetic static method `class$'. */
ref_type = build_dot_class_method_invocation (ref_type);
return java_complete_tree (ref_type);
}