[vmkit-commits] [vmkit] r139469 - in /vmkit/trunk: include/mvm/System.h include/mvm/Threads/ObjectLocks.h lib/J3/Classpath/Classpath.inc lib/J3/Classpath/ClasspathVMClass.inc lib/J3/VMCore/JavaClass.cpp lib/J3/VMCore/JnjvmClassLoader.cpp lib/Mvm/Runtime/UTF8.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Sat Sep 10 02:28:26 PDT 2011


Author: geoffray
Date: Sat Sep 10 04:28:26 2011
New Revision: 139469

URL: http://llvm.org/viewvc/llvm-project?rev=139469&view=rev
Log:
- Small bugfixes here and there.
- X64 archs now always have the same thread start address.


Modified:
    vmkit/trunk/include/mvm/System.h
    vmkit/trunk/include/mvm/Threads/ObjectLocks.h
    vmkit/trunk/lib/J3/Classpath/Classpath.inc
    vmkit/trunk/lib/J3/Classpath/ClasspathVMClass.inc
    vmkit/trunk/lib/J3/VMCore/JavaClass.cpp
    vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp
    vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp

Modified: vmkit/trunk/include/mvm/System.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/System.h?rev=139469&r1=139468&r2=139469&view=diff
==============================================================================
--- vmkit/trunk/include/mvm/System.h (original)
+++ vmkit/trunk/include/mvm/System.h Sat Sep 10 04:28:26 2011
@@ -53,13 +53,13 @@
 
 
 
-#if MACOS_OS && ARCH_X64
-const intptr_t kThreadStart = 0x110000000LL;
-const intptr_t kThreadIDMask = 0xF7FF00000LL;
-const uintptr_t kMvmThreadMask = 0xFF0000000LL;
+#if ARCH_X64
+const intptr_t kThreadStart   = 0x0000000110000000LL;
+const intptr_t kThreadIDMask  = 0xFFFFFFFFFFF00000LL;
+const intptr_t kMvmThreadMask = 0xFFFFFFFFF0000000LL;
 #else
-const intptr_t kThreadStart = 0x10000000;
-const intptr_t kThreadIDMask = 0x7FF00000;
+const intptr_t kThreadStart   = 0x10000000;
+const intptr_t kThreadIDMask  = 0x7FF00000;
 const intptr_t kMvmThreadMask = 0xF0000000;
 #endif
 

Modified: vmkit/trunk/include/mvm/Threads/ObjectLocks.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/ObjectLocks.h?rev=139469&r1=139468&r2=139469&view=diff
==============================================================================
--- vmkit/trunk/include/mvm/Threads/ObjectLocks.h (original)
+++ vmkit/trunk/include/mvm/Threads/ObjectLocks.h Sat Sep 10 04:28:26 2011
@@ -163,10 +163,10 @@
 
   static const uint64_t FatMask = 1LL << (kThreadStart > 0xFFFFFFFFLL ? 61LL : 31LL);
 
-  static const uint32_t NonLockBits = HashBits + GCBits;
+  static const uint64_t NonLockBits = HashBits + GCBits;
   static const uint64_t NonLockBitsMask = ((1LL << NonLockBits) - 1LL);
 
-  static const uint32_t ThinCountMask = ~((1 << 31) + kThreadIDMask + NonLockBitsMask);
+  static const uint64_t ThinCountMask = 0xFFFFFFFFLL & ~(FatMask | kThreadIDMask | NonLockBitsMask);
   static const uint64_t ThinCountShift = NonLockBits;
   static const uint64_t ThinCountAdd = 1LL << NonLockBits;
 

Modified: vmkit/trunk/lib/J3/Classpath/Classpath.inc
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/Classpath.inc?rev=139469&r1=139468&r2=139469&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Classpath/Classpath.inc (original)
+++ vmkit/trunk/lib/J3/Classpath/Classpath.inc Sat Sep 10 04:28:26 2011
@@ -260,6 +260,12 @@
     UserCommonClass::resolvedImplClass(vm, arrayType, true);
   JnjvmClassLoader* loader = base->classLoader;
   const UTF8* name = base->getName();
+  // -1 because we're adding a new dimension in this method.
+  const int kLimit = 255 - 1;
+  const uint16* elements = name->elements;
+  if (name->size > kLimit && elements[kLimit] == '[') {
+    vm->illegalArgumentException("Too many dimensions for array");
+  }
   const UTF8* arrayName = loader->constructArrayName(1, name);
   UserClassArray* array = loader->constructArray(arrayName, base);
   res = array->doNew(arrayLength, vm);

Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMClass.inc
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMClass.inc?rev=139469&r1=139468&r2=139469&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Classpath/ClasspathVMClass.inc (original)
+++ vmkit/trunk/lib/J3/Classpath/ClasspathVMClass.inc Sat Sep 10 04:28:26 2011
@@ -63,7 +63,7 @@
     JnjvmClassLoader::getJnjvmLoaderFromJavaObject(loader, vm);
   UserCommonClass* cl = JCL->loadClassFromJavaString(str, true, false);
 
-  if (cl != 0) {
+  if (cl != NULL && !cl->isPrimitive()) {
     if (clinit && cl->asClass()) {
       cl->asClass()->initialiseClass(vm);
     }

Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=139469&r1=139468&r2=139469&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original)
+++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Sat Sep 10 04:28:26 2011
@@ -1594,27 +1594,7 @@
         // Put Cloneable[...] and Serializable[...] at the end of the list.
         secondaryTypes[index] = firstInterface->virtualVT;
         secondaryTypes[index + 1] = secondInterface->virtualVT;
-
-        // If the depth is greater than the display size, 
-        // Cloneable[...] and Serializable[...] have their own list of
-        // secondary types, and we must therefore tell them that they
-        // implement themselves.
-        // If the depth is less than than the display size, there is nothing
-        // to do: the array of secondary types has been created before loading
-        // the interface arrays, so the interface arrays already reference
-        // the array.
-        if (outOfDepth) {
-          firstInterface->virtualVT->secondaryTypes[index] =
-            firstInterface->virtualVT;
-          firstInterface->virtualVT->secondaryTypes[index + 1] =
-            secondInterface->virtualVT;
-          secondInterface->virtualVT->secondaryTypes[index] =
-            firstInterface->virtualVT;
-          secondInterface->virtualVT->secondaryTypes[index + 1] =
-            secondInterface->virtualVT;
-        }
       }
-
     } else {
       // This is java.lang.Object[].
       depth = 1;

Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=139469&r1=139468&r2=139469&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp (original)
+++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Sat Sep 10 04:28:26 2011
@@ -316,9 +316,8 @@
     cl = JavaObjectClass::getClass(((JavaObjectClass*)obj));
   }
   
-  if (cl) {
-    assert(!cl->isArray());
-    if (doResolve) cl->asClass()->resolveClass();
+  if (cl && doResolve && cl->isClass()) {
+    cl->asClass()->resolveClass();
   }
 
   return (UserClass*)cl;

Modified: vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp?rev=139469&r1=139468&r2=139469&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp (original)
+++ vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp Sat Sep 10 04:28:26 2011
@@ -12,8 +12,8 @@
 
 namespace mvm {
 
-extern "C" const UTF8 TombstoneKey(0);
-extern "C" const UTF8 EmptyKey(0);
+extern "C" const UTF8 TombstoneKey(-1);
+extern "C" const UTF8 EmptyKey(-1);
 
 
 const UTF8* UTF8::extract(UTF8Map* map, uint32 start, uint32 end) const {





More information about the vmkit-commits mailing list