[vmkit-commits] [vmkit] r180360 - Removed specializedTracer. Have to remove virtual methods from gcRoot class and merge with gc.

Peter Senna Tschudin peter.senna at gmail.com
Thu Apr 25 10:10:34 PDT 2013


Author: peter.senna
Date: Thu Apr 25 12:01:26 2013
New Revision: 180360

URL: http://llvm.org/viewvc/llvm-project?rev=180360&view=rev
Log:
Removed specializedTracer. Have to remove virtual methods from gcRoot class and merge with gc.
(cherry picked from commit 9a1b3477e0418a24ed41e5ca8cdf1e9594642077)

Modified:
    vmkit/trunk/include/vmkit/Allocator.h
    vmkit/trunk/lib/j3/VMCore/JavaObject.cpp
    vmkit/trunk/lib/j3/VMCore/JavaObject.h
    vmkit/trunk/lib/vmkit/MMTk/VmkitGC.h

Modified: vmkit/trunk/include/vmkit/Allocator.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/vmkit/Allocator.h?rev=180360&r1=180359&r2=180360&view=diff
==============================================================================
--- vmkit/trunk/include/vmkit/Allocator.h (original)
+++ vmkit/trunk/include/vmkit/Allocator.h Thu Apr 25 12:01:26 2013
@@ -15,8 +15,6 @@
 
 #include <cstring>
 
-class VirtualTable;
-
 namespace vmkit {
 
 class BumpPtrAllocator {

Modified: vmkit/trunk/lib/j3/VMCore/JavaObject.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/JavaObject.cpp?rev=180360&r1=180359&r2=180360&view=diff
==============================================================================
--- vmkit/trunk/lib/j3/VMCore/JavaObject.cpp (original)
+++ vmkit/trunk/lib/j3/VMCore/JavaObject.cpp Thu Apr 25 12:01:26 2013
@@ -30,7 +30,6 @@ static const int hashCodeIncrement = vmk
 uint16_t JavaObject::hashCodeGenerator = hashCodeIncrement;
 static const uint64_t HashMask = ((1 << vmkit::HashBits) - 1) << vmkit::GCBits;
 
-
 /// hashCode - Return the hash code of this object.
 uint32_t JavaObject::hashCode(JavaObject* self) {
   llvm_gcroot(self, 0);

Modified: vmkit/trunk/lib/j3/VMCore/JavaObject.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/JavaObject.h?rev=180360&r1=180359&r2=180360&view=diff
==============================================================================
--- vmkit/trunk/lib/j3/VMCore/JavaObject.h (original)
+++ vmkit/trunk/lib/j3/VMCore/JavaObject.h Thu Apr 25 12:01:26 2013
@@ -40,6 +40,7 @@ public:
   }
 };
 
+
 /// JavaVirtualTable - This class is the virtual table of instances of
 /// Java classes. Besides holding function pointers for virtual calls,
 /// it contains a bunch of information useful for fast dynamic type checking.

Modified: vmkit/trunk/lib/vmkit/MMTk/VmkitGC.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/vmkit/MMTk/VmkitGC.h?rev=180360&r1=180359&r2=180360&view=diff
==============================================================================
--- vmkit/trunk/lib/vmkit/MMTk/VmkitGC.h (original)
+++ vmkit/trunk/lib/vmkit/MMTk/VmkitGC.h Thu Apr 25 12:01:26 2013
@@ -12,23 +12,27 @@
 #define VMKIT_MMTK_GC_H
 
 #include "vmkit/GC.h"
+#include "vmkit/Locks.h"
 #include <cstdlib>
 
 extern "C" void EmptyDestructor();
 
+/*
+ * C++ VirtualTable data layout representation. This is the base for
+ * every object layout based on virtual tables.
+ */
 class VirtualTable {
  public:
   word_t destructor;
   word_t operatorDelete;
   word_t tracer;
-  word_t specializedTracers[1];
-  
+
   static uint32_t numberOfBaseFunctions() {
-    return 4;
+    return 3;
   }
 
   static uint32_t numberOfSpecializedTracers() {
-    return 1;
+    return 0;
   }
 
   word_t* getFunctions() {
@@ -50,6 +54,21 @@ class VirtualTable {
   }
 
   static void emptyTracer(void*) {}
+
+  /// getVirtualTable - Returns the virtual table of this reference.
+  ///
+  static const VirtualTable* getVirtualTable(gc* ref) {
+  	llvm_gcroot(ref, 0);
+    return ((VirtualTable**)(ref))[0];
+  }
+
+  /// setVirtualTable - Sets the virtual table of this reference.
+  ///
+  static void setVirtualTable(gc* ref, VirtualTable* VT) {
+  	llvm_gcroot(ref, 0);
+    ((VirtualTable**)(ref))[0] = VT;
+  }
+
 };
 
 extern "C" void* gcmallocUnresolved(uint32_t sz, void* type);
@@ -58,8 +77,6 @@ extern "C" void* gcmalloc(uint32_t sz, v
 class gc : public gcRoot {
 public:
 
-	virtual void _fakeForSpecializedTracerSlot() {}
-
   size_t objectSize() const {
     abort();
     return 0;





More information about the vmkit-commits mailing list