diff options
author | Tom Tromey <tromey@redhat.com> | 2007-08-17 22:08:04 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2007-08-17 22:08:04 +0000 |
commit | 279e32c924988609c7b48d70b681b492a142b66a (patch) | |
tree | 70cc3ddb26fc919cb7189d6ea58e391a6b723fd6 /gcc/java/class.c | |
parent | 44fd0e80635189f48f24654cb1e9620c39d5314b (diff) | |
download | gcc-279e32c924988609c7b48d70b681b492a142b66a.zip gcc-279e32c924988609c7b48d70b681b492a142b66a.tar.gz gcc-279e32c924988609c7b48d70b681b492a142b66a.tar.bz2 |
typeck.c (find_method_in_interfaces): Update.
* typeck.c (find_method_in_interfaces): Update.
* jcf-parse.c (load_class): Update.
* java-gimplify.c (java_gimplify_component_ref): Removed.
(java_gimplify_modify_expr): Update. Removed pre_p and post_p
arguments.
(java_gimplify_expr): Update.
* decl.c (java_init_decl_processing): Update.
* class.c (set_constant_value): Update.
(make_class_data): Update.
(finish_class): Update.
(build_static_field_ref): Update.
(is_compiled_class): Update.
(maybe_layout_super_class): Update.
(layout_class): Update.
(layout_class_method): Update.
* java-tree.h (CAN_COMPLETE_NORMALLY): Removed.
(lang_decl_var) <am, final_iud, cif>: Removed fields.
(lang_decl_func) <init_calls_this>: Removed field.
(lang_type) <dot_class, verify_method>: Removed fields.
(FIELD_NESTED_ACCESS): Removed.
(FIELD_NESTED_ACCESS_P): Removed.
(DECL_FIELD_FINAL_IUD): Removed.
(DECL_LOCAL_FINAL_IUD): Removed
(LOCAL_FINAL_P): Removed.
(FINAL_VARIABLE_P): Removed.
(CLASS_FINAL_VARIABLE_P): Removed.
(DECL_BIT_INDEX): Removed.
(DECL_INIT_CALLS_THIS): Removed.
(FIELD_LOCAL_ALIAS): Removed.
(FIELD_LOCAL_ALIAS_USED): Removed.
(FIELD_THISN): Removed.
(DECL_FUNCTION_INIT_TEST_CLASS): Removed.
(LOCAL_CLASS_INITIALIZATION_FLAG): Removed.
(LOCAL_CLASS_INITIALIZATION_FLAG_P): Removed.
(TYPE_DOT_CLASS): Removed.
(TYPE_VERIFY_METHOD): Removed.
(ID_CLASSDOLLAR_P): Removed.
(enum java_tree_index) <JTI_CLASSDOLLAR_IDENTIFIER_NODE>:
Removed.
(classdollar_identifier_node): Removed.
(TYPE_UNKNOWN): Removed.
(CLASS_FROM_SOURCE_P): Removed.
* expr.c (build_jni_stub): Update.
(force_evaluation_order): Update.
(build_java_empty_stmt): Update.
(build_class_init): Update.
(java_stack_swap): Update.
(build_jni_stub): Update.
From-SVN: r127602
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r-- | gcc/java/class.c | 59 |
1 files changed, 17 insertions, 42 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c index ec8b0bc..82b71b4 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -851,8 +851,6 @@ set_constant_value (tree field, tree constant) && TREE_TYPE (field) == string_ptr_type_node)) error ("ConstantValue attribute of field '%s' has wrong type", IDENTIFIER_POINTER (DECL_NAME (field))); - if (FIELD_FINAL (field)) - DECL_FIELD_FINAL_IUD (field) = 1; } } @@ -1163,13 +1161,12 @@ build_static_field_ref (tree fdecl) { tree fclass = DECL_CONTEXT (fdecl); int is_compiled = is_compiled_class (fclass); - int from_class = ! CLASS_FROM_SOURCE_P (current_class); /* Allow static final fields to fold to a constant. When using -findirect-dispatch, we simply never do this folding if compiling from .class; in the .class file constants will be referred to via the constant pool. */ - if ((!flag_indirect_dispatch || !from_class) + if (!flag_indirect_dispatch && (is_compiled || (FIELD_FINAL (fdecl) && DECL_INITIAL (fdecl) != NULL_TREE && (JSTRING_TYPE_P (TREE_TYPE (fdecl)) @@ -1853,8 +1850,7 @@ make_class_data (tree type) || DECL_CLINIT_P (method) || DECL_NAME (type_decl) == id_class || DECL_NAME (method) == id_main - || (METHOD_PUBLIC (method) && !METHOD_STATIC (method)) - || TYPE_DOT_CLASS (type) == method) + || (METHOD_PUBLIC (method) && !METHOD_STATIC (method))) { init = make_method_value (method); method_count++; @@ -2173,17 +2169,6 @@ make_class_data (tree type) void finish_class (void) { - if (TYPE_VERIFY_METHOD (output_class)) - { - tree verify_method = TYPE_VERIFY_METHOD (output_class); - DECL_SAVED_TREE (verify_method) - = add_stmt_to_compound (DECL_SAVED_TREE (verify_method), void_type_node, - build1 (RETURN_EXPR, void_type_node, NULL)); - java_genericize (verify_method); - cgraph_finalize_function (verify_method, false); - TYPE_ASSERTIONS (current_class) = NULL; - } - java_expand_catch_classes (current_class); current_function_decl = NULL_TREE; @@ -2228,9 +2213,7 @@ is_compiled_class (tree class) { if (!CLASS_LOADED_P (class)) { - if (CLASS_FROM_SOURCE_P (class)) - safe_layout_class (class); - else if (class != current_class) + if (class != current_class) load_class (class, 1); } return 1; @@ -2327,8 +2310,6 @@ maybe_layout_super_class (tree super_class, tree this_class ATTRIBUTE_UNUSED) return NULL_TREE; else if (TREE_CODE (super_class) == RECORD_TYPE) { - if (!CLASS_LOADED_P (super_class) && CLASS_FROM_SOURCE_P (super_class)) - safe_layout_class (super_class); if (!CLASS_LOADED_P (super_class)) load_class (super_class, 1); } @@ -2366,6 +2347,7 @@ safe_layout_class (tree class) void layout_class (tree this_class) { + int i; tree super_class = CLASSTYPE_SUPER (this_class); class_list = tree_cons (this_class, NULL_TREE, class_list); @@ -2416,28 +2398,22 @@ layout_class (tree this_class) layout_type (this_class); - /* Also recursively load/layout any superinterfaces, but only if - class was loaded from bytecode. The source parser will take care - of this itself. */ - if (!CLASS_FROM_SOURCE_P (this_class)) + /* Also recursively load/layout any superinterfaces. */ + if (TYPE_BINFO (this_class)) { - int i; - if (TYPE_BINFO (this_class)) + for (i = BINFO_N_BASE_BINFOS (TYPE_BINFO (this_class)) - 1; i > 0; i--) { - for (i = BINFO_N_BASE_BINFOS (TYPE_BINFO (this_class)) - 1; i > 0; i--) + tree binfo = BINFO_BASE_BINFO (TYPE_BINFO (this_class), i); + tree super_interface = BINFO_TYPE (binfo); + tree maybe_super_interface + = maybe_layout_super_class (super_interface, NULL_TREE); + if (maybe_super_interface == NULL + || TREE_CODE (TYPE_SIZE (maybe_super_interface)) == ERROR_MARK) { - tree binfo = BINFO_BASE_BINFO (TYPE_BINFO (this_class), i); - tree super_interface = BINFO_TYPE (binfo); - tree maybe_super_interface - = maybe_layout_super_class (super_interface, NULL_TREE); - if (maybe_super_interface == NULL - || TREE_CODE (TYPE_SIZE (maybe_super_interface)) == ERROR_MARK) - { - TYPE_SIZE (this_class) = error_mark_node; - CLASS_BEING_LAIDOUT (this_class) = 0; - class_list = TREE_CHAIN (class_list); - return; - } + TYPE_SIZE (this_class) = error_mark_node; + CLASS_BEING_LAIDOUT (this_class) = 0; + class_list = TREE_CHAIN (class_list); + return; } } } @@ -2632,7 +2608,6 @@ layout_class_method (tree this_class, tree super_class, set_method_index (method_decl, method_index); if (method_index == NULL_TREE && ! flag_indirect_dispatch - && !CLASS_FROM_SOURCE_P (this_class) && ! DECL_ARTIFICIAL (super_method)) error ("non-static method %q+D overrides static method", method_decl); |