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/decl.c | |
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/decl.c')
-rw-r--r-- | gcc/java/decl.c | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 4e413de..8355431 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -621,32 +621,46 @@ java_init_decl_processing (void) one_elt_array_domain_type); TYPE_NONALIASED_COMPONENT (otable_type) = 1; otable_ptr_type = build_pointer_type (otable_type); + atable_type = build_array_type (ptr_type_node, + one_elt_array_domain_type); + TYPE_NONALIASED_COMPONENT (atable_type) = 1; + atable_ptr_type = build_pointer_type (atable_type); - method_symbol_type = make_node (RECORD_TYPE); - PUSH_FIELD (method_symbol_type, field, "clname", utf8const_ptr_type); - PUSH_FIELD (method_symbol_type, field, "name", utf8const_ptr_type); - PUSH_FIELD (method_symbol_type, field, "signature", utf8const_ptr_type); - FINISH_RECORD (method_symbol_type); + symbol_type = make_node (RECORD_TYPE); + PUSH_FIELD (symbol_type, field, "clname", utf8const_ptr_type); + PUSH_FIELD (symbol_type, field, "name", utf8const_ptr_type); + PUSH_FIELD (symbol_type, field, "signature", utf8const_ptr_type); + FINISH_RECORD (symbol_type); - method_symbols_array_type = build_array_type (method_symbol_type, - one_elt_array_domain_type); - method_symbols_array_ptr_type = build_pointer_type - (method_symbols_array_type); + symbols_array_type = build_array_type (symbol_type, + one_elt_array_domain_type); + symbols_array_ptr_type = build_pointer_type (symbols_array_type); if (flag_indirect_dispatch) { - otable_decl = build_decl (VAR_DECL, get_identifier ("otable"), - otable_type); + otable_decl = build_decl (VAR_DECL, get_identifier ("otable"), otable_type); DECL_EXTERNAL (otable_decl) = 1; TREE_STATIC (otable_decl) = 1; TREE_READONLY (otable_decl) = 1; - pushdecl (otable_decl); - + TREE_CONSTANT (otable_decl) = 1; + pushdecl (otable_decl); otable_syms_decl = build_decl (VAR_DECL, get_identifier ("otable_syms"), - method_symbols_array_type); + symbols_array_type); TREE_STATIC (otable_syms_decl) = 1; TREE_CONSTANT (otable_syms_decl) = 1; pushdecl (otable_syms_decl); + + atable_decl = build_decl (VAR_DECL, get_identifier ("atable"), atable_type); + DECL_EXTERNAL (atable_decl) = 1; + TREE_STATIC (atable_decl) = 1; + TREE_READONLY (atable_decl) = 1; + TREE_CONSTANT (atable_decl) = 1; + pushdecl (atable_decl); + atable_syms_decl = build_decl (VAR_DECL, get_identifier ("atable_syms"), + symbols_array_type); + TREE_STATIC (atable_syms_decl) = 1; + TREE_CONSTANT (atable_syms_decl) = 1; + pushdecl (atable_syms_decl); } PUSH_FIELD (object_type_node, field, "vtable", dtable_ptr_type); @@ -684,7 +698,10 @@ java_init_decl_processing (void) PUSH_FIELD (class_type_node, field, "vtable", dtable_ptr_type); PUSH_FIELD (class_type_node, field, "otable", otable_ptr_type); PUSH_FIELD (class_type_node, field, "otable_syms", - method_symbols_array_ptr_type); + symbols_array_ptr_type); + PUSH_FIELD (class_type_node, field, "atable", atable_ptr_type); + PUSH_FIELD (class_type_node, field, "atable_syms", + symbols_array_ptr_type); PUSH_FIELD (class_type_node, field, "interfaces", build_pointer_type (class_ptr_type)); PUSH_FIELD (class_type_node, field, "loader", ptr_type_node); |