OSDN Git Service

2003-10-22 Andrew Haley <aph@redhat.com>
[pf3gnuchains/gcc-fork.git] / gcc / java / java-tree.h
index be591d9..7b5a397 100644 (file)
@@ -146,17 +146,29 @@ extern int compiling_from_source;
 /* List of all class filenames seen so far.  */
 #define all_class_filename java_global_trees [JTI_ALL_CLASS_FILENAME]
 
-/* List of virtual method decls called in this translation unit, used to 
-   generate virtual method offset symbol table. */
+/* List of virtual decls referred to by this translation unit, used to
+   generate virtual method offset symbol table.  */
 #define otable_methods java_global_trees [JTI_OTABLE_METHODS]
+/* List of static decls referred to by this translation unit, used to
+   generate virtual method offset symbol table.  */
+#define atable_methods java_global_trees [JTI_ATABLE_METHODS]
 
-/* The virtual method offset table. This is emitted as uninitialized data of 
-   the required length, and filled out at run time during class linking. */
+/* The virtual offset table.  This is emitted as uninitialized data of
+   the required length, and filled out at run time during class
+   linking. */
 #define otable_decl java_global_trees [JTI_OTABLE_DECL]
+/* The static address table.  */
+#define atable_decl java_global_trees [JTI_ATABLE_DECL]
 
-/* The virtual method offset symbol table. Used by the runtime to fill out the
-   otable. */
+/* The virtual offset symbol table. Used by the runtime to fill out
+   the otable. */
 #define otable_syms_decl java_global_trees [JTI_OTABLE_SYMS_DECL]
+/* The static symbol table. Used by the runtime to fill out the
+   otable. */
+#define atable_syms_decl java_global_trees [JTI_ATABLE_SYMS_DECL]
+
+#define ctable_decl java_global_trees [JTI_CTABLE_DECL]
+#define catch_classes java_global_trees [JTI_CATCH_CLASSES]
 
 extern int flag_emit_class_files;
 
@@ -364,9 +376,11 @@ enum java_tree_index
   JTI_METHOD_PTR_TYPE_NODE,
   JTI_OTABLE_TYPE,
   JTI_OTABLE_PTR_TYPE,
-  JTI_METHOD_SYMBOL_TYPE,
-  JTI_METHOD_SYMBOLS_ARRAY_TYPE,
-  JTI_METHOD_SYMBOLS_ARRAY_PTR_TYPE,
+  JTI_ATABLE_TYPE,
+  JTI_ATABLE_PTR_TYPE,
+  JTI_SYMBOL_TYPE,
+  JTI_SYMBOLS_ARRAY_TYPE,
+  JTI_SYMBOLS_ARRAY_PTR_TYPE,
 
   JTI_END_PARAMS_NODE,
 
@@ -409,6 +423,13 @@ enum java_tree_index
   JTI_OTABLE_DECL,
   JTI_OTABLE_SYMS_DECL,
 
+  JTI_ATABLE_METHODS,
+  JTI_ATABLE_DECL,
+  JTI_ATABLE_SYMS_DECL,
+
+  JTI_CTABLE_DECL,
+  JTI_CATCH_CLASSES,
+
   JTI_PREDEF_FILENAMES,
 
   JTI_MAX
@@ -602,14 +623,20 @@ extern GTY(()) tree java_global_trees[JTI_MAX];
   java_global_trees[JTI_METHOD_PTR_TYPE_NODE]
 #define otable_type \
   java_global_trees[JTI_OTABLE_TYPE]
+#define atable_type \
+  java_global_trees[JTI_ATABLE_TYPE]
 #define otable_ptr_type \
   java_global_trees[JTI_OTABLE_PTR_TYPE]
-#define method_symbol_type \
-  java_global_trees[JTI_METHOD_SYMBOL_TYPE]
-#define method_symbols_array_type \
-  java_global_trees[JTI_METHOD_SYMBOLS_ARRAY_TYPE]
-#define method_symbols_array_ptr_type \
-  java_global_trees[JTI_METHOD_SYMBOLS_ARRAY_PTR_TYPE]
+#define atable_ptr_type \
+  java_global_trees[JTI_ATABLE_PTR_TYPE]
+#define symbol_type \
+  java_global_trees[JTI_SYMBOL_TYPE]
+#define symbols_array_type \
+  java_global_trees[JTI_SYMBOLS_ARRAY_TYPE]
+#define symbols_array_ptr_type \
+  java_global_trees[JTI_SYMBOLS_ARRAY_PTR_TYPE]
+#define class_refs_decl \
+  Jjava_global_trees[TI_CLASS_REFS_DECL]
 
 #define end_params_node \
   java_global_trees[JTI_END_PARAMS_NODE]
@@ -906,12 +933,6 @@ union lang_tree_node
 /* The original WFL of a final variable. */
 #define DECL_FIELD_FINAL_WFL(NODE) \
   (DECL_LANG_SPECIFIC(NODE)->u.v.wfl)
-/* In a FUNCTION_DECL for which DECL_BUILT_IN does not hold, this is
-     the approximate number of instructions in this function.  There is
-     no need for this number to be exact; it is only used in various
-     heuristics regarding optimization.  */
-#define DECL_ESTIMATED_INSNS(NODE) \
-  (FUNCTION_DECL_CHECK (NODE)->decl.u1.i)
 /* True if NODE is a local variable final. */
 #define LOCAL_FINAL_P(NODE) (DECL_LANG_SPECIFIC (NODE) && DECL_FINAL (NODE))
 /* True if NODE is a final field. */
@@ -983,6 +1004,9 @@ struct lang_decl_func GTY(())
   unsigned int fixed_ctor : 1;
   unsigned int init_calls_this : 1;
   unsigned int strictfp : 1;
+  unsigned int invisible : 1;  /* Set for methods we generate
+                                  internally but which shouldn't be
+                                  written to the .class file.  */
 };
 
 struct treetreehash_entry GTY(())
@@ -1077,6 +1101,12 @@ struct lang_type GTY(())
 #define JCF_u4 unsigned long
 #define JCF_u2 unsigned short
 
+/* Possible values to pass to lookup_argument_method_generic.  */
+#define SEARCH_INTERFACE      1
+#define SEARCH_SUPER          2
+#define SEARCH_ONLY_INTERFACE 4
+#define SEARCH_VISIBLE        8
+
 extern void java_parse_file (int);
 extern bool java_mark_addressable (tree);
 extern tree java_type_for_mode (enum machine_mode, int);
@@ -1090,7 +1120,7 @@ extern tree lookup_class (tree);
 extern tree lookup_java_constructor (tree, tree);
 extern tree lookup_java_method (tree, tree, tree);
 extern tree lookup_argument_method (tree, tree, tree);
-extern tree lookup_argument_method2 (tree, tree, tree);
+extern tree lookup_argument_method_generic (tree, tree, tree, int);
 extern int has_method (tree, tree);
 extern tree promote_type (tree);
 extern tree get_constant (struct JCF*, int);
@@ -1196,7 +1226,7 @@ extern void make_class_data (tree);
 extern void register_class (void);
 extern int alloc_name_constant (int, tree);
 extern void emit_register_classes (void);
-extern void emit_offset_symbol_table (void);
+extern tree emit_symbol_table (tree, tree, tree, tree, tree);
 extern void lang_init_source (int);
 extern void write_classfile (tree);
 extern char *print_int_node (tree);
@@ -1278,7 +1308,6 @@ extern void append_gpp_mangled_name (const char *, int);
 extern void add_predefined_file (tree);
 extern int predefined_filename_p (tree);
 
-extern void java_optimize_inline (tree);
 extern tree decl_constant_value (tree);
 
 extern void java_mark_class_local (tree);
@@ -1294,6 +1323,13 @@ extern void compile_resource_file (const char *, const char *);
 extern void write_resource_constructor (void);
 extern void init_resource_processing (void);
 
+extern void start_complete_expand_method (tree);
+extern void java_expand_body (tree);
+
+extern int get_symbol_table_index (tree, tree *);
+
+extern tree make_catch_class_record (tree, tree);
+extern void emit_catch_table (void);
 
 #define DECL_FINAL(DECL) DECL_LANG_FLAG_3 (DECL)
 
@@ -1308,6 +1344,7 @@ extern void init_resource_processing (void);
 #define METHOD_NATIVE(DECL) (DECL_LANG_SPECIFIC(DECL)->u.f.native)
 #define METHOD_ABSTRACT(DECL) DECL_LANG_FLAG_5 (DECL)
 #define METHOD_STRICTFP(DECL) (DECL_LANG_SPECIFIC (DECL)->u.f.strictfp)
+#define METHOD_INVISIBLE(DECL) (DECL_LANG_SPECIFIC (DECL)->u.f.invisible)
 
 #define JAVA_FILE_P(NODE) TREE_LANG_FLAG_2 (NODE)
 #define CLASS_FILE_P(NODE) TREE_LANG_FLAG_3 (NODE)
@@ -1652,11 +1689,16 @@ extern tree *type_map;
 /* Append a field initializer to CONS for a field with the given VALUE.
    NAME is a char* string used for error checking;
    the initializer must be specified in order. */
-#define PUSH_FIELD_VALUE(CONS, NAME, VALUE) {\
-  tree field = TREE_CHAIN(CONS);\
-  if (strcmp (IDENTIFIER_POINTER (DECL_NAME (field)), NAME) != 0) abort();\
-  CONSTRUCTOR_ELTS(CONS) = tree_cons (field, VALUE, CONSTRUCTOR_ELTS(CONS));\
-  TREE_CHAIN(CONS) = TREE_CHAIN (field); }
+#define PUSH_FIELD_VALUE(CONS, NAME, VALUE)                                    \
+do                                                                             \
+{                                                                              \
+  tree field = TREE_CHAIN(CONS);                                               \
+  if (strcmp (IDENTIFIER_POINTER (DECL_NAME (field)), NAME) != 0)              \
+    abort();                                                                   \
+  CONSTRUCTOR_ELTS(CONS) = tree_cons (field, VALUE, CONSTRUCTOR_ELTS(CONS));   \
+  TREE_CHAIN(CONS) = TREE_CHAIN (field);                                       \
+}                                                                              \
+while (0)
 
 /* Finish creating a record CONSTRUCTOR CONS. */
 #define FINISH_RECORD_CONSTRUCTOR(CONS) \