[vmkit-commits] [vmkit] r68861 - /vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Fri Apr 10 23:10:12 PDT 2009
Author: geoffray
Date: Sat Apr 11 01:10:12 2009
New Revision: 68861
URL: http://llvm.org/viewvc/llvm-project?rev=68861&view=rev
Log:
Get the VT from the class array, if we static compile.
Modified:
vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp
Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp?rev=68861&r1=68860&r2=68861&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp (original)
+++ vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp Sat Apr 11 01:10:12 2009
@@ -1849,9 +1849,6 @@
compilingClass->classLoader->bootstrapLoader;
UserClassArray* dcl = loader->getArrayClass(id);
valCl = TheCompiler->getNativeClass(dcl);
- if (valCl->getType() != module->JavaCommonClassType)
- valCl = new BitCastInst(valCl, module->JavaCommonClassType, "",
- currentBlock);
#else
Value* args[2] = { isolateLocal,
ConstantInt::get(Type::Int32Ty, id - 4) };
@@ -1861,7 +1858,12 @@
LLVMAssessorInfo& LAI = LLVMAssessorInfo::AssessorInfo[charId];
sizeElement = LAI.sizeInBytesConstant;
- TheVT = TheCompiler->getVirtualTable(dcl->virtualVT);
+ if (TheCompiler->isStaticCompiling()) {
+ TheVT = CallInst::Create(module->GetVTFromClassArrayFunction,
+ valCl, "", currentBlock);
+ } else {
+ TheVT = TheCompiler->getVirtualTable(dcl->virtualVT);
+ }
} else {
uint16 index = readU2(bytecodes, i);
CommonClass* cl = 0;
@@ -1880,13 +1882,11 @@
if (TheCompiler->isStaticCompiling() &&
valCl->getType() != module->JavaClassArrayType) {
valCl = new LoadInst(valCl, "", currentBlock);
+ TheVT = CallInst::Create(module->GetVTFromClassArrayFunction,
+ valCl, "", currentBlock);
+ } else {
+ TheVT = TheCompiler->getVirtualTable(dcl->virtualVT);
}
-
- if (valCl->getType() != module->JavaCommonClassType) {
- valCl = new BitCastInst(valCl, module->JavaCommonClassType, "",
- currentBlock);
- }
- TheVT = TheCompiler->getVirtualTable(dcl->virtualVT);
} else {
const llvm::Type* Ty =
@@ -1894,10 +1894,6 @@
Value* args[2]= { valCl, Constant::getNullValue(Ty) };
valCl = CallInst::Create(module->GetArrayClassFunction, args,
args + 2, "", currentBlock);
- TheVT = CallInst::Create(module->GetVTFromClassArrayFunction, valCl, "",
- currentBlock);
- valCl = new BitCastInst(valCl, module->JavaCommonClassType, "",
- currentBlock);
}
sizeElement = module->constantPtrSize;
More information about the vmkit-commits
mailing list