You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by mf...@apache.org on 2007/12/06 17:06:18 UTC

svn commit: r601772 - in /harmony/enhanced/drlvm/trunk/vm/jitrino/src: codegenerator/ia32/Ia32SpillGen.cpp optimizer/globalcodemotion.cpp optimizer/osr.cpp

Author: mfursov
Date: Thu Dec  6 08:06:17 2007
New Revision: 601772

URL: http://svn.apache.org/viewvc?rev=601772&view=rev
Log:
Fix for HARMONY-5267 [drlvm][jit] Spillgen makes unnecessary spills and produces incorrect code
Fix for HARMONY-5236 [drlvm][jit][opt] Eclipse fails when run in -Xem:opt mode
Fix for HARMONY-5252 [drlvm][jit][opt] H5090 causes JBOSS failure


Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/globalcodemotion.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/osr.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp?rev=601772&r1=601771&r2=601772&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp Thu Dec  6 08:06:17 2007
@@ -621,8 +621,8 @@
                     break;
 
 #ifdef _DEBUG_SPILLGEN
-                if (log(LogStream::DBG).isEnabled())
-                    outInstxs(log(LogStream::DBG).out(), *this);
+                if (Log::isEnabled())
+                    outInstxs(Log::out(), *this);
 #endif
 
                 size_t x;
@@ -660,10 +660,10 @@
     count_emits += emitted;
 
 #ifdef _DEBUG_SPILLGEN
-    log(LogStream::DBG) << endl << "Emitted movs :" << emitted << endl;
+    DBGOUT(endl << "Emitted movs :" << emitted << endl);
 
     if (fails)
-        log(LogStream::DBG) << endl << "FAILS: " << fails << endl;
+        DBGOUT(endl << "FAILS: " << fails << endl);
 #endif
 
     assert(fails == 0);
@@ -729,11 +729,10 @@
         instxp->regusage [i] = 0;
 
 #ifdef _DEBUG_SPILLGEN
-    log(LogStream::DBG) << endl << "BB#"<< bblock->getId();
+    DBGOUT(endl << "BB#"<< bblock->getId());
     if (!instxs.empty())
-        log(LogStream::DBG) << " [" << *(Inst*)bblock->getFirstInst() << " - " << *(Inst*)bblock->getLastInst() << "] ";
-    log(LogStream::DBG) << instxs.size() - 1
-                        << endl;
+        DBGOUT (" [" << *(Inst*)bblock->getFirstInst() << " - " << *(Inst*)bblock->getLastInst() << "] ");
+    DBGOUT(instxs.size() - 1 << endl);
 #endif
 
 //  calculate registers used at the block exit
@@ -1706,9 +1705,11 @@
     if (evict == 0)
         return RegName_Null;
 
-    if (evict->endx->inst->hasKind(Inst::Kind_LocalControlTransferInst))
-        if (--(evict->endx) < evict->begx)
+    if (evict->endx->inst->hasKind(Inst::Kind_LocalControlTransferInst)) {
+        --(evict->endx);
+        if ((evict->endx < evict->begx) || (evict->endx < endx))
             return RegName_Null;
+    }
 
     if (endx > evict->endx)
         endx = evict->endx;
@@ -1880,6 +1881,7 @@
 } //namespace Ia32
 
 } //namespace Jitrino
+
 
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/globalcodemotion.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/globalcodemotion.cpp?rev=601772&r1=601771&r2=601772&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/globalcodemotion.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/globalcodemotion.cpp Thu Dec  6 08:06:17 2007
@@ -335,8 +335,13 @@
         // find earliest intermediate basic block,  starting from the block containing i
         DominatorNode *instEarliest = domNode;
         for (currentEarliest = domNode; ; currentEarliest = currentEarliest->getParent()) {
-            Node *candidateNode = currentEarliest->getNode();
-            if (Log::isEnabled() ) {
+            if(currentEarliest==0){
+	    	break;
+	    }
+	
+	    Node *candidateNode = currentEarliest->getNode();
+	    
+	    if (Log::isEnabled() ) {
                 Log::out() << "  trying node "; FlowGraph::printLabel(Log::out(), candidateNode);
             }
             // intermediate basic blocks with catch labels are

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/osr.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/osr.cpp?rev=601772&r1=601771&r2=601772&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/osr.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/osr.cpp Thu Dec  6 08:06:17 2007
@@ -582,7 +582,7 @@
                     SsaOpnd* opnd1, SsaOpnd* opnd2){
     findLeadingOpnd(opnd2->getInst(), opnd2);
     SsaOpnd* opnd2Leader = getLeadingOperand(opnd2);
-    if (opnd2 != 0) {
+    if (opnd2Leader!= 0) {
         opnd2 = opnd2Leader;
     }