diff options
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r-- | gcc/java/jcf-parse.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index a3fa212..3214092 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -1,5 +1,5 @@ /* Parser for Java(TM) .class files. - Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -72,10 +72,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ extern struct obstack temporary_obstack; -/* Set to nonzero value in order to emit class initialization code - before static field references. */ -extern int always_initialize_class_p; - static GTY(()) tree parse_roots[3]; /* The FIELD_DECL for the current field. */ @@ -153,7 +149,7 @@ set_source_filename (JCF *jcf, int index) #define HANDLE_CLASS_INFO(ACCESS_FLAGS, THIS, SUPER, INTERFACES_COUNT) \ { tree super_class = SUPER==0 ? NULL_TREE : get_class_constant (jcf, SUPER); \ - current_class = give_name_to_class (jcf, THIS); \ + output_class = current_class = give_name_to_class (jcf, THIS); \ set_super_info (ACCESS_FLAGS, current_class, super_class, INTERFACES_COUNT);} #define HANDLE_CLASS_INTERFACE(INDEX) \ @@ -509,7 +505,7 @@ read_class (tree name) wfl_operator = build_expr_wfl (NULL_TREE, NULL, 0, 0); EXPR_WFL_FILENAME_NODE (wfl_operator) = file; input_filename = ggc_strdup (filename); - current_class = NULL_TREE; + output_class = current_class = NULL_TREE; current_function_decl = NULL_TREE; if (!HAS_BEEN_ALREADY_PARSED_P (file)) { @@ -531,7 +527,7 @@ read_class (tree name) { java_parser_context_save_global (); java_push_parser_context (); - current_class = class; + output_class = current_class = class; input_filename = current_jcf->filename; if (JCF_SEEN_IN_ZIP (current_jcf)) read_zip_member(current_jcf, @@ -549,7 +545,7 @@ read_class (tree name) load_inner_classes (class); } - current_class = save_current_class; + output_class = current_class = save_current_class; input_location = save_location; current_jcf = save_current_jcf; return 1; @@ -709,6 +705,8 @@ parse_class_file (void) compiling from class files. */ always_initialize_class_p = 1; + gen_indirect_dispatch_tables (current_class); + java_mark_class_local (current_class); for (method = TYPE_METHODS (current_class); @@ -1099,7 +1097,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED) input_filename = IDENTIFIER_POINTER (TREE_VALUE (node)); if (CLASS_FILE_P (node)) { - current_class = TREE_PURPOSE (node); + output_class = current_class = TREE_PURPOSE (node); current_jcf = TYPE_JCF (current_class); layout_class (current_class); load_inner_classes (current_class); @@ -1119,18 +1117,6 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED) /* Emit the .jcf section. */ emit_register_classes (); - if (flag_indirect_dispatch) - { - otable_decl - = emit_symbol_table - (get_identifier ("otable"), - otable_decl, otable_methods, otable_syms_decl, integer_type_node); - atable_decl - = emit_symbol_table - (get_identifier ("atable"), - atable_decl, atable_methods, atable_syms_decl, ptr_type_node); - } - emit_catch_table (); } write_resource_constructor (); @@ -1201,7 +1187,7 @@ parse_zip_file_entries (void) class = lookup_class (get_identifier (class_name)); FREE (class_name); current_jcf = TYPE_JCF (class); - current_class = class; + output_class = current_class = class; if (! CLASS_LOADED_P (class)) { |