[vmkit-commits] [vmkit] r102305 - in /vmkit/trunk: include/j3/JavaLLVMCompiler.h lib/J3/Compiler/JavaJITCompiler.cpp lib/J3/Compiler/JavaLLVMCompiler.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Sun Apr 25 05:51:46 PDT 2010
Author: geoffray
Date: Sun Apr 25 07:51:46 2010
New Revision: 102305
URL: http://llvm.org/viewvc/llvm-project?rev=102305&view=rev
Log:
Trust system classes in Java.
Modified:
vmkit/trunk/include/j3/JavaLLVMCompiler.h
vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp
vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp
Modified: vmkit/trunk/include/j3/JavaLLVMCompiler.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/JavaLLVMCompiler.h?rev=102305&r1=102304&r2=102305&view=diff
==============================================================================
--- vmkit/trunk/include/j3/JavaLLVMCompiler.h (original)
+++ vmkit/trunk/include/j3/JavaLLVMCompiler.h Sun Apr 25 07:51:46 2010
@@ -49,7 +49,7 @@
llvm::DIFactory* DebugFactory;
J3Intrinsics JavaIntrinsics;
- void addJavaPasses();
+ void addJavaPasses(bool trusted = false);
private:
bool enabledException;
Modified: vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp?rev=102305&r1=102304&r2=102305&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp Sun Apr 25 07:51:46 2010
@@ -273,7 +273,11 @@
mvm::MvmModule::executionEngine->addModule(TheModule);
mvm::MvmModule::protectEngine.unlock();
- addJavaPasses();
+
+ // The first JIT Compiler initialises JITListener and is trusted wrt.
+ // safe points.
+ bool trusted = (JITListener == NULL);
+ addJavaPasses(trusted);
if (!JITListener) {
JITListener = new JavaJITListener();
@@ -294,7 +298,7 @@
assert(VT && "No VT was allocated!");
if (VT->init) {
- // The VT hash already been filled by the AOT compiler so there
+ // The VT has already been filled by the AOT compiler so there
// is nothing left to do!
return;
}
Modified: vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp?rev=102305&r1=102304&r2=102305&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp Sun Apr 25 07:51:46 2010
@@ -116,7 +116,7 @@
llvm::FunctionPass* createLowerConstantCallsPass(JavaLLVMCompiler* I);
}
-void JavaLLVMCompiler::addJavaPasses() {
+void JavaLLVMCompiler::addJavaPasses(bool trusted) {
JavaNativeFunctionPasses = new FunctionPassManager(TheModule);
JavaNativeFunctionPasses->add(new TargetData(TheModule));
// Lower constant calls to lower things like getClass used
@@ -124,7 +124,9 @@
JavaNativeFunctionPasses->add(createLowerConstantCallsPass(this));
JavaFunctionPasses = new FunctionPassManager(TheModule);
- if (cooperativeGC)
+ // Add safe points in loops if we don't trust the code (trusted code doesn't
+ // do infinite loops).
+ if (cooperativeGC && !trusted)
JavaFunctionPasses->add(mvm::createLoopSafePointsPass());
// Add other passes after the loop pass, because safepoints may move objects.
// Moving objects disable many optimizations.
More information about the vmkit-commits
mailing list