harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r532673 - in /harmony/enhanced/drlvm/trunk: src/test/regression/H3738/ src/test/regression/H3738/Test.java src/test/regression/H3738/run.test.xml vm/jitrino/src/codegenerator/ia32/Ia32I8Lowerer.cpp
Date Thu, 26 Apr 2007 09:01:26 GMT
Author: varlax
Date: Thu Apr 26 02:01:25 2007
New Revision: 532673

URL: http://svn.apache.org/viewvc?view=rev&rev=532673
Log:
Applied HARMONY-3738 [drlvm][jit][vmmagic] I8Lowerer does not eliminate all I8PseudoInsts
when address arithmetic with vmmagics is used.

Added:
    harmony/enhanced/drlvm/trunk/src/test/regression/H3738/
    harmony/enhanced/drlvm/trunk/src/test/regression/H3738/Test.java
    harmony/enhanced/drlvm/trunk/src/test/regression/H3738/run.test.xml
Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32I8Lowerer.cpp

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H3738/Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H3738/Test.java?view=auto&rev=532673
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H3738/Test.java (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H3738/Test.java Thu Apr 26 02:01:25 2007
@@ -0,0 +1,17 @@
+package org.apache.harmony.drlvm.tests.regression.h3738;
+
+import junit.framework.TestCase;
+import org.vmmagic.unboxed.*;
+
+public class Test extends TestCase {
+
+    static Address a;
+    static long val;
+
+    public static void test() {
+        a = Address.fromLong(1L);
+        //crash in I8Lowerer here
+        val = a.toLong();
+    } 
+} 
+

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H3738/run.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H3738/run.test.xml?view=auto&rev=532673
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H3738/run.test.xml (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H3738/run.test.xml Thu Apr 26 02:01:25
2007
@@ -0,0 +1,8 @@
+<project name="RUN HARMONY-3738 Regression Test">
+  <target name="run-test">
+    <run-junit-test 
+        test="org.apache.harmony.drlvm.tests.regression.h3738.Test"
+        vmarg="-Xem:opt">
+    </run-junit-test>
+  </target>
+</project>

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32I8Lowerer.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32I8Lowerer.cpp?view=diff&rev=532673&r1=532672&r2=532673
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32I8Lowerer.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32I8Lowerer.cpp Thu Apr
26 02:01:25 2007
@@ -199,6 +199,8 @@
 {   return src1%src2;   }
 
 
+static void checkIR(IRManager* irm);
+
 void I8Lowerer::runImpl() 
 {
     // I8 operation internal helpers
@@ -310,6 +312,8 @@
             }
         }
     }
+    
+    checkIR(irManager);
 }
 
 void I8Lowerer::processOpnds(Inst * inst)
@@ -415,8 +419,13 @@
                     //setns 	hi		; if lo is positive, then load 1 into hi
                     //sub		hi, 1	; if lo is positive, then hi is now '0'. otherwise, it's
-1
                     irManager->newInstEx(Mnemonic_CDQ, 1, dst_2, dst_1)->insertBefore(inst);
-                    inst->unlink();
+                } else {
+                    //fill upper word with 0
+                    assert(mn == Mnemonic_MOVZX);
+                    Opnd* imm0=irManager->newImmOpnd(irManager->getTypeManager().getInt32Type(),
0);
+                    irManager->newInstEx(Mnemonic_MOV, 1, dst_2, imm0)->insertBefore(inst);
                 }
+                inst->unlink();
                 break;
             case Mnemonic_PUSH  :
                 assert(src1_1);
@@ -1359,5 +1368,20 @@
     }
 }
 
+//IR verification routine.
+//checks that there are no I8Pseudo insts left in CFG after the pass
+static void checkIR(IRManager* irm) {
+#ifdef _DEBUG
+    const Nodes& nodes = irm->getFlowGraph()->getNodes();
+    for (Nodes::const_iterator it = nodes.begin(), end = nodes.end(); it!=end; ++it) {
+       Node* node = *it;
+        for (Inst* inst = (Inst*)node->getFirstInst(); inst!=NULL; inst = inst->getNextInst())
{
+            assert(!inst->hasKind(Inst::Kind_I8PseudoInst));
+        }
+    }
+#endif
+}
+
 }}
+
 



Mime
View raw message