[llvm-commits] [vmkit] r50150 - in /vmkit/trunk/lib/JnJVM/VMCore: JavaMetaJIT.cpp JavaObject.h
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Wed Apr 23 10:13:15 PDT 2008
Author: geoffray
Date: Wed Apr 23 12:13:15 2008
New Revision: 50150
URL: http://llvm.org/viewvc/llvm-project?rev=50150&view=rev
Log:
Update array virtual tables when the java/lang/Object class is resolved.
Modified:
vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp
vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp?rev=50150&r1=50149&r2=50150&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp Wed Apr 23 12:13:15 2008
@@ -220,6 +220,28 @@
} else {
res = allocateVT(cl, cl->virtualMethods.begin());
}
+
+ if (!(cl->super)) {
+ // 12 = number of virtual methods in java/lang/Object (!!!)
+ uint32 size = 12 * sizeof(void*);
+#define COPY(CLASS) \
+ memcpy((void*)((unsigned)res + VT_SIZE), \
+ (void*)((unsigned)CLASS::VT + VT_SIZE), size);
+
+ COPY(ArrayUInt8)
+ COPY(ArraySInt8)
+ COPY(ArrayUInt16)
+ COPY(ArraySInt16)
+ COPY(ArrayUInt32)
+ COPY(ArraySInt32)
+ COPY(ArrayLong)
+ COPY(ArrayFloat)
+ COPY(ArrayDouble)
+ COPY(UTF8)
+ COPY(ArrayObject)
+
+#undef COPY
+ }
#endif
#ifdef WITH_TRACER
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h?rev=50150&r1=50149&r2=50150&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h Wed Apr 23 12:13:15 2008
@@ -103,7 +103,22 @@
void operator()(JavaField* field, sint64 val);
void operator()(JavaField* field, uint32 val);
void operator()(JavaField* field, JavaObject* val);
-
+
+#ifndef WITHOUT_VTABLE
+ // Some of these are final. I could probably remove them from the list.
+ virtual void JavaInit() {}
+ virtual void JavaEquals() {}
+ virtual void JavaHashCode() {}
+ virtual void JavaToString() {}
+ virtual void JavaFinalize() {}
+ virtual void JavaClone() {}
+ virtual void JavaGetClass() {}
+ virtual void JavaNotify() {}
+ virtual void JavaNotifyAll() {}
+ virtual void JavaWait() {}
+ virtual void JavaWait(sint64) {}
+ virtual void JavaWait(sint64, sint32) {}
+#endif
};
More information about the llvm-commits
mailing list