[vmkit-commits] [vmkit] r59149 - in /vmkit/trunk: include/mvm/JIT.h lib/JnJVM/LLVMRuntime/runtime-default.ll lib/JnJVM/VMCore/JavaJIT.cpp lib/JnJVM/VMCore/JavaJITOpcodes.cpp lib/Mvm/Runtime/JIT.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Wed Nov 12 09:18:26 PST 2008
Author: geoffray
Date: Wed Nov 12 11:18:23 2008
New Revision: 59149
URL: http://llvm.org/viewvc/llvm-project?rev=59149&view=rev
Log:
Fix types for llvm debugging output and for thin lock operations.
Modified:
vmkit/trunk/include/mvm/JIT.h
vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll
vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp
vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp
vmkit/trunk/lib/Mvm/Runtime/JIT.cpp
Modified: vmkit/trunk/include/mvm/JIT.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/JIT.h?rev=59149&r1=59148&r2=59149&view=diff
==============================================================================
--- vmkit/trunk/include/mvm/JIT.h (original)
+++ vmkit/trunk/include/mvm/JIT.h Wed Nov 12 11:18:23 2008
@@ -162,6 +162,7 @@
static llvm::ConstantInt* constantThreadIDMask;
static llvm::ConstantInt* constantLockedMask;
static llvm::ConstantInt* constantThreadFreeMask;
+ static llvm::ConstantInt* constantPtrOne;
static const llvm::PointerType* ptrType;
static const llvm::PointerType* ptr32Type;
static const llvm::PointerType* ptrPtrType;
Modified: vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll?rev=59149&r1=59148&r2=59149&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll (original)
+++ vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll Wed Nov 12 11:18:23 2008
@@ -181,6 +181,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Debugging methods ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-declare void @printExecution(i32, i32, i32)
-declare void @printMethodStart(i32)
-declare void @printMethodEnd(i32)
+declare void @printExecution(i8*, i32, i8*)
+declare void @printMethodStart(i8*)
+declare void @printMethodEnd(i8*)
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp?rev=59149&r1=59148&r2=59149&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp Wed Nov 12 11:18:23 2008
@@ -349,7 +349,7 @@
BranchInst::Create(ThinLockBB, FatLockBB, cmp, currentBlock);
currentBlock = ThinLockBB;
- Value* increment = BinaryOperator::CreateAdd(lock, module->constantOne, "",
+ Value* increment = BinaryOperator::CreateAdd(lock, module->constantPtrOne, "",
currentBlock);
increment = new IntToPtrInst(increment, module->ptrType, "", currentBlock);
new StoreInst(increment, lockPtr, false, currentBlock);
@@ -394,7 +394,7 @@
// Locked by the thread, decrement.
currentBlock = ThinLockBB;
- Value* decrement = BinaryOperator::CreateSub(lock, module->constantOne, "",
+ Value* decrement = BinaryOperator::CreateSub(lock, module->constantPtrOne, "",
currentBlock);
decrement = new IntToPtrInst(decrement, module->ptrType, "", currentBlock);
new StoreInst(decrement, lockPtr, false, currentBlock);
@@ -657,7 +657,10 @@
#if JNJVM_EXECUTE > 0
{
std::vector<llvm::Value*> args;
- args.push_back(ConstantInt::get(Type::Int32Ty, (int64_t)compilingMethod));
+ args.push_back(ConstantExpr::getIntToPtr(
+ ConstantInt::get(Type::Int64Ty, uint64_t (compilingMethod))),
+ module->ptrType);
+
llvm::CallInst::Create(module->PrintMethodStartFunction, args.begin(),
args.end(), "", currentBlock);
}
@@ -802,7 +805,9 @@
#if JNJVM_EXECUTE > 0
{
std::vector<llvm::Value*> args;
- args.push_back(ConstantInt::get(Type::Int32Ty, (int64_t)compilingMethod));
+ args.push_back(ConstantExpr::getIntToPtr(
+ ConstantInt::get(Type::Int64Ty, uint64_t (compilingMethod))),
+ module->ptrType);
llvm::CallInst::Create(module->PrintMethodEndFunction, args.begin(),
args.end(), "", currentBlock);
}
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp?rev=59149&r1=59148&r2=59149&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp Wed Nov 12 11:18:23 2008
@@ -148,10 +148,17 @@
#if JNJVM_EXECUTE > 1
{
std::vector<llvm::Value*> args;
- args.push_back(ConstantInt::get(Type::Int32Ty,
- (int64_t)OpcodeNames[bytecodes[i]]));
+ args.push_back(ConstantExpr::getIntToPtr(
+ ConstantInt::get(Type::Int64Ty, (int64_t)OpcodeNames[bytecodes[i]]),
+ module->ptrType));
+
args.push_back(ConstantInt::get(Type::Int32Ty, (int64_t)i));
- args.push_back(ConstantInt::get(Type::Int32Ty, (int64_t)compilingMethod));
+
+ args.push_back(ConstantExpr::getIntToPtr(
+ ConstantInt::get(Type::Int64Ty, (int64_t)compilingMethod),
+ module->ptrType));
+
+
CallInst::Create(module->PrintExecutionFunction, args.begin(),
args.end(), "", currentBlock);
}
Modified: vmkit/trunk/lib/Mvm/Runtime/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/JIT.cpp?rev=59149&r1=59148&r2=59149&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/Runtime/JIT.cpp (original)
+++ vmkit/trunk/lib/Mvm/Runtime/JIT.cpp Wed Nov 12 11:18:23 2008
@@ -93,7 +93,7 @@
ptrPtrType = PointerType::getUnqual(ptrType);
pointerSizeType = module.getPointerSize() == llvm::Module::Pointer32 ?
Type::Int32Ty : Type::Int64Ty;
-
+
// Constant declaration
constantLongMinusOne = ConstantInt::get(Type::Int64Ty, (uint64_t)-1);
constantLongZero = ConstantInt::get(Type::Int64Ty, 0);
@@ -133,9 +133,10 @@
constantDoubleMinusInfinity = ConstantFP::get(Type::DoubleTy, MinDouble);
constantDoubleMinusZero = ConstantFP::get(Type::DoubleTy, -0.0);
constantFloatMinusZero = ConstantFP::get(Type::FloatTy, -0.0f);
- constantThreadIDMask = ConstantInt::get(Type::Int32Ty, mvm::Thread::IDMask);
- constantLockedMask = ConstantInt::get(Type::Int32Ty, 0x7FFFFF00);
- constantThreadFreeMask = ConstantInt::get(Type::Int32Ty, 0x7FFFFFFF);
+ constantThreadIDMask = ConstantInt::get(pointerSizeType, mvm::Thread::IDMask);
+ constantLockedMask = ConstantInt::get(pointerSizeType, 0x7FFFFF00);
+ constantThreadFreeMask = ConstantInt::get(pointerSizeType, 0x7FFFFFFF);
+ constantPtrOne = ConstantInt::get(pointerSizeType, 1);
constantPtrNull = Constant::getNullValue(ptrType);
constantPtrSize = ConstantInt::get(Type::Int32Ty, sizeof(void*));
@@ -252,6 +253,7 @@
llvm::ConstantInt* MvmModule::constantThreadIDMask;
llvm::ConstantInt* MvmModule::constantLockedMask;
llvm::ConstantInt* MvmModule::constantThreadFreeMask;
+llvm::ConstantInt* MvmModule::constantPtrOne;
const llvm::PointerType* MvmModule::ptrType;
const llvm::PointerType* MvmModule::ptr32Type;
const llvm::PointerType* MvmModule::ptrPtrType;
More information about the vmkit-commits
mailing list