mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-03-26 16:51:46 -07:00
Make amc obey shield invariants.
Copied from Perforce Change: 25379 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
ab0821c590
commit
445d06b4ea
1 changed files with 9 additions and 29 deletions
|
|
@ -1397,7 +1397,6 @@ Res AMCFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
|
|||
RefSet summary; /* summary of object being relocated */
|
||||
RefSet toSummary; /* summary of object's destination */
|
||||
Seg toSeg; /* segment to which object is being relocated */
|
||||
Bool shieldUp; /* whether we have exposed seg */
|
||||
|
||||
/* design.mps.trace.fix.noaver */
|
||||
AVERT_CRITICAL(Pool, pool);
|
||||
|
|
@ -1441,13 +1440,9 @@ Res AMCFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
|
|||
AVER_CRITICAL(ref < SegLimit(seg));
|
||||
arena = pool->arena;
|
||||
|
||||
/* .access.read: Make sure seg isn't behind a read barrier. */
|
||||
shieldUp = FALSE;
|
||||
if (SegPM(seg) & AccessREAD) {
|
||||
ShieldExpose(arena, seg);
|
||||
shieldUp = TRUE;
|
||||
}
|
||||
ShieldExpose(arena, seg);
|
||||
newRef = (*format->isMoved)(ref);
|
||||
ShieldCover(arena, seg);
|
||||
|
||||
if (newRef == (Addr)0) {
|
||||
/* If object is nailed already then we mustn't copy it: */
|
||||
|
|
@ -1508,12 +1503,9 @@ Res AMCFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
|
|||
} while (!BUFFER_COMMIT(buffer, newRef, length));
|
||||
ss->copiedSize += length;
|
||||
|
||||
/* Make sure there's no read or write barrier. */
|
||||
if (!shieldUp && (SegPM(seg) & (AccessWRITE | AccessREAD))) {
|
||||
ShieldExpose(arena, seg);
|
||||
shieldUp = TRUE;
|
||||
}
|
||||
ShieldExpose(arena, seg);
|
||||
(*format->move)(ref, newRef);
|
||||
ShieldCover(arena, seg);
|
||||
} else {
|
||||
/* reference to broken heart (which should be snapped out -- */
|
||||
/* consider adding to (non-existant) snap-out cache here) */
|
||||
|
|
@ -1527,8 +1519,6 @@ updateReference:
|
|||
res = ResOK;
|
||||
|
||||
returnRes:
|
||||
if (shieldUp)
|
||||
ShieldCover(arena, seg);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -1554,7 +1544,6 @@ static Res AMCHeaderFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
|
|||
RefSet summary; /* summary of object being relocated */
|
||||
RefSet toSummary; /* summary of object's destination */
|
||||
Seg toSeg; /* segment to which object is being relocated */
|
||||
Bool shieldUp; /* whether we have exposed seg */
|
||||
|
||||
/* design.mps.trace.fix.noaver */
|
||||
AVERT_CRITICAL(Pool, pool);
|
||||
|
|
@ -1597,13 +1586,9 @@ static Res AMCHeaderFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
|
|||
AVER_CRITICAL(ref < SegLimit(seg)); /* see .ref-limit */
|
||||
arena = pool->arena;
|
||||
|
||||
/* .access.read.header: Make sure seg isn't behind a read barrier. */
|
||||
shieldUp = FALSE;
|
||||
if (SegPM(seg) & AccessREAD) {
|
||||
ShieldExpose(arena, seg);
|
||||
shieldUp = TRUE;
|
||||
}
|
||||
ShieldExpose(arena, seg);
|
||||
newRef = (*format->isMoved)(ref);
|
||||
ShieldCover(arena, seg);
|
||||
|
||||
if (newRef == (Addr)0) {
|
||||
/* If object is nailed already then we mustn't copy it: */
|
||||
|
|
@ -1667,12 +1652,9 @@ static Res AMCHeaderFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
|
|||
} while (!BUFFER_COMMIT(buffer, newBase, length));
|
||||
ss->copiedSize += length;
|
||||
|
||||
/* Make sure there's no read or write barrier. */
|
||||
if (!shieldUp && (SegPM(seg) & (AccessWRITE | AccessREAD))) {
|
||||
ShieldExpose(arena, seg);
|
||||
shieldUp = TRUE;
|
||||
}
|
||||
ShieldExpose(arena, seg);
|
||||
(*format->move)(ref, newRef);
|
||||
ShieldCover(arena, seg);
|
||||
} else {
|
||||
/* reference to broken heart (which should be snapped out -- */
|
||||
/* consider adding to (non-existent) snap-out cache here) */
|
||||
|
|
@ -1686,8 +1668,6 @@ updateReference:
|
|||
res = ResOK;
|
||||
|
||||
returnRes:
|
||||
if (shieldUp)
|
||||
ShieldCover(arena, seg);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -1967,7 +1947,7 @@ DEFINE_POOL_CLASS(AMCZPoolClass, this)
|
|||
this->grey = PoolNoGrey;
|
||||
this->scan = PoolNoScan;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* mps_class_amc -- return the pool class descriptor to the client */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue