[vmkit-commits] [vmkit] r186830 - Added AOT/JIT switch to indicate when we are compiling the garbage collector itself.
Koutheir Attouchi
koutheir at gmail.com
Mon Jul 22 08:45:35 PDT 2013
Author: koutheir
Date: Mon Jul 22 10:45:34 2013
New Revision: 186830
URL: http://llvm.org/viewvc/llvm-project?rev=186830&view=rev
Log:
Added AOT/JIT switch to indicate when we are compiling the garbage collector itself.
Updated DaCapo benchmark scripts.
Some code factorization.
Added:
vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.cpp (with props)
vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.h (with props)
Removed:
vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp
Modified:
vmkit/branches/incinerator/.cproject
vmkit/branches/incinerator/incinerator/knopflerfish.patch
vmkit/branches/incinerator/incinerator/osgi/src/j3/vm/OSGi.java
vmkit/branches/incinerator/include/j3/J3Intrinsics.h
vmkit/branches/incinerator/include/j3/JavaAOTCompiler.h
vmkit/branches/incinerator/include/j3/JavaCompiler.h
vmkit/branches/incinerator/include/j3/JavaJITCompiler.h
vmkit/branches/incinerator/include/j3/JavaLLVMCompiler.h
vmkit/branches/incinerator/include/vmkit/GC.h
vmkit/branches/incinerator/include/vmkit/System.h
vmkit/branches/incinerator/lib/j3/Compiler/J3Intrinsics.cpp
vmkit/branches/incinerator/lib/j3/Compiler/JavaAOTCompiler.cpp
vmkit/branches/incinerator/lib/j3/Compiler/JavaJIT.cpp
vmkit/branches/incinerator/lib/j3/Compiler/JavaJITCompiler.cpp
vmkit/branches/incinerator/lib/j3/Compiler/JavaLLVMCompiler.cpp
vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp
vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h
vmkit/branches/incinerator/lib/j3/VMCore/JavaClass.h
vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp
vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.h
vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.cpp
vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.h
vmkit/branches/incinerator/lib/vmkit/CommonThread/ctthread.cpp
vmkit/branches/incinerator/tests/dacapo/2006-10-MR2/Makefile
vmkit/branches/incinerator/tests/dacapo/Makefile.inc
vmkit/branches/incinerator/tests/dacapo/dacapo-avg-overhead.csv
vmkit/branches/incinerator/tests/dacapo/run-all.sh
vmkit/branches/incinerator/tests/dacapo/run-bench.sh
vmkit/branches/incinerator/tests/dacapo/stats-incinerator-dacapo-2006-10-MR2.csv
vmkit/branches/incinerator/tests/dacapo/stats-j3-dacapo-2006-10-MR2.csv
vmkit/branches/incinerator/tools/vmjc/vmjc.cpp
Modified: vmkit/branches/incinerator/.cproject
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/.cproject?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/.cproject (original)
+++ vmkit/branches/incinerator/.cproject Mon Jul 22 10:45:34 2013
@@ -30,13 +30,13 @@
<tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen.783487933" name="autogen.sh" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen"/>
<tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc.1530203096" name="GCC C Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc">
<option id="gnu.c.compiler.option.include.paths.1985077212" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
- <listOptionValue builtIn="false" value="/home/koutheir/PhD/VMKit/llvm-3.2/include"/>
+ <listOptionValue builtIn="false" value="/home/koutheir/PhD/VMKit/llvm-3.3/include"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1841932293" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp.1306149644" name="GCC C++ Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp">
<option id="gnu.cpp.compiler.option.include.paths.195411303" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
- <listOptionValue builtIn="false" value="/home/koutheir/PhD/VMKit/llvm-3.2/include"/>
+ <listOptionValue builtIn="false" value="/home/koutheir/PhD/VMKit/llvm-3.3/include"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.773493973" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
Modified: vmkit/branches/incinerator/incinerator/knopflerfish.patch
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/knopflerfish.patch?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/incinerator/knopflerfish.patch (original)
+++ vmkit/branches/incinerator/incinerator/knopflerfish.patch Mon Jul 22 10:45:34 2013
@@ -1,29 +1,33 @@
-Index: knopflerfish/osgi/framework/src/j3/vm/OSGi.java
-===================================================================
---- knopflerfish/osgi/framework/src/j3/vm/OSGi.java 1970-01-01 01:00:00.000000000 +0100
-+++ knopflerfish/osgi/framework/src/j3/vm/OSGi.java 2012-10-27 00:08:43.000000000 +0200
+diff -U 4 -H -d -p -r -N -- a/osgi/framework/src/j3/vm/OSGi.java b/osgi/framework/src/j3/vm/OSGi.java
+--- a/osgi/framework/src/j3/vm/OSGi.java 1970-01-01 01:00:00.000000000 +0100
++++ b/osgi/framework/src/j3/vm/OSGi.java 2013-07-03 17:15:27.382558975 +0200
@@ -0,0 +1,6 @@
+package j3.vm;
+
+public class OSGi
+{
-+ public static native void associateBundleClass(long bundleID, Class classObject);
++ public static native void setBundleClassLoader(long bundleID, ClassLoader loaderObject);
+}
-Index: knopflerfish/osgi/framework/src/org/knopflerfish/framework/BundleClassLoader.java
-===================================================================
---- knopflerfish/osgi/framework/src/org/knopflerfish/framework/BundleClassLoader.java 2012-10-27 02:29:49.852807353 +0200
-+++ knopflerfish/osgi/framework/src/org/knopflerfish/framework/BundleClassLoader.java 2012-10-27 02:36:22.287024825 +0200
-@@ -821,9 +821,12 @@
- }
- Vector av = classPath.componentExists(path, onlyFirst);
- if (av != null) {
- try {
-- return action.get(av, path, name, pkg, this);
-+ Object cl = action.get(av, path, name, pkg, this);
-+ if (cl instanceof Class)
-+ j3.vm.OSGi.associateBundleClass(getBundle().getBundleId(), (Class)cl);
-+ return cl;
- } catch (IOException ioe) {
- fwCtx.listeners.frameworkError(bpkgs.bg.bundle, ioe);
- return null;
+diff -U 4 -H -d -p -r -N -- a/osgi/framework/src/org/knopflerfish/framework/BundleGeneration.java b/osgi/framework/src/org/knopflerfish/framework/BundleGeneration.java
+--- a/osgi/framework/src/org/knopflerfish/framework/BundleGeneration.java 2013-07-03 17:24:51.446553603 +0200
++++ b/osgi/framework/src/org/knopflerfish/framework/BundleGeneration.java 2013-07-03 17:17:48.950557625 +0200
+@@ -162,8 +162,9 @@ public class BundleGeneration implements
+ lazyExcludes = null;
+ timeStamp = System.currentTimeMillis();
+ bpkgs = new BundlePackages(this, exportStr);
+ classLoader = b.getClassLoader();
++ j3.vm.OSGi.setBundleClassLoader(bundle.getBundleId(), classLoader);
+ }
+
+
+ /**
+@@ -440,8 +441,9 @@ public class BundleGeneration implements
+ }
+ }
+ }
+ classLoader = bundle.secure.newBundleClassLoader(this);
++ j3.vm.OSGi.setBundleClassLoader(bundle.getBundleId(), classLoader);
+
+ return true;
}
+ if (fragments != null) {
Modified: vmkit/branches/incinerator/incinerator/osgi/src/j3/vm/OSGi.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/osgi/src/j3/vm/OSGi.java?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/incinerator/osgi/src/j3/vm/OSGi.java (original)
+++ vmkit/branches/incinerator/incinerator/osgi/src/j3/vm/OSGi.java Mon Jul 22 10:45:34 2013
@@ -3,7 +3,7 @@ package j3.vm;
public class OSGi
{
// OSGi hooks and information gathering
- public static native void associateBundleClass(long bundleID, Class classObject);
+ public static native void setBundleClassLoader(long bundleID, ClassLoader loaderObject);
public static native void notifyBundleUninstalled(long bundleID);
// Commands
Modified: vmkit/branches/incinerator/include/j3/J3Intrinsics.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/j3/J3Intrinsics.h?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/include/j3/J3Intrinsics.h (original)
+++ vmkit/branches/incinerator/include/j3/J3Intrinsics.h Mon Jul 22 10:45:34 2013
@@ -127,10 +127,10 @@ public:
llvm::Constant* OffsetDoYieldInThreadConstant;
llvm::Constant* OffsetIsolateIDInThreadConstant;
llvm::Constant* OffsetVMInThreadConstant;
- llvm::Constant* OffsetThreadInMutatorThreadConstant;
+ llvm::Constant* OffsetThreadInMutatorThreadConstant;
llvm::Constant* OffsetJNIInJavaThreadConstant;
llvm::Constant* OffsetJavaExceptionInJavaThreadConstant;
-
+
llvm::Constant* OffsetClassInVTConstant;
llvm::Constant* OffsetDepthInVTConstant;
llvm::Constant* OffsetDisplayInVTConstant;
Modified: vmkit/branches/incinerator/include/j3/JavaAOTCompiler.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/j3/JavaAOTCompiler.h?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/include/j3/JavaAOTCompiler.h (original)
+++ vmkit/branches/incinerator/include/j3/JavaAOTCompiler.h Mon Jul 22 10:45:34 2013
@@ -28,7 +28,8 @@ using vmkit::UTF8;
class JavaAOTCompiler : public JavaLLVMCompiler {
public:
- JavaAOTCompiler(const std::string &ModuleID);
+ JavaAOTCompiler(
+ const std::string &ModuleID, bool compiling_garbage_collector = false);
virtual bool isStaticCompiling() {
return true;
@@ -38,8 +39,10 @@ public:
return true;
}
- virtual JavaCompiler* Create(const std::string& ModuleID) {
- return new JavaAOTCompiler(ModuleID);
+ virtual JavaCompiler* Create(
+ const std::string& ModuleID, bool compiling_garbage_collector = false)
+ {
+ return new JavaAOTCompiler(ModuleID, compiling_garbage_collector);
}
virtual void* materializeFunction(JavaMethod* meth, Class* customizeFor) {
Modified: vmkit/branches/incinerator/include/j3/JavaCompiler.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/j3/JavaCompiler.h?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/include/j3/JavaCompiler.h (original)
+++ vmkit/branches/incinerator/include/j3/JavaCompiler.h Mon Jul 22 10:45:34 2013
@@ -35,8 +35,14 @@ class JavaCompiler {
public:
vmkit::BumpPtrAllocator allocator;
+ bool compilingGarbageCollector;
- virtual JavaCompiler* Create(const std::string&) {
+ JavaCompiler(bool compiling_garbage_collector = false) :
+ compilingGarbageCollector(compiling_garbage_collector) {}
+
+ virtual JavaCompiler* Create(
+ const std::string&, bool compiling_garbage_collector = false)
+ {
return this;
}
@@ -50,6 +56,10 @@ public:
return false;
}
+ virtual bool isCompilingGarbageCollector() {
+ return compilingGarbageCollector;
+ }
+
virtual bool emitFunctionName() {
return false;
}
Modified: vmkit/branches/incinerator/include/j3/JavaJITCompiler.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/j3/JavaJITCompiler.h?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/include/j3/JavaJITCompiler.h (original)
+++ vmkit/branches/incinerator/include/j3/JavaJITCompiler.h Mon Jul 22 10:45:34 2013
@@ -41,7 +41,8 @@ public:
llvm::ExecutionEngine* executionEngine;
llvm::GCModuleInfo* GCInfo;
- JavaJITCompiler(const std::string &ModuleID);
+ JavaJITCompiler(
+ const std::string &ModuleID, bool compiling_garbage_collector = false);
~JavaJITCompiler();
virtual bool isStaticCompiling() {
@@ -79,7 +80,8 @@ public:
bool stat, llvm::BasicBlock* insert) = 0;
virtual word_t getPointerOrStub(JavaMethod& meth, int type) = 0;
- static JavaJITCompiler* CreateCompiler(const std::string& ModuleID);
+ static JavaJITCompiler* CreateCompiler(
+ const std::string& ModuleID, bool compiling_garbage_collector = false);
};
class JavaJ3LazyJITCompiler : public JavaJITCompiler {
@@ -89,11 +91,14 @@ public:
bool stat, llvm::BasicBlock* insert);
virtual word_t getPointerOrStub(JavaMethod& meth, int side);
- virtual JavaCompiler* Create(const std::string& ModuleID) {
- return new JavaJ3LazyJITCompiler(ModuleID);
+ virtual JavaCompiler* Create(
+ const std::string& ModuleID, bool compiling_garbage_collector = false)
+ {
+ return new JavaJ3LazyJITCompiler(ModuleID, compiling_garbage_collector);
}
- JavaJ3LazyJITCompiler(const std::string& ModuleID);
+ JavaJ3LazyJITCompiler(
+ const std::string& ModuleID, bool compiling_garbage_collector = false);
};
} // end namespace j3
Modified: vmkit/branches/incinerator/include/j3/JavaLLVMCompiler.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/j3/JavaLLVMCompiler.h?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/include/j3/JavaLLVMCompiler.h (original)
+++ vmkit/branches/incinerator/include/j3/JavaLLVMCompiler.h Mon Jul 22 10:45:34 2013
@@ -84,7 +84,8 @@ private:
llvm::DenseMap<llvm::FunctionType*, llvm::Function*> staticAPs;
public:
- JavaLLVMCompiler(const std::string &ModuleID);
+ JavaLLVMCompiler(
+ const std::string &ModuleID, bool compiling_garbage_collector = false);
virtual bool isStaticCompiling() = 0;
virtual bool emitFunctionName() = 0;
@@ -123,7 +124,7 @@ public:
cooperativeGC = false;
}
- virtual JavaCompiler* Create(const std::string& ModuleID) = 0;
+ virtual JavaCompiler* Create(const std::string& ModuleID, bool compiling_garbage_collector = false) = 0;
virtual ~JavaLLVMCompiler();
Modified: vmkit/branches/incinerator/include/vmkit/GC.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/vmkit/GC.h?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/include/vmkit/GC.h (original)
+++ vmkit/branches/incinerator/include/vmkit/GC.h Mon Jul 22 10:45:34 2013
@@ -24,7 +24,6 @@ public:
};
class gcRoot {
- private:
public:
word_t& header(){return toHeader()->_header; }
inline gcHeader* toHeader() { return (gcHeader*)((uintptr_t)this - gcHeader::hiddenHeaderSize()); }
Modified: vmkit/branches/incinerator/include/vmkit/System.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/vmkit/System.h?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/include/vmkit/System.h (original)
+++ vmkit/branches/incinerator/include/vmkit/System.h Mon Jul 22 10:45:34 2013
@@ -17,7 +17,6 @@
#include <stdint.h>
#include <unistd.h>
-
#if defined(__linux__) || defined(__FreeBSD__)
#define LINUX_OS 1
#elif defined(__APPLE__)
@@ -93,7 +92,7 @@ const word_t kVmkitThreadMask = 0xF00000
const word_t kGCMemoryStart = 0x50000000;
#endif
-const word_t kGCMemorySize = 0x30000000;
+const word_t kGCMemorySize = 0x30000000;
#define TRY { vmkit::ExceptionBuffer __buffer__; if (!SETJMP(__buffer__.buffer))
#define CATCH else
Modified: vmkit/branches/incinerator/lib/j3/Compiler/J3Intrinsics.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/Compiler/J3Intrinsics.cpp?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/lib/j3/Compiler/J3Intrinsics.cpp (original)
+++ vmkit/branches/incinerator/lib/j3/Compiler/J3Intrinsics.cpp Mon Jul 22 10:45:34 2013
@@ -162,10 +162,10 @@ void J3Intrinsics::init(llvm::Module* mo
OffsetIsolateIDInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 1);
OffsetVMInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 2);
OffsetDoYieldInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 4);
- OffsetThreadInMutatorThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 0);
+ OffsetThreadInMutatorThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 0);
OffsetJNIInJavaThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 1);
OffsetJavaExceptionInJavaThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 2);
-
+
ClassReadyConstant = ConstantInt::get(Type::getInt8Ty(Context), ready);
InterfaceLookupFunction = module->getFunction("j3InterfaceLookup");
Modified: vmkit/branches/incinerator/lib/j3/Compiler/JavaAOTCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/Compiler/JavaAOTCompiler.cpp?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/lib/j3/Compiler/JavaAOTCompiler.cpp (original)
+++ vmkit/branches/incinerator/lib/j3/Compiler/JavaAOTCompiler.cpp Mon Jul 22 10:45:34 2013
@@ -1832,8 +1832,9 @@ Constant* JavaAOTCompiler::CreateConstan
return Array;
}
-JavaAOTCompiler::JavaAOTCompiler(const std::string& ModuleID) :
- JavaLLVMCompiler(ModuleID) {
+JavaAOTCompiler::JavaAOTCompiler(
+ const std::string& ModuleID, bool compiling_garbage_collector) :
+ JavaLLVMCompiler(ModuleID, compiling_garbage_collector) {
std::string Error;
const Target* TheTarget(TargetRegistry::lookupTarget(
Modified: vmkit/branches/incinerator/lib/j3/Compiler/JavaJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/Compiler/JavaJIT.cpp?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/lib/j3/Compiler/JavaJIT.cpp (original)
+++ vmkit/branches/incinerator/lib/j3/Compiler/JavaJIT.cpp Mon Jul 22 10:45:34 2013
@@ -81,10 +81,10 @@ void JavaJIT::checkYieldPoint() {
if (!TheCompiler->useCooperativeGC()) return;
Value* YieldPtr = getDoYieldPtr(getMutatorThreadPtr());
- Value* Yield = new LoadInst(YieldPtr, "", currentBlock);
+ Value* Yield = new LoadInst(YieldPtr, "yield", currentBlock);
- BasicBlock* continueBlock = createBasicBlock("After safe point");
- BasicBlock* yieldBlock = createBasicBlock("In safe point");
+ BasicBlock* continueBlock = createBasicBlock("afterSafePoint");
+ BasicBlock* yieldBlock = createBasicBlock("inSafePoint");
BranchInst::Create(yieldBlock, continueBlock, Yield, currentBlock);
currentBlock = yieldBlock;
@@ -1140,7 +1140,7 @@ llvm::Function* JavaJIT::javaCompile() {
jmpBuffer = new AllocaInst(ArrayType::get(Type::getInt8Ty(*llvmContext), sizeof(vmkit::ExceptionBuffer)), "", currentBlock);
jmpBuffer = new BitCastInst(jmpBuffer, intrinsics->ptrType, "exceptionSavePoint", currentBlock);
}
-
+
reader.cursor = start;
exploreOpcodes(reader, codeLen);
@@ -1213,7 +1213,7 @@ llvm::Function* JavaJIT::javaCompile() {
if (returnValue != NULL) {
new StoreInst(endNode, returnValue, currentBlock);
}
-
+
if (isSynchro(compilingMethod->access)) {
endSynchronize();
}
@@ -1680,7 +1680,7 @@ void JavaJIT::invokeSpecial(uint16 index
} else {
val = invoke(func, args, "", currentBlock);
}
-
+
Type* retType = virtualType->getReturnType();
if (retType != Type::getVoidTy(*llvmContext)) {
if (retType == intrinsics->JavaObjectType) {
Modified: vmkit/branches/incinerator/lib/j3/Compiler/JavaJITCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/Compiler/JavaJITCompiler.cpp?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/lib/j3/Compiler/JavaJITCompiler.cpp (original)
+++ vmkit/branches/incinerator/lib/j3/Compiler/JavaJITCompiler.cpp Mon Jul 22 10:45:34 2013
@@ -152,8 +152,9 @@ Constant* JavaJITCompiler::getNativeFunc
return ConstantExpr::getIntToPtr(CI, valPtrType);
}
-JavaJITCompiler::JavaJITCompiler(const std::string &ModuleID) :
- JavaLLVMCompiler(ModuleID), listener(this) {
+JavaJITCompiler::JavaJITCompiler(
+ const std::string &ModuleID, bool compiling_garbage_collector) :
+ JavaLLVMCompiler(ModuleID, compiling_garbage_collector), listener(this) {
EmitFunctionName = false;
GCInfo = NULL;
@@ -440,10 +441,13 @@ bool JavaJ3LazyJITCompiler::needsCallbac
getMethod(meth, customizeFor)->hasExternalWeakLinkage());
}
-JavaJ3LazyJITCompiler::JavaJ3LazyJITCompiler(const std::string& ModuleID)
- : JavaJITCompiler(ModuleID) {}
+JavaJ3LazyJITCompiler::JavaJ3LazyJITCompiler(
+ const std::string& ModuleID, bool compiling_garbage_collector) :
+ JavaJITCompiler(ModuleID, compiling_garbage_collector) {}
-JavaJITCompiler* JavaJITCompiler::CreateCompiler(const std::string& ModuleID) {
- return new JavaJ3LazyJITCompiler(ModuleID);
+JavaJITCompiler* JavaJITCompiler::CreateCompiler(
+ const std::string& ModuleID, bool compiling_garbage_collector)
+{
+ return new JavaJ3LazyJITCompiler(ModuleID, compiling_garbage_collector);
}
Modified: vmkit/branches/incinerator/lib/j3/Compiler/JavaLLVMCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/Compiler/JavaLLVMCompiler.cpp?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/lib/j3/Compiler/JavaLLVMCompiler.cpp (original)
+++ vmkit/branches/incinerator/lib/j3/Compiler/JavaLLVMCompiler.cpp Mon Jul 22 10:45:34 2013
@@ -25,7 +25,9 @@ using namespace llvm;
namespace j3 {
-JavaLLVMCompiler::JavaLLVMCompiler(const std::string& str) :
+JavaLLVMCompiler::JavaLLVMCompiler(
+ const std::string& str, bool compiling_garbage_collector) :
+ JavaCompiler(compiling_garbage_collector),
TheModule(new llvm::Module(str, *(new LLVMContext()))),
DebugFactory(new DIBuilder(*TheModule)) {
Modified: vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp (original)
+++ vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp Mon Jul 22 10:45:34 2013
@@ -1,10 +1,13 @@
+#include "Incinerator.h"
+
#include "VmkitGC.h"
#include "Jnjvm.h"
+#include "JnjvmClassLoader.h"
+#include "JavaThread.h"
+#include "JavaClass.h"
#include "VMStaticInstance.h"
-#include "JavaReferenceQueue.h"
-#include <sstream>
#include <algorithm>
#if RESET_STALE_REFERENCES
@@ -37,12 +40,9 @@ Incinerator* Incinerator::get()
void Incinerator::dumpClassLoaderBundles() const
{
- vmkit::LockGuard lg(bundleClassLoadersLock);
- bundleClassLoadersType::const_iterator
- i = bundleClassLoaders.begin(), e = bundleClassLoaders.end();
+ vm->osgi_gateway.dumpClassLoaderBundles();
- for (; i != e; ++i)
- cerr << "bundleID=" << i->first << " classLoader=" << i->second << endl;
+ vmkit::LockGuard lg(lock);
staleBundleClassLoadersType::const_iterator
si = staleBundleClassLoaders.begin(), se = staleBundleClassLoaders.end();
@@ -56,9 +56,9 @@ void Incinerator::dumpClassLoaderBundles
}
}
-void Incinerator::setBundleStaleReferenceCorrected(int64_t bundleID, bool corrected)
+void Incinerator::setBundleStaleReferenceCorrected(OSGiGateway::bundle_id_t bundleID, bool corrected)
{
- JnjvmClassLoader * loader = this->getBundleClassLoader(bundleID);
+ JnjvmClassLoader * loader = vm->osgi_gateway.getBundleClassLoader(bundleID);
if (!loader) {
vm->illegalArgumentException("Invalid bundle ID"); return;}
@@ -73,32 +73,15 @@ void Incinerator::setBundleStaleReferenc
loader->setStaleReferencesCorrectionEnabled(corrected);
}
-bool Incinerator::isBundleStaleReferenceCorrected(int64_t bundleID) const
+bool Incinerator::isBundleStaleReferenceCorrected(OSGiGateway::bundle_id_t bundleID) const
{
- JnjvmClassLoader const* loader = this->getBundleClassLoader(bundleID);
+ JnjvmClassLoader const* loader = vm->osgi_gateway.getBundleClassLoader(bundleID);
if (!loader) {
vm->illegalArgumentException("Invalid bundle ID"); return false;}
return loader->isStaleReferencesCorrectionEnabled();
}
-JnjvmClassLoader * Incinerator::getBundleClassLoader(int64_t bundleID) const
-{
- if (bundleID == -1) return NULL;
-
- vmkit::LockGuard lg(bundleClassLoadersLock);
-
- bundleClassLoadersType::const_iterator
- i = bundleClassLoaders.find(bundleID), e = bundleClassLoaders.end();
- return (i == e) ? NULL : i->second;
-}
-
-bool Incinerator::InstalledBundles_finder::operator() (
- const bundleClassLoadersType::value_type& pair) const
-{
- return (loader == pair.second);
-}
-
bool Incinerator::UninstalledBundles_finder::operator() (
const staleBundleClassLoadersType::value_type& pair) const
{
@@ -109,18 +92,14 @@ bool Incinerator::UninstalledBundles_fin
return (i != e);
}
-int64_t Incinerator::getClassLoaderBundleID(JnjvmClassLoader const * loader) const
+OSGiGateway::bundle_id_t Incinerator::getClassLoaderBundleID(JnjvmClassLoader const * loader) const
{
- if (loader == NULL) return -1;
- vmkit::LockGuard lg(bundleClassLoadersLock);
+ if (loader == NULL) return OSGiGateway::invalidBundleID;
- bundleClassLoadersType::const_iterator
- b = bundleClassLoaders.begin(),
- e = bundleClassLoaders.end();
- bundleClassLoadersType::const_iterator
- i = find_if(b, e, InstalledBundles_finder(loader));
+ OSGiGateway::bundle_id_t r = vm->osgi_gateway.getClassLoaderBundleID(loader);
+ if (r != OSGiGateway::invalidBundleID) return r;
- if (i != e) return i->first;
+ vmkit::LockGuard lg(lock);
// Look up in stale bundles list
staleBundleClassLoadersType::const_iterator
@@ -129,61 +108,41 @@ int64_t Incinerator::getClassLoaderBundl
staleBundleClassLoadersType::const_iterator
si = find_if(sb, se, UninstalledBundles_finder(loader));
- return (si == se) ? -1 : si->first;
+ return (si == se) ? OSGiGateway::invalidBundleID : si->first;
}
// Link a bundle ID (OSGi world) to a class loader (Java world).
-void Incinerator::setBundleClassLoader(int64_t bundleID, JnjvmClassLoader* loader)
+void Incinerator::setBundleClassLoader(OSGiGateway::bundle_id_t bundleID, JnjvmClassLoader* loader)
{
- if (bundleID == -1) return;
- vmkit::LockGuard lg(bundleClassLoadersLock);
-
- JnjvmClassLoader * previous_loader = bundleClassLoaders[bundleID];
+ if (bundleID == OSGiGateway::invalidBundleID) return;
- if (!loader) {
- // Unloaded bundle
- bundleClassLoaders.erase(bundleID);
+ JnjvmClassLoader * previous_loader =
+ vm->osgi_gateway.getBundleClassLoader(bundleID);
-#if DEBUG_VERBOSE_STALE_REF
- cerr << "Bundle uninstalled: bundleID=" << bundleID
- << " classLoader=" << previous_loader << endl;
-#endif
- } else {
- // Installed/Updated bundle
- if (previous_loader == loader)
- return; // Same class loader already associated with the bundle, do nothing
+ bool bundleUpdated =
+ (previous_loader != NULL) && (loader != NULL) &&
+ (previous_loader != loader);
- // Associate the class loader with the bundle
- bundleClassLoaders[bundleID] = loader;
+ vmkit::LockGuard lg(lock);
+ if (bundleUpdated) {
// Propagate the stale reference correction setting to the new
// class loader if a previous one exists.
- if (previous_loader != NULL) {
- loader->setStaleReferencesCorrectionEnabled(
- previous_loader->isStaleReferencesCorrectionEnabled());
- }
-
-#if DEBUG_VERBOSE_STALE_REF
- if (!previous_loader) {
- cerr << "Bundle installed: bundleID=" << bundleID
- << " classLoader=" << loader << endl;
- } else {
- cerr << "Bundle updated: bundleID=" << bundleID
- << " classLoader=" << loader
- << " previousClassLoader=" << previous_loader << endl;
- }
-#endif
+ loader->setStaleReferencesCorrectionEnabled(
+ previous_loader->isStaleReferencesCorrectionEnabled());
}
- if (!previous_loader)
- return; // No previous class loader, nothing to clean up
+ // Either bundle uninstalled, or bundle updated with a different class loader
+ if (bundleUpdated || ((previous_loader != NULL) && !loader)) {
+ // Mark the previous class loader as stale
+ staleBundleClassLoaders[bundleID].push_front(previous_loader);
+ previous_loader->markStale(true);
- // Mark the previous class loader as stale
- staleBundleClassLoaders[bundleID].push_front(previous_loader);
- previous_loader->markStale(true);
+ // Enable stale references scanning
+ setScanningInclusive();
+ }
- // Enable stale references scanning
- setScanningInclusive();
+ vm->osgi_gateway.setBundleClassLoader(bundleID, loader);
}
IncineratorManagedClassLoader::~IncineratorManagedClassLoader()
@@ -194,8 +153,8 @@ IncineratorManagedClassLoader::~Incinera
void Incinerator::classLoaderUnloaded(JnjvmClassLoader const * loader)
{
- int64_t bundleID = getClassLoaderBundleID(loader);
- if (bundleID == -1) {
+ OSGiGateway::bundle_id_t bundleID = getClassLoaderBundleID(loader);
+ if (bundleID == OSGiGateway::invalidBundleID) {
#if DEBUG_VERBOSE_STALE_REF
cerr << "Class loader unloaded: " << loader << endl;
#endif
@@ -455,4 +414,34 @@ void Incinerator::eliminateStaleRef(cons
}
+extern "C" void Java_j3_vm_OSGi_setBundleStaleReferenceCorrected(jlong bundleID, jboolean corrected)
+{
+#if RESET_STALE_REFERENCES
+ j3::Incinerator::get()->setBundleStaleReferenceCorrected(bundleID, corrected);
+#endif
+}
+
+extern "C" jboolean Java_j3_vm_OSGi_isBundleStaleReferenceCorrected(jlong bundleID)
+{
+#if RESET_STALE_REFERENCES
+ return j3::Incinerator::get()->isBundleStaleReferenceCorrected(bundleID);
+#else
+ return false;
+#endif
+}
+
+extern "C" void Java_j3_vm_OSGi_dumpReferencesToObject(jlong obj)
+{
+#if RESET_STALE_REFERENCES
+ j3::Incinerator::get()->dumpReferencesToObject(reinterpret_cast<j3::JavaObject*>(obj));
+#endif
+}
+
+extern "C" void Java_j3_vm_OSGi_forceStaleReferenceScanning()
+{
+#if RESET_STALE_REFERENCES
+ j3::Incinerator::get()->forceStaleReferenceScanning();
+#endif
+}
+
#endif
Modified: vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h (original)
+++ vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h Mon Jul 22 10:45:34 2013
@@ -2,11 +2,12 @@
#ifndef INCINERATOR_H
#define INCINERATOR_H
+#include "OSGiGateway.h"
#include "vmkit/Locks.h"
+#include "j3/jni.h"
-#include <list>
#include <map>
-#include <set>
+#include <list>
#include <vector>
#include <stdint.h>
@@ -26,15 +27,14 @@ public:
Incinerator(j3::Jnjvm* j3vm);
virtual ~Incinerator();
- void setBundleStaleReferenceCorrected(int64_t bundleID, bool corrected);
- bool isBundleStaleReferenceCorrected(int64_t bundleID) const;
+ void setBundleStaleReferenceCorrected(OSGiGateway::bundle_id_t bundleID, bool corrected);
+ bool isBundleStaleReferenceCorrected(OSGiGateway::bundle_id_t bundleID) const;
void dumpClassLoaderBundles() const;
void dumpReferencesToObject(JavaObject* object) const;
void forceStaleReferenceScanning();
- JnjvmClassLoader * getBundleClassLoader(int64_t bundleID) const;
- int64_t getClassLoaderBundleID(JnjvmClassLoader const * loader) const;
- void setBundleClassLoader(int64_t bundleID, JnjvmClassLoader* loader);
+ OSGiGateway::bundle_id_t getClassLoaderBundleID(JnjvmClassLoader const * loader) const;
+ void setBundleClassLoader(OSGiGateway::bundle_id_t bundleID, JnjvmClassLoader* loader);
void beforeCollection();
void markingFinalizersDone();
@@ -53,9 +53,8 @@ public:
volatile scanStackRefFunc scanStackRef;
protected:
- typedef std::map<int64_t, std::list<JnjvmClassLoader const *> >
+ typedef std::map<OSGiGateway::bundle_id_t, std::list<JnjvmClassLoader const *> >
staleBundleClassLoadersType;
- typedef std::map<int64_t, JnjvmClassLoader *> bundleClassLoadersType;
typedef std::map<JavaObject**, const JavaObject*>
StaleRefListType; // (ref, source)
@@ -81,13 +80,6 @@ protected:
static bool scanStackRef_Exclusive(
Incinerator& incinerator, const JavaMethod* method, JavaObject** ref);
- class InstalledBundles_finder {
- JnjvmClassLoader const * loader;
- public:
- InstalledBundles_finder(JnjvmClassLoader const * l) : loader(l) {}
- bool operator() (const bundleClassLoadersType::value_type& pair) const;
- };
-
class UninstalledBundles_finder {
JnjvmClassLoader const * loader;
public:
@@ -98,8 +90,7 @@ protected:
j3::Jnjvm* vm;
- mutable vmkit::LockRecursive bundleClassLoadersLock;
- bundleClassLoadersType bundleClassLoaders;
+ mutable vmkit::LockRecursive lock;
staleBundleClassLoadersType staleBundleClassLoaders;
StaleRefListType staleRefList;
@@ -109,7 +100,6 @@ protected:
std::vector<const JavaObject*> foundReferencerObjects;
};
-
class IncineratorManagedClassLoader
{
protected:
@@ -142,4 +132,9 @@ public:
}
+extern "C" void Java_j3_vm_OSGi_setBundleStaleReferenceCorrected(jlong bundleID, jboolean corrected);
+extern "C" jboolean Java_j3_vm_OSGi_isBundleStaleReferenceCorrected(jlong bundleID);
+extern "C" void Java_j3_vm_OSGi_dumpReferencesToObject(jlong obj);
+extern "C" void Java_j3_vm_OSGi_forceStaleReferenceScanning();
+
#endif
Removed: vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp?rev=186829&view=auto
==============================================================================
--- vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp (original)
+++ vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp (removed)
@@ -1,80 +0,0 @@
-
-#include "Incinerator.h"
-#include "ClasspathReflect.h"
-#include "j3/jni.h"
-
-
-using namespace j3;
-
-/*
- This Java native method must be called by the framework in order to link bundles (given
- by bundle identifiers) to objects (thus, class loaders). This allows the VM to perform
- operations on bundles without actually having to know the precise structure of these.
-*/
-extern "C" void Java_j3_vm_OSGi_associateBundleClass(jlong bundleID, JavaObjectClass* classObject)
-{
- llvm_gcroot(classObject, 0);
-
-#if RESET_STALE_REFERENCES
-
- CommonClass* ccl = JavaObjectClass::getClass(classObject);
- Incinerator::get()->setBundleClassLoader(bundleID, ccl->classLoader);
-
-#endif
-}
-
-extern "C" void Java_j3_vm_OSGi_notifyBundleUninstalled(jlong bundleID)
-{
-#if RESET_STALE_REFERENCES
-
- Incinerator::get()->setBundleClassLoader(bundleID, NULL);
-
-#endif
-}
-
-extern "C" void Java_j3_vm_OSGi_setBundleStaleReferenceCorrected(jlong bundleID, jboolean corrected)
-{
-#if RESET_STALE_REFERENCES
-
- Incinerator::get()->setBundleStaleReferenceCorrected(bundleID, corrected);
-
-#endif
-}
-
-extern "C" jboolean Java_j3_vm_OSGi_isBundleStaleReferenceCorrected(jlong bundleID)
-{
-#if RESET_STALE_REFERENCES
-
- return Incinerator::get()->isBundleStaleReferenceCorrected(bundleID);
-
-#else
- return false;
-#endif
-}
-
-extern "C" void Java_j3_vm_OSGi_dumpClassLoaderBundles()
-{
-#if RESET_STALE_REFERENCES
-
- Incinerator::get()->dumpClassLoaderBundles();
-
-#endif
-}
-
-extern "C" void Java_j3_vm_OSGi_dumpReferencesToObject(jlong obj)
-{
-#if RESET_STALE_REFERENCES
-
- Incinerator::get()->dumpReferencesToObject(reinterpret_cast<JavaObject*>(obj));
-
-#endif
-}
-
-extern "C" void Java_j3_vm_OSGi_forceStaleReferenceScanning()
-{
-#if RESET_STALE_REFERENCES
-
- Incinerator::get()->forceStaleReferenceScanning();
-
-#endif
-}
Modified: vmkit/branches/incinerator/lib/j3/VMCore/JavaClass.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/JavaClass.h?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/lib/j3/VMCore/JavaClass.h (original)
+++ vmkit/branches/incinerator/lib/j3/VMCore/JavaClass.h Mon Jul 22 10:45:34 2013
@@ -1009,7 +1009,6 @@ public:
/// with the given class loader.
///
JavaObject* getReturnType(JnjvmClassLoader* loader);
-
//===----------------------------------------------------------------------===//
//
@@ -1046,7 +1045,6 @@ private:
template<class TYPE, class FUNC_TYPE_VIRTUAL_BUF>
TYPE invokeVirtualBuf(Jnjvm* vm, UserClass* cl, JavaObject* obj, void* buf) __attribute__((noinline)) {
llvm_gcroot(obj, 0);
- verifyNull(obj);
UserCommonClass* theClass = JavaObject::getClass(obj);
UserClass* objCl = theClass->isArray() ? theClass->super : theClass->asClass();
Modified: vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp (original)
+++ vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp Mon Jul 22 10:45:34 2013
@@ -1354,7 +1354,6 @@ Jnjvm::Jnjvm(vmkit::BumpPtrAllocator& Al
, incinerator(this)
#endif
{
-
classpath = getenv("CLASSPATH");
if (classpath == NULL) classpath = ".";
Modified: vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.h?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.h (original)
+++ vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.h Mon Jul 22 10:45:34 2013
@@ -23,6 +23,7 @@
#include "JNIReferences.h"
#include "LockedMap.h"
#include "Incinerator.h"
+#include "OSGiGateway.h"
namespace j3 {
@@ -363,6 +364,8 @@ public:
static void printBacktrace() __attribute__((noinline));
+ OSGiGateway osgi_gateway;
+
#if RESET_STALE_REFERENCES
public:
Incinerator incinerator;
Modified: vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.cpp?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.cpp (original)
+++ vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.cpp Mon Jul 22 10:45:34 2013
@@ -44,6 +44,8 @@
#include "Reader.h"
#include "Zip.h"
+#include "OSGiGateway.h"
+#include "Incinerator.h"
using namespace j3;
using namespace std;
@@ -217,15 +219,17 @@ JnjvmClassLoader::JnjvmClassLoader(vmkit
{
}
-JnjvmClassLoader::JnjvmClassLoader(vmkit::BumpPtrAllocator& Alloc,
- JnjvmClassLoader& JCL, JavaObject* loader,
- VMClassLoader* vmdata,
- Jnjvm* VM) : allocator(Alloc)
+JnjvmClassLoader::JnjvmClassLoader(
+ vmkit::BumpPtrAllocator& Alloc, JnjvmClassLoader& JCL, JavaObject* loader,
+ VMClassLoader* vmdata, Jnjvm* VM) :
+ allocator(Alloc)
{
llvm_gcroot(loader, 0);
llvm_gcroot(vmdata, 0);
bootstrapLoader = JCL.bootstrapLoader;
- TheCompiler = bootstrapLoader->getCompiler()->Create("Applicative loader");
+ TheCompiler = bootstrapLoader->getCompiler()->Create(
+ "Applicative loader",
+ bootstrapLoader->getCompiler()->isCompilingGarbageCollector());
hashUTF8 = new(allocator, "UTF8Map") UTF8Map(allocator);
classes = new(allocator, "ClassMap") ClassMap();
@@ -809,6 +813,21 @@ Signdef* JnjvmClassLoader::constructSign
return res;
}
+JnjvmClassLoader* JnjvmClassLoader::createForJavaObject(
+ Jnjvm* vm, JavaObject* loader, VMClassLoader**vmdata)
+{
+ llvm_gcroot(loader, 0);
+
+ *vmdata = VMClassLoader::allocate();
+ vmkit::BumpPtrAllocator* A = new vmkit::BumpPtrAllocator();
+
+ JnjvmClassLoader* JCL = new(*A, "Class loader")
+ JnjvmClassLoader(*A, *vm->bootstrapLoader, loader, *vmdata, vm);
+
+ Classpath* upcalls = vm->bootstrapLoader->upcalls;
+ upcalls->vmdataClassLoader->setInstanceObjectField(loader, *vmdata);
+ return JCL;
+}
JnjvmClassLoader*
JnjvmClassLoader::getJnjvmLoaderFromJavaObject(JavaObject* loader, Jnjvm* vm) {
@@ -834,29 +853,23 @@ JnjvmClassLoader::getJnjvmLoaderFromJava
vmdata =
(VMClassLoader*)(upcalls->vmdataClassLoader->getInstanceObjectField(loader));
if (!vmdata || !VMClassLoader::isVMClassLoader(vmdata)) {
- vmdata = VMClassLoader::allocate();
- vmkit::BumpPtrAllocator* A = new vmkit::BumpPtrAllocator();
- JCL = new(*A, "Class loader") JnjvmClassLoader(*A, *vm->bootstrapLoader,
- loader, vmdata, vm);
- upcalls->vmdataClassLoader->setInstanceObjectField(loader, (JavaObject*)vmdata);
+ JCL = JnjvmClassLoader::createForJavaObject(vm, loader, &vmdata);
}
JavaObject::release(loader);
}
else if (!VMClassLoader::isVMClassLoader(vmdata)) {
JavaObject::acquire(loader);
- vmdata = VMClassLoader::allocate();
- vmkit::BumpPtrAllocator* A = new vmkit::BumpPtrAllocator();
- JCL = new(*A, "Class loader") JnjvmClassLoader(*A, *vm->bootstrapLoader,
- loader, vmdata, vm);
- upcalls->vmdataClassLoader->setInstanceObjectField(loader, (JavaObject*)vmdata);
+ JCL = JnjvmClassLoader::createForJavaObject(vm, loader, &vmdata);
JavaObject::release(loader);
} else {
JCL = vmdata->getClassLoader();
assert(JCL->javaLoader == loader);
}
+
if (!JCL) {
assert( vmdata->getClassLoader() == JCL && "Loader is not equal to stored value");
- fprintf(stderr, "Error in method %s, %d because condition 1: %d\n", __FILE__, __LINE__, (vmdata == NULL || !VMClassLoader::isVMClassLoader(vmdata)));
+ fprintf(stderr, "Error in method %s, %d because condition 1: %d\n",
+ __FILE__, __LINE__, (vmdata == NULL || !VMClassLoader::isVMClassLoader(vmdata)));
}
return JCL;
}
Modified: vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.h?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.h (original)
+++ vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.h Mon Jul 22 10:45:34 2013
@@ -26,6 +26,7 @@
#include "JnjvmConfig.h"
#include "UTF8.h"
#include "Incinerator.h"
+#include "OSGiGateway.h"
namespace j3 {
@@ -179,6 +180,8 @@ public:
/// of the given class loader.
///
static JnjvmClassLoader* getJnjvmLoaderFromJavaObject(JavaObject*, Jnjvm *vm);
+ static JnjvmClassLoader* createForJavaObject(
+ Jnjvm* vm, JavaObject* loader, VMClassLoader**vmdata);
/// getJavaClassLoader - Return the Java representation of this class loader.
///
Added: vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.cpp?rev=186830&view=auto
==============================================================================
--- vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.cpp (added)
+++ vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.cpp Mon Jul 22 10:45:34 2013
@@ -0,0 +1,136 @@
+
+#include "OSGiGateway.h"
+#include "ClasspathReflect.h"
+#include "Jnjvm.h"
+#include "Incinerator.h"
+
+#include <iostream>
+#include <algorithm>
+
+#define DEBUG_VERBOSE_OSGI_GATEWAY 0
+
+using namespace std;
+
+namespace j3 {
+
+OSGiGateway* OSGiGateway::get()
+{
+ vmkit::Thread* th = vmkit::Thread::get();
+ assert(th && "Invalid current thread.");
+ if (!th) return NULL;
+
+ return &static_cast<Jnjvm*>(th->MyVM)->osgi_gateway;
+}
+
+void OSGiGateway::dumpClassLoaderBundles() const
+{
+ vmkit::LockGuard lg(lock);
+ bundleClassLoadersType::const_iterator
+ i = bundleClassLoaders.begin(), e = bundleClassLoaders.end();
+
+ for (; i != e; ++i)
+ cerr << "bundleID=" << i->first << " classLoader=" << i->second << endl;
+}
+
+JnjvmClassLoader * OSGiGateway::getBundleClassLoader(bundle_id_t bundleID) const
+{
+ if (bundleID == invalidBundleID) return NULL;
+
+ vmkit::LockGuard lg(lock);
+
+ bundleClassLoadersType::const_iterator
+ i = bundleClassLoaders.find(bundleID), e = bundleClassLoaders.end();
+ return (i == e) ? NULL : i->second;
+}
+
+OSGiGateway::bundle_id_t OSGiGateway::getClassLoaderBundleID(
+ JnjvmClassLoader const * loader) const
+{
+ if (loader == NULL) return invalidBundleID;
+ vmkit::LockGuard lg(lock);
+
+ bundleClassLoadersType::const_iterator
+ b = bundleClassLoaders.begin(),
+ e = bundleClassLoaders.end();
+ bundleClassLoadersType::const_iterator
+ i = find_if(b, e, BundlesFinder(loader));
+
+ return (i == e) ? invalidBundleID : i->first;
+}
+
+void OSGiGateway::setBundleClassLoader(bundle_id_t bundleID, JnjvmClassLoader* loader)
+{
+ if (bundleID == invalidBundleID) return;
+ vmkit::LockGuard lg(lock);
+
+ JnjvmClassLoader * previous_loader = bundleClassLoaders[bundleID];
+
+ if (!loader) {
+ // Unloaded bundle
+ bundleClassLoaders.erase(bundleID);
+
+#if DEBUG_VERBOSE_OSGI_GATEWAY
+ cerr << "Bundle uninstalled: bundleID=" << bundleID
+ << " classLoader=" << previous_loader << endl;
+#endif
+ } else {
+ // Installed/Updated bundle
+ if (previous_loader == loader)
+ return; // Same class loader already associated with the bundle, do nothing
+
+ // Associate the class loader with the bundle
+ bundleClassLoaders[bundleID] = loader;
+
+#if DEBUG_VERBOSE_OSGI_GATEWAY
+ if (!previous_loader) {
+ cerr << "Bundle installed: bundleID=" << bundleID
+ << " classLoader=" << loader << endl;
+ } else {
+ cerr << "Bundle updated: bundleID=" << bundleID
+ << " classLoader=" << loader
+ << " previousClassLoader=" << previous_loader << endl;
+ }
+#endif
+ }
+}
+
+}
+
+extern "C" void Java_j3_vm_OSGi_setBundleClassLoader(
+ jlong bundleID, j3::JavaObject* loaderObject)
+{
+ llvm_gcroot(loaderObject, 0);
+
+ j3::Jnjvm* vm = j3::JavaThread::get()->getJVM();
+ j3::JnjvmClassLoader* loader =
+ j3::JnjvmClassLoader::getJnjvmLoaderFromJavaObject(loaderObject, vm);
+
+ assert((loader != NULL) && "Invalid class loader");
+
+#if RESET_STALE_REFERENCES
+ j3::Incinerator::get()->
+#else
+ j3::OSGiGateway::get()->
+#endif
+ setBundleClassLoader(bundleID, loader);
+}
+
+extern "C" void Java_j3_vm_OSGi_notifyBundleUninstalled(jlong bundleID)
+{
+#if RESET_STALE_REFERENCES
+ j3::Incinerator::get()->
+#else
+ j3::OSGiGateway::get()->
+#endif
+ setBundleClassLoader(bundleID, NULL);
+}
+
+extern "C" void Java_j3_vm_OSGi_dumpClassLoaderBundles()
+{
+#if RESET_STALE_REFERENCES
+ j3::Incinerator::get()->
+#else
+ j3::OSGiGateway::get()->
+#endif
+ dumpClassLoaderBundles();
+}
Propchange: vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.cpp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.h?rev=186830&view=auto
==============================================================================
--- vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.h (added)
+++ vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.h Mon Jul 22 10:45:34 2013
@@ -0,0 +1,58 @@
+
+#ifndef OSGIGATEWAY_H_
+#define OSGIGATEWAY_H_
+
+#include "vmkit/Locks.h"
+#include "j3/jni.h"
+
+#include <map>
+#include <stdint.h>
+
+namespace j3 {
+
+class JnjvmClassLoader;
+class JavaObjectClass;
+class JavaObject;
+
+class OSGiGateway
+{
+public:
+ typedef int64_t bundle_id_t;
+
+ static const bundle_id_t invalidBundleID = (bundle_id_t)-1;
+
+protected:
+ typedef std::map<bundle_id_t, j3::JnjvmClassLoader *> bundleClassLoadersType;
+
+ class BundlesFinder {
+ j3::JnjvmClassLoader const * loader;
+ public:
+ BundlesFinder(j3::JnjvmClassLoader const * l) : loader(l) {}
+ bool operator() (const bundleClassLoadersType::value_type& pair) const
+ {return (loader == pair.second);}
+ };
+
+ mutable vmkit::LockRecursive lock;
+ bundleClassLoadersType bundleClassLoaders;
+
+public:
+ OSGiGateway() {}
+ virtual ~OSGiGateway() {}
+
+ static OSGiGateway* get();
+
+ j3::JnjvmClassLoader * getBundleClassLoader(bundle_id_t bundleID) const;
+ bundle_id_t getClassLoaderBundleID(j3::JnjvmClassLoader const * loader) const;
+ void setBundleClassLoader(bundle_id_t bundleID, j3::JnjvmClassLoader* loader);
+
+ void dumpClassLoaderBundles() const;
+};
+
+}
+
+extern "C" void Java_j3_vm_OSGi_setBundleClassLoader(
+ jlong bundleID, j3::JavaObject* loaderObject);
+extern "C" void Java_j3_vm_OSGi_notifyBundleUninstalled(jlong bundleID);
+extern "C" void Java_j3_vm_OSGi_dumpClassLoaderBundles();
+
+#endif
Propchange: vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.h
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: vmkit/branches/incinerator/lib/vmkit/CommonThread/ctthread.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/vmkit/CommonThread/ctthread.cpp?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/lib/vmkit/CommonThread/ctthread.cpp (original)
+++ vmkit/branches/incinerator/lib/vmkit/CommonThread/ctthread.cpp Mon Jul 22 10:45:34 2013
@@ -282,7 +282,7 @@ public:
word_t ptr = kThreadStart;
uint32 flags = MAP_PRIVATE | MAP_ANON | MAP_FIXED;
- baseAddr = (word_t)mmap((void*)ptr, STACK_SIZE * NR_THREADS,
+ baseAddr = (word_t)mmap((void*)ptr, STACK_SIZE * NR_THREADS,
PROT_READ | PROT_WRITE, flags, -1, 0);
if (baseAddr == (word_t) MAP_FAILED) {
Modified: vmkit/branches/incinerator/tests/dacapo/2006-10-MR2/Makefile
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/2006-10-MR2/Makefile?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/tests/dacapo/2006-10-MR2/Makefile (original)
+++ vmkit/branches/incinerator/tests/dacapo/2006-10-MR2/Makefile Mon Jul 22 10:45:34 2013
@@ -1,7 +1,6 @@
LEVEL := ..
DACAPO_VERSION := 2006-10-MR2
DACAPO_ARGS := -s default
-DECAPO_BENCHMARKS := hsqldb
-# DECAPO_BENCHMARKS := antlr bloat chart eclipse fop hsqldb jython luindex lusearch pmd xalan
+DECAPO_BENCHMARKS := antlr bloat chart eclipse fop hsqldb jython luindex lusearch pmd xalan
include ../Makefile.inc
Modified: vmkit/branches/incinerator/tests/dacapo/Makefile.inc
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/Makefile.inc?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/tests/dacapo/Makefile.inc (original)
+++ vmkit/branches/incinerator/tests/dacapo/Makefile.inc Mon Jul 22 10:45:34 2013
@@ -7,10 +7,10 @@ endif
TEMP_LEVEL := ../..
RUN_BENCH := $(PWD)/$(LEVEL)/run-bench.sh
DACAPO := $(PWD)/$(LEVEL)/jars/dacapo-$(DACAPO_VERSION).jar
-TMP_DIR := $(LEVEL)/tmp
-LOG_DIR := $(LEVEL)/logs
-JVM1_PATH := $(PWD)/../$(TEMP_LEVEL)/$(LEVEL)/incinerator/$(BUILD_MODE)_NoIncinerator/bin/j3
-JVM2_PATH := $(PWD)/../$(TEMP_LEVEL)/$(LEVEL)/incinerator/$(BUILD_MODE)/bin/j3
+JVM1_PATH := $(PWD)/../$(TEMP_LEVEL)/$(LEVEL)/incinerator/$(BUILD_MODE)/bin/j3
+JVM2_PATH := $(PWD)/../$(TEMP_LEVEL)/$(LEVEL)/incinerator/$(BUILD_MODE)_NoIncinerator/bin/j3
+#WORK_DIR := $(LEVEL)
+WORK_DIR := $(HOME)/dacapo_benchmarks
ifndef ENABLE_JVM1
ENABLE_JVM1 := 1
@@ -20,11 +20,18 @@ ifndef ENABLE_JVM2
ENABLE_JVM2 := 1
endif
-all: $(VM) $(DECAPO_BENCHMARKS)
+ifndef VERBOSE
+ QUIET := @
+endif
+
+TMP_DIR := $(shell mktemp -d --suffix=.$(DACAPO_VERSION) --tmpdir=$(WORK_DIR))
+
+all: $(DECAPO_BENCHMARKS)
$(DECAPO_BENCHMARKS): $(DACAPO)
- @-$(RUN_BENCH) "$(ENABLE_JVM1)" "jvm1" "$(DACAPO_VERSION)" "$(JVM1_PATH)" "$(DACAPO)" "$(DACAPO_ARGS)" "$@"
- @-$(RUN_BENCH) "$(ENABLE_JVM2)" "jvm2" "$(DACAPO_VERSION)" "$(JVM2_PATH)" "$(DACAPO)" "$(DACAPO_ARGS)" "$@"
+ $(QUIET) mkdir -p "$(TMP_DIR)/$@" 2>/dev/null
+ $(QUIET) if [ 1 -eq $(ENABLE_JVM1) ] ; then cd "$(TMP_DIR)/$@" && "$(JVM1_PATH)" -jar "$(DACAPO)" $(DACAPO_ARGS) "$@" > "$(TMP_DIR).$@.log" 2>&1 ; else true ; fi
+ $(QUIET) if [ 1 -eq $(ENABLE_JVM2) ] ; then cd "$(TMP_DIR)/$@" && "$(JVM2_PATH)" -jar "$(DACAPO)" $(DACAPO_ARGS) "$@" > "$(TMP_DIR).$@.log" 2>&1 ; else true ; fi
clean:
- @-rm -rf "$(TMP_DIR)" "$(LOG_DIR)" 2>/dev/null
+ @-rm -rf $(WORK_DIR)/tmp.* $(WORK_DIR)/*.log 2>/dev/null
Modified: vmkit/branches/incinerator/tests/dacapo/dacapo-avg-overhead.csv
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/dacapo-avg-overhead.csv?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/tests/dacapo/dacapo-avg-overhead.csv (original)
+++ vmkit/branches/incinerator/tests/dacapo/dacapo-avg-overhead.csv Mon Jul 22 10:45:34 2013
@@ -1,12 +1,10 @@
#bench_suite,benchmark,vm,avg_overhead
-2006-10-MR2,antlr,j3,20.81
-2006-10-MR2,bloat,j3,6.44
-2006-10-MR2,chart,j3,7.42
-2006-10-MR2,eclipse,j3,-4.30
-2006-10-MR2,fop,j3,5.36
-2006-10-MR2,hsqldb,j3,7.44
-2006-10-MR2,jython,j3,2.78
-2006-10-MR2,luindex,j3,-9.91
-2006-10-MR2,lusearch,j3,-30.56
-2006-10-MR2,pmd,j3,-10.74
-2006-10-MR2,xalan,j3,9.06
+2006-10-MR2,antlr,j3,-1.55
+2006-10-MR2,bloat,j3,0.72
+2006-10-MR2,eclipse,j3,-0.24
+2006-10-MR2,fop,j3,-0.35
+2006-10-MR2,hsqldb,j3,3.25
+2006-10-MR2,jython,j3,-0.12
+2006-10-MR2,luindex,j3,2.60
+2006-10-MR2,lusearch,j3,1.86
+2006-10-MR2,xalan,j3,-0.85
Modified: vmkit/branches/incinerator/tests/dacapo/run-all.sh
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/run-all.sh?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/tests/dacapo/run-all.sh (original)
+++ vmkit/branches/incinerator/tests/dacapo/run-all.sh Mon Jul 22 10:45:34 2013
@@ -4,9 +4,13 @@
# ./run-all.sh 40 12 2006-10-MR2 'sleep $(($RANDOM / 7276))s ; echo Hello'
times=$1
-jn=$2
-dir=$3
-cmd=$4
+# jn=$2
+dir=$2
+cmd=$3
cd "$dir"
+$cmd
+
+exit
+
seq $times | parallel -n0 -j "$jn" -- $cmd
Modified: vmkit/branches/incinerator/tests/dacapo/run-bench.sh
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/run-bench.sh?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/tests/dacapo/run-bench.sh (original)
+++ vmkit/branches/incinerator/tests/dacapo/run-bench.sh Mon Jul 22 10:45:34 2013
@@ -26,7 +26,9 @@ log_file=$(mktemp --suffix=${suffix}.log
curdir=$(pwd)
cd "$scratch_dir"
-"$jvm" -jar "$jar" $vmargs "$bench_name" > $log_file 2>&1
+echo "$jvm" -jar "$jar" $vmargs "$bench_name"
+"$jvm" -jar "$jar" $vmargs "$bench_name"
+# "$jvm" -jar "$jar" $vmargs "$bench_name" > $log_file 2>&1
r=$?
cd "$curdir"
Modified: vmkit/branches/incinerator/tests/dacapo/stats-incinerator-dacapo-2006-10-MR2.csv
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/stats-incinerator-dacapo-2006-10-MR2.csv?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/tests/dacapo/stats-incinerator-dacapo-2006-10-MR2.csv (original)
+++ vmkit/branches/incinerator/tests/dacapo/stats-incinerator-dacapo-2006-10-MR2.csv Mon Jul 22 10:45:34 2013
@@ -1,12 +1,10 @@
#bench_suite,benchmark,vm,avg_duration_ms,min_duration_ms,max_duration_ms,std_dev_duration_ms
-2006-10-MR2,antlr,j3,23844.12,21628.00,30792.00,2089.37
-2006-10-MR2,bloat,j3,44784.18,41862.00,51632.00,1888.43
-2006-10-MR2,chart,j3,127983.77,93646.00,153582.00,14994.01
-2006-10-MR2,eclipse,j3,153188.67,134362.00,165685.00,6405.52
-2006-10-MR2,fop,j3,104318.48,79760.00,116871.00,9762.53
-2006-10-MR2,hsqldb,j3,31109.70,26858.00,33444.00,1640.83
-2006-10-MR2,jython,j3,57968.65,53826.00,63947.00,1865.41
-2006-10-MR2,luindex,j3,33129.62,28667.00,38861.00,2626.92
-2006-10-MR2,lusearch,j3,12023.73,9457.00,15939.00,1380.69
-2006-10-MR2,pmd,j3,39026.12,33250.00,45380.00,3067.13
-2006-10-MR2,xalan,j3,17262.50,12479.00,20394.00,2136.92
+2006-10-MR2,antlr,j3,14323.25,14114.00,14807.00,157.61
+2006-10-MR2,bloat,j3,36136.65,35377.00,36804.00,346.64
+2006-10-MR2,eclipse,j3,110993.75,108194.00,114120.00,1300.44
+2006-10-MR2,fop,j3,25823.90,25277.00,26336.00,276.04
+2006-10-MR2,hsqldb,j3,24406.10,24015.00,25004.00,334.35
+2006-10-MR2,jython,j3,38839.15,38225.00,39285.00,318.74
+2006-10-MR2,luindex,j3,29578.00,28258.00,30758.00,673.48
+2006-10-MR2,lusearch,j3,9537.80,8787.00,10618.00,520.29
+2006-10-MR2,xalan,j3,10398.80,9782.00,11546.00,534.50
Modified: vmkit/branches/incinerator/tests/dacapo/stats-j3-dacapo-2006-10-MR2.csv
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/stats-j3-dacapo-2006-10-MR2.csv?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/tests/dacapo/stats-j3-dacapo-2006-10-MR2.csv (original)
+++ vmkit/branches/incinerator/tests/dacapo/stats-j3-dacapo-2006-10-MR2.csv Mon Jul 22 10:45:34 2013
@@ -1,12 +1,10 @@
#bench_suite,benchmark,vm,avg_duration_ms,min_duration_ms,max_duration_ms,std_dev_duration_ms
-2006-10-MR2,antlr,j3,19735.97,17593.00,30859.00,2801.75
-2006-10-MR2,bloat,j3,42072.12,40035.00,47651.00,1491.42
-2006-10-MR2,chart,j3,119134.68,95089.00,140917.00,11348.92
-2006-10-MR2,eclipse,j3,160059.03,137516.00,207306.00,18388.06
-2006-10-MR2,fop,j3,99011.45,77498.00,119261.00,11201.14
-2006-10-MR2,hsqldb,j3,28953.33,26835.00,30806.00,1068.32
-2006-10-MR2,jython,j3,56398.65,52766.00,58694.00,1249.38
-2006-10-MR2,luindex,j3,36773.30,30243.00,43885.00,4531.07
-2006-10-MR2,lusearch,j3,17314.83,12121.00,27206.00,3245.44
-2006-10-MR2,pmd,j3,43720.15,37125.00,53931.00,5370.74
-2006-10-MR2,xalan,j3,15828.10,11996.00,18063.00,1656.58
+2006-10-MR2,antlr,j3,14547.90,14141.00,15454.00,401.94
+2006-10-MR2,bloat,j3,35877.90,35315.00,36286.00,249.70
+2006-10-MR2,eclipse,j3,111249.95,108443.00,113827.00,1546.82
+2006-10-MR2,fop,j3,25913.50,25523.00,26523.00,274.12
+2006-10-MR2,hsqldb,j3,23636.60,23029.00,24592.00,387.67
+2006-10-MR2,jython,j3,38885.45,38284.00,39456.00,314.49
+2006-10-MR2,luindex,j3,28826.80,27860.00,30031.00,544.18
+2006-10-MR2,lusearch,j3,9363.35,8698.00,10562.00,485.42
+2006-10-MR2,xalan,j3,10487.00,9711.00,12008.00,731.92
Modified: vmkit/branches/incinerator/tools/vmjc/vmjc.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tools/vmjc/vmjc.cpp?rev=186830&r1=186829&r2=186830&view=diff
==============================================================================
--- vmkit/branches/incinerator/tools/vmjc/vmjc.cpp (original)
+++ vmkit/branches/incinerator/tools/vmjc/vmjc.cpp Mon Jul 22 10:45:34 2013
@@ -125,7 +125,15 @@ int main(int argc, char **argv) {
vmkit::VmkitModule::initialise(argc, argv);
vmkit::Collector::initialise(argc, argv);
- JavaAOTCompiler* Comp = new JavaAOTCompiler("AOT");
+ // WARNING: This is a silly method to discover that we are compiling MMTk.
+ // Please change to anything more deterministic.
+ bool compilingMMTk = (
+ DisableExceptions &&
+ DisableCooperativeGC &&
+ DisableStubs &&
+ AssumeCompiled);
+
+ JavaAOTCompiler* Comp = new JavaAOTCompiler("AOT", compilingMMTk);
vmkit::BumpPtrAllocator allocator;
JnjvmBootstrapLoader* loader = new(allocator, "Bootstrap loader")
More information about the vmkit-commits
mailing list