harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r521708 - in /harmony/enhanced/drlvm/trunk: src/test/regression/H1840/ src/test/regression/H3446/ vm/jitrino/src/jet/
Date Fri, 23 Mar 2007 12:48:55 GMT
Author: varlax
Date: Fri Mar 23 05:48:54 2007
New Revision: 521708

URL: http://svn.apache.org/viewvc?view=rev&rev=521708
Log:
Applied HARMONY-1840, HARMONY-3446 [drlvm][jet] JSR handling fixes
Regression tests added

Added:
    harmony/enhanced/drlvm/trunk/src/test/regression/H1840/
    harmony/enhanced/drlvm/trunk/src/test/regression/H1840/SimplestTest.j
    harmony/enhanced/drlvm/trunk/src/test/regression/H1840/run.test.xml
    harmony/enhanced/drlvm/trunk/src/test/regression/H3446/
    harmony/enhanced/drlvm/trunk/src/test/regression/H3446/SubSubTest.j
    harmony/enhanced/drlvm/trunk/src/test/regression/H3446/run.test.xml
Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H1840/SimplestTest.j
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H1840/SimplestTest.j?view=auto&rev=521708
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H1840/SimplestTest.j (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H1840/SimplestTest.j Fri Mar 23 05:48:54
2007
@@ -0,0 +1,20 @@
+.class public org/apache/harmony/drlvm/tests/regression/h1840/SimplestTest
+.super junit/framework/TestCase
+.method public <init>()V
+    aload_0
+    invokespecial junit/framework/TestCase/<init>()V
+    return
+.end method
+
+;
+; Launches testcases which check subroutine verification.
+;
+.method public test()V
+    .limit stack 1
+    .limit locals 2
+
+    jsr LabelSub
+LabelSub:
+    return
+.end method
+

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H1840/run.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H1840/run.test.xml?view=auto&rev=521708
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H1840/run.test.xml (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H1840/run.test.xml Fri Mar 23 05:48:54
2007
@@ -0,0 +1,9 @@
+<project name="RUN HARMONY-1840 Regression Test">
+    <target name="run-test">
+        <run-junit-test
+            test="org.apache.harmony.drlvm.tests.regression.h1840.SimplestTest"
+            vmarg="-Xem:jet -XX:-vm.assert_dialog">
+        </run-junit-test>
+    </target>
+</project>
+

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H3446/SubSubTest.j
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H3446/SubSubTest.j?view=auto&rev=521708
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H3446/SubSubTest.j (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H3446/SubSubTest.j Fri Mar 23 05:48:54
2007
@@ -0,0 +1,28 @@
+.class public org/apache/harmony/drlvm/tests/regression/h3446/SubSubTest
+.super junit/framework/TestCase
+.method public <init>()V
+    aload_0
+    invokespecial junit/framework/TestCase/<init>()V
+    return
+.end method
+
+; 
+; Subroutine is called from the other subroutine and 
+; from the top level code. 
+; 
+.method public test()V 
+   .limit stack 1 
+   .limit locals 2 
+
+   jsr LabelSub 
+   jsr LabelSubSub 
+   return 
+LabelSub: 
+   astore 1 
+   jsr LabelSubSub 
+   ret 1 
+LabelSubSub: 
+   astore 0 
+   ret 0 
+.end method 
+

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H3446/run.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H3446/run.test.xml?view=auto&rev=521708
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H3446/run.test.xml (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H3446/run.test.xml Fri Mar 23 05:48:54
2007
@@ -0,0 +1,9 @@
+<project name="RUN HARMONY-3446 Regression Test">
+    <target name="run-test">
+        <run-junit-test
+            test="org.apache.harmony.drlvm.tests.regression.h3446.SubSubTest"
+            vmarg="-Xem:jet -XX:-vm.assert_dialog">
+        </run-junit-test>
+    </target>
+</project>
+

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp?view=diff&rev=521708&r1=521707&r2=521708
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp Fri Mar 23 05:48:54 2007
@@ -874,13 +874,21 @@
     if (bbinfo.processed) {
         if (bbinfo.jsr_target) {
             // we're processing JSR subroutine
-            assert(jsr_lead == pc);
-            // Simply load the state back to the parent's
-            BBState* prevState = m_bbStates[parentPC];
-            assert(m_jsrStates.find(jsr_lead) != m_jsrStates.end());
-            const BBState* jsrState = m_jsrStates[jsr_lead];
-            //prevState.jframe.init(&jsrState.jframe);
-            *prevState = *jsrState;
+            if (jsr_lead != NOTHING) {
+                assert(jsr_lead == pc);
+                // Simply load the state back to the parent's
+                BBState* prevState = m_bbStates[parentPC];
+                assert(m_jsrStates.find(jsr_lead) != m_jsrStates.end());
+                const BBState* jsrState = m_jsrStates[jsr_lead];
+                //prevState.jframe.init(&jsrState.jframe);
+                *prevState = *jsrState;
+            }
+            else {
+                // we have a fall through (and not through a JSR) path 
+                // to a subroutine
+                // do nothing here - we only need to return the state 
+                // back for JSR
+            }
         }
         return false;
     }
@@ -888,15 +896,15 @@
     BBState * parentState;
     {
         const BBInfo& parentBB = m_bbs[parentPC];
-        // If we see that parent block was a JSR subroutine, this in fact 
-        // means that the parent block ended with a JSR call, and then 
+        // If we see that parent block was a JSR subroutine, this may mean
+        // that the parent block ended with a JSR call, and then 
         // 'parentPC' of this block was substituted (see the appropriate 
         // code in comp_gen_code_bb()).
-        // So, in this block we must use the state after the JSR subroutine.
+        // So, in this case we must use the state after the JSR subroutine.
         // The 'jsr_lead != parentPC' prevents from taking state from m_jsrStates
         // when the parentPC is the real parent, that is in a JSR subroutine
         // with several blocks.
-        if (parentBB.jsr_target && jsr_lead != parentPC) {
+        if (parentBB.jsr_target && jsr_lead != parentPC && jsr_lead != pc)
{
             assert(m_jsrStates.find(parentPC) != m_jsrStates.end());
             parentState = m_jsrStates[parentPC];
         }



Mime
View raw message