From: Per Bothner Date: Wed, 7 Jul 2004 23:44:12 +0000 (-0700) Subject: jvm.h (namespace jcj): Declare verbose_class_flag X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0bd241538e3a612adf2baed111e774e554a561fd;p=gcc.git jvm.h (namespace jcj): Declare verbose_class_flag * include/jvm.h (namespace jcj): Declare verbose_class_flag * java/lang/natClass.cc (gcj::verbose_class_flag): New variable. (initializeClass): If verbose_class_flag, print message. * gij.cc (main): Handle -verbose:class flag. From-SVN: r84242 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 3a0ec3e7fcb..adcf27512f9 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,10 @@ +2004-07-07 Per Bothner + + * include/jvm.h (namespace jcj): Declare verbose_class_flag + * java/lang/natClass.cc (gcj::verbose_class_flag): New variable. + (initializeClass): If verbose_class_flag, print message. + * gij.cc (main): Handle -verbose:class flag. + 2004-07-07 Andreas Tobler * configure.host: Enable hash synchronization on Darwin. diff --git a/libjava/gij.cc b/libjava/gij.cc index 3b0683de03e..8c75fa6db7a 100644 --- a/libjava/gij.cc +++ b/libjava/gij.cc @@ -133,6 +133,8 @@ main (int argc, const char **argv) // correct behavior. _Jv_Jar_Class_Path = argv[++i]; } + else if (! strcmp (arg, "-verbose:class")) + gcj::verbose_class_flag = true; else if (arg[1] == 'X') { if (arg[2] == '\0') diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h index 398f854e783..9cc59160dda 100644 --- a/libjava/include/jvm.h +++ b/libjava/include/jvm.h @@ -238,6 +238,9 @@ namespace gcj /* Set to true by _Jv_CreateJavaVM. */ extern bool runtimeInitialized; + + /* Print out class names as they are initialized. */ + extern bool verbose_class_flag; } /* Type of pointer used as finalizer. */ diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc index ead9bce6b36..943269eb52e 100644 --- a/libjava/java/lang/natClass.cc +++ b/libjava/java/lang/natClass.cc @@ -59,10 +59,13 @@ details. */ #include #include + using namespace gcj; +bool gcj::verbose_class_flag; + jclass java::lang::Class::forName (jstring className, jboolean initialize, java::lang::ClassLoader *loader) @@ -828,6 +831,9 @@ 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 ();