diff options
| author | David Lovemore | 2012-09-10 15:17:38 +0100 |
|---|---|---|
| committer | David Lovemore | 2012-09-10 15:17:38 +0100 |
| commit | 1ece8c4ccb23e7cda087e366f97f139cdb4ea948 (patch) | |
| tree | 520b5226f29ad8f16a77479546b897e1c53c5e06 /mps/code/trace.c | |
| parent | 77ecf56fc2f42ec177a64e9636801bb080d70026 (diff) | |
| download | emacs-1ece8c4ccb23e7cda087e366f97f139cdb4ea948.tar.gz emacs-1ece8c4ccb23e7cda087e366f97f139cdb4ea948.zip | |
Remove whiteminalign handling code which was used to calculate a mask for scanning in tracescanareatagged. for now we use sizeof(word)-1, which will work for dylan and configura.
Copied from Perforce
Change: 179393
ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code/trace.c')
| -rw-r--r-- | mps/code/trace.c | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/mps/code/trace.c b/mps/code/trace.c index ffe800e151e..bb4d4f1cd99 100644 --- a/mps/code/trace.c +++ b/mps/code/trace.c | |||
| @@ -155,7 +155,6 @@ Bool TraceCheck(Trace trace) | |||
| 155 | CHECKL(TraceIdCheck(trace->ti)); | 155 | CHECKL(TraceIdCheck(trace->ti)); |
| 156 | CHECKL(trace == &trace->arena->trace[trace->ti]); | 156 | CHECKL(trace == &trace->arena->trace[trace->ti]); |
| 157 | CHECKL(TraceSetIsMember(trace->arena->busyTraces, trace)); | 157 | CHECKL(TraceSetIsMember(trace->arena->busyTraces, trace)); |
| 158 | CHECKL(AlignCheck(trace->whiteMinAlign)); | ||
| 159 | CHECKL(ZoneSetSub(trace->mayMove, trace->white)); | 158 | CHECKL(ZoneSetSub(trace->mayMove, trace->white)); |
| 160 | /* Use trace->state to check more invariants. */ | 159 | /* Use trace->state to check more invariants. */ |
| 161 | switch(trace->state) { | 160 | switch(trace->state) { |
| @@ -369,10 +368,6 @@ Res TraceAddWhite(Trace trace, Seg seg) | |||
| 369 | trace->mayMove = ZoneSetUnion(trace->mayMove, | 368 | trace->mayMove = ZoneSetUnion(trace->mayMove, |
| 370 | ZoneSetOfSeg(trace->arena, seg)); | 369 | ZoneSetOfSeg(trace->arena, seg)); |
| 371 | } | 370 | } |
| 372 | /* This is used to eliminate unaligned references in TraceScanAreaTagged */ | ||
| 373 | if(pool->alignment < trace->whiteMinAlign) { | ||
| 374 | trace->whiteMinAlign = pool->alignment; | ||
| 375 | } | ||
| 376 | } | 371 | } |
| 377 | 372 | ||
| 378 | return ResOK; | 373 | return ResOK; |
| @@ -694,7 +689,6 @@ found: | |||
| 694 | 689 | ||
| 695 | trace->arena = arena; | 690 | trace->arena = arena; |
| 696 | trace->why = why; | 691 | trace->why = why; |
| 697 | trace->whiteMinAlign = (Align)1 << (MPS_WORD_WIDTH - 1); | ||
| 698 | trace->white = ZoneSetEMPTY; | 692 | trace->white = ZoneSetEMPTY; |
| 699 | trace->mayMove = ZoneSetEMPTY; | 693 | trace->mayMove = ZoneSetEMPTY; |
| 700 | trace->ti = ti; | 694 | trace->ti = ti; |
| @@ -1494,36 +1488,26 @@ Res TraceScanArea(ScanState ss, Addr *base, Addr *limit) | |||
| 1494 | 1488 | ||
| 1495 | /* TraceScanAreaTagged -- scan contiguous area of tagged references | 1489 | /* TraceScanAreaTagged -- scan contiguous area of tagged references |
| 1496 | * | 1490 | * |
| 1497 | * This is as TraceScanArea except words are only fixed they are tagged | 1491 | * .tagging: This is as TraceScanArea except words are only fixed they are |
| 1498 | * as zero according to the minimum alignment of the condemned set. | 1492 | * tagged as zero according to the alignment of a Word. |
| 1499 | */ | 1493 | * |
| 1494 | * See also PoolSingleAccess <code/poolabs.c#.tagging>. | ||
| 1495 | * | ||
| 1496 | * TODO: Generalise the handling of tags so that pools can decide how | ||
| 1497 | * their objects are tagged. This may use the user defined format | ||
| 1498 | * to describe how tags are done */ | ||
| 1500 | Res TraceScanAreaTagged(ScanState ss, Addr *base, Addr *limit) | 1499 | Res TraceScanAreaTagged(ScanState ss, Addr *base, Addr *limit) |
| 1501 | { | 1500 | { |
| 1502 | TraceSet ts; | ||
| 1503 | TraceId ti; | ||
| 1504 | Trace trace; | ||
| 1505 | Arena arena; | ||
| 1506 | Word mask; | 1501 | Word mask; |
| 1507 | 1502 | ||
| 1508 | AVERT(ScanState, ss); | ||
| 1509 | |||
| 1510 | /* This calculation of the mask could be moved to ScanStateInit | ||
| 1511 | * but there is little point as we probably only do a couple of ambiguous | ||
| 1512 | * scan per thread per flip. */ | ||
| 1513 | /* NOTE: An optimisation that maybe worth considering is setting some of the | 1503 | /* NOTE: An optimisation that maybe worth considering is setting some of the |
| 1514 | * top bits in the mask as an early catch of addresses outside the arena. | 1504 | * top bits in the mask as an early catch of addresses outside the arena. |
| 1515 | * This might help slightly on 64-bit windows. However these are picked up | 1505 | * This might help slightly on 64-bit windows. However these are picked up |
| 1516 | * soon afterwards by later checks. The bottom bits are more important | 1506 | * soon afterwards by later checks. The bottom bits are more important |
| 1517 | * to check as we ignore them in AMCFix, so the non-reference could | 1507 | * to check as we ignore them in AMCFix, so the non-reference could |
| 1518 | * otherwise end up pinning an object. */ | 1508 | * otherwise end up pinning an object. */ |
| 1519 | mask = (Word)-1; | 1509 | mask = sizeof(Word) - 1; |
| 1520 | ts = ss->traces; | 1510 | AVER(WordIsP2(mask + 1)); |
| 1521 | arena = ss->arena; | ||
| 1522 | TRACE_SET_ITER(ti, trace, ts, arena) | ||
| 1523 | AVER(WordIsP2(trace->whiteMinAlign)); | ||
| 1524 | mask = mask & (trace->whiteMinAlign - 1); | ||
| 1525 | TRACE_SET_ITER_END(ti, trace, ts, arena); | ||
| 1526 | |||
| 1527 | return TraceScanAreaMasked(ss, base, limit, mask); | 1511 | return TraceScanAreaMasked(ss, base, limit, mask); |
| 1528 | } | 1512 | } |
| 1529 | 1513 | ||