diff options
Diffstat (limited to 'gcc/java/java-tree.h')
-rw-r--r-- | gcc/java/java-tree.h | 78 |
1 files changed, 50 insertions, 28 deletions
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 88be2a0..7da5055 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -1,6 +1,6 @@ /* Definitions for parsing and type checking for the GNU compiler for the Java(TM) language. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -134,10 +134,17 @@ extern int compiling_from_source; #define main_class \ java_global_trees[JTI_MAIN_CLASS] -/* The class we are currently processing. */ +/* The class we use as the base for name resolution. It's usually the + class we're generating code for but sometimes it points to an inner + class. If you really want to know the class we're currently + generating code for, use output_class instead. */ #define current_class \ java_global_trees[JTI_CURRENT_CLASS] +/* The class we are currently generating. Really. */ +#define output_class \ + java_global_trees[JTI_OUTPUT_CLASS] + /* List of all class DECLs seen so far. */ #define all_class_list \ java_global_trees[JTI_ALL_CLASS_LIST] @@ -147,27 +154,13 @@ extern int compiling_from_source; /* List of virtual decls referred to by this translation unit, used to generate virtual method offset symbol table. */ -#define otable_methods java_global_trees [JTI_OTABLE_METHODS] -/* List of static decls referred to by this translation unit, used to - generate virtual method offset symbol table. */ -#define atable_methods java_global_trees [JTI_ATABLE_METHODS] /* The virtual offset table. This is emitted as uninitialized data of the required length, and filled out at run time during class linking. */ -#define otable_decl java_global_trees [JTI_OTABLE_DECL] -/* The static address table. */ -#define atable_decl java_global_trees [JTI_ATABLE_DECL] /* The virtual offset symbol table. Used by the runtime to fill out the otable. */ -#define otable_syms_decl java_global_trees [JTI_OTABLE_SYMS_DECL] -/* The static symbol table. Used by the runtime to fill out the - otable. */ -#define atable_syms_decl java_global_trees [JTI_ATABLE_SYMS_DECL] - -#define ctable_decl java_global_trees [JTI_CTABLE_DECL] -#define catch_classes java_global_trees [JTI_CATCH_CLASSES] extern int flag_emit_class_files; @@ -244,6 +237,10 @@ extern const char *current_encoding; /* The Java .class file that provides main_class; the main input file. */ extern GTY(()) struct JCF * current_jcf; +/* Set to nonzero value in order to emit class initialization code + before static field references. */ +extern int always_initialize_class_p; + typedef struct CPool constant_pool; #define CONSTANT_ResolvedFlag 16 @@ -413,20 +410,10 @@ enum java_tree_index JTI_MAIN_CLASS, JTI_CURRENT_CLASS, + JTI_OUTPUT_CLASS, JTI_ALL_CLASS_LIST, JTI_ALL_CLASS_FILENAME, - JTI_OTABLE_METHODS, - JTI_OTABLE_DECL, - JTI_OTABLE_SYMS_DECL, - - JTI_ATABLE_METHODS, - JTI_ATABLE_DECL, - JTI_ATABLE_SYMS_DECL, - - JTI_CTABLE_DECL, - JTI_CATCH_CLASSES, - JTI_PREDEF_FILENAMES, JTI_MAX @@ -923,6 +910,9 @@ union lang_tree_node /* The original WFL of a final variable. */ #define DECL_FIELD_FINAL_WFL(NODE) \ (DECL_LANG_SPECIFIC(NODE)->u.v.wfl) +/* The class that's the owner of a dynamic binding table. */ +#define DECL_OWNER(NODE) \ + (DECL_LANG_SPECIFIC(NODE)->u.v.owner) /* True if NODE is a local variable final. */ #define LOCAL_FINAL_P(NODE) (DECL_LANG_SPECIFIC (NODE) && DECL_FINAL (NODE)) /* True if NODE is a final field. */ @@ -1022,6 +1012,7 @@ struct lang_decl_var GTY(()) tree slot_chain; tree am; /* Access method for this field (1.1) */ tree wfl; /* Original wfl */ + tree owner; unsigned int final_iud : 1; /* Final initialized upon declaration */ unsigned int cif : 1; /* True: decl is a class initialization flag */ unsigned int freed; /* Decl is no longer in scope. */ @@ -1070,6 +1061,19 @@ struct lang_decl GTY(()) #define TYPE_STRICTFP(T) (TYPE_LANG_SPECIFIC(T)->strictfp) #define TYPE_USES_ASSERTIONS(T) (TYPE_LANG_SPECIFIC(T)->assertions) +#define TYPE_ATABLE_METHODS(T) (TYPE_LANG_SPECIFIC(T)->atable_methods) +#define TYPE_ATABLE_SYMS_DECL(T) (TYPE_LANG_SPECIFIC(T)->atable_syms_decl) +#define TYPE_ATABLE_DECL(T) (TYPE_LANG_SPECIFIC(T)->atable_decl) + +#define TYPE_OTABLE_METHODS(T) (TYPE_LANG_SPECIFIC(T)->otable_methods) +#define TYPE_OTABLE_SYMS_DECL(T) (TYPE_LANG_SPECIFIC(T)->otable_syms_decl) +#define TYPE_OTABLE_DECL(T) (TYPE_LANG_SPECIFIC(T)->otable_decl) + +#define TYPE_CTABLE_DECL(T) (TYPE_LANG_SPECIFIC(T)->ctable_decl) +#define TYPE_CATCH_CLASSES(T) (TYPE_LANG_SPECIFIC(T)->catch_classes) + +#define TYPE_TO_RUNTIME_MAP(T) (TYPE_LANG_SPECIFIC(T)->type_to_runtime_map) + struct lang_type GTY(()) { tree signature; @@ -1086,6 +1090,21 @@ struct lang_type GTY(()) tree package_list; /* List of package names, progressive */ tree import_list; /* Imported types, in the CU of this class */ tree import_demand_list; /* Imported types, in the CU of this class */ + + tree otable_methods; /* List of static decls referred to by this class. */ + tree otable_decl; /* The static address table. */ + tree otable_syms_decl; + + tree atable_methods; /* List of static decls referred to by this class. */ + tree atable_decl; /* The static address table. */ + tree atable_syms_decl; + + tree ctable_decl; /* The table of classes for the runtime type matcher. */ + tree catch_classes; + + htab_t GTY ((param_is (struct treetreehash_entry))) type_to_runtime_map; + /* The mapping of classes to exception region markers. */ + unsigned pic:1; /* Private Inner Class. */ unsigned poic:1; /* Protected Inner Class. */ unsigned strictfp:1; /* `strictfp' class. */ @@ -1200,6 +1219,7 @@ extern tree build_instanceof (tree, tree); extern tree create_label_decl (tree); extern void push_labeled_block (tree); extern tree prepare_eh_table_type (tree); +extern void java_expand_catch_classes (tree); extern tree build_exception_object_ref (tree); extern tree generate_name (void); extern void pop_labeled_block (void); @@ -1322,7 +1342,9 @@ extern void java_expand_body (tree); extern int get_symbol_table_index (tree, tree *); extern tree make_catch_class_record (tree, tree); -extern void emit_catch_table (void); +extern tree emit_catch_table (tree); + +extern void gen_indirect_dispatch_tables (tree type); #define DECL_FINAL(DECL) DECL_LANG_FLAG_3 (DECL) |