[vmkit-commits] [vmkit] r108702 - in /vmkit/trunk/lib/J3/Compiler: JavaJIT.cpp JavaJITCompiler.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Mon Jul 19 08:58:58 PDT 2010
Author: geoffray
Date: Mon Jul 19 10:58:58 2010
New Revision: 108702
URL: http://llvm.org/viewvc/llvm-project?rev=108702&view=rev
Log:
Don't inline a java.lang.Class object in the code, but get a pointer from the class and load it.
Also call j3PrintMethodStart after nullifying the object locals and stack.
Modified:
vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp
vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp
Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=108702&r1=108701&r2=108702&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Mon Jul 19 10:58:58 2010
@@ -729,7 +729,8 @@
if (isVirtual(compilingMethod->access)) {
obj = llvmFunction->arg_begin();
} else {
- obj = TheCompiler->getJavaClass(compilingClass);
+ obj = TheCompiler->getJavaClassPtr(compilingClass);
+ obj = new LoadInst(obj, "", false, currentBlock);
}
monitorEnter(obj);
}
@@ -739,7 +740,8 @@
if (isVirtual(compilingMethod->access)) {
obj = llvmFunction->arg_begin();
} else {
- obj = TheCompiler->getJavaClass(compilingClass);
+ obj = TheCompiler->getJavaClassPtr(compilingClass);
+ obj = new LoadInst(obj, "", false, currentBlock);
}
monitorExit(obj);
}
@@ -1030,17 +1032,6 @@
for (uint32 i = 0; i < codeLen; ++i) {
opcodeInfos[i].exceptionBlock = endExceptionBlock;
}
-
-#if JNJVM_EXECUTE > 0
- {
- Value* arg = TheCompiler->getMethodInClass(compilingMethod);
-
- llvm::CallInst::Create(intrinsics->PrintMethodStartFunction, arg, "",
- currentBlock);
- }
-#endif
-
-
for (int i = 0; i < maxLocals; i++) {
intLocals.push_back(new AllocaInst(Type::getInt32Ty(*llvmContext), "", currentBlock));
@@ -1067,6 +1058,15 @@
longStack.push_back(new AllocaInst(Type::getInt64Ty(*llvmContext), "", currentBlock));
floatStack.push_back(new AllocaInst(Type::getFloatTy(*llvmContext), "", currentBlock));
}
+
+#if JNJVM_EXECUTE > 0
+ {
+ Value* arg = TheCompiler->getMethodInClass(compilingMethod);
+
+ llvm::CallInst::Create(intrinsics->PrintMethodStartFunction, arg, "",
+ currentBlock);
+ }
+#endif
uint32 index = 0;
uint32 count = 0;
Modified: vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp?rev=108702&r1=108701&r2=108702&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp Mon Jul 19 10:58:58 2010
@@ -177,11 +177,8 @@
}
Constant* JavaJITCompiler::getJavaClass(CommonClass* cl) {
- JavaObject* obj = cl->getClassDelegatee(JavaThread::get()->getJVM());
- assert(obj && "Delegatee not created");
- Constant* CI = ConstantInt::get(Type::getInt64Ty(getLLVMContext()),
- uint64(obj));
- return ConstantExpr::getIntToPtr(CI, JavaIntrinsics.JavaObjectType);
+ fprintf(stderr, "Should not be here\n");
+ abort();
}
Constant* JavaJITCompiler::getJavaClassPtr(CommonClass* cl) {
More information about the vmkit-commits
mailing list