Commit 4969f3ea by David Daney Committed by David Daney

class.c (is_compiled_class): Move check to avoid reloading current class.

	* class.c (is_compiled_class): Move check to avoid reloading
	current class.
	(layout_class_method): Don't calculate DECL_EXTERNAL if it is
	already set.

From-SVN: r121506
parent c9d60742
2007-02-02 David Daney <ddaney@avtrex.com>
* class.c (is_compiled_class): Move check to avoid reloading
current class.
(layout_class_method): Don't calculate DECL_EXTERNAL if it is
already set.
2007-02-01 Andrew Haley <aph@redhat.com> 2007-02-01 Andrew Haley <aph@redhat.com>
PR java/30641 PR java/30641
......
...@@ -2134,10 +2134,6 @@ is_compiled_class (tree class) ...@@ -2134,10 +2134,6 @@ is_compiled_class (tree class)
return 1; return 1;
if (TYPE_ARRAY_P (class)) if (TYPE_ARRAY_P (class))
return 0; return 0;
/* We have to check this explicitly to avoid trying to load a class
that we're currently parsing. */
if (class == current_class)
return 2;
seen_in_zip = (TYPE_JCF (class) && JCF_SEEN_IN_ZIP (TYPE_JCF (class))); seen_in_zip = (TYPE_JCF (class) && JCF_SEEN_IN_ZIP (TYPE_JCF (class)));
if (CLASS_FROM_CURRENTLY_COMPILED_P (class)) if (CLASS_FROM_CURRENTLY_COMPILED_P (class))
...@@ -2147,7 +2143,7 @@ is_compiled_class (tree class) ...@@ -2147,7 +2143,7 @@ is_compiled_class (tree class)
been loaded already. Load it if necessary. This prevent been loaded already. Load it if necessary. This prevent
build_class_ref () from crashing. */ build_class_ref () from crashing. */
if (seen_in_zip && !CLASS_LOADED_P (class)) if (seen_in_zip && !CLASS_LOADED_P (class) && (class != current_class))
load_class (class, 1); load_class (class, 1);
/* We return 2 for class seen in ZIP and class from files /* We return 2 for class seen in ZIP and class from files
...@@ -2161,7 +2157,7 @@ is_compiled_class (tree class) ...@@ -2161,7 +2157,7 @@ is_compiled_class (tree class)
{ {
if (CLASS_FROM_SOURCE_P (class)) if (CLASS_FROM_SOURCE_P (class))
safe_layout_class (class); safe_layout_class (class);
else else if (class != current_class)
load_class (class, 1); load_class (class, 1);
} }
return 1; return 1;
...@@ -2510,10 +2506,12 @@ layout_class_method (tree this_class, tree super_class, ...@@ -2510,10 +2506,12 @@ layout_class_method (tree this_class, tree super_class,
tree method_name = DECL_NAME (method_decl); tree method_name = DECL_NAME (method_decl);
TREE_PUBLIC (method_decl) = 1; TREE_PUBLIC (method_decl) = 1;
/* Considered external unless it is being compiled into this object /* Considered external unless it is being compiled into this object
file. */ file, or it was already flagged as external. */
DECL_EXTERNAL (method_decl) = ((is_compiled_class (this_class) != 2) if (!DECL_EXTERNAL (method_decl))
|| METHOD_NATIVE (method_decl)); DECL_EXTERNAL (method_decl) = ((is_compiled_class (this_class) != 2)
|| METHOD_NATIVE (method_decl));
if (ID_INIT_P (method_name)) if (ID_INIT_P (method_name))
{ {
......
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