[vmkit-commits] [vmkit] r134313 - in /vmkit/trunk: lib/J3/Compiler/ lib/J3/LLVMRuntime/ lib/J3/VMCore/ tools/vmjc/
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Sat Jul 2 03:47:10 PDT 2011
Author: geoffray
Date: Sat Jul 2 05:47:10 2011
New Revision: 134313
URL: http://llvm.org/viewvc/llvm-project?rev=134313&view=rev
Log:
More cleanup.
Removed:
vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll
vmkit/trunk/lib/J3/LLVMRuntime/runtime-isolate.ll
vmkit/trunk/lib/J3/LLVMRuntime/runtime-service.ll
Modified:
vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp
vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp
vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp
vmkit/trunk/lib/J3/Compiler/JavaJIT.h
vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp
vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp
vmkit/trunk/lib/J3/VMCore/JavaClass.cpp
vmkit/trunk/lib/J3/VMCore/JavaClass.h
vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp
vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp
vmkit/trunk/lib/J3/VMCore/JavaThread.cpp
vmkit/trunk/lib/J3/VMCore/JavaThread.h
vmkit/trunk/lib/J3/VMCore/JavaTypes.h
vmkit/trunk/lib/J3/VMCore/Jni.cpp
vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp
vmkit/trunk/lib/J3/VMCore/JnjvmConfig.h
vmkit/trunk/lib/J3/VMCore/LinkJavaRuntime.h
vmkit/trunk/lib/J3/VMCore/ReferenceQueue.h
vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp
vmkit/trunk/tools/vmjc/vmjc.cpp
Modified: vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp Sat Jul 2 05:47:10 2011
@@ -38,10 +38,6 @@
VTType = PointerType::getUnqual(module->getTypeByName("VT"));
LLVMContext& Context = module->getContext();
-#ifdef ISOLATE_SHARING
- JnjvmType =
- PointerType::getUnqual(module->getTypeByName("Jnjvm"));
-#endif
ConstantPoolType = ptrPtrType;
JavaObjectType =
@@ -222,23 +218,7 @@
GetFinalFloatFieldFunction = module->getFunction("getFinalFloatField");
GetFinalDoubleFieldFunction = module->getFunction("getFinalDoubleField");
-#ifdef ISOLATE_SHARING
- GetCtpClassFunction = module->getFunction("getCtpClass");
- GetJnjvmExceptionClassFunction =
- module->getFunction("getJnjvmExceptionClass");
- GetJnjvmArrayClassFunction = module->getFunction("getJnjvmArrayClass");
- StaticCtpLookupFunction = module->getFunction("j3StaticCtpLookup");
- SpecialCtpLookupFunction = module->getFunction("j3SpecialCtpLookup");
-#endif
-
-#ifdef SERVICE
- ServiceCallStartFunction = module->getFunction("j3ServiceCallStart");
- ServiceCallStopFunction = module->getFunction("j3ServiceCallStop");
-#endif
-
-#ifndef WITHOUT_VTABLE
VirtualLookupFunction = module->getFunction("j3VirtualTableLookup");
-#endif
GetLockFunction = module->getFunction("getLock");
ThrowExceptionFromJITFunction =
Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Sat Jul 2 05:47:10 2011
@@ -228,10 +228,6 @@
}
Constant* JavaAOTCompiler::getJavaClassPtr(CommonClass* cl) {
-#ifdef ISOLATE
- abort();
- return 0;
-#else
// Make sure it's emitted.
getJavaClass(cl);
@@ -248,7 +244,6 @@
Constant* Ptr = ConstantExpr::getGetElementPtr(TCMArray, GEP2, 2);
return Ptr;
-#endif
}
JavaObject* JavaAOTCompiler::getFinalObject(llvm::Value* obj) {
@@ -476,10 +471,6 @@
}
Constant* JavaAOTCompiler::getStaticInstance(Class* classDef) {
-#ifdef ISOLATE
- assert(0 && "Should not be here");
- abort();
-#endif
static_instance_iterator End = staticInstances.end();
static_instance_iterator I = staticInstances.find(classDef);
if (I == End) {
@@ -1687,37 +1678,6 @@
}
-#ifdef SERVICE
-Value* JavaAOTCompiler::getIsolate(Jnjvm* isolate, Value* Where) {
- llvm::Constant* varGV = 0;
- isolate_iterator End = isolates.end();
- isolate_iterator I = isolates.find(isolate);
- if (I == End) {
-
-
- Constant* cons =
- ConstantExpr::getIntToPtr(ConstantInt::get(Type::getInt64Ty(getLLVMContext()),
- uint64_t(isolate)),
- ptrType);
-
- Module& Mod = *getLLVMModule();
- varGV = new GlobalVariable(Mod, ptrType, !staticCompilation,
- GlobalValue::ExternalLinkage,
- cons, "");
-
- isolates.insert(std::make_pair(isolate, varGV));
- } else {
- varGV = I->second;
- }
- if (BasicBlock* BB = dyn_cast<BasicBlock>(Where)) {
- return new LoadInst(varGV, "", BB);
- } else {
- assert(dyn_cast<Instruction>(Where) && "Wrong use of module");
- return new LoadInst(varGV, "", dyn_cast<Instruction>(Where));
- }
-}
-#endif
-
void JavaAOTCompiler::CreateStaticInitializer() {
std::vector<const llvm::Type*> llvmArgs;
@@ -1766,28 +1726,6 @@
}
}
-#if 0
- // Disable initialization of UTF8s, it makes the Init method too big.
- // If we have defined some UTF8s.
- if (utf8s.begin() != utf8s.end()) {
- llvmArgs.clear();
- llvmArgs.push_back(JavaIntrinsics.ptrType); // class loader
- llvmArgs.push_back(utf8s.begin()->second->getType()); // val
- FTy = FunctionType::get(Type::getVoidTy(getLLVMContext()), llvmArgs, false);
-
- Function* AddUTF8 = Function::Create(FTy, GlobalValue::ExternalLinkage,
- "vmjcAddUTF8", getLLVMModule());
-
-
-
- for (utf8_iterator i = utf8s.begin(), e = utf8s.end(); i != e; ++i) {
- Args[0] = loader;
- Args[1] = i->second;
- CallInst::Create(AddUTF8, Args, Args + 2, "", currentBlock);
- }
- }
-#endif
-
for (native_class_iterator i = nativeClasses.begin(),
e = nativeClasses.end(); i != e; ++i) {
if (isCompiling(i->first)) {
Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Sat Jul 2 05:47:10 2011
@@ -45,10 +45,6 @@
using namespace llvm;
static bool needsInitialisationCheck(Class* cl, Class* compilingClass) {
-#ifdef SERVICE
- return true;
-#else
-
if (cl->isReadyForCompilation() ||
(!cl->isInterface() && compilingClass->isAssignableFrom(cl))) {
return false;
@@ -62,7 +58,6 @@
}
return true;
-#endif
}
bool JavaJIT::canBeInlined(JavaMethod* meth) {
@@ -135,17 +130,10 @@
Value* indexes2[2];
indexes2[0] = intrinsics->constantZero;
-#ifdef ISOLATE_SHARING
- Value* indexesCtp; //[3];
-#endif
if (meth) {
LLVMMethodInfo* LMI = TheCompiler->getMethodInfo(meth);
Constant* Offset = LMI->getOffset();
indexes2[1] = Offset;
-#ifdef ISOLATE_SHARING
- indexesCtp = ConstantInt::get(Type::getInt32Ty(*llvmContext),
- Offset->getZExtValue() * -1);
-#endif
} else {
GlobalVariable* GV = new GlobalVariable(*llvmFunction->getParent(),
@@ -178,11 +166,6 @@
currentBlock = endResolveVirtual;
indexes2[1] = node;
-#ifdef ISOLATE_SHARING
- Value* mul = BinaryOperator::CreateMul(val, intrinsics->constantMinusOne,
- "", currentBlock);
- indexesCtp = mul;
-#endif
}
makeArgs(it, index, args, signature->nbArguments + 1);
@@ -196,13 +179,6 @@
Value* Func = new LoadInst(FuncPtr, "", currentBlock);
Func = new BitCastInst(Func, LSI->getVirtualPtrType(), "", currentBlock);
-#ifdef ISOLATE_SHARING
- Value* CTP = GetElementPtrInst::Create(VT, indexesCtp, "", currentBlock);
-
- CTP = new LoadInst(CTP, "", currentBlock);
- CTP = new BitCastInst(CTP, intrinsics->ConstantPoolType, "", currentBlock);
- args.push_back(CTP);
-#endif
val = invoke(Func, args, "", currentBlock);
if (endBlock) {
@@ -396,13 +372,7 @@
uint32 index = 0;
if (stat) {
-#ifdef ISOLATE_SHARING
- Value* val = getClassCtp();
- Value* cl = CallInst::Create(intrinsics->GetClassDelegateePtrFunction,
- val, "", currentBlock);
-#else
Value* cl = TheCompiler->getJavaClassPtr(compilingClass);
-#endif
nativeArgs.push_back(cl);
index = 2;
} else {
@@ -658,27 +628,6 @@
currentBlock = OK;
}
-#ifdef ISOLATE_SHARING
-Value* JavaJIT::getStaticInstanceCtp() {
- Value* cl = getClassCtp();
- Value* indexes[2] = { intrinsics->constantZero, module->constantSeven };
- Value* arg1 = GetElementPtrInst::Create(cl, indexes, indexes + 2,
- "", currentBlock);
- arg1 = new LoadInst(arg1, "", false, currentBlock);
- return arg1;
-
-}
-
-Value* JavaJIT::getClassCtp() {
- Value* indexes = intrinsics->constantOne;
- Value* arg1 = GetElementPtrInst::Create(ctpCache, indexes.begin(),
- indexes.end(), "", currentBlock);
- arg1 = new LoadInst(arg1, "", false, currentBlock);
- arg1 = new BitCastInst(arg1, intrinsics->JavaClassType, "", currentBlock);
- return arg1;
-}
-#endif
-
void JavaJIT::beginSynchronize() {
Value* obj = 0;
if (isVirtual(compilingMethod->access)) {
@@ -847,15 +796,11 @@
floatStack.push_back(new AllocaInst(Type::getFloatTy(*llvmContext), "", firstBB));
}
}
-
-
+
uint32 index = 0;
uint32 count = 0;
-#if defined(ISOLATE_SHARING)
- uint32 max = args.size() - 2;
-#else
uint32 max = args.size();
-#endif
+
Signdef* sign = compilingMethod->getSignature();
Typedef* const* arguments = sign->getArgumentsType();
uint32 type = 0;
@@ -870,7 +815,6 @@
thisObject = objectLocals[0];
}
-
for (;count < max; ++i, ++index, ++count, ++type) {
const Typedef* cur = arguments[type];
@@ -1017,11 +961,8 @@
uint32 index = 0;
uint32 count = 0;
-#if defined(ISOLATE_SHARING)
- uint32 max = func->arg_size() - 2;
-#else
uint32 max = func->arg_size();
-#endif
+
Function::arg_iterator i = func->arg_begin();
Signdef* sign = compilingMethod->getSignature();
Typedef* const* arguments = sign->getArgumentsType();
@@ -1073,62 +1014,6 @@
}
#endif
-#if defined(ISOLATE_SHARING)
- ctpCache = i;
- Value* addrCtpCache = new AllocaInst(intrinsics->ConstantPoolType, "",
- currentBlock);
- /// make it volatile to be sure it's on the stack
- new StoreInst(ctpCache, addrCtpCache, true, currentBlock);
-#endif
-
-
-#if defined(SERVICE)
- JnjvmClassLoader* loader = compilingClass->classLoader;
- Value* Cmp = 0;
- Value* mutatorThreadId = 0;
- Value* OldIsolateID = 0;
- Value* IsolateIDPtr = 0;
- Value* OldIsolate = 0;
- Value* NewIsolate = 0;
- Value* IsolatePtr = 0;
- if (loader != loader->bootstrapLoader && isPublic(compilingMethod->access)) {
- mutatorThreadId = getMutatorThreadPtr();
-
- IsolateIDPtr = getIsolateIDPtr(mutatorThreadPtr);
- const Type* realType = PointerType::getUnqual(intrinsics->pointerSizeType);
- IsolateIDPtr = new BitCastInst(IsolateIDPtr, realType, "",
- currentBlock);
- OldIsolateID = new LoadInst(IsolateIDPtr, "", currentBlock);
-
- Value* MyID = ConstantInt::get(intrinsics->pointerSizeType,
- loader->getIsolate()->IsolateID);
- Cmp = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, OldIsolateID, MyID,
- "");
-
- BasicBlock* EndBB = createBasicBlock("After service check");
- BasicBlock* ServiceBB = createBasicBlock("Begin service call");
-
- BranchInst::Create(EndBB, ServiceBB, Cmp, currentBlock);
-
- currentBlock = ServiceBB;
-
- new StoreInst(MyID, IsolateIDPtr, currentBlock);
- IsolatePtr = getVMPtr(mutatorThreadId);
-
- OldIsolate = new LoadInst(IsolatePtr, "", currentBlock);
- NewIsolate = intrinsics->getIsolate(loader->getIsolate(), currentBlock);
- new StoreInst(NewIsolate, IsolatePtr, currentBlock);
-
-#if DEBUG
- Value* GEP[2] = { OldIsolate, NewIsolate };
- CallInst::Create(intrinsics->ServiceCallStartFunction, GEP, GEP + 2,
- "", currentBlock);
-#endif
- BranchInst::Create(EndBB, currentBlock);
- currentBlock = EndBB;
- }
-#endif
-
readExceptionTable(reader, codeLen);
reader.cursor = start;
@@ -1223,28 +1108,6 @@
}
#endif
-#if defined(SERVICE)
- if (Cmp) {
- BasicBlock* EndBB = createBasicBlock("After service check");
- BasicBlock* ServiceBB = createBasicBlock("End Service call");
-
- BranchInst::Create(EndBB, ServiceBB, Cmp, currentBlock);
-
- currentBlock = ServiceBB;
-
- new StoreInst(OldIsolateID, IsolateIDPtr, currentBlock);
- new StoreInst(OldIsolate, IsolatePtr, currentBlock);
-
-#if DEBUG
- Value* GEP[2] = { OldIsolate, NewIsolate };
- CallInst::Create(intrinsics->ServiceCallStopFunction, GEP, GEP + 2,
- "", currentBlock);
-#endif
- BranchInst::Create(EndBB, currentBlock);
- currentBlock = EndBB;
- }
-#endif
-
PI = pred_begin(currentBlock);
PE = pred_end(currentBlock);
if (PI == PE) {
@@ -1285,10 +1148,9 @@
UTF8Buffer(compilingClass->name).cString(),
UTF8Buffer(compilingMethod->name).cString());
-#ifndef DWARF_EXCEPTIONS
- if (codeLen < 5 && !callsStackWalker && !TheCompiler->isStaticCompiling())
+ if (codeLen < 5 && !callsStackWalker && !TheCompiler->isStaticCompiling()) {
compilingMethod->canBeInlined = false;
-#endif
+ }
Attribut* annotationsAtt =
compilingMethod->lookupAttribut(Attribut::annotationsAttribut);
@@ -1333,10 +1195,6 @@
uint8 type = ctpInfo->typeAt(index);
if (type == JavaConstantPool::ConstantString) {
-#if defined(ISOLATE)
- abort();
-#else
-
if (TheCompiler->isStaticCompiling()) {
const UTF8* utf8 = ctpInfo->UTF8At(ctpInfo->ctpDef[index]);
JavaString* str = *(compilingClass->classLoader->UTF8ToStr(utf8));
@@ -1357,7 +1215,6 @@
push(val, false, upcalls->newString);
}
}
-#endif
} else if (type == JavaConstantPool::ConstantLong) {
push(ConstantInt::get(Type::getInt64Ty(*llvmContext), ctpInfo->LongAt(index)),
false);
@@ -1441,20 +1298,11 @@
void JavaJIT::makeArgs(FunctionType::param_iterator it,
uint32 index, std::vector<Value*>& Args, uint32 nb) {
-#if defined(ISOLATE_SHARING)
- nb += 1;
-#endif
Args.reserve(nb + 2);
mvm::ThreadAllocator threadAllocator;
Value** args = (Value**)threadAllocator.Allocate(nb*sizeof(Value*));
-#if defined(ISOLATE_SHARING)
- args[nb - 1] = isolateLocal;
- sint32 start = nb - 2;
- it--;
- it--;
-#else
sint32 start = nb - 1;
-#endif
+
for (sint32 i = start; i >= 0; --i) {
it--;
if (it->get() == Type::getInt64Ty(*llvmContext) || it->get() == Type::getDoubleTy(*llvmContext)) {
@@ -1738,18 +1586,9 @@
func = TheCompiler->getMethod(meth);
}
-#if defined(ISOLATE_SHARING)
- Value* newCtpCache = getConstantPoolAt(index,
- intrinsics->StaticCtpLookupFunction,
- intrinsics->ConstantPoolType, 0,
- false);
-#endif
std::vector<Value*> args; // size = [signature->nbIn + 2];
FunctionType::param_iterator it = staticType->param_end();
makeArgs(it, index, args, signature->nbArguments);
-#if defined(ISOLATE_SHARING)
- args.push_back(newCtpCache);
-#endif
if (className->equals(loader->mathName)) {
val = lowerMathOps(name, args);
@@ -1784,16 +1623,9 @@
// This makes unswitch loop very unhappy time-wise, but makes GVN happy
// number-wise. IMO, it's better to have this than Unswitch.
-#ifdef ISOLATE_SHARING
- Value* CTP = ctpCache;
- Value* Cl = GetElementPtrInst::Create(CTP, intrinsics->ConstantOne, "",
- currentBlock);
- Cl = new LoadInst(Cl, "", currentBlock);
-#else
JavaConstantPool* ctp = compilingClass->ctpInfo;
Value* CTP = TheCompiler->getConstantPool(ctp);
Value* Cl = TheCompiler->getNativeClass(compilingClass);
-#endif
std::vector<Value*> Args;
Args.push_back(resolver);
@@ -1937,18 +1769,11 @@
if (needsCheck) {
Cl = invoke(intrinsics->InitialisationCheckFunction, Cl, "",
currentBlock);
- }
-#if !defined(ISOLATE) && !defined(ISOLATE_SHARING)
- if (needsCheck) {
CallInst::Create(intrinsics->ForceInitialisationCheckFunction, Cl, "",
currentBlock);
}
object = TheCompiler->getStaticInstance(field->classDef);
-#else
- object = CallInst::Create(intrinsics->GetStaticInstanceFunction, Cl, "",
- currentBlock);
-#endif
} else {
object = new LoadInst(
object, "", TheCompiler->useCooperativeGC(), currentBlock);
@@ -2052,7 +1877,6 @@
Value* ptr = ldResolved(index, true, NULL, LAI.llvmTypePtr);
bool final = false;
-#if !defined(ISOLATE) && !defined(ISOLATE_SHARING)
JnjvmBootstrapLoader* JBL = compilingClass->classLoader->bootstrapLoader;
if (!compilingMethod->name->equals(JBL->clinitName)) {
JavaField* field = compilingClass->ctpInfo->lookupField(index, true);
@@ -2105,7 +1929,6 @@
}
}
}
-#endif
if (!final) {
JnjvmClassLoader* JCL = compilingClass->classLoader;
@@ -2911,7 +2734,6 @@
ex->catche = reader.readU2();
-#ifndef ISOLATE_SHARING
if (ex->catche) {
UserClass* cl =
(UserClass*)(compilingClass->ctpInfo->isClassLoaded(ex->catche));
@@ -2922,7 +2744,6 @@
} else {
ex->catchClass = Classpath::newThrowable;
}
-#endif
ex->tester = createBasicBlock("testException");
@@ -2987,34 +2808,6 @@
Value* VTVar = TheCompiler->getVirtualTable(cur->catchClass->virtualVT);
-
-#ifdef SERVICE
- // Verifies that the current isolate is not stopped. If it is, we don't
- // catch the exception but resume unwinding.
- JnjvmClassLoader* loader = compilingClass->classLoader;;
- if (loader != loader->bootstrapLoader) {
- Value* Isolate = getVMPtr(getMutatorThread());
-
- Isolate = new LoadInst(Isolate, "", currentBlock);
- Isolate = new BitCastInst(Isolate, intrinsics->ptrPtrType, "", currentBlock);
- Value* Status = GetElementPtrInst::Create(Isolate, intrinsics->constantOne, "",
- currentBlock);
- Status = new LoadInst(Status, "", currentBlock);
- Status = new PtrToIntInst(Status, Type::Int32Ty, "", currentBlock);
-
- Value* stopping = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, Status,
- intrinsics->constantOne, "");
-
- BasicBlock* raiseBlock = createBasicBlock("raiseBlock");
- BasicBlock* continueBlock = createBasicBlock("continueBlock");
- BranchInst::Create(raiseBlock, continueBlock, stopping, currentBlock);
- currentBlock = raiseBlock;
- BranchInst::Create(endExceptionBlock, currentBlock);
-
- currentBlock = continueBlock;
- }
-#endif
-
// Get the Java exception.
Value* obj = currentBlock->begin();
@@ -3068,39 +2861,6 @@
// Clear exceptions.
new StoreInst(intrinsics->JavaObjectNullConstant, javaExceptionPtr,
currentBlock);
-
-#if defined(SERVICE)
-
- // Change the isolate we are currently running, now that we have catched
- // the exception: the exception may have been thrown by another isolate.
- Value* mutatorThreadId = 0;
- Value* OldIsolateID = 0;
- Value* IsolateIDPtr = 0;
- Value* OldIsolate = 0;
- Value* NewIsolate = 0;
- Value* IsolatePtr = 0;
- currentBlock = cur->javaHandler;
- if (loader != loader->bootstrapLoader) {
- mutatorThreadId = getGetMutatorThreadPtr();
- IsolateIDPtr = getIsolateIDPtr(mutatorThreadId);
- const Type* realType = PointerType::getUnqual(intrinsics->pointerSizeType);
- IsolateIDPtr = new BitCastInst(IsolateIDPtr, realType, "",
- currentBlock);
- OldIsolateID = new LoadInst(IsolateIDPtr, "", currentBlock);
-
- Value* MyID = ConstantInt::get(intrinsics->pointerSizeType,
- loader->getIsolate()->IsolateID);
-
- new StoreInst(MyID, IsolateIDPtr, currentBlock);
- IsolatePtr = getVMPtr(mutatorThreadPtr);
-
- OldIsolate = new LoadInst(IsolatePtr, "", currentBlock);
- NewIsolate = intrinsics->getIsolate(loader->getIsolate(), currentBlock);
- new StoreInst(NewIsolate, IsolatePtr, currentBlock);
-
- }
-#endif
-
}
// Restore currentBlock.
Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.h?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaJIT.h (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaJIT.h Sat Jul 2 05:47:10 2011
@@ -508,25 +508,6 @@
//===--------------------- Yield point support ---------------------------===//
void checkYieldPoint();
-
-
-#if defined(ISOLATE_SHARING)
-//===----------------- Sharing bytecode support ---------------------------===//
-
- /// isolateLocal - The Jnjvm object that the method is currently executing.
- llvm::Value* isolateLocal;
-
- /// ctpCache - The constant pool cache.
- llvm::Value* ctpCache;
-
- /// getStaticInstanceCtp - Get the static instance of the class of the method
- /// being compiled.
- llvm::Value* getStaticInstanceCtp();
-
- /// getClassCtp - Get the class of the method being compiled.
- llvm::Value* getClassCtp();
-#endif
-
};
enum Opcode {
Modified: vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp Sat Jul 2 05:47:10 2011
@@ -154,10 +154,6 @@
}
Constant* JavaJITCompiler::getStaticInstance(Class* classDef) {
-#ifdef ISOLATE
- assert(0 && "Should not be here");
- abort();
-#endif
void* obj = classDef->getStaticInstance();
if (!obj) {
classDef->acquire();
@@ -214,14 +210,6 @@
// ~JavaLLVMCompiler will delete the module.
}
-#ifdef SERVICE
-Value* JavaJITCompiler::getIsolate(Jnjvm* isolate, Value* Where) {
- ConstantInt* CI = ConstantInt::get(Type::getInt64Ty(getLLVMContext()),
- uint64_t(isolate));
- return ConstantExpr::getIntToPtr(CI, JavaIntrinsics.ptrType);
-}
-#endif
-
void JavaJITCompiler::makeVT(Class* cl) {
JavaVirtualTable* VT = cl->virtualVT;
assert(VT && "No VT was allocated!");
Modified: vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp Sat Jul 2 05:47:10 2011
@@ -36,65 +36,6 @@
};
char LowerConstantCalls::ID = 0;
-#if 0
- static RegisterPass<LowerConstantCalls> X("LowerConstantCalls",
- "Lower Constant calls");
-#endif
-
-
-#ifdef ISOLATE
-static Value* getTCM(J3Intrinsics* intrinsics, Value* Arg, Instruction* CI) {
- Value* GEP[2] = { intrinsics->constantZero,
- intrinsics->OffsetTaskClassMirrorInClassConstant };
- Value* TCMArray = GetElementPtrInst::Create(Arg, GEP, GEP + 2, "", CI);
-
- Value* threadId = CallInst::Create(intrinsics->llvm_frameaddress,
- intrinsics->constantZero, "", CI);
- threadId = new PtrToIntInst(threadId, intrinsics->pointerSizeType, "", CI);
- threadId = BinaryOperator::CreateAnd(threadId, intrinsics->constantThreadIDMask,
- "", CI);
-
- threadId = new IntToPtrInst(threadId, intrinsics->ptr32Type, "", CI);
-
- Value* GEP1[2] = { intrinsics->OffsetThreadInMutatorThreadConstant, intrinsics->OffsetIsolateInThreadConstant }
- Value* IsolateID = GetElementPtrInst::Create(threadId, GEP1, GEP1 + 2, "", CI);
-
- IsolateID = new LoadInst(IsolateID, "", CI);
-
- Value* GEP2[2] = { intrinsics->constantZero, IsolateID };
-
- Value* TCM = GetElementPtrInst::Create(TCMArray, GEP2, GEP2 + 2, "",
- CI);
- return TCM;
-}
-
-static Value* getDelegatee(J3Intrinsics* intrinsics, Value* Arg, Instruction* CI) {
- Value* GEP[2] = { intrinsics->constantZero,
- intrinsics->constantTwo };
- Value* TCMArray = GetElementPtrInst::Create(Arg, GEP, GEP + 2, "", CI);
-
- Value* threadId = CallInst::Create(intrinsics->llvm_frameaddress,
- intrinsics->constantZero, "", CI);
- threadId = new PtrToIntInst(threadId, intrinsics->pointerSizeType, "", CI);
- threadId = BinaryOperator::CreateAnd(threadId, intrinsics->constantThreadIDMask,
- "", CI);
-
- threadId = new IntToPtrInst(threadId, intrinsics->ptr32Type, "", CI);
-
- Value* GEP1[2] = { intrinsics->OffsetThreadInMutatorThreadConstant, intrinsics->OffsetIsolateInThreadConstant }
- Value* IsolateID = GetElementPtrInst::Create(threadId, GEP1, GEP1 + 2, "", CI);
-
- IsolateID = new LoadInst(IsolateID, "", CI);
-
- Value* GEP2[2] = { intrinsics->constantZero, IsolateID };
-
- Value* TCM = GetElementPtrInst::Create(TCMArray, GEP2, GEP2 + 2, "",
- CI);
- return new LoadInst(TCM, "", CI);
-}
-
-#else
-
static Value* getTCM(J3Intrinsics* intrinsics, Value* Arg, Instruction* CI) {
Value* GEP[2] = { intrinsics->constantZero,
intrinsics->OffsetTaskClassMirrorInClassConstant };
@@ -120,7 +61,6 @@
return new LoadInst(TCM, "", CI);
}
-#endif
bool LowerConstantCalls::runOnFunction(Function& F) {
LLVMContext* Context = &F.getContext();
@@ -489,14 +429,7 @@
NBB = Invoke->getNormalDest();
}
-#ifdef ISOLATE_SHARING
- ConstantInt* Cons = dyn_cast<ConstantInt>(Index);
- assert(CI && "Wrong use of GetConstantPoolAt");
- uint64 val = Cons->getZExtValue();
- Value* indexes = ConstantInt::get(Type::getInt32Ty(*Context), val + 1);
-#else
Value* indexes = Index;
-#endif
Value* arg1 = GetElementPtrInst::Create(CTP, indexes, "", CI);
arg1 = new LoadInst(arg1, "", false, CI);
Value* test = new ICmpInst(CI, ICmpInst::ICMP_EQ, arg1,
@@ -767,40 +700,6 @@
// And reanalyse the current block.
break;
}
-#ifdef ISOLATE_SHARING
- else if (V == intrinsics->GetCtpClassFunction) {
- Changed = true;
- Value* val = Call.getArgument(0);
- Value* indexes[2] = { intrinsics->constantZero,
- intrinsics->OffsetCtpInClassConstant };
- Value* VTPtr = GetElementPtrInst::Create(val, indexes,
- indexes + 2, "", CI);
- Value* VT = new LoadInst(VTPtr, "", CI);
- CI->replaceAllUsesWith(VT);
- CI->eraseFromParent();
- } else if (V == intrinsics->GetJnjvmArrayClassFunction) {
- Changed = true;
- Value* val = Call.getArgument(0);
- Value* index = Call.getArgument(1);
- Value* indexes[3] = { intrinsics->constantZero, intrinsics->constantTwo,
- index };
- Value* VTPtr = GetElementPtrInst::Create(val, indexes, indexes + 3,
- "", CI);
- Value* VT = new LoadInst(VTPtr, "", CI);
- CI->replaceAllUsesWith(VT);
- CI->eraseFromParent();
- } else if (V == intrinsics->GetJnjvmExceptionClassFunction) {
- Changed = true;
- Value* val = Call.getArgument(0);
- Value* indexes[2] = { intrinsics->constantZero, intrinsics->constantOne };
- Value* VTPtr = GetElementPtrInst::Create(val, indexes, indexes + 2,
- "", CI);
- Value* VT = new LoadInst(VTPtr, "", CI);
- CI->replaceAllUsesWith(VT);
- CI->eraseFromParent();
- }
-#endif
-
}
}
}
Removed: vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll?rev=134312&view=auto
==============================================================================
--- vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll (original)
+++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll (removed)
@@ -1,2 +0,0 @@
-;;; Field 0: the thread
-%MutatorThread = type { %Thread }
Removed: vmkit/trunk/lib/J3/LLVMRuntime/runtime-isolate.ll
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/LLVMRuntime/runtime-isolate.ll?rev=134312&view=auto
==============================================================================
--- vmkit/trunk/lib/J3/LLVMRuntime/runtime-isolate.ll (original)
+++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-isolate.ll (removed)
@@ -1,46 +0,0 @@
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;;;; Isolate specific types ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-%Jnjvm = type { %VT*, %JavaClass*, [9 x %JavaClass*] }
-
-%JavaCommonClass = type { [32 x %JavaObject*],
- i16, %JavaClass**, i16, %UTF8*, %JavaClass*, i8*,
- %VT* }
-
-
-%JavaClass = type { %JavaCommonClass, i32, i32, [32 x %TaskClassMirror],
- %JavaField*, i16, %JavaField*, i16, %JavaMethod*, i16,
- %JavaMethod*, i16, i8*, %ArrayUInt8*, i8*, %Attribut*,
- i16, %JavaClass**, i16, %JavaClass*, i16, i8, i8, i32, i32 }
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;;; Isolate specific methods ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-;;; j3EnveloppeLookup - Find the enveloppe for the current user class.
-declare i8* @j3EnveloppeLookup(%JavaClass*, i32, ...) readnone
-
-;;; j3StaticCtpLookup - Find the user constant pool at the given offset in
-;;; the constant pool.
-declare i8* @j3StaticCtpLookup(%JavaClass*, i32, ...) readnone
-
-;;; j3SpecialCtpLookup - Find the user constant pool at the given offset in
-;;; the constant pool.
-declare i8** @j3SpecialCtpLookup(i8**, i32, i8**) readnone
-
-;;; getCtpCacheNode - Get the constant pool cache of a cache node. This is a
-;;; constant call because the cache node never changes.
-declare i8** @getCtpCacheNode(%CacheNode*) readnone
-
-;;; getCtpCacheNode - Get the constant pool cache of a class. This is a
-;;; constant call because the constant pool never changes.
-declare i8** @getCtpClass(%JavaClass*) readnone
-
-;;; getJnjvmExceptionClass - Get the exception user class for the given
-;;; isolate.
-declare %JavaClass* @getJnjvmExceptionClass(%Jnjvm*) readnone
-
-;;; getJnjvmArrayClass - Get the array user class of the index, for the given
-;;; isolate.
-declare %JavaClass* @getJnjvmArrayClass(%Jnjvm*, i32) readnone
Removed: vmkit/trunk/lib/J3/LLVMRuntime/runtime-service.ll
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/LLVMRuntime/runtime-service.ll?rev=134312&view=auto
==============================================================================
--- vmkit/trunk/lib/J3/LLVMRuntime/runtime-service.ll (original)
+++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-service.ll (removed)
@@ -1,9 +0,0 @@
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;;; Service specific methods ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-;;; j3ServiceCallStart - Mark the switching between services.
-declare void @j3ServiceCallStart(i8*, i8*)
-
-;;; j3ServiceCallStop - Mark the switching between services.
-declare void @j3ServiceCallStop(i8*, i8*)
Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original)
+++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Sat Jul 2 05:47:10 2011
@@ -135,14 +135,12 @@
}
}
-JavaMethod::~JavaMethod() {
-
+JavaMethod::~JavaMethod() {
for (uint32 i = 0; i < nbAttributs; ++i) {
Attribut* cur = &(attributs[i]);
cur->~Attribut();
classDef->classLoader->allocator.Deallocate(cur);
}
-
}
UserClassPrimitive* CommonClass::toPrimitive(Jnjvm* vm) const {
@@ -271,18 +269,9 @@
}
void* JavaMethod::compiledPtr() {
- if (code != 0) return code;
- else {
-#ifdef SERVICE
- Jnjvm *vm = classDef->classLoader->getIsolate();
- if (vm && vm->status == 0) {
- JavaThread* th = JavaThread::get();
- th->throwException(th->ServiceException);
- }
-#endif
+ if (code == 0) {
code = classDef->classLoader->getCompiler()->materializeFunction(this);
}
-
return code;
}
@@ -922,12 +911,6 @@
interfaces[i]->resolveClass();
}
-#ifndef ISOLATE_SHARING
-#ifdef ISOLATE
-void Class::resolveClass() {
- UNIMPLEMENTED();
-}
-#else
void Class::resolveClass() {
if (isResolved() || isErroneous()) return;
resolveParents();
@@ -937,13 +920,6 @@
&(getCurrentTaskClassMirror().status), loaded, resolved);
assert(isResolved() || isErroneous());
}
-#endif
-#else
-void Class::resolveClass() {
- assert(status >= resolved &&
- "Asking to resolve a not resolved-class in a isolate environment");
-}
-#endif
void UserClass::resolveInnerOuterClasses() {
if (!innerOuterResolved) {
@@ -1043,32 +1019,6 @@
}
-#ifdef ISOLATE
-TaskClassMirror& Class::getCurrentTaskClassMirror() {
- return IsolateInfo[JavaThread::get()->getJVM()->IsolateID];
-}
-
-JavaObject* CommonClass::getDelegatee() {
- return delegatee[JavaThread::get()->getJVM()->IsolateID];
-}
-
-JavaObject** CommonClass::getDelegateePtr() {
- return &(delegatee[JavaThread::get()->getJVM()->IsolateID]);
-}
-
-JavaObject* CommonClass::setDelegatee(JavaObject* val) {
- llvm_gcroot(val, 0);
- JavaObject** obj = &(delegatee[JavaThread::get()->getJVM()->IsolateID]);
- classLoader->lock.lock();
- if (*obj == NULL) {
- mvm::Collector::objectReferenceNonHeapWriteBarrier((gc**)obj, (gc*)val);
- }
- classLoader->lock.unlock();
- return getDelegatee();
-}
-
-#else
-
JavaObject* CommonClass::setDelegatee(JavaObject* val) {
llvm_gcroot(val, 0);
JavaObject** obj = &(delegatee[0]);
@@ -1080,9 +1030,6 @@
return getDelegatee();
}
-#endif
-
-
UserCommonClass* UserCommonClass::resolvedImplClass(Jnjvm* vm,
JavaObject* clazz,
@@ -1099,6 +1046,7 @@
return cl;
}
+
void JavaMethod::jniConsFromMeth(char* buf, const UTF8* jniConsClName,
const UTF8* jniConsName,
const UTF8* jniConsType,
@@ -1272,8 +1220,8 @@
}
-bool UserClass::isNativeOverloaded(JavaMethod* meth) {
-
+
+bool UserClass::isNativeOverloaded(JavaMethod* meth) {
for (uint32 i = 0; i < nbVirtualMethods; ++i) {
JavaMethod& cur = virtualMethods[i];
if (&cur != meth && isNative(cur.access) && cur.name->equals(meth->name))
@@ -1290,8 +1238,7 @@
}
-ArrayUInt16* JavaMethod::toString() const {
-
+ArrayUInt16* JavaMethod::toString() const {
Jnjvm* vm = JavaThread::get()->getJVM();
uint32 size = classDef->name->size + name->size + type->size + 1;
ArrayUInt16* res = (ArrayUInt16*)vm->upcalls->ArrayOfChar->doNew(size, vm);
@@ -1324,6 +1271,7 @@
return res;
}
+
bool UserClass::needsInitialisationCheck() {
if (isReady()) return false;
@@ -1344,6 +1292,7 @@
return false;
}
+
void ClassArray::initialiseVT(Class* javaLangObject) {
ClassArray::SuperArray = javaLangObject;
Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.h?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/VMCore/JavaClass.h (original)
+++ vmkit/trunk/lib/J3/VMCore/JavaClass.h Sat Jul 2 05:47:10 2011
@@ -158,9 +158,6 @@
/// super or interfaces.
///
class CommonClass : public mvm::PermanentObject {
-#ifdef ISOLATE_SHARING
-friend class UserCommonClass;
-#endif
public:
@@ -342,7 +339,6 @@
///
JavaObject* setDelegatee(JavaObject* val);
-#if !defined(ISOLATE) && !defined(ISOLATE_SHARING)
/// getDelegatee - Get the java/lang/Class object representing this class.
///
JavaObject* getDelegatee() const {
@@ -356,13 +352,6 @@
return delegatee;
}
-#else
-#if defined(ISOLATE)
- JavaObject* getDelegatee();
- JavaObject** getDelegateePtr();
-#endif
-#endif
-
/// resolvedImplClass - Return the internal representation of the
/// java.lang.Class object. The class must be resolved.
//
@@ -593,11 +582,9 @@
return staticSize;
}
-#ifndef ISOLATE_SHARING
/// doNew - Allocates a Java object whose class is this class.
///
JavaObject* doNew(Jnjvm* vm);
-#endif
/// tracer - Tracer function of instances of Class.
///
@@ -686,8 +673,6 @@
///
void broadcastClass();
-#ifndef ISOLATE
-
/// getCurrentTaskClassMirror - Get the class task mirror of the executing
/// isolate.
///
@@ -719,35 +704,6 @@
getCurrentTaskClassMirror().status = resolving;
}
-
-#else
-
- TaskClassMirror& getCurrentTaskClassMirror();
-
- bool isReadyForCompilation() {
- return false;
- }
-
- void setResolved() {
- for (uint32 i = 0; i < NR_ISOLATES; ++i) {
- IsolateInfo[i].status = resolved;
- }
- }
-
- void setIsResolving() {
- for (uint32 i = 0; i < NR_ISOLATES; ++i) {
- IsolateInfo[i].status = resolving;
- }
- }
-
- void setErroneous() {
- for (uint32 i = 0; i < NR_ISOLATES; ++i) {
- IsolateInfo[i].status = erroneous;
- }
- }
-
-#endif
-
/// getStaticInstance - Get the memory that holds static variables.
///
void* getStaticInstance() {
@@ -1349,9 +1305,4 @@
} // end namespace j3
-
-#ifdef ISOLATE_SHARING
-#include "IsolateCommonClass.h"
-#endif
-
#endif
Modified: vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp (original)
+++ vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp Sat Jul 2 05:47:10 2011
@@ -9,7 +9,6 @@
#define JNJVM_LOAD 0
-#include <alloca.h>
#include <cstdio>
#include <cstdlib>
@@ -282,7 +281,6 @@
CommonClass* JavaConstantPool::loadClass(uint32 index, bool resolve) {
CommonClass* temp = isClassLoaded(index);
-#ifndef ISOLATE_SHARING
if (!temp) {
JnjvmClassLoader* loader = classDef->classLoader;
const UTF8* name = UTF8At(ctpDef[index]);
@@ -293,20 +291,17 @@
}
ctpRes[index] = temp;
}
-#endif
return temp;
}
CommonClass* JavaConstantPool::getMethodClassIfLoaded(uint32 index) {
CommonClass* temp = isClassLoaded(index);
-#ifndef ISOLATE_SHARING
if (!temp) {
JnjvmClassLoader* loader = classDef->classLoader;
assert(loader && "Class has no loader?");
const UTF8* name = UTF8At(ctpDef[index]);
temp = loader->lookupClassOrArray(name);
}
-#endif
if (!temp && classDef->classLoader->getCompiler()->isStaticCompiling()) {
temp = loadClass(index);
@@ -504,13 +499,10 @@
if (field) {
if (!stat) {
ctpRes[index] = (void*)field->ptrOffset;
- }
-#ifndef ISOLATE_SHARING
- else if (lookup->isReady()) {
+ } else if (lookup->isReady()) {
void* S = field->classDef->getStaticInstance();
ctpRes[index] = (void*)((uint64)S + field->ptrOffset);
}
-#endif
}
return field;
}
Modified: vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp (original)
+++ vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp Sat Jul 2 05:47:10 2011
@@ -138,7 +138,6 @@
return res;
}
-#ifndef WITHOUT_VTABLE
// Throws if the method is not found.
extern "C" uint32 j3VirtualTableLookup(UserClass* caller, uint32 index,
uint32* offset, JavaObject* obj) {
@@ -169,10 +168,8 @@
*offset = dmeth->offset;
}
-#if !defined(ISOLATE_SHARING) && !defined(SERVICE)
assert(dmeth->classDef->isInitializing() &&
"Class not ready in a virtual lookup.");
-#endif
res = dmeth->offset;
@@ -180,7 +177,6 @@
return res;
}
-#endif
// Throws if the class is not found.
extern "C" void* j3ClassLookup(UserClass* caller, uint32 index) {
@@ -546,9 +542,7 @@
UserConstantPool* ctpInfo = cl->getConstantPool();
const UTF8* utf8 = ctpInfo->UTF8At(ctpInfo->ctpDef[index]);
str = cl->classLoader->UTF8ToStr(utf8);
-#if defined(ISOLATE_SHARING) || !defined(ISOLATE)
ctpInfo->ctpRes[index] = str;
-#endif
END_NATIVE_EXCEPTION
@@ -591,9 +585,7 @@
// Update the virtual table.
assert(lookup->isResolved() && "Class not resolved");
-#if !defined(ISOLATE_SHARING) && !defined(SERVICE)
assert(lookup->isInitializing() && "Class not ready");
-#endif
assert(lookup->virtualVT && "Class has no VT");
assert(lookup->virtualTableSize > Virt->offset &&
"The method's offset is greater than the virtual table size");
@@ -741,62 +733,3 @@
UTF8Buffer(meth->name).cString(),
OpcodeNames[opcode], index);
}
-
-#ifdef SERVICE
-
-extern "C" void j3ServiceCallStart(Jnjvm* OldService,
- Jnjvm* NewService) {
- fprintf(stderr, "I have switched from %d to %d\n", OldService->IsolateID,
- NewService->IsolateID);
-
- fprintf(stderr, "Now the thread id is %d\n", mvm::Thread::get()->IsolateID);
-}
-
-extern "C" void j3ServiceCallStop(Jnjvm* OldService,
- Jnjvm* NewService) {
- fprintf(stderr, "End service call\n");
-}
-
-#endif
-
-
-#ifdef ISOLATE_SHARING
-extern "C" void* j3StaticCtpLookup(UserClass* cl, uint32 index) {
- UserConstantPool* ctpInfo = cl->getConstantPool();
- JavaConstantPool* shared = ctpInfo->getSharedPool();
- uint32 clIndex = shared->getClassIndexFromMethod(index);
- UserClass* refCl = (UserClass*)ctpInfo->loadClass(clIndex);
- refCl->initialiseClass(JavaThread::get()->getJVM());
-
- CommonClass* baseCl = 0;
- const UTF8* utf8 = 0;
- Signdef* sign = 0;
-
- shared->resolveMethod(index, baseCl, utf8, sign);
- UserClass* methodCl = 0;
- refCl->lookupMethod(utf8, sign->keyName, true, true, &methodCl);
- ctpInfo->ctpRes[index] = methodCl->getConstantPool();
- shared->ctpRes[clIndex] = refCl->classDef;
- return (void*)methodCl->getConstantPool();
-}
-
-extern "C" UserConstantPool* j3SpecialCtpLookup(UserConstantPool* ctpInfo,
- uint32 index,
- UserConstantPool** res) {
- JavaConstantPool* shared = ctpInfo->getSharedPool();
- uint32 clIndex = shared->getClassIndexFromMethod(index);
- UserClass* refCl = (UserClass*)ctpInfo->loadClass(clIndex);
-
- CommonClass* baseCl = 0;
- const UTF8* utf8 = 0;
- Signdef* sign = 0;
-
- shared->resolveMethod(index, baseCl, utf8, sign);
- UserClass* methodCl = 0;
- refCl->lookupMethod(utf8, sign->keyName, false, true, &methodCl);
- shared->ctpRes[clIndex] = refCl->classDef;
- *res = methodCl->getConstantPool();
- return methodCl->getConstantPool();
-}
-
-#endif
Modified: vmkit/trunk/lib/J3/VMCore/JavaThread.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaThread.cpp?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/VMCore/JavaThread.cpp (original)
+++ vmkit/trunk/lib/J3/VMCore/JavaThread.cpp Sat Jul 2 05:47:10 2011
@@ -27,14 +27,6 @@
currentAddedReferences = NULL;
javaThread = NULL;
vmThread = NULL;
-
-#ifdef SERVICE
- eipIndex = 0;
- replacedEIPs = new void*[100];
- if (isolate->upcalls->newThrowable) {
- ServiceException = isolate->upcalls->newThrowable->doNew(isolate);
- }
-#endif
}
void JavaThread::initialise(JavaObject* thread, JavaObject* vmth) {
@@ -46,9 +38,6 @@
JavaThread::~JavaThread() {
delete localJNIRefs;
-#ifdef SERVICE
- delete replacedEIPs;
-#endif
}
void JavaThread::throwException(JavaObject* obj) {
Modified: vmkit/trunk/lib/J3/VMCore/JavaThread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaThread.h?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/VMCore/JavaThread.h (original)
+++ vmkit/trunk/lib/J3/VMCore/JavaThread.h Sat Jul 2 05:47:10 2011
@@ -112,9 +112,6 @@
/// JavaThread - Empty constructor, used to get the VT.
///
JavaThread() {
-#ifdef SERVICE
- replacedEIPs = 0;
-#endif
}
/// ~JavaThread - Delete any potential malloc'ed objects used by this thread.
@@ -221,25 +218,6 @@
virtual void internalClearException() {
pendingException = NULL;
}
-
-public:
-
-#ifdef SERVICE
- /// ServiceException - The exception that will be thrown if a bundle is
- /// stopped.
- JavaObject* ServiceException;
-
- /// replacedEIPs - List of instruction pointers which must be replaced
- /// to a function that throws an exception. We maintain this list and update
- /// the stack correctly so that Dwarf unwinding does not complain.
- ///
- void** replacedEIPs;
-
- /// eipIndex - The current index in the replacedIPs list.
- ///
- uint32_t eipIndex;
-#endif
-
};
} // end namespace j3
Modified: vmkit/trunk/lib/J3/VMCore/JavaTypes.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaTypes.h?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/VMCore/JavaTypes.h (original)
+++ vmkit/trunk/lib/J3/VMCore/JavaTypes.h Sat Jul 2 05:47:10 2011
@@ -423,16 +423,13 @@
}
private:
-
+
/// arguments - The list of arguments of the signature. First is the return
/// type.
///
Typedef* arguments[1];
-
-
};
-
} // end namespace j3
#endif
Modified: vmkit/trunk/lib/J3/VMCore/Jni.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jni.cpp?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/VMCore/Jni.cpp (original)
+++ vmkit/trunk/lib/J3/VMCore/Jni.cpp Sat Jul 2 05:47:10 2011
@@ -29,21 +29,13 @@
UserClass* getClassFromStaticMethod(Jnjvm* vm, JavaMethod* meth,
JavaObject* clazz) {
llvm_gcroot(clazz, 0);
-#ifdef ISOLATE_SHARING
- return (UserClass*)UserCommonClass::resolvedImplClass(vm, clazz, false);
-#else
return meth->classDef;
-#endif
}
static UserClass* getClassFromVirtualMethod(Jnjvm* vm,
JavaMethod* meth,
UserCommonClass* cl) {
-#ifdef ISOLATE_SHARING
- return cl->lookupClassFromMethod(this);
-#else
return meth->classDef;
-#endif
}
extern "C" const struct JNIInvokeInterface_ JNI_JavaVMTable;
Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp (original)
+++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Sat Jul 2 05:47:10 2011
@@ -216,11 +216,7 @@
clinitType = asciizConstructUTF8("()V");
runName = asciizConstructUTF8("run");
prelib = asciizConstructUTF8("lib");
-#if defined(__MACH__)
- postlib = asciizConstructUTF8(".dylib");
-#else
- postlib = asciizConstructUTF8(".so");
-#endif
+ postlib = asciizConstructUTF8(DYLD_EXTENSION);
mathName = asciizConstructUTF8("java/lang/Math");
stackWalkerName = asciizConstructUTF8("gnu/classpath/VMStackWalker");
NoClassDefFoundError = asciizConstructUTF8("java/lang/NoClassDefFoundError");
@@ -283,28 +279,6 @@
JavaObject::getClass(loader)->asClass()->lookupMethodDontThrow(
meth->name, meth->type, false, true, &loadClass);
assert(loadClass && "Loader does not have a loadClass function");
-
-#if defined(SERVICE)
- /// If the appClassLoader is already set in the isolate, then we need
- /// a new one each time a class loader is allocated.
- if (isolate->appClassLoader) {
- isolate = new Jnjvm(allocator, bootstrapLoader);
- isolate->memoryLimit = 4000000;
- isolate->threadLimit = 10;
- isolate->parent = I->parent;
- isolate->CU = this;
- mvm::Thread* th = mvm::Thread::get();
- mvm::VirtualMachine* OldVM = th->MyVM;
- th->MyVM = isolate;
- th->IsolateID = isolate->IsolateID;
-
- isolate->loadBootstrap();
-
- th->MyVM = OldVM;
- th->IsolateID = OldVM->IsolateID;
- }
-#endif
-
}
void JnjvmClassLoader::setCompiler(JavaCompiler* Comp) {
Modified: vmkit/trunk/lib/J3/VMCore/JnjvmConfig.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmConfig.h?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/VMCore/JnjvmConfig.h (original)
+++ vmkit/trunk/lib/J3/VMCore/JnjvmConfig.h Sat Jul 2 05:47:10 2011
@@ -11,10 +11,6 @@
#ifndef JNJVM_CONFIG_H
#define JNJVM_CONFIG_H
-#ifdef ISOLATE_SHARING
-#define ISOLATE_STATIC
-#else
-
namespace j3 {
class ClassArray;
@@ -31,13 +27,7 @@
}
#define ISOLATE_STATIC static
-#endif
-
-#ifdef ISOLATE
-#define NR_ISOLATES 32
-#else
#define NR_ISOLATES 1
-#endif
#endif // JNJVM_CONFIG_H
Modified: vmkit/trunk/lib/J3/VMCore/LinkJavaRuntime.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/LinkJavaRuntime.h?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/VMCore/LinkJavaRuntime.h (original)
+++ vmkit/trunk/lib/J3/VMCore/LinkJavaRuntime.h Sat Jul 2 05:47:10 2011
@@ -61,29 +61,10 @@
extern "C" void j3PrintExecution(uint32 opcode, uint32 index,
JavaMethod* meth);
-
-#ifdef SERVICE
-extern "C" void j3ServiceCallStart(Jnjvm* OldService,
- Jnjvm* NewService);
-extern "C" void j3ServiceCallStop(Jnjvm* OldService,
- Jnjvm* NewService);
-#endif
-
-
-
-
-#ifdef ISOLATE_SHARING
-extern "C" void* j3StaticCtpLookup(UserClass* cl, uint32 index);
-extern "C" UserConstantPool* j3SpecialCtpLookup(UserConstantPool* ctpInfo,
- uint32 index,
- UserConstantPool** res);
-#endif
-
-
namespace force_linker {
struct ForceRuntimeLinking {
ForceRuntimeLinking() {
- // We must reference the passes in such a way that compilers will not
+ // We must reference the methods in such a way that compilers will not
// delete it all as dead code, even with whole program optimization,
// yet is effectively a NO-OP. As the compiler isn't smart enough
// to know that getenv() never returns -1, this will do the job.
@@ -117,16 +98,6 @@
(void) j3PrintMethodEnd(0);
(void) j3PrintExecution(0, 0, 0);
(void) j3StringLookup(0, 0);
-#ifdef SERVICE
- (void) j3ServiceCallStart(0, 0);
- (void) j3ServiceCallStop(0, 0);
-#endif
-
-#ifdef ISOLATE_SHARING
- (void) j3StaticCtpLookup(0, 0);
- (void) j3SpecialCtpLookup(0, 0, 0);
-#endif
-
}
} ForcePassLinking; // Force link by creating a global definition.
}
Modified: vmkit/trunk/lib/J3/VMCore/ReferenceQueue.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/ReferenceQueue.h?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/VMCore/ReferenceQueue.h (original)
+++ vmkit/trunk/lib/J3/VMCore/ReferenceQueue.h Sat Jul 2 05:47:10 2011
@@ -205,7 +205,6 @@
delete[] FinalizationQueue;
delete[] ToBeFinalized;
}
-
};
} // namespace j3
Modified: vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp (original)
+++ vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Sat Jul 2 05:47:10 2011
@@ -7,9 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This file contains GC specific tracing functions. It is used by the
-// GCMmap2 garbage collector and may be of use for other GCs. Boehm GC does
-// not use these functions.
+// This file contains GC specific tracing functions.
//
// The file is divided into four parts:
// (1) Declaration of internal GC classes.
Modified: vmkit/trunk/tools/vmjc/vmjc.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmjc/vmjc.cpp?rev=134313&r1=134312&r2=134313&view=diff
==============================================================================
--- vmkit/trunk/tools/vmjc/vmjc.cpp (original)
+++ vmkit/trunk/tools/vmjc/vmjc.cpp Sat Jul 2 05:47:10 2011
@@ -139,60 +139,7 @@
return 0;
}
- // Disable cross-compiling for now.
- if (false) {
- Module* TheModule = new Module("bootstrap module",
- *(new llvm::LLVMContext()));
- if (!TargetTriple.empty())
- TheModule->setTargetTriple(TargetTriple);
- else
- TheModule->setTargetTriple(mvm::MvmModule::getHostTriple());
-
-#if 0
- // explicitly specified an architecture to compile for.
- const Target *TheTarget = 0;
- if (!MArch.empty()) {
- for (TargetRegistry::iterator it = TargetRegistry::begin(),
- ie = TargetRegistry::end(); it != ie; ++it) {
- if (MArch == it->getName()) {
- TheTarget = &*it;
- break;
- }
- }
-
- if (!TheTarget) {
- errs() << argv[0] << ": error: invalid target '" << MArch << "'.\n";
- return 1;
- }
- } else {
- std::string Err;
- TheTarget =
- TargetRegistry::getClosestStaticTargetForModule(*TheModule, Err);
- if (TheTarget == 0) {
- errs() << argv[0] << ": error auto-selecting target for module '"
- << Err << "'. Please use the -march option to explicitly "
- << "pick a target.\n";
- return 1;
- }
- }
-
- std::string FeaturesStr;
- std::auto_ptr<TargetMachine>
- target(TheTarget->createTargetMachine(*TheModule, FeaturesStr));
- assert(target.get() && "Could not allocate target machine!");
- TargetMachine &Target = *target.get();
-
- // Install information about target datalayout stuff into the module for
- // optimizer use.
- TheModule->setDataLayout(Target.getTargetData()->
- getStringRepresentation());
-
-
- mvm::MvmModule::initialise(CodeGenOpt::Default, TheModule, &Target);
-#endif
- } else {
- mvm::MvmModule::initialise();
- }
+ mvm::MvmModule::initialise();
for (std::vector<std::string>::iterator i = LoadBytecodeFiles.begin(),
e = LoadBytecodeFiles.end(); i != e; ++i) {
More information about the vmkit-commits
mailing list