constants.c (find_methodref_index): When the class is an interface...

T
	* 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: r24161
This commit is contained in:
Per Bothner 1998-12-07 07:43:14 -08:00
parent 72a0aac6d2
commit 157412f5c7
2 changed files with 7 additions and 3 deletions

View File

@ -543,7 +543,7 @@ init_decl_processing ()
TYPE_identifier_node = get_identifier ("TYPE");
init_identifier_node = get_identifier ("<init>");
clinit_identifier_node = get_identifier ("<clinit>");
finit_identifier_node = get_identifier ("<finit>");
finit_identifier_node = get_identifier ("$finit$");
void_signature_node = get_identifier ("()V");
length_identifier_node = get_identifier ("length");
this_identifier_node = get_identifier ("this");

View File

@ -52,6 +52,7 @@ struct JCF;
SWITCH_HAS_DEFAULT (in SWITCH_EXPR)
4: IS_A_COMMAND_LINE_FILENAME_P (in IDENTIFIER_NODE)
RESOLVE_TYPE_NAME_P (in EXPR_WITH_FILE_LOCATION)
CALL_USING_SUPER (in CALL_EXPR)
5: HAS_BEEN_ALREADY_PARSED_P (in IDENTIFIER_NODE)
IS_BREAK_STMT_P (in EXPR_WITH_FILE_LOCATION)
IS_CRAFTED_STRING_BUFFER_P (in CALL_EXPR)
@ -211,7 +212,7 @@ extern tree string_array_type_node;
extern tree TYPE_identifier_node; /* "TYPE" */
extern tree init_identifier_node; /* "<init>" */
extern tree clinit_identifier_node; /* "<clinit>" */
extern tree finit_identifier_node; /* "<finit>" */
extern tree finit_identifier_node; /* "$finit$" */
extern tree void_signature_node; /* "()V" */
extern tree length_identifier_node; /* "length" */
extern tree this_identifier_node; /* "this" */
@ -707,7 +708,7 @@ extern tree *type_map;
#define CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P(TYPE) \
TYPE_LANG_FLAG_5 (TYPE)
/* True if class TYPE has a field initializer <finit> function */
/* True if class TYPE has a field initializer $finit$ function */
#define CLASS_HAS_FINIT_P(TYPE) TYPE_LANG_FLAG_6 (TYPE)
/* True if identifier ID was seen while processing a single type import stmt */
@ -760,6 +761,9 @@ extern tree *type_map;
/* True if EXPR (a CALL_EXPR in that case) is a crafted StringBuffer */
#define IS_CRAFTED_STRING_BUFFER_P(EXPR) TREE_LANG_FLAG_5 (EXPR)
/* If set in CALL_EXPR, the receiver is 'super'. */
#define CALL_USING_SUPER(EXPR) TREE_LANG_FLAG_4 (EXPR)
/* True if NODE (a statement) can complete normally. */
#define CAN_COMPLETE_NORMALLY(NODE) TREE_LANG_FLAG_6(NODE)