Commit 165f37bc by Alexandre Petit-Bianco Committed by Alexandre Petit-Bianco

[multiple changes]

2000-03-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.y (check_abstract_method_definitions): New local
	`end_type_reached'. Make sure we also consider `end_type'.
	(java_check_abstract_method_definitions): Make sure we also
	eventually consider `java.lang.Object'.
	(maybe_use_access_method): Don't use access method if not a pure
	inner class or if the method's context is right.
	(find_applicable_accessible_methods_list): New static
	`object_done'. Don't search abstract classes as interfaces. Fixed
	indentation. Fixed the `java.lang.Object' only search. Search class'
	interface(s) first, fully search enclosing contexts.
	(find_most_specific_methods_list): Pick closest candidates when
	they're all abstract.

2000-03-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.y (check_method_types_complete): New function.
	(create_class): Reset anonymous class counter only when seeing an
	non inner classe.
	(java_complete_class): JDEP_METHOD: Don't recompute signature
	if incomplete.

2000-03-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* class.c (build_static_ref): Fixed indentation in comment.
	* java-tree.def (TRY_EXPR): Fixed typo in name.
	(CLASS_LITERAL): Likewise.
	* java-tree.h: (TYPE_DOT_CLASS): New macro.
	(struct lang_type): New field `dot_class'.
	* jcf-write.c (generate_bytecode_insns): Fixed error message.
	(generate_classfile): Method `class$' is synthetic.
	* parse.y (build_do_class_method): New function.
	(build_dot_class_method_invocation): Likewise.
	(java_complete_expand_methods): Expand TYPE_DOT_CLASS if necessary.
	(resolve_qualified_expression_name): Handle CLASS_LITERAL.
	(qualify_ambiguous_name): Likewise.
	(patch_incomplete_class_ref): Invoke synthetic method if necessary.
	(build_try_statement): Fixed leading comment.

2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.h (INNER_ENCLOSING_SCOPE_CHECK): Disregard anonymous
	classes.
	* parse.y (patch_method_invocation): Handle anonymous classes
	creation in static context.

2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.h (INNER_ENCLOSING_SCOPE_CHECK): New macro.
	* parse.y (resolve_qualified_expression_name): Use it.
	(patch_method_invocation): Likewise.

2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.y (register_incomplete_type): JDEP_ENCLOSING set
	depending on the type of dependency which dictates what the
	current class is.
	(unresolved_type_p): Resolved types limited to the current class.

(For details, see: http://gcc.gnu.org/ml/gcc-patches/2000-03/msg00790.html)

From-SVN: r32701
parent e4a3c2f6
2000-03-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (check_abstract_method_definitions): New local
`end_type_reached'. Make sure we also consider `end_type'.
(java_check_abstract_method_definitions): Make sure we also
eventually consider `java.lang.Object'.
(maybe_use_access_method): Don't use access method if not a pure
inner class or if the method's context is right.
(find_applicable_accessible_methods_list): New static
`object_done'. Don't search abstract classes as interfaces. Fixed
indentation. Fixed the `java.lang.Object' only search. Search class'
interface(s) first, fully search enclosing contexts.
(find_most_specific_methods_list): Pick closest candidates when
they're all abstract.
Mon Mar 20 08:58:51 2000 Alexandre Petit-Bianco <apbianco@cygnus.com> Mon Mar 20 08:58:51 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
* jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR: * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
...@@ -8,6 +23,31 @@ Mon Mar 20 08:58:51 2000 Alexandre Petit-Bianco <apbianco@cygnus.com> ...@@ -8,6 +23,31 @@ Mon Mar 20 08:58:51 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
* except.c (emit_handlers): Clear catch_clauses_last. * except.c (emit_handlers): Clear catch_clauses_last.
2000-03-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (check_method_types_complete): New function.
(create_class): Reset anonymous class counter only when seeing an
non inner classe.
(java_complete_class): JDEP_METHOD: Don't recompute signature
if incomplete.
2000-03-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
* class.c (build_static_ref): Fixed indentation in comment.
* java-tree.def (TRY_EXPR): Fixed typo in name.
(CLASS_LITERAL): Likewise.
* java-tree.h: (TYPE_DOT_CLASS): New macro.
(struct lang_type): New field `dot_class'.
* jcf-write.c (generate_bytecode_insns): Fixed error message.
(generate_classfile): Method `class$' is synthetic.
* parse.y (build_do_class_method): New function.
(build_dot_class_method_invocation): Likewise.
(java_complete_expand_methods): Expand TYPE_DOT_CLASS if necessary.
(resolve_qualified_expression_name): Handle CLASS_LITERAL.
(qualify_ambiguous_name): Likewise.
(patch_incomplete_class_ref): Invoke synthetic method if necessary.
(build_try_statement): Fixed leading comment.
Fri Mar 17 08:09:14 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Fri Mar 17 08:09:14 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* class.c (make_field_value): Properly handle sizes. * class.c (make_field_value): Properly handle sizes.
...@@ -35,6 +75,26 @@ Fri Mar 17 08:09:14 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> ...@@ -35,6 +75,26 @@ Fri Mar 17 08:09:14 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* lang.c (lang_decode_option): Enable -Wunused when -Wall given. * lang.c (lang_decode_option): Enable -Wunused when -Wall given.
2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.h (INNER_ENCLOSING_SCOPE_CHECK): Disregard anonymous
classes.
* parse.y (patch_method_invocation): Handle anonymous classes
creation in static context.
2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.h (INNER_ENCLOSING_SCOPE_CHECK): New macro.
* parse.y (resolve_qualified_expression_name): Use it.
(patch_method_invocation): Likewise.
2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (register_incomplete_type): JDEP_ENCLOSING set
depending on the type of dependency which dictates what the
current class is.
(unresolved_type_p): Resolved types limited to the current class.
2000-03-15 Tom Tromey <tromey@cygnus.com> 2000-03-15 Tom Tromey <tromey@cygnus.com>
* decl.c (init_decl_processing): Set type of `sync_info' to be * decl.c (init_decl_processing): Set type of `sync_info' to be
......
...@@ -967,8 +967,7 @@ build_static_field_ref (fdecl) ...@@ -967,8 +967,7 @@ build_static_field_ref (fdecl)
else else
{ {
/* Compile as: /* Compile as:
* *(FTYPE*)build_class_ref(FCLASS)->fields[INDEX].info.addr * *(FTYPE*)build_class_ref(FCLASS)->fields[INDEX].info.addr */
*/
static tree fields_ident = NULL_TREE; static tree fields_ident = NULL_TREE;
static tree info_ident = NULL_TREE; static tree info_ident = NULL_TREE;
tree ref = build_class_ref (fclass); tree ref = build_class_ref (fclass);
......
...@@ -50,7 +50,7 @@ DEFTREECODE (DEFAULT_EXPR, "default", 'x', 0) ...@@ -50,7 +50,7 @@ DEFTREECODE (DEFAULT_EXPR, "default", 'x', 0)
/* Try expression /* Try expression
Operand 0 is the tried block, Operand 0 is the tried block,
Operand 1 contains chained catch nodes. */ Operand 1 contains chained catch nodes. */
DEFTREECODE (TRY_EXPR, "try-catch-finally", 'e', 2) DEFTREECODE (TRY_EXPR, "try-catch", 'e', 2)
/* Catch clause. /* Catch clause.
Operand 0 is the catch clause block, which contains the declaration of Operand 0 is the catch clause block, which contains the declaration of
...@@ -86,7 +86,7 @@ DEFTREECODE (NEW_ARRAY_INIT, "new_array_init", '1', 1) ...@@ -86,7 +86,7 @@ DEFTREECODE (NEW_ARRAY_INIT, "new_array_init", '1', 1)
/* Class literal. /* Class literal.
Operand 0 is the name of the class we're trying to build a Operand 0 is the name of the class we're trying to build a
reference from. */ reference from. */
DEFTREECODE (CLASS_LITERAL, "class_litteral", '1', 1) DEFTREECODE (CLASS_LITERAL, "class_literal", '1', 1)
/* Instance initializer. /* Instance initializer.
Operand 0 contains the intance initializer statement. This tree node Operand 0 contains the intance initializer statement. This tree node
......
...@@ -547,6 +547,9 @@ struct lang_decl_var ...@@ -547,6 +547,9 @@ struct lang_decl_var
#define TYPE_FINIT_STMT_LIST(T) (TYPE_LANG_SPECIFIC(T)->finit_stmt_list) #define TYPE_FINIT_STMT_LIST(T) (TYPE_LANG_SPECIFIC(T)->finit_stmt_list)
#define TYPE_CLINIT_STMT_LIST(T) (TYPE_LANG_SPECIFIC(T)->clinit_stmt_list) #define TYPE_CLINIT_STMT_LIST(T) (TYPE_LANG_SPECIFIC(T)->clinit_stmt_list)
#define TYPE_II_STMT_LIST(T) (TYPE_LANG_SPECIFIC(T)->ii_block) #define TYPE_II_STMT_LIST(T) (TYPE_LANG_SPECIFIC(T)->ii_block)
/* The decl of the synthetic method `class$' used to handle `.class'
for non primitive types when compiling to bytecode. */
#define TYPE_DOT_CLASS(T) (TYPE_LANG_SPECIFIC(T)->dot_class)
struct lang_type struct lang_type
{ {
...@@ -557,6 +560,10 @@ struct lang_type ...@@ -557,6 +560,10 @@ struct lang_type
tree finit_stmt_list; /* List of statements $finit$ will use */ tree finit_stmt_list; /* List of statements $finit$ will use */
tree clinit_stmt_list; /* List of statements <clinit> will use */ tree clinit_stmt_list; /* List of statements <clinit> will use */
tree ii_block; /* Instance initializer block */ tree ii_block; /* Instance initializer block */
tree dot_class; /* The decl of the `class$' function that
needs to be invoked and generated when
compiling to bytecode to implement
<non_primitive_type>.class */
}; };
#ifdef JAVA_USE_HANDLES #ifdef JAVA_USE_HANDLES
......
...@@ -2569,7 +2569,7 @@ generate_bytecode_insns (exp, target, state) ...@@ -2569,7 +2569,7 @@ generate_bytecode_insns (exp, target, state)
/* fall through */ /* fall through */
notimpl: notimpl:
default: default:
error("internal error - tree code not implemented: %s", error("internal error in generate_bytecode_insn - tree code not implemented: %s",
tree_code_name [(int) TREE_CODE (exp)]); tree_code_name [(int) TREE_CODE (exp)]);
} }
} }
...@@ -2911,7 +2911,8 @@ generate_classfile (clas, state) ...@@ -2911,7 +2911,8 @@ generate_classfile (clas, state)
/* Make room for the Synthetic attribute (of zero length.) */ /* Make room for the Synthetic attribute (of zero length.) */
if (DECL_FINIT_P (part) if (DECL_FINIT_P (part)
|| OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (part))) || OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (part))
|| TYPE_DOT_CLASS (clas) == part)
{ {
i++; i++;
synthetic_p = 1; synthetic_p = 1;
......
...@@ -823,6 +823,17 @@ struct parser_ctxt { ...@@ -823,6 +823,17 @@ struct parser_ctxt {
TREE_VALUE (GET_ENCLOSING_CPC ()) : \ TREE_VALUE (GET_ENCLOSING_CPC ()) : \
NULL_TREE) NULL_TREE)
/* Make sure that innerclass T sits in an appropriate enclosing
context. */
#define INNER_ENCLOSING_SCOPE_CHECK(T) \
(INNER_CLASS_TYPE_P ((T)) && !ANONYMOUS_CLASS_P ((T)) \
/* We have a this and it's not the right one */ \
&& ((current_this \
&& (DECL_CONTEXT (TYPE_NAME ((T))) \
!= TYPE_NAME (TREE_TYPE (TREE_TYPE (current_this))))) \
/* We don't have a this. */ \
|| !current_this))
/* Push macro. First argument to PUSH_CPC is a DECL_TYPE, second /* Push macro. First argument to PUSH_CPC is a DECL_TYPE, second
argument is the unqualified currently parsed class name. */ argument is the unqualified currently parsed class name. */
#define PUSH_CPC(C,R) { \ #define PUSH_CPC(C,R) { \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment