harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r573551 - in /harmony/enhanced/drlvm/trunk: src/test/regression/H4751/ src/test/regression/H4751/Test.java src/test/regression/H4751/run.test.xml vm/jitrino/src/codegenerator/ia32/Ia32BranchTrans.cpp
Date Fri, 07 Sep 2007 11:39:31 GMT
Author: varlax
Date: Fri Sep  7 04:39:29 2007
New Revision: 573551

URL: http://svn.apache.org/viewvc?rev=573551&view=rev
Log:
Applied HARMONY-4751  [drlvm][jit][opt] branch translator may incorrectly remove branches
depending on local vars

Added:
    harmony/enhanced/drlvm/trunk/src/test/regression/H4751/
    harmony/enhanced/drlvm/trunk/src/test/regression/H4751/Test.java   (with props)
    harmony/enhanced/drlvm/trunk/src/test/regression/H4751/run.test.xml   (with props)
Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32BranchTrans.cpp

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H4751/Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H4751/Test.java?rev=573551&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H4751/Test.java (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H4751/Test.java Fri Sep  7 04:39:29 2007
@@ -0,0 +1,40 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.harmony.drlvm.tests.regression.h4751;
+
+import junit.framework.TestCase;
+
+public class Test extends TestCase {
+    
+    public void test() {
+
+        Test t1 = this;
+
+        while (true) {
+            if (t1 == null) {
+                break;
+            } else {
+                Test t2 = t1;
+                t1 = null;
+                t2.foo();  // the bug caused NPE here
+            }
+        }
+    }
+
+    public void foo() {}
+
+}

Propchange: harmony/enhanced/drlvm/trunk/src/test/regression/H4751/Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H4751/run.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H4751/run.test.xml?rev=573551&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H4751/run.test.xml (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H4751/run.test.xml Fri Sep  7 04:39:29
2007
@@ -0,0 +1,9 @@
+<project name="RUN HARMONY-4751 Regression Test">
+    <target name="run-test">
+        <run-junit-test 
+             test="org.apache.harmony.drlvm.tests.regression.h4751.Test"
+             vmarg="-Xem:server">
+        </run-junit-test>
+    </target>
+</project>
+

Propchange: harmony/enhanced/drlvm/trunk/src/test/regression/H4751/run.test.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32BranchTrans.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32BranchTrans.cpp?rev=573551&r1=573550&r2=573551&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32BranchTrans.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32BranchTrans.cpp Fri
Sep  7 04:39:29 2007
@@ -214,19 +214,6 @@
 
                         if (cmpOp1->getDefScope() == Opnd::DefScope_Temporary) {
                             cmpOp1 = getMOVsChainSource(cmpInst, cmpOp1);
-                            if (!cmpOp1->isPlacedIn(OpndKind_Imm)) {
-                                for(Inst * copy = (Inst *)bb->getLastInst();copy!=NULL;
copy=copy->getPrevInst()) {
-                                    Inst::Opnds opnds(copy, Inst::OpndRole_Def|Inst::OpndRole_ForIterator);
-                                    for (Inst::Opnds::iterator ito = opnds.begin(); ito !=
opnds.end(); ito = opnds.next(ito)){
-                                        Opnd * opnd = copy->getOpnd(ito);
-                                        if (opnd == cmpOp1 && copy->getMnemonic()
== Mnemonic_MOV) {
-                                            cmpOp1 = copy->getOpnd(1);
-                                        } else {
-                                            break;
-                                        }
-                                    }
-                                }
-                            }
                             if (cmpOp1->isPlacedIn(OpndKind_Imm)) {
                                 cmpOp2 = getMOVsChainSource(cmpInst, cmpOp2);
                                 if (cmpOp2->isPlacedIn(OpndKind_Imm)) { 



Mime
View raw message