harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfur...@apache.org
Subject svn commit: r567998 - in /harmony/enhanced/drlvm/trunk/vm: em/src/DrlEMImpl.cpp jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp
Date Tue, 21 Aug 2007 07:53:13 GMT
Author: mfursov
Date: Tue Aug 21 00:53:12 2007
New Revision: 567998

URL: http://svn.apache.org/viewvc?rev=567998&view=rev
Log:
Fix for HARMONY-4309 [drlvm][jit] problem with allocation for dead-def and jump instructions
in spillgen
Adding "new-line" to DrlEMImpl.cpp 

Modified:
    harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp?rev=567998&r1=567997&r2=567998&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp Tue Aug 21 00:53:12 2007
@@ -840,4 +840,5 @@
 
 void DrlEMImpl::classloaderUnloadingCallback(ClassLoaderHandle class_handle) {
     //notify every profile collector about classloader unloading
-}
\ No newline at end of file
+}
+

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=567998&r1=567997&r2=567998&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 Tue Aug
21 00:53:12 2007
@@ -1364,6 +1364,9 @@
     if (loadOpnd(opline, begx, opnd_reg))
         (begx-1)->regusage[opline.idx] |= mk;
 
+    bool has_def = false;
+    Instx* savex = endx;
+
     for (Instx* ptrx = begx; ptrx <= endx; ++ptrx)
     {
         if (opline.save_changed && opline.catched && ptrx->inst->hasKind(Inst::Kind_CallInst))
@@ -1376,7 +1379,11 @@
         {// the operand is used in the instruction
             ++reguses;
             if (opline.isDef(ptrx->inst))
+            {
+                has_def = true;
                 opline.save_changed = true;
+                savex = ptrx;
+            }
         }
         else
         {// the operand is not used in the instruction, so it can be evicted
@@ -1384,17 +1391,18 @@
                 ptrx->evicts->push_back(opnd_reg);
         }
 
-        if (ptrx != endx)
+    //  special processing for dead-definition (begx == endx && has_def)
+        if (ptrx != endx || (begx == endx && has_def))
             ptrx->regusage[opline.idx] |= mk;
     }
 
     bool before = false;
-    if (endx->inst->getMnemonic() == Mnemonic_CALL && !opline.isDef(endx->inst))
+    if (savex->inst->getMnemonic() == Mnemonic_CALL && !opline.isDef(savex->inst))
     {
-        Constraint ci = static_cast<CallInst*>(endx->inst)->getCalleeSaveRegs(getRegKind(rn));
+        Constraint ci = static_cast<CallInst*>(savex->inst)->getCalleeSaveRegs(getRegKind(rn));
         before = (ci.getMask() & mk) == 0;
     }
-    saveOpnd(opline, endx, opnd_reg, before ? 0 : mk, opline.idx, before);
+    saveOpnd(opline, savex, opnd_reg, before ? 0 : mk, opline.idx, before);
 
 #ifdef _DEBUG_SPILLGEN
     assigns.incr(reguses);



Mime
View raw message