[llvm-commits] [vmkit] r51053 - in /vmkit/trunk/lib: JnJVM/VMCore/JavaArray.cpp JnJVM/VMCore/JavaArray.h JnJVM/VMCore/JavaJIT.h JnJVM/VMCore/JavaJITInitialise.cpp JnJVM/VMCore/JavaObject.cpp JnJVM/VMCore/JavaObject.h JnJVM/VMCore/JavaRuntimeJIT.cpp JnJVM/VMCore/JavaThread.cpp JnJVM/VMCore/JavaThread.h JnJVM/VMCore/Jni.cpp JnJVM/VMCore/VirtualTables.cpp Mvm/GCMmap2/MvmGC.h Mvm/GCMmap2/gc.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Tue May 13 09:43:50 PDT 2008
Author: geoffray
Date: Tue May 13 11:43:50 2008
New Revision: 51053
URL: http://llvm.org/viewvc/llvm-project?rev=51053&view=rev
Log:
Add C wrappers for C++ runtime calls.
Modified:
vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp
vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h
vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h
vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp
vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp
vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h
vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp
vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp
vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h
vmkit/trunk/lib/JnJVM/VMCore/Jni.cpp
vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp
vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h
vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp?rev=51053&r1=51052&r2=51053&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp Tue May 13 11:43:50 2008
@@ -242,49 +242,3 @@
buf->setAt(size, 0);
return buf->cString();
}
-
-static JavaArray* multiCallNewIntern(arrayCtor_t ctor, ClassArray* cl,
- uint32 len,
- sint32* dims,
- Jnjvm* vm) {
- if (len <= 0) JavaThread::get()->isolate->unknownError("Can not happen");
- JavaArray* _res = ctor(dims[0], cl, vm);
- if (len > 1) {
- ArrayObject* res = (ArrayObject*)_res;
- CommonClass* _base = cl->baseClass();
- if (_base->isArray) {
- ClassArray* base = (ClassArray*)_base;
- AssessorDesc* func = base->funcs();
- arrayCtor_t newCtor = func->arrayCtor;
- if (dims[0] > 0) {
- for (sint32 i = 0; i < dims[0]; ++i) {
- res->setAt(i, multiCallNewIntern(newCtor, base, (len - 1), &dims[1],
- vm));
- }
- } else {
- for (uint32 i = 1; i < len; ++i) {
- sint32 p = dims[i];
- if (p < 0) JavaThread::get()->isolate->negativeArraySizeException(p);
- }
- }
- } else {
- JavaThread::get()->isolate->unknownError("Can not happen");
- }
- }
- return _res;
-}
-
-JavaArray* JavaArray::multiCallNew(ClassArray* cl, uint32 len, ...) {
- va_list ap;
- va_start(ap, len);
- sint32 dims[len];
- for (uint32 i = 0; i < len; ++i){
- dims[i] = va_arg(ap, int);
- }
-#ifdef MULTIPLE_VM
- Jnjvm* vm = va_arg(ap, Jnjvm*);
-#else
- Jnjvm* vm = 0;
-#endif
- return multiCallNewIntern((arrayCtor_t)ArrayObject::acons, cl, len, dims, vm);
-}
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h?rev=51053&r1=51052&r2=51053&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h Tue May 13 11:43:50 2008
@@ -55,7 +55,6 @@
static llvm::ConstantInt* sizeOffset();
static llvm::ConstantInt* elementsOffset();
- static JavaArray* multiCallNew(ClassArray* cl, uint32 len, ...);
virtual void print(mvm::PrintBuffer* buf) const;
virtual void TRACER;
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h?rev=51053&r1=51052&r2=51053&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h Tue May 13 11:43:50 2008
@@ -293,6 +293,8 @@
static llvm::GlobalVariable* ArrayObjectVT;
static llvm::GlobalVariable* JavaObjectVT;
+
+ static void AddStandardCompilePasses(llvm::FunctionPassManager*);
};
enum Opcode {
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp?rev=51053&r1=51052&r2=51053&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp Tue May 13 11:43:50 2008
@@ -146,11 +146,7 @@
const FunctionType* type = FunctionType::get(Type::VoidTy, args, false);
javaObjectTracerLLVM = Function::Create(type,
GlobalValue::ExternalLinkage,
-#ifdef MULTIPLE_GC
- "_ZN5jnjvm10JavaObject6tracerEPv",
-#else
- "_ZN5jnjvm10JavaObject6tracerEv",
-#endif
+ "JavaObjectTracer",
module);
}
@@ -179,7 +175,7 @@
true);
multiCallNewLLVM = Function::Create(type, GlobalValue::ExternalLinkage,
- "_ZN5jnjvm9JavaArray12multiCallNewEPNS_10ClassArrayEjz",
+ "multiCallNew",
module);
}
@@ -513,7 +509,7 @@
const FunctionType* type = FunctionType::get(Type::VoidTy, args, false);
throwExceptionLLVM = Function::Create(type, GlobalValue::ExternalLinkage,
- "_ZN5jnjvm10JavaThread14throwExceptionEPNS_10JavaObjectE",
+ "JavaThreadThrowException",
module);
}
@@ -523,7 +519,7 @@
const FunctionType* type = FunctionType::get(Type::VoidTy, args, false);
clearExceptionLLVM = Function::Create(type, GlobalValue::ExternalLinkage,
- "_ZN5jnjvm10JavaThread14clearExceptionEv",
+ "JavaThreadClearException",
module);
}
@@ -536,7 +532,7 @@
args, false);
getExceptionLLVM = Function::Create(type, GlobalValue::ExternalLinkage,
- "_ZN5jnjvm10JavaThread12getExceptionEv",
+ "JavaThreadGetException",
module);
}
@@ -547,7 +543,7 @@
args, false);
getJavaExceptionLLVM = Function::Create(type, GlobalValue::ExternalLinkage,
- "_ZN5jnjvm10JavaThread16getJavaExceptionEv",
+ "JavaThreadGetJavaException",
module);
}
@@ -558,7 +554,7 @@
const FunctionType* type = FunctionType::get(Type::Int1Ty, args, false);
compareExceptionLLVM = Function::Create(type, GlobalValue::ExternalLinkage,
- "_ZN5jnjvm10JavaThread16compareExceptionEPNS_5ClassE",
+ "JavaThreadCompareException",
module);
}
@@ -607,7 +603,7 @@
const FunctionType* type = FunctionType::get(Type::Int32Ty, args, false);
instanceOfLLVM = Function::Create(type, GlobalValue::ExternalLinkage,
- "_ZN5jnjvm10JavaObject10instanceOfEPNS_11CommonClassE",
+ "JavaObjectInstanceOf",
module);
PAListPtr func_toto_PAL;
SmallVector<ParamAttrsWithIndex, 4> Attrs;
@@ -625,7 +621,7 @@
const FunctionType* type = FunctionType::get(Type::VoidTy, args, false);
aquireObjectLLVM = Function::Create(type, GlobalValue::ExternalLinkage,
- "_ZN5jnjvm10JavaObject6aquireEv",
+ "JavaObjectAquire",
module);
#ifdef SERVICE_VM
aquireObjectInSharedDomainLLVM = Function::Create(type, GlobalValue::ExternalLinkage,
@@ -641,7 +637,7 @@
const FunctionType* type = FunctionType::get(Type::VoidTy, args, false);
releaseObjectLLVM = Function::Create(type, GlobalValue::ExternalLinkage,
- "_ZN5jnjvm10JavaObject6unlockEv",
+ "JavaObjectRelease",
module);
#ifdef SERVICE_VM
releaseObjectInSharedDomainLLVM = Function::Create(type, GlobalValue::ExternalLinkage,
@@ -686,11 +682,7 @@
markAndTraceLLVMType = FunctionType::get(llvm::Type::VoidTy, args, false);
markAndTraceLLVM = Function::Create(markAndTraceLLVMType,
GlobalValue::ExternalLinkage,
-#ifdef MULTIPLE_GC
- "_ZNK2gc12markAndTraceEP9Collector",
-#else
- "_ZNK2gc12markAndTraceEv",
-#endif
+ "MarkAndTrace",
module);
}
#endif
@@ -769,7 +761,7 @@
PM->add(P);
}
-void AddStandardCompilePasses(FunctionPassManager *PM) {
+void JavaJIT::AddStandardCompilePasses(FunctionPassManager *PM) {
llvm::MutexGuard locked(mvm::jit::executionEngine->lock);
// LLVM does not allow calling functions from other modules in verifier
//PM->add(llvm::createVerifierPass()); // Verify that input is correct
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp?rev=51053&r1=51052&r2=51053&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp Tue May 13 11:43:50 2008
@@ -104,7 +104,7 @@
buf->write(">");
}
-static LockObj* myLock(JavaObject* obj) {
+LockObj* LockObj::myLock(JavaObject* obj) {
verifyNull(obj);
if (obj->lockObj == 0) {
JavaObject::globalLock->lock();
@@ -116,41 +116,8 @@
return obj->lockObj;
}
-void JavaObject::aquire() {
-#ifdef SERVICE_VM
- ServiceDomain* vm = (ServiceDomain*)JavaThread::get()->isolate;
- if (!(vm->GC->isMyObject(this))) {
- vm->serviceError(vm, "I'm locking an object I don't own");
- }
-#endif
- myLock(this)->aquire();
-}
-
-
-void JavaObject::unlock() {
- verifyNull(this);
-#ifdef SERVICE_VM
- ServiceDomain* vm = (ServiceDomain*)JavaThread::get()->isolate;
- if (!(vm->GC->isMyObject(this))) {
- vm->serviceError(vm, "I'm unlocking an object I don't own");
- }
-#endif
- lockObj->release();
-}
-
-#ifdef SERVICE_VM
-extern "C" void aquireObjectInSharedDomain(JavaObject* obj) {
- myLock(obj)->aquire();
-}
-
-extern "C" void releaseObjectInSharedDomain(JavaObject* obj) {
- verifyNull(obj);
- obj->lockObj->release();
-}
-#endif
-
void JavaObject::waitIntern(struct timeval* info, bool timed) {
- LockObj * l = myLock(this);
+ LockObj * l = LockObj::myLock(this);
bool owner = l->owner();
if (owner) {
@@ -205,7 +172,7 @@
}
void JavaObject::notify() {
- LockObj* l = myLock(this);
+ LockObj* l = LockObj::myLock(this);
if (l->owner()) {
l->varcond->notify();
} else {
@@ -214,29 +181,10 @@
}
void JavaObject::notifyAll() {
- LockObj* l = myLock(this);
+ LockObj* l = LockObj::myLock(this);
if (l->owner()) {
l->varcond->notifyAll();
} else {
JavaThread::get()->isolate->illegalMonitorStateException(this);
}
}
-
-bool JavaObject::instanceOfString(const UTF8* name) {
- if (!this) return false;
- else return this->classOf->isOfTypeName(name);
-}
-
-bool JavaObject::checkCast(const UTF8* Tname) {
- if (!this || this->classOf->isOfTypeName(Tname)) {
- return true;
- } else {
- JavaThread::get()->isolate->classCastException("checkcast");
- return false;
- }
-}
-
-bool JavaObject::instanceOf(CommonClass* cl) {
- if (!this) return false;
- else return this->classOf->isAssignableFrom(cl);
-}
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h?rev=51053&r1=51052&r2=51053&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h Tue May 13 11:43:50 2008
@@ -21,9 +21,10 @@
#include "types.h"
+#include "JavaClass.h"
+
namespace jnjvm {
-class CommonClass;
class JavaField;
class JavaObject;
class JavaThread;
@@ -55,6 +56,8 @@
virtual void TRACER;
static LockObj* allocate();
+ static LockObj* myLock(JavaObject* obj);
+
void aquire();
void release();
bool owner();
@@ -72,8 +75,6 @@
virtual void print(mvm::PrintBuffer* buf) const;
virtual void TRACER;
- void aquire();
- void unlock();
void waitIntern(struct timeval *info, bool timed);
void wait();
void timedWait(struct timeval &info);
@@ -84,9 +85,15 @@
this->lockObj = 0;
}
- bool checkCast(const UTF8* name);
- bool instanceOfString(const UTF8* name);
- bool instanceOf(CommonClass* cl);
+ bool instanceOfString(const UTF8* name) {
+ if (!this) return false;
+ else return this->classOf->isOfTypeName(name);
+ }
+
+ bool instanceOf(CommonClass* cl) {
+ if (!this) return false;
+ else return this->classOf->isAssignableFrom(cl);
+ }
static llvm::ConstantInt* classOffset();
static llvm::ConstantInt* lockOffset();
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp?rev=51053&r1=51052&r2=51053&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp Tue May 13 11:43:50 2008
@@ -286,3 +286,106 @@
}
#endif
+
+static JavaArray* multiCallNewIntern(arrayCtor_t ctor, ClassArray* cl,
+ uint32 len,
+ sint32* dims,
+ Jnjvm* vm) {
+ if (len <= 0) JavaThread::get()->isolate->unknownError("Can not happen");
+ JavaArray* _res = ctor(dims[0], cl, vm);
+ if (len > 1) {
+ ArrayObject* res = (ArrayObject*)_res;
+ CommonClass* _base = cl->baseClass();
+ if (_base->isArray) {
+ ClassArray* base = (ClassArray*)_base;
+ AssessorDesc* func = base->funcs();
+ arrayCtor_t newCtor = func->arrayCtor;
+ if (dims[0] > 0) {
+ for (sint32 i = 0; i < dims[0]; ++i) {
+ res->setAt(i, multiCallNewIntern(newCtor, base, (len - 1), &dims[1],
+ vm));
+ }
+ } else {
+ for (uint32 i = 1; i < len; ++i) {
+ sint32 p = dims[i];
+ if (p < 0) JavaThread::get()->isolate->negativeArraySizeException(p);
+ }
+ }
+ } else {
+ JavaThread::get()->isolate->unknownError("Can not happen");
+ }
+ }
+ return _res;
+}
+
+extern "C" JavaArray* multiCallNew(ClassArray* cl, uint32 len, ...) {
+ va_list ap;
+ va_start(ap, len);
+ sint32 dims[len];
+ for (uint32 i = 0; i < len; ++i){
+ dims[i] = va_arg(ap, int);
+ }
+#ifdef MULTIPLE_VM
+ Jnjvm* vm = va_arg(ap, Jnjvm*);
+#else
+ Jnjvm* vm = 0;
+#endif
+ return multiCallNewIntern((arrayCtor_t)ArrayObject::acons, cl, len, dims, vm);
+}
+
+extern "C" void JavaObjectAquire(JavaObject* obj) {
+#ifdef SERVICE_VM
+ ServiceDomain* vm = (ServiceDomain*)JavaThread::get()->isolate;
+ if (!(vm->GC->isMyObject(obj))) {
+ vm->serviceError(vm, "I'm locking an object I don't own");
+ }
+#endif
+ LockObj::myLock(obj)->aquire();
+}
+
+
+extern "C" void JavaObjectRelease(JavaObject* obj) {
+ verifyNull(obj);
+#ifdef SERVICE_VM
+ ServiceDomain* vm = (ServiceDomain*)JavaThread::get()->isolate;
+ if (!(vm->GC->isMyObject(obj))) {
+ vm->serviceError(vm, "I'm unlocking an object I don't own");
+ }
+#endif
+ obj->lockObj->release();
+}
+
+#ifdef SERVICE_VM
+extern "C" void aquireObjectInSharedDomain(JavaObject* obj) {
+ myLock(obj)->aquire();
+}
+
+extern "C" void releaseObjectInSharedDomain(JavaObject* obj) {
+ verifyNull(obj);
+ obj->lockObj->release();
+}
+#endif
+
+extern "C" bool JavaObjectInstanceOf(JavaObject* obj, CommonClass* cl) {
+ return obj->instanceOf(cl);
+}
+
+extern "C" void* JavaThreadGetException() {
+ return JavaThread::getException();
+}
+
+extern "C" void JavaThreadThrowException(JavaObject* obj) {
+ return JavaThread::throwException(obj);
+}
+
+extern "C" JavaObject* JavaThreadGetJavaException() {
+ return JavaThread::getJavaException();
+}
+
+extern "C" bool JavaThreadCompareException(Class* cl) {
+ return JavaThread::compareException(cl);
+}
+
+extern "C" void JavaThreadClearException() {
+ return JavaThread::clearException();
+}
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp?rev=51053&r1=51052&r2=51053&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp Tue May 13 11:43:50 2008
@@ -43,8 +43,6 @@
return (JavaThread*)Thread::threadKey->get();
}
-extern void AddStandardCompilePasses(llvm::FunctionPassManager*);
-
void JavaThread::initialise(JavaObject* thread, Jnjvm* isolate) {
this->javaThread = thread;
this->isolate = isolate;
@@ -57,7 +55,7 @@
ModuleProvider* MP = isolate->TheModuleProvider;
this->perFunctionPasses = new llvm::FunctionPassManager(MP);
this->perFunctionPasses->add(new llvm::TargetData(isolate->module));
- AddStandardCompilePasses(this->perFunctionPasses);
+ JavaJIT::AddStandardCompilePasses(this->perFunctionPasses);
}
JavaObject* JavaThread::currentThread() {
@@ -68,27 +66,6 @@
return 0;
}
-extern "C" void* __cxa_allocate_exception(unsigned);
-extern "C" void __cxa_throw(void*, void*, void*);
-
-void* JavaThread::getException() {
- return (void*)((char*)JavaThread::get()->internalPendingException - 8 * sizeof(void*));
-}
-
-JavaObject* JavaThread::getJavaException() {
- return JavaThread::get()->pendingException;
-}
-
-
-void JavaThread::throwException(JavaObject* obj) {
- JavaThread* th = JavaThread::get();
- assert(th->pendingException == 0 && "pending exception already there?");
- th->pendingException = obj;
- void* exc = __cxa_allocate_exception(0);
- th->internalPendingException = exc;
- __cxa_throw(exc, 0, 0);
-}
-
void JavaThread::throwPendingException() {
JavaThread* th = JavaThread::get();
assert(th->pendingException);
@@ -97,19 +74,6 @@
__cxa_throw(exc, 0, 0);
}
-void JavaThread::clearException() {
- JavaThread* th = JavaThread::get();
- th->pendingException = 0;
- th->internalPendingException = 0;
-}
-
-bool JavaThread::compareException(Class* cl) {
- JavaObject* pe = JavaThread::get()->pendingException;
- assert(pe && "no pending exception?");
- bool val = pe->classOf->subclassOf(cl);
- return val;
-}
-
void JavaThread::returnFromNative() {
assert(sjlj_buffers.size());
#if defined(__MACH__)
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h?rev=51053&r1=51052&r2=51053&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h Tue May 13 11:43:50 2008
@@ -20,6 +20,11 @@
#include "mvm/Threads/Locks.h"
#include "mvm/Threads/Thread.h"
+#include "JavaObject.h"
+
+extern "C" void* __cxa_allocate_exception(unsigned);
+extern "C" void __cxa_throw(void*, void*, void*);
+
namespace jnjvm {
class Class;
@@ -53,12 +58,39 @@
static JavaThread* get();
static JavaObject* currentThread();
- static void* getException();
- static void throwException(JavaObject*);
+ static void* getException() {
+ return (void*)
+ ((char*)JavaThread::get()->internalPendingException - 8 * sizeof(void*));
+ }
+
+ static void throwException(JavaObject* obj) {
+ JavaThread* th = JavaThread::get();
+ assert(th->pendingException == 0 && "pending exception already there?");
+ th->pendingException = obj;
+ void* exc = __cxa_allocate_exception(0);
+ th->internalPendingException = exc;
+ __cxa_throw(exc, 0, 0);
+ }
+
static void throwPendingException();
- static void clearException();
- static bool compareException(Class*);
- static JavaObject* getJavaException();
+
+ static void clearException() {
+ JavaThread* th = JavaThread::get();
+ th->pendingException = 0;
+ th->internalPendingException = 0;
+ }
+
+ static bool compareException(Class* cl) {
+ JavaObject* pe = JavaThread::get()->pendingException;
+ assert(pe && "no pending exception?");
+ bool val = pe->classOf->subclassOf(cl);
+ return val;
+ }
+
+ static JavaObject* getJavaException() {
+ return JavaThread::get()->pendingException;
+ }
+
void returnFromNative();
};
Modified: vmkit/trunk/lib/JnJVM/VMCore/Jni.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jni.cpp?rev=51053&r1=51052&r2=51053&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/Jni.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/Jni.cpp Tue May 13 11:43:50 2008
@@ -2028,12 +2028,14 @@
return 0;
}
+extern "C" void JavaObjectAquire(JavaObject* obj);
+extern "C" void JavaObjectRelease(JavaObject* obj);
jint MonitorEnter(JNIEnv *env, jobject obj) {
BEGIN_EXCEPTION
- ((JavaObject*)obj)->aquire();
+ JavaObjectAquire(((JavaObject*)obj));
return 1;
END_EXCEPTION
@@ -2045,7 +2047,7 @@
BEGIN_EXCEPTION
- ((JavaObject*)obj)->unlock();
+ JavaObjectRelease((JavaObject*)obj);
return 1;
END_EXCEPTION
Modified: vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp?rev=51053&r1=51052&r2=51053&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp Tue May 13 11:43:50 2008
@@ -172,6 +172,16 @@
lockObj->MARK_AND_TRACE;
}
+#ifdef MULTIPLE_GC
+extern "C" void JavaObjectTracer(JavaObject* obj, Collector* GC) {
+#else
+extern "C" void JavaObjectTracer(JavaObject* obj) {
+#endif
+ obj->classOf->MARK_AND_TRACE;
+ obj->lockObj->MARK_AND_TRACE;
+}
+
+
void JavaThread::TRACER {
javaThread->MARK_AND_TRACE;
// FIXME: do I need this?
Modified: vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h?rev=51053&r1=51052&r2=51053&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h (original)
+++ vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h Tue May 13 11:43:50 2008
@@ -100,10 +100,4 @@
STATIC void setMinMemory(size_t);
};
-#ifdef MULTIPLE_GC
-extern "C" gc* gcmalloc(size_t sz, VirtualTable* VT, Collector* GC);
-#else
-extern "C" gc* gcmalloc(size_t sz, VirtualTable* VT);
-#endif
-
#endif
Modified: vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp?rev=51053&r1=51052&r2=51053&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp (original)
+++ vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp Tue May 13 11:43:50 2008
@@ -31,10 +31,16 @@
void gc::markAndTrace(Collector* GC) const {
((GCCollector*)GC)->markAndTrace((void*)this);
}
+extern "C" void MarkAndTrace(gc* gc, Collector* GC) {
+ ((GCCollector*)GC)->markAndTrace((void*)gc);
+}
#else
void gc::markAndTrace() const {
GCCollector::markAndTrace((void*)this);
}
+extern "C" void MarkAndTrace(gc* gc) {
+ GCCollector::markAndTrace((void*)gc);
+}
#endif
size_t gc::objectSize() const {
More information about the llvm-commits
mailing list