[vmkit-commits] [vmkit] r73068 - in /vmkit/trunk/lib/JnJVM: Compiler/JavaJIT.cpp LLVMRuntime/runtime-default.ll VMCore/JavaCache.h VMCore/JavaRuntimeJIT.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Mon Jun 8 06:19:20 PDT 2009
Author: geoffray
Date: Mon Jun 8 08:19:13 2009
New Revision: 73068
URL: http://llvm.org/viewvc/llvm-project?rev=73068&view=rev
Log:
Use the VT instead of the class to cache the last cible of an
invokeinterface.
Modified:
vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.cpp
vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll
vmkit/trunk/lib/JnJVM/VMCore/JavaCache.h
vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp
Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.cpp?rev=73068&r1=73067&r2=73068&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.cpp (original)
+++ vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.cpp Mon Jun 8 08:19:13 2009
@@ -1935,14 +1935,14 @@
"", currentBlock);
Value* cache = new LoadInst(cachePtr, "", currentBlock);
- Value* cl = CallInst::Create(module->GetClassFunction, args[0], "",
+ Value* VT = CallInst::Create(module->GetVTFunction, args[0], "",
currentBlock);
Value* args3[2] = { zero, one };
Value* lastCiblePtr = GetElementPtrInst::Create(cache, args3, args3 + 2, "",
currentBlock);
Value* lastCible = new LoadInst(lastCiblePtr, "", currentBlock);
- Value* cmp = new ICmpInst(ICmpInst::ICMP_EQ, cl, lastCible, "", currentBlock);
+ Value* cmp = new ICmpInst(ICmpInst::ICMP_EQ, VT, lastCible, "", currentBlock);
BasicBlock* ifTrue = createBasicBlock("cache ok");
BasicBlock* ifFalse = createBasicBlock("cache not ok");
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=73068&r1=73067&r2=73068&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll (original)
+++ vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll Mon Jun 8 08:19:13 2009
@@ -22,7 +22,7 @@
%ArrayUInt8 = type { %JavaObject, i8*, [0 x i8] }
;;; The CacheNode type. The first field is the last called method.
-%CacheNode = type { i8*, %JavaCommonClass*, %CacheNode*, %Enveloppe* }
+%CacheNode = type { i8*, %VT*, %CacheNode*, %Enveloppe* }
;;; The Enveloppe type, which contains the first cache and all the info
;;; to lookup in the constant pool.
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaCache.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaCache.h?rev=73068&r1=73067&r2=73068&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaCache.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaCache.h Mon Jun 8 08:19:13 2009
@@ -32,7 +32,7 @@
namespace jnjvm {
class Enveloppe;
-class UserClass;
+class JavaVirtualTable;
class UTF8;
/// CacheNode - A {class, method pointer} pair.
@@ -42,8 +42,8 @@
/// methPtr - The method pointer of this cache.
void* methPtr;
- /// lastCible - The class of this cache.
- UserClass* lastCible;
+ /// lastCible - The VT corresponding to this cache.
+ JavaVirtualTable* lastCible;
/// next - The next cache.
CacheNode* next;
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp?rev=73068&r1=73067&r2=73068&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp Mon Jun 8 08:19:13 2009
@@ -34,7 +34,7 @@
Enveloppe* enveloppe = cache->enveloppe;
- UserCommonClass* ocl = obj->getClass();
+ JavaVirtualTable* ovt = (JavaVirtualTable*)obj->getVirtualTable();
#ifndef SERVICE
assert((obj->getClass()->isClass() &&
@@ -48,7 +48,7 @@
CacheNode* last = tmp;
while (tmp) {
- if (ocl == tmp->lastCible) {
+ if (ovt == tmp->lastCible) {
rcache = tmp;
break;
} else {
@@ -58,6 +58,7 @@
}
if (!rcache) {
+ UserCommonClass* ocl = ovt->cl;
UserClass* methodCl = 0;
UserClass* lookup = ocl->isArray() ? ocl->super : ocl->asClass();
JavaMethod* dmeth = lookup->lookupMethod(enveloppe->methodName,
@@ -79,7 +80,7 @@
}
rcache->methPtr = dmeth->compiledPtr();
- rcache->lastCible = (UserClass*)ocl;
+ rcache->lastCible = ovt;
}
More information about the vmkit-commits
mailing list