diff options
author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-10-16 08:35:17 +0000 |
---|---|---|
committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-10-16 08:35:17 +0000 |
commit | 380cddab526fcf3c2f33dc8ebeb61c2d42703f41 (patch) | |
tree | 48472b1f97ae998bfbcb469ac6838d504c367998 /libjava/defineclass.cc | |
parent | c490b220adad350c352aa16b7c0c6c812fc1cd48 (diff) | |
download | gcc-380cddab526fcf3c2f33dc8ebeb61c2d42703f41.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46282 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/defineclass.cc')
-rw-r--r-- | libjava/defineclass.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libjava/defineclass.cc b/libjava/defineclass.cc index e25b106b2d8..85f6ce3a65e 100644 --- a/libjava/defineclass.cc +++ b/libjava/defineclass.cc @@ -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) { |