aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code
diff options
context:
space:
mode:
authorNick Barnes2002-06-20 17:11:31 +0100
committerNick Barnes2002-06-20 17:11:31 +0100
commit59360f67ff1c808eab4de8f4ff5d7e75a63d6666 (patch)
tree73031a3c5c8aac4c4abf03b29050fb4f76e5ea95 /mps/code
parent230b5bf00a8234695553cda27a2da45857570fef (diff)
downloademacs-59360f67ff1c808eab4de8f4ff5d7e75a63d6666.tar.gz
emacs-59360f67ff1c808eab4de8f4ff5d7e75a63d6666.zip
Ams now uses (!nonwhite & !nongrey) for grey. see analysis of job000535.
Copied from Perforce Change: 30349 ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
-rw-r--r--mps/code/poolams.c37
-rw-r--r--mps/code/poolams.h14
2 files changed, 34 insertions, 17 deletions
diff --git a/mps/code/poolams.c b/mps/code/poolams.c
index b8542425954..b8650af428e 100644
--- a/mps/code/poolams.c
+++ b/mps/code/poolams.c
@@ -1451,11 +1451,28 @@ static Res AMSFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
1451 1451
1452/* AMSBlacken -- the pool class blackening method 1452/* AMSBlacken -- the pool class blackening method
1453 * 1453 *
1454 * Turn all grey objects black. 1454 * Turn all grey objects black. */
1455 */ 1455
1456
1457static Res amsBlackenObject(Seg seg, Index i, Addr p, Addr next, void *clos)
1458{
1459 AVER(clos == NULL);
1460 /* Do what amsScanObject does, minus the scanning. */
1461 if (AMS_IS_GREY(seg, i)) {
1462 Index j = AMS_ADDR_INDEX(seg, next);
1463 AVER(!AMS_IS_INVALID_COLOUR(seg, i));
1464 AMS_GREY_BLACKEN(seg, i);
1465 if (i+1 < j)
1466 AMS_RANGE_BLACKEN(seg, i+1, j);
1467 }
1468 return ResOK;
1469}
1470
1471
1456static void AMSBlacken(Pool pool, TraceSet traceSet, Seg seg) 1472static void AMSBlacken(Pool pool, TraceSet traceSet, Seg seg)
1457{ 1473{
1458 AMS ams; 1474 AMS ams;
1475 Res res;
1459 1476
1460 AVERT(Pool, pool); 1477 AVERT(Pool, pool);
1461 ams = Pool2AMS(pool); 1478 ams = Pool2AMS(pool);
@@ -1463,14 +1480,14 @@ static void AMSBlacken(Pool pool, TraceSet traceSet, Seg seg)
1463 AVERT(TraceSet, traceSet); 1480 AVERT(TraceSet, traceSet);
1464 AVERT(Seg, seg); 1481 AVERT(Seg, seg);
1465 1482
1466 /* If it's white for any of these traces, remove the greyness from tables. */ 1483 /* If it's white for any of these traces, turn grey to black without scanning. */
1467 if (TraceSetInter(traceSet, SegWhite(seg)) != TraceSetEMPTY) { 1484 if (TraceSetInter(traceSet, SegWhite(seg)) != TraceSetEMPTY) {
1468 AMSSeg amsseg = Seg2AMSSeg(seg); 1485 AMSSeg amsseg = Seg2AMSSeg(seg);
1469 AVERT(AMSSeg, amsseg); 1486 AVERT(AMSSeg, amsseg);
1470 AVER(amsseg->marksChanged); /* there must be something grey */ 1487 AVER(amsseg->marksChanged); /* there must be something grey */
1471 amsseg->marksChanged = FALSE; 1488 amsseg->marksChanged = FALSE;
1472 /* This will turn grey->black, and not affect black or white. */ 1489 res = amsIterate(seg, amsBlackenObject, NULL);
1473 BTSetRange(amsseg->nongreyTable, 0, amsseg->grains); 1490 AVER(res == ResOK);
1474 } 1491 }
1475} 1492}
1476 1493
@@ -1685,18 +1702,18 @@ Bool AMSCheck(AMS ams)
1685 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>. 1702 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
1686 * All rights reserved. This is an open source license. Contact 1703 * All rights reserved. This is an open source license. Contact
1687 * Ravenbrook for commercial licensing options. 1704 * Ravenbrook for commercial licensing options.
1688 * 1705 *
1689 * Redistribution and use in source and binary forms, with or without 1706 * Redistribution and use in source and binary forms, with or without
1690 * modification, are permitted provided that the following conditions are 1707 * modification, are permitted provided that the following conditions are
1691 * met: 1708 * met:
1692 * 1709 *
1693 * 1. Redistributions of source code must retain the above copyright 1710 * 1. Redistributions of source code must retain the above copyright
1694 * notice, this list of conditions and the following disclaimer. 1711 * notice, this list of conditions and the following disclaimer.
1695 * 1712 *
1696 * 2. Redistributions in binary form must reproduce the above copyright 1713 * 2. Redistributions in binary form must reproduce the above copyright
1697 * notice, this list of conditions and the following disclaimer in the 1714 * notice, this list of conditions and the following disclaimer in the
1698 * documentation and/or other materials provided with the distribution. 1715 * documentation and/or other materials provided with the distribution.
1699 * 1716 *
1700 * 3. Redistributions in any form must be accompanied by information on how 1717 * 3. Redistributions in any form must be accompanied by information on how
1701 * to obtain complete source code for this software and any accompanying 1718 * to obtain complete source code for this software and any accompanying
1702 * software that uses this software. The source code must either be 1719 * software that uses this software. The source code must either be
@@ -1707,7 +1724,7 @@ Bool AMSCheck(AMS ams)
1707 * include source code for modules or files that typically accompany the 1724 * include source code for modules or files that typically accompany the
1708 * major components of the operating system on which the executable file 1725 * major components of the operating system on which the executable file
1709 * runs. 1726 * runs.
1710 * 1727 *
1711 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 1728 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
1712 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 1729 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
1713 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 1730 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
diff --git a/mps/code/poolams.h b/mps/code/poolams.h
index 7a4c27bfd59..e2d34b178a5 100644
--- a/mps/code/poolams.h
+++ b/mps/code/poolams.h
@@ -110,17 +110,17 @@ typedef struct AMSSegStruct {
110 (!AMS_IS_GREY(seg, index) && !AMS_IS_WHITE(seg, index)) 110 (!AMS_IS_GREY(seg, index) && !AMS_IS_WHITE(seg, index))
111 111
112#define AMS_IS_INVALID_COLOUR(seg, index) \ 112#define AMS_IS_INVALID_COLOUR(seg, index) \
113 (AMS_IS_GREY(seg, index) && AMS_IS_WHITE(seg, index)) 113 (AMS_IS_GREY(seg, index) && !AMS_IS_WHITE(seg, index))
114 114
115#define AMS_WHITE_GREYEN(seg, index) \ 115#define AMS_WHITE_GREYEN(seg, index) \
116 BEGIN \ 116 BEGIN \
117 BTSet(Seg2AMSSeg(seg)->nonwhiteTable, index); \
118 BTRes(Seg2AMSSeg(seg)->nongreyTable, index); \ 117 BTRes(Seg2AMSSeg(seg)->nongreyTable, index); \
119 END 118 END
120 119
121#define AMS_GREY_BLACKEN(seg, index) \ 120#define AMS_GREY_BLACKEN(seg, index) \
122 BEGIN \ 121 BEGIN \
123 BTSet(Seg2AMSSeg(seg)->nongreyTable, index); \ 122 BTSet(Seg2AMSSeg(seg)->nongreyTable, index); \
123 BTSet(Seg2AMSSeg(seg)->nonwhiteTable, index); \
124 END 124 END
125 125
126#define AMS_WHITE_BLACKEN(seg, index) \ 126#define AMS_WHITE_BLACKEN(seg, index) \
@@ -200,18 +200,18 @@ extern AMSPoolClass AMSDebugPoolClassGet(void);
200 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>. 200 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
201 * All rights reserved. This is an open source license. Contact 201 * All rights reserved. This is an open source license. Contact
202 * Ravenbrook for commercial licensing options. 202 * Ravenbrook for commercial licensing options.
203 * 203 *
204 * Redistribution and use in source and binary forms, with or without 204 * Redistribution and use in source and binary forms, with or without
205 * modification, are permitted provided that the following conditions are 205 * modification, are permitted provided that the following conditions are
206 * met: 206 * met:
207 * 207 *
208 * 1. Redistributions of source code must retain the above copyright 208 * 1. Redistributions of source code must retain the above copyright
209 * notice, this list of conditions and the following disclaimer. 209 * notice, this list of conditions and the following disclaimer.
210 * 210 *
211 * 2. Redistributions in binary form must reproduce the above copyright 211 * 2. Redistributions in binary form must reproduce the above copyright
212 * notice, this list of conditions and the following disclaimer in the 212 * notice, this list of conditions and the following disclaimer in the
213 * documentation and/or other materials provided with the distribution. 213 * documentation and/or other materials provided with the distribution.
214 * 214 *
215 * 3. Redistributions in any form must be accompanied by information on how 215 * 3. Redistributions in any form must be accompanied by information on how
216 * to obtain complete source code for this software and any accompanying 216 * to obtain complete source code for this software and any accompanying
217 * software that uses this software. The source code must either be 217 * software that uses this software. The source code must either be
@@ -222,7 +222,7 @@ extern AMSPoolClass AMSDebugPoolClassGet(void);
222 * include source code for modules or files that typically accompany the 222 * include source code for modules or files that typically accompany the
223 * major components of the operating system on which the executable file 223 * major components of the operating system on which the executable file
224 * runs. 224 * runs.
225 * 225 *
226 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 226 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
227 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 227 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
228 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 228 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR