Eliminate use of C++ static constructors.
* interpret.cc: Remove static Utf8Consts. Use namespace gcj. * jni.cc: Likewise. * resolve.cc: Likewise. * defineclass.cc: Likewise. (_Jv_ClassReader::handleClassBegin): Synchronize call to _Jv_RegisterClass. * include/jvm.h (void_signature, clinit_name, init_name, finit_name): Declare in namespace gcj. * java/lang/Class.h (Class): Remove initialization for primitive types. (friend void _Jv_InitPrimClass): This is in prims.cc. * prims.cc (_Jv_InitPrimClass): Do primitive type initialization here instead. (void_signature, clinit_name, init_name, finit_name): Define in namespace gcj. (_Jv_CreateJavaVM): Call _Jv_InitThreads, _Jv_InitGC, and _Jv_InitializeSyncMutex from here. Initialize Utf8 constants. Initialize primitive types. * java/lang/natClassLoader.cc (_Jv_RegisterClasses): Don't call initialization routines. Don't synchronize. * java/lang/natRuntime.cc (_load): Synchronize on java.lang.Class across dlopen call. From-SVN: r46282
This commit is contained in:
parent
6fd617e3e1
commit
107abb2f61
10 changed files with 131 additions and 61 deletions
|
@ -41,10 +41,7 @@ details. */
|
|||
#include <java/lang/IncompatibleClassChangeError.h>
|
||||
#include <java/lang/reflect/Modifier.h>
|
||||
|
||||
// we don't verify method names that match these.
|
||||
static _Jv_Utf8Const *clinit_name = _Jv_makeUtf8Const ("<clinit>", 8);
|
||||
static _Jv_Utf8Const *init_name = _Jv_makeUtf8Const ("<init>", 6);
|
||||
|
||||
using namespace gcj;
|
||||
|
||||
// these go in some separate functions, to avoid having _Jv_InitClass
|
||||
// inserted all over the place.
|
||||
|
@ -934,7 +931,11 @@ _Jv_ClassReader::handleClassBegin
|
|||
// to include references to this class.
|
||||
|
||||
def->state = JV_STATE_PRELOADING;
|
||||
_Jv_RegisterClass (def);
|
||||
|
||||
{
|
||||
JvSynchronize sync (&java::lang::Class::class$);
|
||||
_Jv_RegisterClass (def);
|
||||
}
|
||||
|
||||
if (super_class != 0)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue