From 4e0557e20ee558537350509b3ec080576bc7fc00 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Wed, 23 Mar 2016 19:03:00 +0000 Subject: [PATCH] Improving shieldflushentries to allow for delayed protection changes on shieldlower. Copied from Perforce Change: 190363 ServerID: perforce.ravenbrook.com --- mps/code/shield.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mps/code/shield.c b/mps/code/shield.c index 71ee4ec0950..43eb3e284c5 100644 --- a/mps/code/shield.c +++ b/mps/code/shield.c @@ -226,8 +226,8 @@ static void shieldSync(Shield shield, Seg seg) SHIELD_AVERT_CRITICAL(Seg, seg); if (!SegIsSynced(seg)) { - ProtSet(SegBase(seg), SegLimit(seg), SegSM(seg)); shieldSetPM(shield, seg, SegSM(seg)); + ProtSet(SegBase(seg), SegLimit(seg), SegPM(seg)); } } @@ -418,8 +418,7 @@ static void shieldFlushEntries(Shield shield) if (!SegIsSynced(seg)) { shieldSetPM(shield, seg, SegSM(seg)); if (SegSM(seg) != mode || SegBase(seg) != limit) { - if (mode != AccessSetEMPTY) { - AVER(base != NULL); + if (base != NULL) { AVER(base < limit); ProtSet(base, limit, mode); } @@ -429,9 +428,8 @@ static void shieldFlushEntries(Shield shield) limit = SegLimit(seg); } } - if (mode != AccessSetEMPTY) { - AVER(base != NULL); - AVER(limit != NULL); + if (base != NULL) { + AVER(base < limit); ProtSet(base, limit, mode); } @@ -580,6 +578,7 @@ void (ShieldLower)(Arena arena, Seg seg, AccessSet mode) /* TODO: Do we need to promptly call shieldProtLower here? It loses the opportunity to coalesce the protection call. It would violate design.mps.shield.prop.inside.access. */ + /* shieldQueue(arena, seg); */ shieldProtLower(shield, seg, mode); /* Check queue and segment consistency. */