[vmkit-commits] [vmkit] r120702 - in /vmkit/branches/multi-vm: include/mvm/GC.h include/mvm/Threads/Thread.h lib/J3/Compiler/JavaAOTCompiler.cpp lib/J3/Compiler/JavaJITOpcodes.cpp lib/J3/VMCore/JavaClass.cpp lib/J3/VMCore/VirtualTables.cpp lib/Mvm/GCMmap2/MvmGC.h lib/Mvm/MMTk/MvmGC.h
Gael Thomas
gael.thomas at lip6.fr
Thu Dec 2 02:57:05 PST 2010
Author: gthomas
Date: Thu Dec 2 04:57:05 2010
New Revision: 120702
URL: http://llvm.org/viewvc/llvm-project?rev=120702&view=rev
Log:
add the vm in CommonVirtualtable
Modified:
vmkit/branches/multi-vm/include/mvm/GC.h
vmkit/branches/multi-vm/include/mvm/Threads/Thread.h
vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp
vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITOpcodes.cpp
vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.cpp
vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp
vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MvmGC.h
vmkit/branches/multi-vm/lib/Mvm/MMTk/MvmGC.h
Modified: vmkit/branches/multi-vm/include/mvm/GC.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/GC.h?rev=120702&r1=120701&r2=120702&view=diff
==============================================================================
--- vmkit/branches/multi-vm/include/mvm/GC.h (original)
+++ vmkit/branches/multi-vm/include/mvm/GC.h Thu Dec 2 04:57:05 2010
@@ -39,26 +39,28 @@
}
};
+ // WARNING: if you modify this class, you must also change the generation of VT in JavaAOTCompiler
class CommonVirtualTable {
public:
uintptr_t destructor;
uintptr_t operatorDelete;
uintptr_t tracer;
- // VirtualMachine* vm;
+ VirtualMachine* vm;
uintptr_t* getFunctions() {
return &destructor;
}
- CommonVirtualTable(uintptr_t d, uintptr_t o, uintptr_t t) {
+ CommonVirtualTable(uintptr_t d, uintptr_t o, uintptr_t t, VirtualMachine* v) {
destructor = d;
operatorDelete = o;
tracer = t;
+ vm = v;
}
CommonVirtualTable() {}
- static int numberOfCommonEntries() { return 3; }
+ static int numberOfCommonEntries() { return 4; }
static void emptyTracer(void*) {}
};
@@ -73,7 +75,7 @@
class VirtualTable : public GCVirtualTable {
public:
- VirtualTable(uintptr_t d, uintptr_t o, uintptr_t t) : GCVirtualTable(d, o, t) {}
+ VirtualTable(uintptr_t d, uintptr_t o, uintptr_t t, VirtualMachine* v) : GCVirtualTable(d, o, t, v) {}
VirtualTable() {}
};
Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/Threads/Thread.h?rev=120702&r1=120701&r2=120702&view=diff
==============================================================================
--- vmkit/branches/multi-vm/include/mvm/Threads/Thread.h (original)
+++ vmkit/branches/multi-vm/include/mvm/Threads/Thread.h Thu Dec 2 04:57:05 2010
@@ -43,6 +43,7 @@
/// CircularBase - This class represents a circular list. Classes that extend
/// this class automatically place their instances in a circular list.
///
+// WARNING: if you modify this class, you must also change mvm-runtime.ll
class CircularBase {
/// _next - The next object in the list.
///
@@ -143,6 +144,7 @@
class MutatorThread;
class VMKit;
+// WARNING: if you modify this class, you must also change mvm-runtime.ll
class VMThreadData {
public:
/// mut - The associated thread mutator
@@ -164,6 +166,7 @@
/// Thread - This class is the base of custom virtual machines' Thread classes.
/// It provides static functions to manage threads. An instance of this class
/// contains all thread-specific informations.
+// WARNING: if you modify this class, you must also change mvm-runtime.ll
class Thread : public CircularBase {
public:
Thread(VMKit* vmk) {
Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=120702&r1=120701&r2=120702&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp Thu Dec 2 04:57:05 2010
@@ -1414,7 +1414,11 @@
Elemts.push_back(Tracer ?
ConstantExpr::getCast(Instruction::BitCast, Tracer, PTy) : N);
+
+ // vm
+ Elemts.push_back(N);
+ // specialized tracers
for (uint32_t i = 0; i < mvm::VirtualTable::numberOfSpecializedTracers(); i++) {
// Push null for now.
Elemts.push_back(N);
Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITOpcodes.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITOpcodes.cpp?rev=120702&r1=120701&r2=120702&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITOpcodes.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITOpcodes.cpp Thu Dec 2 04:57:05 2010
@@ -156,6 +156,7 @@
}
#if JNJVM_EXECUTE > 1
+ // if (compilingMethod->name->equals(compilingClass->classLoader->asciizConstructUTF8("allocSlowOnce")))
{
Value* args[3] = {
ConstantInt::get(Type::getInt32Ty(*llvmContext), (int64_t)bytecode),
Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.cpp?rev=120702&r1=120701&r2=120702&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.cpp Thu Dec 2 04:57:05 2010
@@ -1399,7 +1399,8 @@
}
JavaVirtualTable::JavaVirtualTable(Class* C) {
-
+ vm = C->classLoader->getIsolate();
+
if (C->super) {
Class* referenceClass =
@@ -1495,6 +1496,7 @@
}
JavaVirtualTable::JavaVirtualTable(ClassArray* C) {
+ vm = C->classLoader->getIsolate();
if (C->baseClass()->isClass())
C->baseClass()->asClass()->resolveClass();
@@ -1713,6 +1715,7 @@
JavaVirtualTable::JavaVirtualTable(ClassPrimitive* C) {
// Only used for subtype checking
+ vm = C->classLoader->getIsolate();
cl = C;
depth = 0;
display[0] = this;
Modified: vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp?rev=120702&r1=120701&r2=120702&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp Thu Dec 2 04:57:05 2010
@@ -55,7 +55,8 @@
mvm::VirtualTable VMClassLoader::VT((uintptr_t)VMClassLoader::staticDestructor,
(uintptr_t)VMClassLoader::staticDestructor,
- (uintptr_t)VMClassLoader::staticTracer);
+ (uintptr_t)VMClassLoader::staticTracer,
+ 0);
//===----------------------------------------------------------------------===//
// Trace methods for Java objects. There are four types of objects:
Modified: vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MvmGC.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MvmGC.h?rev=120702&r1=120701&r2=120702&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MvmGC.h (original)
+++ vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MvmGC.h Thu Dec 2 04:57:05 2010
@@ -33,7 +33,7 @@
return 0;
}
- GCVirtualTable(uintptr_t d, uintptr_t o, uintptr_t t) : CommonVirtualTable(d, o, t) {}
+ GCVirtualTable(uintptr_t d, uintptr_t o, uintptr_t t, VirtualMachine *v) : CommonVirtualTable(d, o, t, v) {}
GCVirtualTable() {}
};
Modified: vmkit/branches/multi-vm/lib/Mvm/MMTk/MvmGC.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/MMTk/MvmGC.h?rev=120702&r1=120701&r2=120702&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/MMTk/MvmGC.h (original)
+++ vmkit/branches/multi-vm/lib/Mvm/MMTk/MvmGC.h Thu Dec 2 04:57:05 2010
@@ -29,7 +29,7 @@
return 1;
}
- GCVirtualTable(uintptr_t d, uintptr_t o, uintptr_t t) : CommonVirtualTable(d, o, t) {}
+ GCVirtualTable(uintptr_t d, uintptr_t o, uintptr_t t, VirtualMachine* v) : CommonVirtualTable(d, o, t, v) {}
GCVirtualTable() {}
};
More information about the vmkit-commits
mailing list