diff options
author | Andrew Haley <aph@redhat.com> | 2003-10-01 16:22:13 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2003-10-01 16:22:13 +0000 |
commit | 9dfc2ec225a5a8f0a5d2a9b5853d0a19d728e129 (patch) | |
tree | 2dba069aa1abbb8cef2f212c67ca484cf5f8a674 /gcc/java/java-tree.h | |
parent | 530ce5517ce00a43761d303a614b25d3371dd030 (diff) | |
download | gcc-9dfc2ec225a5a8f0a5d2a9b5853d0a19d728e129.zip gcc-9dfc2ec225a5a8f0a5d2a9b5853d0a19d728e129.tar.gz gcc-9dfc2ec225a5a8f0a5d2a9b5853d0a19d728e129.tar.bz2 |
jcf-parse.c (java_parse_file): Write otable and atable.
2003-10-01 Andrew Haley <aph@redhat.com>
* jcf-parse.c (java_parse_file): Write otable and atable.
* java-tree.h (atable_methods): New.
(atable_decl): New.
(atable_syms_decl): New.
(enum java_tree_index): Add JTI_ATABLE_METHODS, JTI_ATABLE_DECL,
JTI_ATABLE_SYMS_DECL. Rename JTI_METHOD_SYMBOL* to JTI_SYMBOL*.
(symbol_*type): Rename method_symbol* to symbol*type.
(emit_offset_symbol_table): Delete.
(emit_symbol_table): New.
(get_symbol_table_index): New.
(atable_type): New.
* expr.c (build_field_ref): Handle flag_indirect_dispatch.
(build_known_method_ref): Likewise.
(get_symbol_table_index): Rename from get_offset_table_index.
Parameterize to allow re-use by differing types of symbol table.
(build_invokevirtual): Pass table to get_offset_table_index.
* decl.c (java_init_decl_processing): Push types and decls for
atable and atable_syyms.
* class.c (build_static_field_ref): Handle flag_indirect_dispatch.
(make_class_data): Add new fields atable and atable_syms.
(emit_symbol_table): Rename from emit_offset_symbol_table.
Parameterize to allow re-use by different types of symbol table.
(build_symbol_entry): Renamed from build_method_symbols_entry.
2003-10-01 Andrew Haley <aph@redhat.com>
* java/lang/natClass.cc (initializeClass): Check for otable and
atable.
(_Jv_LinkOffsetTable): Check for existence of atable. Rewrite
loops using for(). Search superinterfaces. Check for fields as
well as methods. Initialize atable as well as otable: check for
static methods as well as virtual methods.
* java/lang/Class.h (struct _Jv_AddressTable): New.
(atable): New.
(atable_syms): New.
* include/jvm.h (_Jv_equalUtf8Consts): constify.
* prims.cc (_Jv_equalUtf8Consts): constify.
From-SVN: r71979
Diffstat (limited to 'gcc/java/java-tree.h')
-rw-r--r-- | gcc/java/java-tree.h | 62 |
1 files changed, 41 insertions, 21 deletions
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 8f52428..42f99b5 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -146,17 +146,26 @@ extern int compiling_from_source; /* List of all class filenames seen so far. */ #define all_class_filename java_global_trees [JTI_ALL_CLASS_FILENAME] -/* List of virtual method decls called in this translation unit, used to - generate virtual method offset symbol table. */ +/* 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 method offset table. This is emitted as uninitialized data of - the required length, and filled out at run time during class linking. */ +/* 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 method offset symbol table. Used by the runtime to fill out the - otable. */ +/* 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] extern int flag_emit_class_files; @@ -364,9 +373,11 @@ enum java_tree_index JTI_METHOD_PTR_TYPE_NODE, JTI_OTABLE_TYPE, JTI_OTABLE_PTR_TYPE, - JTI_METHOD_SYMBOL_TYPE, - JTI_METHOD_SYMBOLS_ARRAY_TYPE, - JTI_METHOD_SYMBOLS_ARRAY_PTR_TYPE, + JTI_ATABLE_TYPE, + JTI_ATABLE_PTR_TYPE, + JTI_SYMBOL_TYPE, + JTI_SYMBOLS_ARRAY_TYPE, + JTI_SYMBOLS_ARRAY_PTR_TYPE, JTI_END_PARAMS_NODE, @@ -409,6 +420,10 @@ enum java_tree_index JTI_OTABLE_DECL, JTI_OTABLE_SYMS_DECL, + JTI_ATABLE_METHODS, + JTI_ATABLE_DECL, + JTI_ATABLE_SYMS_DECL, + JTI_PREDEF_FILENAMES, JTI_MAX @@ -602,14 +617,18 @@ extern GTY(()) tree java_global_trees[JTI_MAX]; java_global_trees[JTI_METHOD_PTR_TYPE_NODE] #define otable_type \ java_global_trees[JTI_OTABLE_TYPE] +#define atable_type \ + java_global_trees[JTI_ATABLE_TYPE] #define otable_ptr_type \ java_global_trees[JTI_OTABLE_PTR_TYPE] -#define method_symbol_type \ - java_global_trees[JTI_METHOD_SYMBOL_TYPE] -#define method_symbols_array_type \ - java_global_trees[JTI_METHOD_SYMBOLS_ARRAY_TYPE] -#define method_symbols_array_ptr_type \ - java_global_trees[JTI_METHOD_SYMBOLS_ARRAY_PTR_TYPE] +#define atable_ptr_type \ + java_global_trees[JTI_ATABLE_PTR_TYPE] +#define symbol_type \ + java_global_trees[JTI_SYMBOL_TYPE] +#define symbols_array_type \ + java_global_trees[JTI_SYMBOLS_ARRAY_TYPE] +#define symbols_array_ptr_type \ + java_global_trees[JTI_SYMBOLS_ARRAY_PTR_TYPE] #define end_params_node \ java_global_trees[JTI_END_PARAMS_NODE] @@ -1199,7 +1218,7 @@ extern void make_class_data (tree); extern void register_class (void); extern int alloc_name_constant (int, tree); extern void emit_register_classes (void); -extern void emit_offset_symbol_table (void); +extern tree emit_symbol_table (tree, tree, tree, tree, tree); extern void lang_init_source (int); extern void write_classfile (tree); extern char *print_int_node (tree); @@ -1299,6 +1318,7 @@ extern void init_resource_processing (void); extern void start_complete_expand_method (tree); extern void java_expand_body (tree); +extern int get_symbol_table_index (tree, tree *); #define DECL_FINAL(DECL) DECL_LANG_FLAG_3 (DECL) @@ -1658,11 +1678,11 @@ extern tree *type_map; /* Append a field initializer to CONS for a field with the given VALUE. NAME is a char* string used for error checking; the initializer must be specified in order. */ -#define PUSH_FIELD_VALUE(CONS, NAME, VALUE) {\ - tree field = TREE_CHAIN(CONS);\ - if (strcmp (IDENTIFIER_POINTER (DECL_NAME (field)), NAME) != 0) abort();\ - CONSTRUCTOR_ELTS(CONS) = tree_cons (field, VALUE, CONSTRUCTOR_ELTS(CONS));\ - TREE_CHAIN(CONS) = TREE_CHAIN (field); } + #define PUSH_FIELD_VALUE(CONS, NAME, VALUE) {\ + tree field = TREE_CHAIN(CONS);\ + if (strcmp (IDENTIFIER_POINTER (DECL_NAME (field)), NAME) != 0) abort();\ + CONSTRUCTOR_ELTS(CONS) = tree_cons (field, VALUE, CONSTRUCTOR_ELTS(CONS));\ + TREE_CHAIN(CONS) = TREE_CHAIN (field); } /* Finish creating a record CONSTRUCTOR CONS. */ #define FINISH_RECORD_CONSTRUCTOR(CONS) \ |