summaryrefslogtreecommitdiff
path: root/gcc/java/lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java/lang.c')
-rw-r--r--gcc/java/lang.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index c2494daacea..2f68f7c0453 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -1,5 +1,5 @@
/* Java(TM) language-specific utility routines.
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GCC.
@@ -464,6 +464,11 @@ java_init (void)
if (flag_inline_functions)
flag_inline_trees = 1;
+ /* FIXME: Indirect dispatch isn't yet compatible with static class
+ init optimization. */
+ if (flag_indirect_dispatch)
+ always_initialize_class_p = true;
+
/* Force minimum function alignment if g++ uses the least significant
bit of function pointers to store the virtual bit. This is required
to keep vtables compatible. */
@@ -967,11 +972,9 @@ inline_init_test_initialization (void **entry, void *x)
(DECL_FUNCTION_INIT_TEST_TABLE (current_function_decl), ite->key);
if (! h)
return true;
-
splay_tree_insert (decl_map,
(splay_tree_key) ite->value,
(splay_tree_value) h);
-
return true;
}
@@ -1102,7 +1105,7 @@ java_dump_tree (void *dump_info, tree t)
static bool
java_decl_ok_for_sibcall (tree decl)
{
- return decl != NULL && DECL_CONTEXT (decl) == current_class;
+ return decl != NULL && DECL_CONTEXT (decl) == output_class;
}
/* Used by estimate_num_insns. Estimate number of instructions seen
@@ -1228,7 +1231,7 @@ java_start_inlining (tree fn)
static tree
java_get_callee_fndecl (tree call_expr)
{
- tree method, table, element;
+ tree method, table, element, atable_methods;
HOST_WIDE_INT index;
@@ -1239,10 +1242,14 @@ java_get_callee_fndecl (tree call_expr)
if (TREE_CODE (method) != ARRAY_REF)
return NULL;
table = TREE_OPERAND (method, 0);
- if (table != atable_decl)
+ if (! DECL_LANG_SPECIFIC(table)
+ || !DECL_OWNER (table)
+ || TYPE_ATABLE_DECL (DECL_OWNER (table)) != table)
return NULL;
- index = TREE_INT_CST_LOW (TREE_OPERAND (method, 1));
+ atable_methods = TYPE_ATABLE_METHODS (DECL_OWNER (table));
+ index = TREE_INT_CST_LOW (TREE_OPERAND (method, 1));
+
/* FIXME: Replace this for loop with a hash table lookup. */
for (element = atable_methods; element; element = TREE_CHAIN (element))
{
@@ -1257,7 +1264,7 @@ java_get_callee_fndecl (tree call_expr)
}
--index;
}
-
+
return NULL;
}