[llvm-commits] [vmkit] r51247 - in /vmkit/trunk/lib/JnJVM/VMCore: JavaConstantPool.cpp JavaIsolate.cpp JavaJIT.cpp JavaTypes.cpp JavaUpcalls.cpp Jnjvm.cpp Jnjvm.h JnjvmModule.cpp JnjvmModuleProvider.cpp JnjvmModuleProvider.h
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Mon May 19 06:08:54 PDT 2008
Author: geoffray
Date: Mon May 19 08:08:53 2008
New Revision: 51247
URL: http://llvm.org/viewvc/llvm-project?rev=51247&view=rev
Log:
Rename Jnjvm::module --> Jnjvm::TheModule
Modified:
vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.cpp
vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp
vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp
vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.cpp
vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.cpp
vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp
vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h
vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp
vmkit/trunk/lib/JnJVM/VMCore/JnjvmModuleProvider.cpp
vmkit/trunk/lib/JnJVM/VMCore/JnjvmModuleProvider.h
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.cpp?rev=51247&r1=51246&r2=51247&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.cpp Mon May 19 08:08:53 2008
@@ -414,7 +414,7 @@
// lookup the method
meth = cl->lookupMethodDontThrow(utf8, sign->keyName, isStatic(access), false);
if (meth) { // don't throw if no meth, the exception will be thrown just in time
- JnjvmModule* M = classDef->isolate->module;
+ JnjvmModule* M = classDef->isolate->TheModule;
void* F = M->getMethod(meth);
ctpRes[index] = (void*)F;
return F;
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp?rev=51247&r1=51246&r2=51247&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp Mon May 19 08:08:53 2008
@@ -442,8 +442,8 @@
isolate->analyseClasspathEnv(isolate->bootClasspathEnv);
- isolate->module = new JnjvmModule("Isolate JnJVM");
- isolate->TheModuleProvider = new JnjvmModuleProvider(isolate->module);
+ isolate->TheModule = new JnjvmModule("Isolate JnJVM");
+ isolate->TheModuleProvider = new JnjvmModuleProvider(isolate->TheModule);
isolate->bootstrapThread = vm_new(isolate, JavaThread)();
isolate->bootstrapThread->initialise(0, isolate);
@@ -503,10 +503,9 @@
isolate->analyseClasspathEnv(isolate->bootClasspathEnv);
- isolate->protectModule = mvm::Lock::allocNormal();
- isolate->module = new JnjvmModule("Bootstrap JnJVM");
- isolate->TheModuleProvider = new JnjvmModuleProvider(isolate->module);
- isolate->module->initialise();
+ isolate->TheModule = new JnjvmModule("Bootstrap JnJVM");
+ isolate->TheModuleProvider = new JnjvmModuleProvider(isolate->TheModule);
+ isolate->TheModule->initialise();
isolate->bootstrapThread = vm_new(isolate, JavaThread)();
isolate->bootstrapThread->initialise(0, isolate);
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp?rev=51247&r1=51246&r2=51247&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp Mon May 19 08:08:53 2008
@@ -132,7 +132,7 @@
} else {
GlobalVariable* gv =
new GlobalVariable(Type::Int32Ty, false, GlobalValue::ExternalLinkage,
- zero, "", compilingClass->isolate->module);
+ zero, "", module);
// set is volatile
Value* val = new LoadInst(gv, "", true, currentBlock);
@@ -1644,13 +1644,13 @@
new GlobalVariable(mvm::jit::ptrType, false,
GlobalValue::ExternalLinkage,
mvm::jit::constantPtrNull,
- "", compilingClass->isolate->module);
+ "", module);
Constant* zero = mvm::jit::constantZero;
GlobalVariable* gv =
new GlobalVariable(Type::Int32Ty, false, GlobalValue::ExternalLinkage,
- zero, "", compilingClass->isolate->module);
+ zero, "", module);
// set is volatile
Value* val = new LoadInst(gv, "", true, currentBlock);
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.cpp?rev=51247&r1=51246&r2=51247&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.cpp Mon May 19 08:08:53 2008
@@ -550,7 +550,7 @@
void* Signdef::staticCallBuf() {
if (!_staticCallBuf) {
- LLVMSignatureInfo* LSI = isolate->module->getSignatureInfo(this);
+ LLVMSignatureInfo* LSI = isolate->TheModule->getSignatureInfo(this);
LSI->getStaticBuf();
}
return _staticCallBuf;
@@ -558,7 +558,7 @@
void* Signdef::virtualCallBuf() {
if (!_virtualCallBuf) {
- LLVMSignatureInfo* LSI = isolate->module->getSignatureInfo(this);
+ LLVMSignatureInfo* LSI = isolate->TheModule->getSignatureInfo(this);
LSI->getVirtualBuf();
}
return _virtualCallBuf;
@@ -566,7 +566,7 @@
void* Signdef::staticCallAP() {
if (!_staticCallAP) {
- LLVMSignatureInfo* LSI = isolate->module->getSignatureInfo(this);
+ LLVMSignatureInfo* LSI = isolate->TheModule->getSignatureInfo(this);
LSI->getStaticAP();
}
return _staticCallAP;
@@ -574,7 +574,7 @@
void* Signdef::virtualCallAP() {
if (!_virtualCallAP) {
- LLVMSignatureInfo* LSI = isolate->module->getSignatureInfo(this);
+ LLVMSignatureInfo* LSI = isolate->TheModule->getSignatureInfo(this);
LSI->getVirtualAP();
}
return _virtualCallAP;
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.cpp?rev=51247&r1=51246&r2=51247&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.cpp Mon May 19 08:08:53 2008
@@ -366,11 +366,11 @@
JavaMethod* internString =
UPCALL_METHOD(vm, "java/lang/VMString", "intern",
"(Ljava/lang/String;)Ljava/lang/String;", ACC_STATIC);
- vm->module->setMethod(internString, "internString");
+ vm->TheModule->setMethod(internString, "internString");
JavaMethod* isArray =
UPCALL_METHOD(vm, "java/lang/Class", "isArray", "()Z", ACC_VIRTUAL);
- vm->module->setMethod(isArray, "isArray");
+ vm->TheModule->setMethod(isArray, "isArray");
ClasspathThread::initialise(vm);
@@ -387,17 +387,17 @@
JavaMethod* getCallingClass =
UPCALL_METHOD(vm, "gnu/classpath/VMStackWalker", "getCallingClass",
"()Ljava/lang/Class;", ACC_STATIC);
- vm->module->setMethod(getCallingClass, "getCallingClass");
+ vm->TheModule->setMethod(getCallingClass, "getCallingClass");
JavaMethod* getCallingClassLoader =
UPCALL_METHOD(vm, "gnu/classpath/VMStackWalker", "getCallingClassLoader",
"()Ljava/lang/ClassLoader;", ACC_STATIC);
- vm->module->setMethod(getCallingClassLoader, "getCallingClassLoader");
+ vm->TheModule->setMethod(getCallingClassLoader, "getCallingClassLoader");
JavaMethod* postProperties =
UPCALL_METHOD(vm, "gnu/classpath/VMSystemProperties", "postInit",
"(Ljava/util/Properties;)V", ACC_STATIC);
- vm->module->setMethod(postProperties, "propertiesPostInit");
+ vm->TheModule->setMethod(postProperties, "propertiesPostInit");
}
extern "C" JavaString* internString(JavaString* obj) {
Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=51247&r1=51246&r2=51247&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Mon May 19 08:08:53 2008
@@ -325,7 +325,7 @@
cl->super->initialiseClass();
}
- module->resolveStaticClass((Class*)cl);
+ TheModule->resolveStaticClass((Class*)cl);
*status = inClinit;
JavaMethod* meth = cl->lookupMethodDontThrow(clinitName, clinitType, true,
@@ -395,7 +395,7 @@
loadParents((Class*)cl);
cl->aquire();
cl->status = prepared;
- module->resolveVirtualClass((Class*)cl);
+ TheModule->resolveVirtualClass((Class*)cl);
cl->status = resolved;
}
cl->release();
@@ -885,11 +885,6 @@
GC->destroy();
delete GC;
#endif
- mvm::jit::protectEngine->lock();
- mvm::jit::executionEngine->removeModuleProvider(TheModuleProvider);
- mvm::jit::protectEngine->unlock();
delete globalRefsLock;
- delete protectModule;
delete TheModuleProvider;
- delete module;
}
Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h?rev=51247&r1=51246&r2=51247&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h Mon May 19 08:08:53 2008
@@ -261,9 +261,8 @@
#endif
- mvm::Lock* protectModule;
- JnjvmModule* module;
JnjvmModuleProvider* TheModuleProvider;
+ JnjvmModule* TheModule;
#ifndef MULTIPLE_GC
Modified: vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp?rev=51247&r1=51246&r2=51247&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp Mon May 19 08:08:53 2008
@@ -134,7 +134,7 @@
varGV = new GlobalVariable(JnjvmModule::JavaClassType, true,
GlobalValue::ExternalLinkage,
cons, "",
- classDef->isolate->module);
+ classDef->isolate->TheModule);
}
return new LoadInst(varGV, "", jit->currentBlock);
}
@@ -149,7 +149,7 @@
delegateeGV = new GlobalVariable(JnjvmModule::JavaObjectType, true,
GlobalValue::ExternalLinkage,
cons, "",
- classDef->isolate->module);
+ classDef->isolate->TheModule);
}
return new LoadInst(delegateeGV, "", jit->currentBlock);
#else
@@ -240,7 +240,7 @@
Function* func = Function::Create(JnjvmModule::MarkAndTraceType,
GlobalValue::ExternalLinkage,
"markAndTraceObject",
- cl->isolate->module);
+ cl->isolate->TheModule);
Constant* zero = mvm::jit::constantZero;
Argument* arg = func->arg_begin();
@@ -409,7 +409,7 @@
staticVarGV = new GlobalVariable(JnjvmModule::JavaObjectType, true,
GlobalValue::ExternalLinkage,
cons, "",
- classDef->isolate->module);
+ classDef->isolate->TheModule);
}
return new LoadInst(staticVarGV, "", jit->currentBlock);
@@ -434,7 +434,7 @@
virtualTableGV = new GlobalVariable(JnjvmModule::VTType, true,
GlobalValue::ExternalLinkage,
cons, "",
- classDef->isolate->module);
+ classDef->isolate->TheModule);
}
return new LoadInst(virtualTableGV, "", jit->currentBlock);
}
@@ -468,7 +468,7 @@
methodFunction = Function::Create(getFunctionType(),
GlobalValue::GhostLinkage,
methodDef->printString(),
- vm->module);
+ vm->TheModule);
vm->TheModuleProvider->addFunction(methodFunction, methodDef);
}
return methodFunction;
@@ -586,7 +586,7 @@
getStaticBufType(),
GlobalValue::ExternalLinkage,
signature->printString(),
- signature->isolate->module);
+ signature->isolate->TheModule);
BasicBlock* currentBlock = BasicBlock::Create("enter", res);
Function::arg_iterator i = res->arg_begin();
@@ -640,7 +640,7 @@
getStaticBufType(),
GlobalValue::ExternalLinkage,
signature->printString(),
- signature->isolate->module);
+ signature->isolate->TheModule);
BasicBlock* currentBlock = BasicBlock::Create("enter", res);
Function::arg_iterator i = res->arg_begin();
Modified: vmkit/trunk/lib/JnJVM/VMCore/JnjvmModuleProvider.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JnjvmModuleProvider.cpp?rev=51247&r1=51246&r2=51247&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JnjvmModuleProvider.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JnjvmModuleProvider.cpp Mon May 19 08:08:53 2008
@@ -125,7 +125,7 @@
llvm::Function* JnjvmModuleProvider::addCallback(Class* cl, uint32 index,
Signdef* sign, bool stat) {
const llvm::FunctionType* type = 0;
- JnjvmModule* M = cl->isolate->module;
+ JnjvmModule* M = cl->isolate->TheModule;
LLVMSignatureInfo* LSI = M->getSignatureInfo(sign);
if (stat) {
@@ -136,7 +136,7 @@
Function* func = llvm::Function::Create(type,
llvm::GlobalValue::GhostLinkage,
"callback",
- cl->isolate->module);
+ TheModule);
callbacks.insert(std::make_pair(func, std::make_pair(cl, index)));
return func;
@@ -212,3 +212,10 @@
perFunctionPasses->add(new llvm::TargetData(m));
AddStandardCompilePasses(perFunctionPasses);
}
+
+JnjvmModuleProvider::~JnjvmModuleProvider() {
+ mvm::jit::protectEngine->lock();
+ mvm::jit::executionEngine->removeModuleProvider(this);
+ mvm::jit::protectEngine->unlock();
+ delete TheModule;
+}
Modified: vmkit/trunk/lib/JnJVM/VMCore/JnjvmModuleProvider.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JnjvmModuleProvider.h?rev=51247&r1=51246&r2=51247&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JnjvmModuleProvider.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JnjvmModuleProvider.h Mon May 19 08:08:53 2008
@@ -41,13 +41,14 @@
public:
JnjvmModuleProvider(JnjvmModule *m);
+ ~JnjvmModuleProvider();
llvm::Function* addCallback(Class* cl, uint32 index, Signdef* sign,
bool stat);
void addFunction(llvm::Function* F, JavaMethod* meth);
bool materializeFunction(Function *F, std::string *ErrInfo = 0);
- void* materializeFunction(JavaMethod* meth);
+ void* materializeFunction(JavaMethod* meth);
Module* materializeModule(std::string *ErrInfo = 0) { return TheModule; }
};
More information about the llvm-commits
mailing list