harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r530253 - /harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp
Date Thu, 19 Apr 2007 03:52:31 GMT
Author: varlax
Date: Wed Apr 18 20:52:30 2007
New Revision: 530253

URL: http://svn.apache.org/viewvc?view=rev&rev=530253
Log:
Applied HARMONY-3642 [drlvm][jit][opt] assertion failure in Ia32GCSafePoints.cpp in debug
builds

Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp?view=diff&rev=530253&r1=530252&r2=530253
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp Wed
Apr 18 20:52:30 2007
@@ -456,10 +456,16 @@
                 pair->base = opnd;
             }
         } else { //def of mptr
+            // detect which operand is base
             Opnd* fromOpnd = inst->getOpnd(useIndex1);
-            int32 offset = MPTR_OFFSET_UNKNOWN;
-            assert(fromOpnd->getType()->isObject() || fromOpnd->getType()->isManagedPtr());
             uint32 useIndex2 = opnds.next(useIndex1);
+            Opnd* fromOpnd2 = useIndex2!=opnds.end() ? inst->getOpnd(useIndex2) : NULL;
+            if (!(fromOpnd->getType()->isObject() || fromOpnd->getType()->isManagedPtr()))
{
+                assert(fromOpnd2!=NULL);
+                Opnd* tmp = fromOpnd; fromOpnd = fromOpnd2; fromOpnd2 = tmp;
+            }
+            assert(fromOpnd->getType()->isObject() || fromOpnd->getType()->isManagedPtr());
+            int32 offset = MPTR_OFFSET_UNKNOWN;
             if (inst->getMnemonic() == Mnemonic_LEA) {
                 assert(fromOpnd->isPlacedIn(OpndKind_Memory));
                 Opnd* scaleOpnd = fromOpnd->getMemOpndSubOpnd(MemOpndSubOpndKind_Scale);
@@ -469,8 +475,8 @@
                     offset = (int32)displOpnd->getImmValue();
                 }
                 fromOpnd = fromOpnd->getMemOpndSubOpnd(MemOpndSubOpndKind_Base);
-            } else if (useIndex2 < opnds.end()) {
-                Opnd* offsetOpnd = inst->getOpnd(useIndex2); 
+            } else if (fromOpnd2!=NULL) {
+                Opnd* offsetOpnd = fromOpnd2; 
                 offset = getOffsetFromImmediate(offsetOpnd);
             }
             updateMptrInfoInPairs(res, opnd, fromOpnd, offset, fromOpnd->getType()->isObject());



Mime
View raw message