[vmkit-commits] [vmkit] r59302 - in /vmkit/trunk/lib/JnJVM/VMCore: JavaMetaJIT.cpp JnjvmModule.cpp NativeUtil.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Fri Nov 14 06:29:36 PST 2008
Author: geoffray
Date: Fri Nov 14 08:29:32 2008
New Revision: 59302
URL: http://llvm.org/viewvc/llvm-project?rev=59302&view=rev
Log:
64bit cleaning.
Modified:
vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp
vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp
vmkit/trunk/lib/JnJVM/VMCore/NativeUtil.cpp
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp?rev=59302&r1=59301&r2=59302&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp Fri Nov 14 08:29:32 2008
@@ -58,36 +58,28 @@
const PrimitiveTypedef* prim = (PrimitiveTypedef*)type;\
if (prim->isLong()){\
((sint64*)buf)[0] = va_arg(ap, sint64);\
- buf += 2;\
} else if (prim->isInt()){ \
((sint32*)buf)[0] = va_arg(ap, sint32);\
- buf++; \
} else if (prim->isChar()){ \
((uint32*)buf)[0] = va_arg(ap, uint32);\
- buf++; \
} else if (prim->isShort()){ \
((uint32*)buf)[0] = va_arg(ap, uint32);\
- buf++; \
} else if (prim->isByte()){ \
((uint32*)buf)[0] = va_arg(ap, uint32);\
- buf++; \
} else if (prim->isBool()){ \
((uint32*)buf)[0] = va_arg(ap, uint32);\
- buf++;\
} else if (prim->isFloat()){\
((float*)buf)[0] = (float)va_arg(ap, double);\
- buf++;\
} else if (prim->isDouble()){\
((double*)buf)[0] = va_arg(ap, double);\
- buf += 2;\
} else{\
fprintf(stderr, "Can't happen");\
abort();\
}\
} else{\
((JavaObject**)buf)[0] = va_arg(ap, JavaObject*);\
- buf++; \
}\
+ buf += 2; \
}\
Modified: vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp?rev=59302&r1=59301&r2=59302&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp Fri Nov 14 08:29:32 2008
@@ -692,7 +692,6 @@
Function* LLVMSignatureInfo::createFunctionCallBuf(bool virt) {
- ConstantInt* CI = mvm::MvmModule::constantZero;
std::vector<Value*> Args;
Function* res = Function::Create(virt ? getVirtualBufType() :
@@ -720,17 +719,13 @@
for (std::vector<Typedef*>::iterator i = signature->args.begin(),
e = signature->args.end(); i!= e; ++i) {
- ptr = GetElementPtrInst::Create(ptr, CI, "", currentBlock);
LLVMAssessorInfo& LAI = JnjvmModule::getTypedefInfo(*i);
const Type* type = LAI.llvmType;
Value* val = new BitCastInst(ptr, LAI.llvmTypePtr, "", currentBlock);
Value* arg = new LoadInst(val, "", currentBlock);
Args.push_back(arg);
- if (type == Type::Int64Ty || type == Type::DoubleTy) {
- CI = mvm::MvmModule::constantTwo;
- } else {
- CI = mvm::MvmModule::constantOne;
- }
+ ptr = GetElementPtrInst::Create(ptr, JnjvmModule::constantEight, "",
+ currentBlock);
}
#if defined(ISOLATE_SHARING)
@@ -823,7 +818,7 @@
Args2.push_back(JnjvmModule::ConstantPoolType); // ctp
Args2.push_back(getVirtualPtrType());
Args2.push_back(JnjvmModule::JavaObjectType);
- Args2.push_back(PointerType::getUnqual(Type::Int32Ty));
+ Args2.push_back(JnjvmModule::ptrType);
LLVMAssessorInfo& LAI = JnjvmModule::getTypedefInfo(signature->ret);
virtualBufType = FunctionType::get(LAI.llvmType, Args2, false);
}
@@ -837,7 +832,7 @@
std::vector<const llvm::Type*> Args;
Args.push_back(JnjvmModule::ConstantPoolType); // ctp
Args.push_back(getStaticPtrType());
- Args.push_back(PointerType::getUnqual(Type::Int32Ty));
+ Args.push_back(JnjvmModule::ptrType);
LLVMAssessorInfo& LAI = JnjvmModule::getTypedefInfo(signature->ret);
staticBufType = FunctionType::get(LAI.llvmType, Args, false);
}
Modified: vmkit/trunk/lib/JnJVM/VMCore/NativeUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/NativeUtil.cpp?rev=59302&r1=59301&r2=59302&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/NativeUtil.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/NativeUtil.cpp Fri Nov 14 08:29:32 2008
@@ -204,7 +204,7 @@
vm->illegalArgumentException("wrong type argument");
}
((JavaObject**)buf)[0] = obj;
- buf++;
+ buf += 2;
return;
} else if (obj == 0) {
vm->illegalArgumentException("");
@@ -220,12 +220,12 @@
if (prim->isShort()) {
if (value == vm->upcalls->OfShort) {
((uint16*)buf)[0] = vm->upcalls->shortValue->getInt16Field(obj);
- buf++;
+ buf += 2;
return;
} else if (value == vm->upcalls->OfByte) {
((sint16*)buf)[0] =
(sint16)vm->upcalls->byteValue->getInt8Field(obj);
- buf++;
+ buf += 2;
return;
} else {
vm->illegalArgumentException("");
@@ -233,7 +233,7 @@
} else if (prim->isByte()) {
if (value == vm->upcalls->OfByte) {
((uint8*)buf)[0] = vm->upcalls->byteValue->getInt8Field(obj);
- buf++;
+ buf += 2;
return;
} else {
vm->illegalArgumentException("");
@@ -241,7 +241,7 @@
} else if (prim->isBool()) {
if (value == vm->upcalls->OfBool) {
((uint8*)buf)[0] = vm->upcalls->boolValue->getInt8Field(obj);
- buf++;
+ buf += 2;
return;
} else {
vm->illegalArgumentException("");
@@ -260,7 +260,7 @@
vm->illegalArgumentException("");
}
((sint32*)buf)[0] = val;
- buf++;
+ buf += 2;
return;
} else if (prim->isChar()) {
uint16 val = 0;
@@ -270,7 +270,7 @@
vm->illegalArgumentException("");
}
((uint16*)buf)[0] = val;
- buf++;
+ buf += 2;
return;
} else if (prim->isFloat()) {
float val = 0;
@@ -290,7 +290,7 @@
vm->illegalArgumentException("");
}
((float*)buf)[0] = val;
- buf++;
+ buf += 2;
return;
} else if (prim->isDouble()) {
double val = 0;
More information about the vmkit-commits
mailing list