[vmkit-commits] [vmkit] r121138 - in /vmkit/branches/multi-vm: ./ include/j3/ include/mvm/Threads/ lib/J3/Compiler/ lib/J3/VMCore/ lib/Mvm/Allocator/ lib/Mvm/GCMmap2/
Gael Thomas
gael.thomas at lip6.fr
Tue Dec 7 07:32:03 PST 2010
Author: gthomas
Date: Tue Dec 7 09:32:03 2010
New Revision: 121138
URL: http://llvm.org/viewvc/llvm-project?rev=121138&view=rev
Log:
remove all SERVICE depend code
Modified:
vmkit/branches/multi-vm/find-it.sh
vmkit/branches/multi-vm/include/j3/J3Intrinsics.h
vmkit/branches/multi-vm/include/j3/JavaAOTCompiler.h
vmkit/branches/multi-vm/include/j3/JavaLLVMCompiler.h
vmkit/branches/multi-vm/include/mvm/Threads/Thread.h
vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsCheck.inc
vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsDwarf.inc
vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp
vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp
vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp
vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITCompiler.cpp
vmkit/branches/multi-vm/lib/J3/Compiler/LLVMMaterializer.cpp
vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.cpp
vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp
vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp
vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h
vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp
vmkit/branches/multi-vm/lib/J3/VMCore/LinkJavaRuntime.h
vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp
vmkit/branches/multi-vm/lib/Mvm/Allocator/gcchunk.h
vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MvmGC.h
Modified: vmkit/branches/multi-vm/find-it.sh
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/find-it.sh?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/find-it.sh (original)
+++ vmkit/branches/multi-vm/find-it.sh Tue Dec 7 09:32:03 2010
@@ -6,6 +6,6 @@
else
- grep -w --exclude *.txt --exclude-dir autoconf --exclude config.status --exclude config.log --exclude configure --exclude *.xml --exclude *.html --exclude *.jar --exclude *.bc --exclude MMTkInline.inc --exclude-dir patches --exclude-dir N3 --exclude *.java --exclude *.class -R --exclude-dir .svn --exclude-dir Release --exclude *.s "$1" .
+ grep -w --exclude-dir IJvm --exclude-dir Isolate --exclude *.txt --exclude-dir autoconf --exclude config.status --exclude config.log --exclude configure --exclude *.xml --exclude *.html --exclude *.jar --exclude *.bc --exclude MMTkInline.inc --exclude-dir patches --exclude-dir N3 --exclude *.java --exclude *.class -R --exclude-dir .svn --exclude-dir Release --exclude *.s "$1" .
fi
\ No newline at end of file
Modified: vmkit/branches/multi-vm/include/j3/J3Intrinsics.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/j3/J3Intrinsics.h?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/include/j3/J3Intrinsics.h (original)
+++ vmkit/branches/multi-vm/include/j3/J3Intrinsics.h Tue Dec 7 09:32:03 2010
@@ -78,11 +78,6 @@
llvm::Function* MultiCallNewFunction;
llvm::Function* GetArrayClassFunction;
-#ifdef SERVICE
- llvm::Function* ServiceCallStartFunction;
- llvm::Function* ServiceCallStopFunction;
-#endif
-
llvm::Function* GetClassDelegateeFunction;
llvm::Function* RuntimeDelegateeFunction;
llvm::Function* ArrayLengthFunction;
Modified: vmkit/branches/multi-vm/include/j3/JavaAOTCompiler.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/j3/JavaAOTCompiler.h?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/include/j3/JavaAOTCompiler.h (original)
+++ vmkit/branches/multi-vm/include/j3/JavaAOTCompiler.h Tue Dec 7 09:32:03 2010
@@ -69,11 +69,6 @@
virtual void setMethod(llvm::Function* func, void* ptr, const char* name);
-
-#ifdef SERVICE
- virtual llvm::Value* getIsolate(Jnjvm* vm, llvm::Value* Where);
-#endif
-
virtual ~JavaAOTCompiler() {}
virtual void* loadMethod(void* handle, const char* symbol);
@@ -156,13 +151,6 @@
typedef std::map<const UTF8*, llvm::Constant*>::iterator
utf8_iterator;
-#ifdef SERVICE
- virtual llvm::Value* getIsolate(Jnjvm* vm, llvm::Value* Where);
- std::map<const Jnjvm*, llvm::GlobalVariable*> isolates;
- typedef std::map<const Jnjvm*, llvm::GlobalVariable*>::iterator
- isolate_iterator;
-#endif
-
bool isCompiling(const CommonClass* cl) const;
public:
Modified: vmkit/branches/multi-vm/include/j3/JavaLLVMCompiler.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/j3/JavaLLVMCompiler.h?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/include/j3/JavaLLVMCompiler.h (original)
+++ vmkit/branches/multi-vm/include/j3/JavaLLVMCompiler.h Tue Dec 7 09:32:03 2010
@@ -197,10 +197,6 @@
virtual void setMethod(llvm::Function* func, void* ptr, const char* name) = 0;
-#ifdef SERVICE
- virtual llvm::Value* getIsolate(Jnjvm* vm, llvm::Value* Where) = 0;
-#endif
-
virtual void* materializeFunction(JavaMethod* meth) = 0;
llvm::Function* parseFunction(JavaMethod* meth);
Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/Threads/Thread.h?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/include/mvm/Threads/Thread.h (original)
+++ vmkit/branches/multi-vm/include/mvm/Threads/Thread.h Tue Dec 7 09:32:03 2010
@@ -318,12 +318,6 @@
///
void (*routine)(mvm::Thread*);
-#ifdef SERVICE
- /// stoppingService - The service that is currently stopping.
- ///
- VirtualMachine* stoppingService;
-#endif
-
/// printBacktrace - Print the backtrace.
///
void printBacktrace();
Modified: vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsCheck.inc
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsCheck.inc?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsCheck.inc (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsCheck.inc Tue Dec 7 09:32:03 2010
@@ -379,34 +379,6 @@
"Class not loaded when reading the exception table");
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();
@@ -462,38 +434,6 @@
new StoreInst(intrinsics->JavaObjectNullConstant, exceptionPtr,
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/branches/multi-vm/lib/J3/Compiler/ExceptionsDwarf.inc
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsDwarf.inc?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsDwarf.inc (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsDwarf.inc Tue Dec 7 09:32:03 2010
@@ -375,34 +375,6 @@
if (clVar->getType() != module->JavaCommonClassType)
clVar = new BitCastInst(clVar, module->JavaCommonClassType, "",
currentBlock);
-
-
-#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(getMutatorThreadPtr());
-
- Isolate = new LoadInst(Isolate, "", currentBlock);
- Isolate = new BitCastInst(Isolate, module->ptrPtrType, "", currentBlock);
- Value* Status = GetElementPtrInst::Create(Isolate, module->constantOne, "",
- currentBlock);
- Status = new LoadInst(Status, "", currentBlock);
- Status = new PtrToIntInst(Status, Type::Int32Ty, "", currentBlock);
-
- Value* stopping = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, Status,
- module->constantOne, "");
-
- BasicBlock* raiseBlock = createBasicBlock("raiseBlock");
- BasicBlock* continueBlock = createBasicBlock("continueBlock");
- BranchInst::Create(raiseBlock, continueBlock, stopping, currentBlock);
- currentBlock = raiseBlock;
- BranchInst::Create(endExceptionBlock, currentBlock);
-
- currentBlock = continueBlock;
- }
-#endif
Value* mutatorThreadId = getMutatorThreadPtr();
Value* javaThreadId = getJavaThreadPtr(mutatorThreadId);
@@ -489,39 +461,6 @@
node->addIncoming(exc, cur->nativeHandler);
}
-
-#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/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp Tue Dec 7 09:32:03 2010
@@ -211,11 +211,6 @@
GetFinalFloatFieldFunction = module->getFunction("getFinalFloatField");
GetFinalDoubleFieldFunction = module->getFunction("getFinalDoubleField");
-#ifdef SERVICE
- ServiceCallStartFunction = module->getFunction("j3ServiceCallStart");
- ServiceCallStopFunction = module->getFunction("j3ServiceCallStop");
-#endif
-
#ifndef WITHOUT_VTABLE
VirtualLookupFunction = module->getFunction("j3VirtualTableLookup");
#endif
Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp Tue Dec 7 09:32:03 2010
@@ -1681,38 +1681,6 @@
fprintf(stderr, "%lluB\n", (unsigned long long int)size);
}
-
-#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;
Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp Tue Dec 7 09:32:03 2010
@@ -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) {
@@ -1059,53 +1054,6 @@
}
#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;
@@ -1199,28 +1147,6 @@
CallInst::Create(intrinsics->PrintMethodEndFunction, arg, "", currentBlock);
}
#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);
Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITCompiler.cpp?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITCompiler.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITCompiler.cpp Tue Dec 7 09:32:03 2010
@@ -211,14 +211,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/branches/multi-vm/lib/J3/Compiler/LLVMMaterializer.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/LLVMMaterializer.cpp?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/LLVMMaterializer.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/LLVMMaterializer.cpp Tue Dec 7 09:32:03 2010
@@ -150,9 +150,7 @@
LLVMMethodInfo* LMI = Comp->getMethodInfo(meth);
uint64_t offset = dyn_cast<ConstantInt>(LMI->getOffset())->getZExtValue();
assert(meth->classDef->isResolved() && "Class not resolved");
-#if !defined(SERVICE)
assert(meth->classDef->isInitializing() && "Class not ready");
-#endif
assert(meth->classDef->virtualVT && "Class has no VT");
assert(meth->classDef->virtualTableSize > offset &&
"The method's offset is greater than the virtual table size");
Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.cpp?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.cpp Tue Dec 7 09:32:03 2010
@@ -271,17 +271,10 @@
}
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)
+ return code;
+ else
code = classDef->classLoader->getCompiler()->materializeFunction(this);
- }
return code;
}
Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp Tue Dec 7 09:32:03 2010
@@ -167,10 +167,8 @@
*offset = dmeth->offset;
}
-#if !defined(SERVICE)
assert(dmeth->classDef->isInitializing() &&
"Class not ready in a virtual lookup.");
-#endif
res = dmeth->offset;
@@ -595,9 +593,7 @@
// Update the virtual table.
assert(lookup->isResolved() && "Class not resolved");
-#if !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");
@@ -745,22 +741,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
-
-
Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp Tue Dec 7 09:32:03 2010
@@ -25,14 +25,6 @@
currentAddedReferences = NULL;
javaThread = NULL;
vmThread = NULL;
-
-#ifdef SERVICE
- eipIndex = 0;
- replacedEIPs = new void*[100];
- if (vm->upcalls->newThrowable) {
- ServiceException = vm->upcalls->newThrowable->doNew(vm);
- }
-#endif
}
JavaThread* JavaThread::j3Thread(mvm::Thread* mut) {
@@ -56,9 +48,6 @@
JavaThread::~JavaThread() {
delete localJNIRefs;
-#ifdef SERVICE
- delete replacedEIPs;
-#endif
}
void JavaThread::startJNI() {
Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h Tue Dec 7 09:32:03 2010
@@ -105,9 +105,6 @@
/// JavaThread - Empty constructor, used to get the VT.
///
JavaThread() : mvm::VMThreadData(0, 0) {
-#ifdef SERVICE
- replacedEIPs = 0;
-#endif
}
/// ~JavaThread - Delete any potential malloc'ed objects used by this thread.
@@ -205,23 +202,6 @@
/// the stack.
///
uint32 getJavaFrameContext(void** buffer);
-
-#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/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp Tue Dec 7 09:32:03 2010
@@ -283,28 +283,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/branches/multi-vm/lib/J3/VMCore/LinkJavaRuntime.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/LinkJavaRuntime.h?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/LinkJavaRuntime.h (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/LinkJavaRuntime.h Tue Dec 7 09:32:03 2010
@@ -62,13 +62,6 @@
JavaMethod* meth);
-#ifdef SERVICE
-extern "C" void j3ServiceCallStart(Jnjvm* OldService,
- Jnjvm* NewService);
-extern "C" void j3ServiceCallStop(Jnjvm* OldService,
- Jnjvm* NewService);
-#endif
-
namespace force_linker {
struct ForceRuntimeLinking {
ForceRuntimeLinking() {
@@ -106,10 +99,6 @@
(void) j3PrintMethodEnd(0);
(void) j3PrintExecution(0, 0, 0);
(void) j3StringLookup(0, 0);
-#ifdef SERVICE
- (void) j3ServiceCallStart(0, 0);
- (void) j3ServiceCallStop(0, 0);
-#endif
}
} ForcePassLinking; // Force link by creating a global definition.
}
Modified: vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp Tue Dec 7 09:32:03 2010
@@ -308,19 +308,11 @@
for (i = i + 1; i < mvm::LockSystem::GlobalSize; i++) {
assert(lockSystem.LockTable[i] == NULL);
}
-
-
-#ifdef SERVICE
- parent->tracer(closure);
-#endif
}
void JavaThread::tracer(uintptr_t closure) {
mvm::Collector::markAndTraceRoot(&javaThread, closure);
mvm::Collector::markAndTraceRoot(&vmThread, closure);
-#ifdef SERVICE
- mvm::Collector::markAndTraceRoot(&ServiceException, closure);
-#endif
JNILocalReferences* end = localJNIRefs;
while (end != NULL) {
Modified: vmkit/branches/multi-vm/lib/Mvm/Allocator/gcchunk.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/Allocator/gcchunk.h?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/Allocator/gcchunk.h (original)
+++ vmkit/branches/multi-vm/lib/Mvm/Allocator/gcchunk.h Tue Dec 7 09:32:03 2010
@@ -31,9 +31,6 @@
/* bit 0-2: la marque */
/* bit 3: est-on collectable */
public:
-#ifdef SERVICE
- mvm::VirtualMachine* meta; // who allocated me
-#endif
static const signed int maskCollectable = 8;
static const signed int maskNotCollectable = 0;
Modified: vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MvmGC.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MvmGC.h?rev=121138&r1=121137&r2=121138&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MvmGC.h (original)
+++ vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MvmGC.h Tue Dec 7 09:32:03 2010
@@ -120,13 +120,7 @@
}
static inline void maybeCollect() {
- if(_enable_auto &&
-#ifdef SERVICE
- (mvm::Thread::get()->MyVM->_since_last_collection <= (_collect_freq_auto - _collect_freq_maybe))
-#else
- (_since_last_collection <= (_collect_freq_auto - _collect_freq_maybe))
-#endif
- )
+ if(_enable_auto && (_since_last_collection <= (_collect_freq_auto - _collect_freq_maybe)))
collect();
}
@@ -138,47 +132,13 @@
return res;
#else
lock();
-
-#ifdef SERVICE
- if (threads->get_nb_threads()) {
- VirtualMachine* vm = mvm::Thread::get()->MyVM;
- vm->_since_last_collection -= n;
- if (_enable_auto && (vm->_since_last_collection <= 0)) {
- vm->gcTriggered++;
- if (vm->gcTriggered > vm->GCLimit) {
- vm->_since_last_collection += n;
- unlock();
- vm->stopService();
- return 0;
- }
- collect_unprotect();
- }
-
- if (vm->memoryUsed + n > vm->memoryLimit) {
- vm->_since_last_collection += n;
- unlock();
- vm->stopService();
- return 0;
- }
- } else {
-#endif
_since_last_collection -= n;
if(_enable_auto && (_since_last_collection <= 0)) {
collect_unprotect();
}
-#ifdef SERVICE
- }
-#endif
register GCChunkNode *header = allocator->alloc_chunk(n, 1, current_mark & 1);
-#ifdef SERVICE
- if (threads->get_nb_threads()) {
- VirtualMachine* vm = mvm::Thread::get()->MyVM;
- header->meta = vm;
- vm->memoryUsed += n;
- }
-#endif
header->append(used_nodes);
register struct gcRoot *p = header->chunk();
p->setVirtualTable(vt);
@@ -208,28 +168,6 @@
gcfatal("%p isn't a avalid object", ptr);
size_t old_sz = node->nbb();
-#ifdef SERVICE
- if (threads->get_nb_threads()) {
- VirtualMachine* vm = mvm::Thread::get()->MyVM;
- vm->_since_last_collection -= (n - old_sz);
- if (_enable_auto && (vm->_since_last_collection <= 0)) {
- if (vm->gcTriggered + 1 > vm->GCLimit) {
- unlock();
- vm->stopService();
- return 0;
- }
- vm->gcTriggered++;
- collect_unprotect();
- }
-
- if (vm->memoryUsed + (n - old_sz) > vm->memoryLimit) {
- vm->_since_last_collection += (n - old_sz);
- unlock();
- vm->stopService();
- return 0;
- }
- } else {
-#endif
_since_last_collection -= (n - old_sz);
@@ -237,20 +175,8 @@
collect_unprotect();
}
-#ifdef SERVICE
- }
-#endif
-
GCChunkNode *res = allocator->realloc_chunk(desc, node, n);
-#ifdef SERVICE
- if (threads->get_nb_threads()) {
- VirtualMachine* vm = mvm::Thread::get()->MyVM;
- res->meta = vm;
- vm->memoryUsed += (n - old_sz);
- }
-#endif
-
if(res != node) {
res->append(used_nodes);
mark(res);
More information about the vmkit-commits
mailing list