[vmkit-commits] [vmkit] r72566 - in /vmkit/trunk/lib/JnJVM/VMCore: JavaArray.h JavaObject.h VirtualTables.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Fri May 29 03:00:26 PDT 2009


Author: geoffray
Date: Fri May 29 05:00:09 2009
New Revision: 72566

URL: http://llvm.org/viewvc/llvm-project?rev=72566&view=rev
Log:
Remove unused functions.


Modified:
    vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h
    vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h
    vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp

Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h?rev=72566&r1=72565&r2=72566&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h Fri May 29 05:00:09 2009
@@ -46,7 +46,7 @@
 };
 
 /// JavaArray - This class is just a placeholder for constants and for the
-///  virtual table of arrays of primitive types (e.g. double, int).
+/// virtual table of arrays.
 class JavaArray : public TJavaArray<void*> {
 public:
 
@@ -65,14 +65,9 @@
   static const unsigned int T_INT;
   static const unsigned int T_LONG;
   
-  /// tracer - The trace method of Java arrays of primitive types. Since their
-  /// class lives throughout the lifetime of the application, there is no need
-  /// to trace them. Therefore this trace function does nothing.
-  virtual void TRACER;
-  
 };
 
-/// Instantiation of the TJavaArray class for Java arrays of primitive types.
+/// Instantiation of the TJavaArray class for Java arrays.
 #define ARRAYCLASS(name, elmt)                                \
   class name : public TJavaArray<elmt> {                      \
   }
@@ -86,20 +81,10 @@
 ARRAYCLASS(ArrayLong,   sint64);
 ARRAYCLASS(ArrayFloat,  float);
 ARRAYCLASS(ArrayDouble, double);
+ARRAYCLASS(ArrayObject, JavaObject*);
 
 #undef ARRAYCLASS
 
-/// ArrayObject - Instantiation of the TJavaArray class for arrays of objects.
-/// Arrays of objects are different than arrays of primitive types because
-/// they have to trace all objects in the array.
-class ArrayObject : public TJavaArray<JavaObject*> {
-public:
-  /// tracer - The tracer method of Java arrays of objects. This method will
-  /// trace all objects in the array.
-  virtual void TRACER;
-};
-
-
 /// UTF8 - The UTF8 class is basically the ArrayUInt16 class (arrays of elements
 /// of type uint16) with helper functions for manipulating UTF8. Each JVM
 /// instance hashes UTF8. UTF8 are not allocated by the application's garbage

Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h?rev=72566&r1=72565&r2=72566&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h Fri May 29 05:00:09 2009
@@ -348,9 +348,6 @@
     if (obj == 0) JavaThread::get()->getJVM()->nullPointerException();
 #endif
   
-  virtual void TRACER;
-
-
   /// lockObj - Get the LockObj if the lock is a fat lock.
   LockObj* lockObj() {
     return lock.getFatLock();

Modified: vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp?rev=72566&r1=72565&r2=72566&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp Fri May 29 05:00:09 2009
@@ -84,39 +84,31 @@
 
 /// Method for scanning the root of an object. This method is called by all
 /// JavObjects except native Java arrays.
-void JavaObject::tracer() {
-  if (getClass()) getClass()->classLoader->getJavaClassLoader()->markAndTrace();
-  LockObj* l = lockObj();
-  if (l) l->markAndTrace();
-}
-
 extern "C" void JavaObjectTracer(JavaObject* obj) {
-  obj->JavaObject::tracer();
+  if (obj->getClass())
+    obj->getClass()->classLoader->getJavaClassLoader()->markAndTrace();
+  LockObj* l = obj->lockObj();
+  if (l) l->markAndTrace();
 }
 
 /// Method for scanning an array whose elements are JavaObjects. This method is
 /// called by all non-native Java arrays.
-void ArrayObject::tracer() {
-  JavaObject::tracer();
-  for (sint32 i = 0; i < size; i++) {
-    if (elements[i]) elements[i]->MARK_AND_TRACE;
-  } 
-}
-
 extern "C" void ArrayObjectTracer(ArrayObject* obj) {
-  obj->ArrayObject::tracer();
+  if (obj->getClass())
+    obj->getClass()->classLoader->getJavaClassLoader()->markAndTrace();
+  LockObj* l = obj->lockObj();
+  if (l) l->markAndTrace();
+  for (sint32 i = 0; i < obj->size; i++) {
+    if (obj->elements[i]) obj->elements[i]->MARK_AND_TRACE;
+  } 
 }
 
 /// Method for scanning a native array. Only scan the lock. The classloader of
 /// the class is the bootstrap loader and therefore does not need to be
 /// scanned here.
-void JavaArray::tracer() {
-  LockObj* l = lockObj();
-  if (l) l->markAndTrace();
-}
-
 extern "C" void JavaArrayTracer(JavaArray* obj) {
-  obj->JavaArray::tracer();
+  LockObj* l = obj->lockObj();
+  if (l) l->markAndTrace();
 }
 
 





More information about the vmkit-commits mailing list