harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r521699 - in /harmony/enhanced/drlvm/trunk: src/test/regression/H2874/ src/test/regression/H2874/Test.java src/test/regression/H2874/run.test.xml vm/jitrino/src/optimizer/escanalyzer.cpp
Date Fri, 23 Mar 2007 12:26:30 GMT
Author: varlax
Date: Fri Mar 23 05:26:29 2007
New Revision: 521699

URL: http://svn.apache.org/viewvc?view=rev&rev=521699
Log:
HARMONY-2874 [drlvm] Segfault in Scalar replacement optimization fixed
Regression test added

Added:
    harmony/enhanced/drlvm/trunk/src/test/regression/H2874/
    harmony/enhanced/drlvm/trunk/src/test/regression/H2874/Test.java
    harmony/enhanced/drlvm/trunk/src/test/regression/H2874/run.test.xml
Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H2874/Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H2874/Test.java?view=auto&rev=521699
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H2874/Test.java (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H2874/Test.java Fri Mar 23 05:26:29 2007
@@ -0,0 +1,41 @@
+package org.apache.harmony.drlvm.tests.regression.H2874;
+
+import junit.framework.TestCase;
+
+
+
+class aeo0 {
+    private long num;
+    public aeo0() { num = 0; }
+    public void inc(aeo1 i) { num++; }
+    public void inc1() { num++; }
+    public long getNum() { return num; }
+    public void reset() { num = 0; }
+}
+class aeo1 {
+}
+
+public class Test extends TestCase {
+    static final long limit = 100000000;
+    static aeo0 obj = new aeo0();
+
+    public void test() {
+        long before = 0, after = 0;
+        for (int i = 0; i < 5; i++) {    
+            obj.reset();
+            before = System.currentTimeMillis();
+            for (long k = 0; k < limit; k++ ) {
+                dofc(k);
+            }
+            after = System.currentTimeMillis();
+            System.out.println("Calls per millisecond: " + (obj.getNum() / (after - before)));
+        }
+    }
+    static void dofc(long i) {
+        aeo1 i1 = new aeo1();
+        obj.inc1();
+        if (i<0) {
+            obj.inc(i1);
+        }
+    }
+}

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

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp?view=diff&rev=521699&r1=521698&r2=521699
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp Fri Mar 23 05:26:29
2007
@@ -4837,7 +4837,7 @@
         collectStLdInsts(onode, scObjFlds);
 
         if (_scinfo) {
-            os_sc << " found objects " << scObjFlds->size() << std::endl;
+            os_sc << " doLOSR: found object fields " << scObjFlds->size()
<< std::endl;
         }
 
         if (onode->nodeType == NT_LDOBJ) {
@@ -5107,7 +5107,7 @@
             }
             collectStLdInsts(nonode, nscObjFlds);
             if (_scinfo) {
-                os_sc << " found objects for newobj " << nscObjFlds->size()
<< std::endl;
+                os_sc << " doEOSR: found object fields for newobj " << nscObjFlds->size()
<< std::endl;
             }
             if (!checkObjFlds(nscObjFlds, scObjFlds)) {
                 if (_scinfo) {
@@ -5124,14 +5124,12 @@
         collectCallInsts(onode->cngNodeId, vc_insts, vcids);
 
         if (_scinfo) {
-            os_sc << " found objects " << scObjFlds->size() << " vc_inst
" << vc_insts->size()  
+            os_sc << " doEOSR: found object fields " << scObjFlds->size()
<< " vc_inst " << vc_insts->size()  
                 << std::endl;
         }
         if (_scinfo) {
-            if (lobj_opt) {
-                for (it3=vc_insts->begin(); it3!=vc_insts->end(); it3++) {
-                    (*it3)->print(os_sc); os_sc << std::endl;
-                }
+            for (it3=vc_insts->begin(); it3!=vc_insts->end(); it3++) {
+                (*it3)->print(os_sc); os_sc << std::endl;
             }
         }
 
@@ -5147,12 +5145,12 @@
         Edge* excedge = NULL;
         VarOpnd* ob_flag_opnd = _opndManager.createVarOpnd(typeInt32, false);
         VarOpnd* ob_var_opnd = _opndManager.createVarOpnd(nobj_inst->getDst()->getType(),
false);
-        SsaTmpOpnd* ob_init_opnd = NULL;
+        SsaTmpOpnd* ob_init_opnd = _opndManager.createSsaTmpOpnd(ob_var_opnd->getType());
         uint32 ob_id = onode->opndId;
         Node* ob_exc_tnode = NULL;
         Insts::iterator itvc;
         ScObjFlds::iterator ito;
-        Node* node_no = NULL;
+        Node* node_no = nobj_inst->getNode();
         ScObjFld* sco = NULL;
 
         insertLdConst(1);
@@ -5167,8 +5165,6 @@
             lobj_inst = lonode->nInst;
         }
         if (scObjFlds->size() > 0) {
-            ob_init_opnd = _opndManager.createSsaTmpOpnd(ob_var_opnd->getType());
-            node_no = nobj_inst->getNode();
             for (ito = scObjFlds->begin( ); ito != scObjFlds->end( ); ito++ ){
                 sco = (*ito);
                 if (sco->ls_insts->size()==0)
@@ -6190,11 +6186,6 @@
                 Inst* stv = _instFactory.makeStVar(sco->fldVarOpnd,fl_tmp_opnd_ld);
                 node_after1->appendInst(stv);
             }
-            if (tnode!=NULL) {
-                node_obj1=fg.splitNodeAtInstruction(newobj,splitAfter,false,
-                    _instFactory.makeLabel());
-                fg.addEdge(node_obj,tnode);
-            }
             if (node_after1 != NULL) {
                 if (_scinfo) {
                     os_sc << "!!!! to restore not final fields "  << std::endl;
@@ -6206,19 +6197,24 @@
                 fg.addEdge(node_var,node_after1);
                 fg.addEdge(node_after1,node_after);
             }
-            if (_scinfo) {
-                os_sc << "++++ objectCreate: after"  << std::endl;
-                FlowGraph::print(os_sc,node_before);
-                FlowGraph::print(os_sc,node_obj);
-                if (node_obj1 != NULL) {
-                   FlowGraph::print(os_sc,node_obj1);
-                }
-                FlowGraph::print(os_sc,node_var);
-                if (node_after1 != NULL) {
-                    FlowGraph::print(os_sc,node_after1);
-                }
-                os_sc << "++++ objectCreate: after end"  << std::endl;
+        }
+        if (tnode!=NULL) {
+            node_obj1=fg.splitNodeAtInstruction(newobj,splitAfter,false,
+                _instFactory.makeLabel());
+            fg.addEdge(node_obj,tnode);
+        }
+        if (_scinfo) {
+            os_sc << "++++ objectCreate: after"  << std::endl;
+            FlowGraph::print(os_sc,node_before);
+            FlowGraph::print(os_sc,node_obj);
+            if (node_obj1 != NULL) {
+                FlowGraph::print(os_sc,node_obj1);
+            }
+            FlowGraph::print(os_sc,node_var);
+            if (node_after1 != NULL) {
+                FlowGraph::print(os_sc,node_after1);
             }
+            os_sc << "++++ objectCreate: after end"  << std::endl;
         }
     }
 } // restoreEOCreation(Insts* vc_insts, ScObjFlds* objs, VarOpnd* ob_var_opnd,...)



Mime
View raw message