aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/expr.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-09-23 17:09:39 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-09-23 17:09:39 +0000
commit19e223db83b86b7262db77c9ea67e7d6d32a0d73 (patch)
tree95f1fa9690fd278ef5602931fc5a32ddfca8d2bd /gcc/java/expr.c
parenta3b434a23543ba4fe8ac546382475e145b8be83f (diff)
downloadgcc-19e223db83b86b7262db77c9ea67e7d6d32a0d73.zip
gcc-19e223db83b86b7262db77c9ea67e7d6d32a0d73.tar.gz
gcc-19e223db83b86b7262db77c9ea67e7d6d32a0d73.tar.bz2
Make-lang.in (JAVA_SRCS): Include java-tree.h.
* Make-lang.in (JAVA_SRCS): Include java-tree.h. * Makefile.in (parse.o): Depend on ggc.h. (class.o): Likewise. (constants.o): Likewise. (decl.o): Likewise. (expr.o): Likewise. (jcf-parse.o): Likewise. (jcf-write.o): Likewise. (mangle.o): Likewise. * class.c: Include ggc.h. (build_static_field_ref): Register GC roots. (layout_class): Likewise. (init_class_processing): Likewise. * constants.c: Include ggc.h. (current_constant_pool_data_ref): Remove. (tag_nodes): Move it to ... (get_tag_node): ... here. Register GC roots. * decl.c: Include ggc.h. Remove many global tree definitions. (throw_node): Define. (java_global_trees): Likewise. (predef_filenames): Make the size a constant. (init_decl_processing): Adjust accordingly. (init_decl_processing): Call init_jcf_parse. Register GC roots. * expr.c: Include ggc.h. (init_expr_processing): Register GC roots. (build_invokeinterface): Likewise. * java-tree.h: Replace extern tree declarations with macros. (java_global_trees): New variable. (java_tree_index): New enumeration. (init_jcf_parse): Declare. * jcf-parse.c: Include ggc.h. (current_class): Remove declaration. (main_class): Likewise. (all_class_list): Likewise. (predefined_filename_p): Adjust for constant size of predef_filenames. (init_jcf_parse): New function. * jcf-write.c: Include ggc.h. (generate_classfile): Register GC roots. (append_synthetic_attribute): Likewise. (append_innerclass_attribute_entry): Likewise. * lang.c: Include ggc.h. (lang_print_error): Register GC roots. * parse.h (struct parser_ctxt): Rename fields to avoid conflicts with macros. * parse.y: Include ggc.h. (wfl_operator): Remove. (goal): Register GC roots. (java_pop_parser_context): Adjust for new field names. (java_parser_context_save_global): Likewse. (java_parser_context_restore_global): Likewise. (java_parser_context_suspend): Likewise. (java_parser_context_resume): Likewise. (verify_constructor_circularity): Register GC roots. (lookup_cl): Likewise. (java_reorder_fields): Likewise. (build_current_this): Likewise. (class_in_current_package): Likewise. (argument_types_convertible): Likewise. (patch_cast): Rename wfl_op parameter to avoid macro conflicts. From-SVN: r36581
Diffstat (limited to 'gcc/java/expr.c')
-rw-r--r--gcc/java/expr.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index fbc08c6..54a3332 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -40,6 +40,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "toplev.h"
#include "except.h"
#include "defaults.h"
+#include "ggc.h"
static void flush_quick_stack PARAMS ((void));
static void push_value PARAMS ((tree));
@@ -83,6 +84,10 @@ static tree case_identity PARAMS ((tree, tree));
static tree operand_type[59];
extern struct obstack permanent_obstack;
+static tree methods_ident = NULL_TREE;
+static tree ncode_ident = NULL_TREE;
+tree dtable_ident = NULL_TREE;
+
/* Set to non-zero value in order to emit class initilization code
before static field references. */
int always_initialize_class_p;
@@ -95,6 +100,9 @@ init_expr_processing()
operand_type[23] = operand_type[56] = float_type_node;
operand_type[24] = operand_type[57] = double_type_node;
operand_type[25] = operand_type[58] = ptr_type_node;
+ ggc_add_tree_root (operand_type, 59);
+ ggc_add_tree_root (&methods_ident, 1);
+ ggc_add_tree_root (&ncode_ident, 1);
}
/* We store the stack state in two places:
@@ -1652,10 +1660,6 @@ build_class_init (clas, expr)
return init;
}
-static tree methods_ident = NULL_TREE;
-static tree ncode_ident = NULL_TREE;
-tree dtable_ident = NULL_TREE;
-
tree
build_known_method_ref (method, method_type, self_type, method_signature, arg_list)
tree method, method_type ATTRIBUTE_UNUSED, self_type,
@@ -1771,8 +1775,11 @@ build_invokeinterface (dtable, method)
abstract nor static. */
if (class_ident == NULL_TREE)
- class_ident = get_identifier ("class");
-
+ {
+ class_ident = get_identifier ("class");
+ ggc_add_tree_root (&class_ident, 1);
+ }
+
dtable = build1 (INDIRECT_REF, dtable_type, dtable);
dtable = build (COMPONENT_REF, class_ptr_type, dtable,
lookup_field (&dtable_type, class_ident));