diff options
author | David Daney <ddaney@avtrex.com> | 2007-02-02 15:46:44 +0000 |
---|---|---|
committer | David Daney <daney@gcc.gnu.org> | 2007-02-02 15:46:44 +0000 |
commit | 4969f3ea0b7fdd4f6d5e41be99c5d8ce9a0231c1 (patch) | |
tree | 2f554598619c543308411b92a4e22989468dc8c4 /gcc/java | |
parent | c9d607421cc4eb4df08a495a6e075d11381cd13c (diff) | |
download | gcc-4969f3ea0b7fdd4f6d5e41be99c5d8ce9a0231c1.zip gcc-4969f3ea0b7fdd4f6d5e41be99c5d8ce9a0231c1.tar.gz gcc-4969f3ea0b7fdd4f6d5e41be99c5d8ce9a0231c1.tar.bz2 |
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
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/java/class.c | 16 |
2 files changed, 14 insertions, 9 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index e5fc36a..56ab178 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,10 @@ +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> PR java/30641 diff --git a/gcc/java/class.c b/gcc/java/class.c index 28b0dfe..7a14aca 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -2134,10 +2134,6 @@ is_compiled_class (tree class) return 1; if (TYPE_ARRAY_P (class)) 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))); if (CLASS_FROM_CURRENTLY_COMPILED_P (class)) @@ -2147,7 +2143,7 @@ is_compiled_class (tree class) been loaded already. Load it if necessary. This prevent 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); /* We return 2 for class seen in ZIP and class from files @@ -2161,7 +2157,7 @@ is_compiled_class (tree class) { if (CLASS_FROM_SOURCE_P (class)) safe_layout_class (class); - else + else if (class != current_class) load_class (class, 1); } return 1; @@ -2510,10 +2506,12 @@ layout_class_method (tree this_class, tree super_class, tree method_name = DECL_NAME (method_decl); TREE_PUBLIC (method_decl) = 1; + /* Considered external unless it is being compiled into this object - file. */ - DECL_EXTERNAL (method_decl) = ((is_compiled_class (this_class) != 2) - || METHOD_NATIVE (method_decl)); + file, or it was already flagged as external. */ + if (!DECL_EXTERNAL (method_decl)) + DECL_EXTERNAL (method_decl) = ((is_compiled_class (this_class) != 2) + || METHOD_NATIVE (method_decl)); if (ID_INIT_P (method_name)) { |