harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r528441 - in /harmony/enhanced/drlvm/trunk: src/test/regression/H3216/ src/test/regression/H3216/ASETest.java src/test/regression/H3216/run.test.xml vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
Date Fri, 13 Apr 2007 11:27:13 GMT
Author: varlax
Date: Fri Apr 13 04:27:12 2007
New Revision: 528441

URL: http://svn.apache.org/viewvc?view=rev&rev=528441
Log:
HARMONY-3216 [drlvm][jit] OPT loses ArrayStoreException when optimizing java.lang.System.arraycopy

Added:
    harmony/enhanced/drlvm/trunk/src/test/regression/H3216/
    harmony/enhanced/drlvm/trunk/src/test/regression/H3216/ASETest.java
    harmony/enhanced/drlvm/trunk/src/test/regression/H3216/run.test.xml
Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H3216/ASETest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H3216/ASETest.java?view=auto&rev=528441
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H3216/ASETest.java (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H3216/ASETest.java Fri Apr 13 04:27:12
2007
@@ -0,0 +1,19 @@
+package org.apache.harmony.drlvm.tests.regression.h3216;
+
+import junit.framework.TestCase;
+
+public class ASETest extends TestCase { 
+    Object[] oo1 = new String[3];
+
+    public void testASE() { 
+        
+        Integer[] oo2 = new Integer[oo1.length]; 
+        for (int i=0; i<oo2.length; i++) { 
+            oo2[i] = new Integer(i); 
+        } 
+        try { 
+            System.arraycopy(oo2, 0, oo1, 0, oo1.length); 
+            fail("ArrayStoreException should be thrown");
+        } catch (ArrayStoreException ok) {} 
+    } 
+} 

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H3216/run.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H3216/run.test.xml?view=auto&rev=528441
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H3216/run.test.xml (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H3216/run.test.xml Fri Apr 13 04:27:12
2007
@@ -0,0 +1,9 @@
+<project name="RUN HARMONY-3216 Regression Test">
+    <target name="run-test">
+        <run-junit-test 
+            test="org.apache.harmony.drlvm.tests.regression.h3216.ASETest"
+            vmarg="-Xem:opt">
+        </run-junit-test>
+    </target>
+</project>
+

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp?view=diff&rev=528441&r1=528440&r2=528441
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
(original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
Fri Apr 13 04:27:12 2007
@@ -2795,7 +2795,7 @@
         // To avoid this we just reject the inlining of System::arraycopy call in this case.
         NamedType* srcElemType = srcAsArrayType->getElementType();
         NamedType* dstElemType = dstAsArrayType->getElementType();
-        throwsASE = ! VMInterface::isSubClassOf(srcElemType->getVMTypeHandle(),dstElemType->getVMTypeHandle());
+        throwsASE = srcElemType->getVMTypeHandle() != dstElemType->getVMTypeHandle();
     }
     if ( throwsASE )
         return false;



Mime
View raw message