aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>2004-07-19 11:29:31 -0700
committerPer Bothner <bothner@gcc.gnu.org>2004-07-19 11:29:31 -0700
commit963ddbd50fbb62666384ea56cfc7e06753f9bb6d (patch)
tree597d2c3053a8c38dbe90a83d42c5d5788337fa93 /libjava
parentb06f03362fe56b4a81a506f6c7fc6a5bf721d905 (diff)
downloadgcc-963ddbd50fbb62666384ea56cfc7e06753f9bb6d.zip
gcc-963ddbd50fbb62666384ea56cfc7e06753f9bb6d.tar.gz
gcc-963ddbd50fbb62666384ea56cfc7e06753f9bb6d.tar.bz2
Print -verbose:message on "loading", not initialization.
* java/lang/Class.h (JV_STATE_LOADED, JV_STATE_COMPILED): Swap order. * defineclass.cc (_Jv_ClassReader::parse): Print message if gcj::verbose_class_flag. * java/lang/natClass.cc (initializeClass): Don't print message here. * java/lang/natClassLoader.cc (_Jv_WaitForState): If state was _JV_STATE_COMPILED, set to JV_STATE_LOADED and may print message. (_Jv_PrepareCompiledClass): Likewise. From-SVN: r84926
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog11
-rw-r--r--libjava/defineclass.cc2
-rw-r--r--libjava/java/lang/Class.h5
-rw-r--r--libjava/java/lang/natClass.cc3
-rw-r--r--libjava/java/lang/natClassLoader.cc13
5 files changed, 27 insertions, 7 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index eb4d7c6..8f7edb1 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,14 @@
+2004-07-19 Per Bothner <per@bothner.com>
+
+ Print -verbose:message on "loading", not initialization.
+ * java/lang/Class.h (JV_STATE_LOADED, JV_STATE_COMPILED): Swap order.
+ * defineclass.cc (_Jv_ClassReader::parse): Print message if
+ gcj::verbose_class_flag.
+ * java/lang/natClass.cc (initializeClass): Don't print message here.
+ * java/lang/natClassLoader.cc (_Jv_WaitForState): If state was
+ _JV_STATE_COMPILED, set to JV_STATE_LOADED and may print message.
+ (_Jv_PrepareCompiledClass): Likewise.
+
2004-07-18 Matthias Klose <doko@debian.org>
* configure.in: Substitute target_noncanonical.
diff --git a/libjava/defineclass.cc b/libjava/defineclass.cc
index 2660681..0648ad9 100644
--- a/libjava/defineclass.cc
+++ b/libjava/defineclass.cc
@@ -336,6 +336,8 @@ _Jv_ClassReader::parse ()
// tell everyone we're done.
def->state = JV_STATE_LOADED;
+ if (gcj::verbose_class_flag)
+ fprintf (stderr, "[Loaded (bytecode) %s]\n", (const char*)(def->name->data));
def->notifyAll ();
}
diff --git a/libjava/java/lang/Class.h b/libjava/java/lang/Class.h
index e93920c..de00c2e 100644
--- a/libjava/java/lang/Class.h
+++ b/libjava/java/lang/Class.h
@@ -39,10 +39,9 @@ enum
JV_STATE_PRELOADING = 1, // Can do _Jv_FindClass.
JV_STATE_LOADING = 3, // Has super installed.
- JV_STATE_LOADED = 5, // Is complete.
-
- JV_STATE_COMPILED = 6, // This was a compiled class.
+ JV_STATE_COMPILED = 5, // This was a compiled class.
+ JV_STATE_LOADED = 6, // Is complete.
JV_STATE_PREPARED = 7, // Layout & static init done.
JV_STATE_LINKED = 9, // Strings interned.
diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc
index 943269e..1b1a32d 100644
--- a/libjava/java/lang/natClass.cc
+++ b/libjava/java/lang/natClass.cc
@@ -831,9 +831,6 @@ java::lang::Class::initializeClass (void)
throw except;
}
- if (gcj::verbose_class_flag)
- fprintf (stderr, "[Loaded %s]\n", (const char*)(name->data));
-
_Jv_MonitorEnter (this);
state = JV_STATE_DONE;
notifyAll ();
diff --git a/libjava/java/lang/natClassLoader.cc b/libjava/java/lang/natClassLoader.cc
index ec48352..b38c2db 100644
--- a/libjava/java/lang/natClassLoader.cc
+++ b/libjava/java/lang/natClassLoader.cc
@@ -48,6 +48,12 @@ _Jv_WaitForState (jclass klass, int state)
_Jv_MonitorEnter (klass) ;
+ if (klass->state == JV_STATE_COMPILED)
+ {
+ klass->state = JV_STATE_LOADED;
+ if (gcj::verbose_class_flag)
+ fprintf (stderr, "[Loaded (pre-compiled) %s]\n", (const char*)(klass->name->data));
+ }
if (state == JV_STATE_LINKED)
{
// Must call _Jv_PrepareCompiledClass while holding the class
@@ -86,7 +92,8 @@ typedef unsigned int uaddr __attribute__ ((mode (pointer)));
void
_Jv_PrepareCompiledClass (jclass klass)
{
- if (klass->state >= JV_STATE_LINKED)
+ jint state = klass->state;
+ if (state >= JV_STATE_LINKED)
return;
// Short-circuit, so that mutually dependent classes are ok.
@@ -173,6 +180,10 @@ _Jv_PrepareCompiledClass (jclass klass)
if (klass->isInterface ())
_Jv_LayoutInterfaceMethods (klass);
+ if (state == JV_STATE_COMPILED && gcj::verbose_class_flag)
+ fprintf (stderr, "[Loaded (pre-compiled) %s]\n",
+ (const char*)(klass->name->data));
+
klass->notifyAll ();
_Jv_PushClass (klass);