[vmkit-commits] [vmkit] r186841 - Merging changes from trunk.

Koutheir Attouchi koutheir at gmail.com
Mon Jul 22 09:23:13 PDT 2013


Author: koutheir
Date: Mon Jul 22 11:23:13 2013
New Revision: 186841

URL: http://llvm.org/viewvc/llvm-project?rev=186841&view=rev
Log:
Merging changes from trunk.

Modified:
    vmkit/branches/incinerator/autoconf/configure.ac
    vmkit/branches/incinerator/configure
    vmkit/branches/incinerator/lib/j3/ClassLib/Unsafe.inc
    vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp
    vmkit/branches/incinerator/www/get_started.html
    vmkit/branches/incinerator/www/tuto/VMKit_tutorial.tar.gz
    vmkit/branches/incinerator/www/tuto/toy-vm-base.tar.gz

Modified: vmkit/branches/incinerator/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/autoconf/configure.ac?rev=186841&r1=186840&r2=186841&view=diff
==============================================================================
--- vmkit/branches/incinerator/autoconf/configure.ac (original)
+++ vmkit/branches/incinerator/autoconf/configure.ac Mon Jul 22 11:23:13 2013
@@ -386,6 +386,10 @@ if test -z ${ANT}; then
     AC_MSG_ERROR([Unable to find ant, please put ant tool in your path])
 fi
 
+if test -z ${ZIP}; then
+    AC_MSG_ERROR([Unable to find zip, please put zip in your path])
+fi
+
 if test -z ${LLVM_CONFIG}; then
     AC_MSG_ERROR([Unable to find llvm-config, please specify its path])
 fi

Modified: vmkit/branches/incinerator/configure
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/configure?rev=186841&r1=186840&r2=186841&view=diff
==============================================================================
--- vmkit/branches/incinerator/configure (original)
+++ vmkit/branches/incinerator/configure Mon Jul 22 11:23:13 2013
@@ -3636,6 +3636,10 @@ if test -z ${ANT}; then
     as_fn_error $? "Unable to find ant, please put ant tool in your path" "$LINENO" 5
 fi
 
+if test -z ${ZIP}; then
+    as_fn_error $? "Unable to find zip, please put zip in your path" "$LINENO" 5
+fi
+
 if test -z ${LLVM_CONFIG}; then
     as_fn_error $? "Unable to find llvm-config, please specify its path" "$LINENO" 5
 fi

Modified: vmkit/branches/incinerator/lib/j3/ClassLib/Unsafe.inc
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/ClassLib/Unsafe.inc?rev=186841&r1=186840&r2=186841&view=diff
==============================================================================
--- vmkit/branches/incinerator/lib/j3/ClassLib/Unsafe.inc (original)
+++ vmkit/branches/incinerator/lib/j3/ClassLib/Unsafe.inc Mon Jul 22 11:23:13 2013
@@ -80,8 +80,10 @@ JavaObject* unsafe, JavaObjectField* _fi
 ///
 JNIEXPORT jlong JNICALL Java_sun_misc_Unsafe_arrayBaseOffset(
 JavaObject* unsafe, JavaObject* clazz) {
-  // Array starts at beginning of object
-  return 0;
+  llvm_gcroot(clazz, 0);
+  llvm_gcroot(unsafe, 0);
+  // See JavaArray.h for arrays layout
+  return sizeof(JavaObject) + sizeof(ssize_t);
 }
 
 /// arrayIndexScale - Indexing scale for the element type in
@@ -92,9 +94,23 @@ JavaObject* unsafe, JavaObject* clazz) {
 ///
 JNIEXPORT jlong JNICALL Java_sun_misc_Unsafe_arrayIndexScale(
 JavaObject* unsafe, JavaObject* clazz) {
-  // For now, just return '0', indicating we don't support this indexing.
-  // TODO: Implement this for the array types we /do/ support this way.
-  return 0;
+  JavaObjectClass* jcl = 0;
+  llvm_gcroot(clazz, 0);
+  llvm_gcroot(unsafe, 0);
+  llvm_gcroot(jcl, 0);
+  ClassArray* clArray = 0;
+  int size = 0;
+  
+  UserCommonClass* cl = JavaObjectClass::getClass(jcl = (JavaObjectClass*)clazz);
+  if (cl->isArray()) {
+    clArray = cl->asArrayClass();
+    if(clArray->_baseClass->isPrimitive()) {
+      size = 1 << clArray->_baseClass->asPrimitiveClass()->logSize;
+    } else {
+      size = sizeof(JavaObject*);
+    }
+  }
+  return size;
 }
 
 

Modified: vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp?rev=186841&r1=186840&r2=186841&view=diff
==============================================================================
--- vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp (original)
+++ vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp Mon Jul 22 11:23:13 2013
@@ -1383,13 +1383,6 @@ ArrayUInt16* Jnjvm::asciizToArray(const
 }
 
 void Jnjvm::startCollection() {
-
-#if DEBUG > 0
-	printf("Start Collection\n");
-	vmkit::Thread::get()->printBacktrace();
-	fflush(stdout);
-#endif
-
 #if RESET_STALE_REFERENCES
 	incinerator.beforeCollection();
 #endif
@@ -1413,12 +1406,6 @@ void Jnjvm::endCollection() {
 #if RESET_STALE_REFERENCES
 	incinerator.afterCollection();
 #endif
-
-#if DEBUG > 0
-  printf("End Collection\n");
-  vmkit::Thread::get()->printBacktrace();
-  fflush(stdout);
-#endif
 }
   
 void Jnjvm::scanWeakReferencesQueue(word_t closure) {

Modified: vmkit/branches/incinerator/www/get_started.html
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/www/get_started.html?rev=186841&r1=186840&r2=186841&view=diff
==============================================================================
--- vmkit/branches/incinerator/www/get_started.html (original)
+++ vmkit/branches/incinerator/www/get_started.html Mon Jul 22 11:23:13 2013
@@ -31,20 +31,23 @@ You will have to install a C++ compiler
 compile vmkit2</p>
 
 <ol>
-  <li>Download <a href="http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz">
-    LLVM 3.2</a> and 
-    <a href="http://llvm.org/releases/3.2/clang-3.2.src.tar.gz">Clang 3.2</a>
+  <li>Download <a href="http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz">
+    LLVM 3.3</a> and 
+    <a href="http://llvm.org/releases/3.3/cfe-3.3.src.tar.gz">Clang 3.3</a>
     source code.
   </li>
 
   <ul>
-    <li><tt>tar zxvf llvm-3.2.src.tar.gz</tt></li>
+    <li><tt>tar zxvf llvm-3.3.src.tar.gz</tt></li>
     <li><tt>cd llvm-3.2.src/tools</li></tt>
-    <li><tt>tar zxvf ../../clang-3.2.src.tar.gz</tt></li>
-    <li><tt>mv clang-3.2.src clang</li></tt>
+    <li><tt>tar zxvf ../../cfe-3.3.src.tar.gz</tt></li>
+    <li><tt>mv cfe-3.3.src clang</li></tt>
     <li><tt>cd ..</li></tt>
     <li><tt>./configure --enable-optimized; make</tt></li>
   </ul>
+  <br>Note: To compile LLVM and VMKit with RTTI enabled, one can pass the parameter
+REQUIRES_RTTI=1 to make. Passing this argument removes the flag -fno-rtti from
+the compiler options. Ex: $ make REQUIRES_RTTI=1
 
   <p><b>Skip the Classpath steps if you plan to use OpenJDK.</b><br/>
   <li><a href="ftp://ftp.gnu.org/gnu/classpath/classpath-0.99.tar.gz">Download

Modified: vmkit/branches/incinerator/www/tuto/VMKit_tutorial.tar.gz
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/www/tuto/VMKit_tutorial.tar.gz?rev=186841&r1=186840&r2=186841&view=diff
==============================================================================
Binary files vmkit/branches/incinerator/www/tuto/VMKit_tutorial.tar.gz (original) and vmkit/branches/incinerator/www/tuto/VMKit_tutorial.tar.gz Mon Jul 22 11:23:13 2013 differ

Modified: vmkit/branches/incinerator/www/tuto/toy-vm-base.tar.gz
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/www/tuto/toy-vm-base.tar.gz?rev=186841&r1=186840&r2=186841&view=diff
==============================================================================
Binary files vmkit/branches/incinerator/www/tuto/toy-vm-base.tar.gz (original) and vmkit/branches/incinerator/www/tuto/toy-vm-base.tar.gz Mon Jul 22 11:23:13 2013 differ





More information about the vmkit-commits mailing list