From 7776ff6176109fdcc5113b8b0eaa01f04ff66aa7 Mon Sep 17 00:00:00 2001 From: Richard Kistruck Date: Thu, 23 Aug 2007 17:50:31 +0100 Subject: [PATCH] Mps master: poolamc.c amcfix, amcheaderfix: correct bad shield code (but badness was being masked by the shield cache; see job001706). ShieldExpose(seg) once, and ShieldCover it once, so that _all_ .exposed.seg statements are between Expose and Cover. Copied from Perforce Change: 163171 ServerID: perforce.ravenbrook.com --- mps/code/poolamc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mps/code/poolamc.c b/mps/code/poolamc.c index c4fbf8f46a3..7ab6e5b9875 100644 --- a/mps/code/poolamc.c +++ b/mps/code/poolamc.c @@ -1656,11 +1656,10 @@ Res AMCFix(Pool pool, ScanState ss, Seg seg, Ref *refIO) AVER_CRITICAL(ref < SegLimit(seg)); arena = pool->arena; - /* .exposed.seg: statements tagged ".exposed.seg" below require */ + /* .exposed.seg: Statements tagged ".exposed.seg" below require */ /* that "seg" (that is: the 'from' seg) has been ShieldExposed. */ ShieldExpose(arena, seg); newRef = (*format->isMoved)(ref); /* .exposed.seg */ - ShieldCover(arena, seg); /* .exposed.seg */ if(newRef == (Addr)0) { /* If object is nailed already then we mustn't copy it: */ @@ -1724,9 +1723,7 @@ Res AMCFix(Pool pool, ScanState ss, Seg seg, Ref *refIO) } while(!BUFFER_COMMIT(buffer, newRef, length)); ss->copiedSize += length; - ShieldExpose(arena, seg); (*format->move)(ref, newRef); /* .exposed.seg */ - ShieldCover(arena, seg); } else { /* reference to broken heart (which should be snapped out -- */ /* consider adding to (non-existant) snap-out cache here) */ @@ -1740,6 +1737,7 @@ updateReference: res = ResOK; returnRes: + ShieldCover(arena, seg); /* .exposed.seg */ return res; } @@ -1809,11 +1807,10 @@ static Res AMCHeaderFix(Pool pool, ScanState ss, Seg seg, Ref *refIO) AVER_CRITICAL(ref < SegLimit(seg)); /* see .ref-limit */ arena = pool->arena; - /* .exposed.seg: statements tagged ".exposed.seg" below require */ + /* .exposed.seg: Statements tagged ".exposed.seg" below require */ /* that "seg" (that is: the 'from' seg) has been ShieldExposed. */ ShieldExpose(arena, seg); newRef = (*format->isMoved)(ref); /* .exposed.seg */ - ShieldCover(arena, seg); /* .exposed.seg */ if(newRef == (Addr)0) { /* If object is nailed already then we mustn't copy it: */ @@ -1877,9 +1874,7 @@ static Res AMCHeaderFix(Pool pool, ScanState ss, Seg seg, Ref *refIO) } while (!BUFFER_COMMIT(buffer, newBase, length)); ss->copiedSize += length; - ShieldExpose(arena, seg); (*format->move)(ref, newRef); /* .exposed.seg */ - ShieldCover(arena, seg); } else { /* reference to broken heart (which should be snapped out -- */ /* consider adding to (non-existent) snap-out cache here) */ @@ -1893,6 +1888,7 @@ updateReference: res = ResOK; returnRes: + ShieldCover(arena, seg); /* .exposed.seg */ return res; }