diff options
| author | David Lovemore | 2012-09-10 12:15:20 +0100 |
|---|---|---|
| committer | David Lovemore | 2012-09-10 12:15:20 +0100 |
| commit | 8cc0eeb220353e59c45adeae84d0a34bbe2d62f3 (patch) | |
| tree | 21d0ca271d99be7ef5da8e5d8750c03d5928d7f5 /mps/code | |
| parent | 1c9b8d7eb3455c6ebbf10e5a9b6e8f49dbb51d79 (diff) | |
| download | emacs-8cc0eeb220353e59c45adeae84d0a34bbe2d62f3.tar.gz emacs-8cc0eeb220353e59c45adeae84d0a34bbe2d62f3.zip | |
Scan at correct rank according to the band in arenaread.
Copied from Perforce
Change: 179385
ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
| -rw-r--r-- | mps/code/global.c | 17 | ||||
| -rw-r--r-- | mps/code/poolabs.c | 8 |
2 files changed, 19 insertions, 6 deletions
diff --git a/mps/code/global.c b/mps/code/global.c index 3ca9745388f..5368cb6a04b 100644 --- a/mps/code/global.c +++ b/mps/code/global.c | |||
| @@ -915,12 +915,16 @@ void ArenaPokeSeg(Arena arena, Seg seg, Ref *p, Ref ref) | |||
| 915 | /* ArenaRead -- read a single reference, possibly through a barrier | 915 | /* ArenaRead -- read a single reference, possibly through a barrier |
| 916 | * | 916 | * |
| 917 | * This forms part of a software barrier. It provides fine-grain access | 917 | * This forms part of a software barrier. It provides fine-grain access |
| 918 | * to single references in segments. */ | 918 | * to single references in segments. |
| 919 | * | ||
| 920 | * See also PoolSingleAccess and PoolSegAccess. */ | ||
| 919 | 921 | ||
| 920 | Ref ArenaRead(Arena arena, Ref *p) | 922 | Ref ArenaRead(Arena arena, Ref *p) |
| 921 | { | 923 | { |
| 922 | Bool b; | 924 | Bool b; |
| 923 | Seg seg = NULL; /* suppress "may be used uninitialized" */ | 925 | Seg seg = NULL; /* suppress "may be used uninitialized" */ |
| 926 | Rank rank; | ||
| 927 | Ref ref; | ||
| 924 | 928 | ||
| 925 | AVERT(Arena, arena); | 929 | AVERT(Arena, arena); |
| 926 | 930 | ||
| @@ -935,10 +939,13 @@ Ref ArenaRead(Arena arena, Ref *p) | |||
| 935 | /* it somewhere after having read it) references that are white. */ | 939 | /* it somewhere after having read it) references that are white. */ |
| 936 | AVER(TraceSetSub(SegWhite(seg), arena->flippedTraces)); | 940 | AVER(TraceSetSub(SegWhite(seg), arena->flippedTraces)); |
| 937 | 941 | ||
| 938 | /* .read.conservative: @@@@ Should scan at rank phase-of-trace, */ | 942 | /* .read.conservative: Scan according to rank phase-of-trace, */ |
| 939 | /* not RankEXACT which is conservative. See also */ | 943 | /* See <code/trace.c#scan.conservative> */ |
| 940 | /* <code/trace.c#scan.conservative> for a similar nasty. */ | 944 | rank = TraceRankForAccess(arena, seg); |
| 941 | TraceScanSingleRef(arena->flippedTraces, RankEXACT, arena, seg, p); | 945 | TraceScanSingleRef(arena->flippedTraces, rank, arena, seg, p); |
| 946 | /* We don't need to update the Seg Summary as in PoolSingleAccess | ||
| 947 | * because we are not changing it after it has been scanned. */ | ||
| 948 | |||
| 942 | /* get the possibly fixed reference */ | 949 | /* get the possibly fixed reference */ |
| 943 | return ArenaPeekSeg(arena, seg, p); | 950 | return ArenaPeekSeg(arena, seg, p); |
| 944 | } | 951 | } |
diff --git a/mps/code/poolabs.c b/mps/code/poolabs.c index 9834feb711d..e3e45b7480c 100644 --- a/mps/code/poolabs.c +++ b/mps/code/poolabs.c | |||
| @@ -348,6 +348,8 @@ Res PoolNoAccess(Pool pool, Seg seg, Addr addr, | |||
| 348 | 348 | ||
| 349 | /* SegAccess | 349 | /* SegAccess |
| 350 | * | 350 | * |
| 351 | * See also PoolSingleAccess | ||
| 352 | * | ||
| 351 | * Should be used (for the access method) by Pool Classes which intend | 353 | * Should be used (for the access method) by Pool Classes which intend |
| 352 | * to handle page faults by scanning the entire segment and lowering | 354 | * to handle page faults by scanning the entire segment and lowering |
| 353 | * the barrier. | 355 | * the barrier. |
| @@ -372,6 +374,8 @@ Res PoolSegAccess(Pool pool, Seg seg, Addr addr, | |||
| 372 | 374 | ||
| 373 | /* SingleAccess | 375 | /* SingleAccess |
| 374 | * | 376 | * |
| 377 | * See also ArenaRead, and PoolSegAccess. | ||
| 378 | * | ||
| 375 | * Handles page faults by attempting emulation. If the faulting | 379 | * Handles page faults by attempting emulation. If the faulting |
| 376 | * instruction cannot be emulated then this function returns ResFAIL. | 380 | * instruction cannot be emulated then this function returns ResFAIL. |
| 377 | * | 381 | * |
| @@ -410,7 +414,7 @@ Res PoolSingleAccess(Pool pool, Seg seg, Addr addr, | |||
| 410 | /* .single-access.assume.ref */ | 414 | /* .single-access.assume.ref */ |
| 411 | /* .single-access.improve.format */ | 415 | /* .single-access.improve.format */ |
| 412 | ref = *(Ref *)addr; | 416 | ref = *(Ref *)addr; |
| 413 | /* Check that the reference is aligned to a word boundary */ | 417 | /* .tagging: Check that the reference is aligned to a word boundary */ |
| 414 | /* (we assume it is not a reference otherwise). */ | 418 | /* (we assume it is not a reference otherwise). */ |
| 415 | if(WordIsAligned((Word)ref, sizeof(Word))) { | 419 | if(WordIsAligned((Word)ref, sizeof(Word))) { |
| 416 | Rank rank; | 420 | Rank rank; |
| @@ -427,6 +431,8 @@ Res PoolSingleAccess(Pool pool, Seg seg, Addr addr, | |||
| 427 | 431 | ||
| 428 | /* Update SegSummary according to the possibly changed reference. */ | 432 | /* Update SegSummary according to the possibly changed reference. */ |
| 429 | ref = *(Ref *)addr; | 433 | ref = *(Ref *)addr; |
| 434 | /* .tagging: ought to check the reference for a tag. But | ||
| 435 | * this is conservative. */ | ||
| 430 | SegSetSummary(seg, RefSetAdd(arena, SegSummary(seg), ref)); | 436 | SegSetSummary(seg, RefSetAdd(arena, SegSummary(seg), ref)); |
| 431 | 437 | ||
| 432 | ShieldCover(arena, seg); | 438 | ShieldCover(arena, seg); |