aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Bothner <bothner@gcc.gnu.org>1998-12-07 07:43:11 -0800
committerPer Bothner <bothner@gcc.gnu.org>1998-12-07 07:43:11 -0800
commit72a0aac6d24eb609d28b9c034c98ae29257db4a6 (patch)
tree33f45545a526236474f5118d8bbe2be9bf3f2ecc
parent2dfaf550bdee9b83e6a4a25f71f2fc8e9e9271d0 (diff)
downloadgcc-72a0aac6d24eb609d28b9c034c98ae29257db4a6.zip
gcc-72a0aac6d24eb609d28b9c034c98ae29257db4a6.tar.gz
gcc-72a0aac6d24eb609d28b9c034c98ae29257db4a6.tar.bz2
constants.c (find_methodref_index): When the class is an interface...
/ * constants.c (find_methodref_index): When the class is an interface, generate CONSTANT_InterfaceMethodref instead of a CONSTANT_MethodRef. * decl.c (finit_identifier_node): Use "$finit$", rather than "<finit>" (which Sun's verifier rejects). * parse.y (maybe_generate_finit): Leave out meaningless final flag. (generate_field_initialization_code): Removed. (fix_constructors) Don't add call to $finit$ here (wrong order). (patch_method_invocation): Add $finit$ call here. * java-tree.h (CALL_USING_SUPER): New macro. * parse.y (patch_invoke): Remove im local variable. (patch_method_invocation, patch_invoke): Don't pass super parameter. (patch_invoke): Use CALL_USING_SUPER instead of from_super parameter. (resolve_qualified_expression_name): Maybe set CALL_USING_SUPER. * jcf-write.c (get_access_flags): Fix typo ACC_PUBLIC -> ACC_FINAL. * parse.y (java_complete_tree): Don't complain about unreachable statement if it is empty_stmt_node. * jcf-write.c (find_constant_wide): New function. (push_long_const): Use find_constant_wide. * jcf-write.c (generate_bytecode_insn): Fix bug in switch handling. (generate_bytecode_insn): Use correct dup variant for MODIFY_EXPR. Add "redundant" NOTE_PUSH/NOTE_POP uses so code_SP_max gets set. Emit invokeinterface when calling an interface method. Emit invokespecial also when calling super or private methods. * jcf-write.c (generate_classfile): Emit ConstantValue attributes. From-SVN: r24160
-rw-r--r--gcc/java/constants.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/java/constants.c b/gcc/java/constants.c
index 6d4ad2f..8eb9f54 100644
--- a/gcc/java/constants.c
+++ b/gcc/java/constants.c
@@ -190,13 +190,16 @@ find_methodref_index (cpool, decl)
CPool *cpool;
tree decl;
{
- int class_index = find_class_constant (cpool, DECL_CONTEXT (decl));
+ tree mclass = DECL_CONTEXT (decl);
+ int class_index = find_class_constant (cpool, mclass);
tree name = DECL_CONSTRUCTOR_P (decl) ? init_identifier_node
: DECL_NAME (decl);
int name_type_index
= find_name_and_type_constant (cpool, name, TREE_TYPE (decl));
- /* Methodref or INterfacemethodRef - FIXME */
- return find_constant1 (cpool, CONSTANT_Methodref,
+ return find_constant1 (cpool,
+ CLASS_INTERFACE (TYPE_NAME (mclass))
+ ? CONSTANT_InterfaceMethodref
+ : CONSTANT_Methodref,
(class_index << 16) | name_type_index);
}