aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code
diff options
context:
space:
mode:
authorNick Barnes2002-12-30 13:55:44 +0000
committerNick Barnes2002-12-30 13:55:44 +0000
commit27f6ee2a8dd9b1db89bbe7967c765eefc1505106 (patch)
tree566cf9d290c17619a0c2cd493275cc21915bdc95 /mps/code
parentd1cab62bc820aecbb5cec4d9f44f63da30047a49 (diff)
parente0b805400340b4edc4ea2b6421bcf2cf80aa11c4 (diff)
downloademacs-27f6ee2a8dd9b1db89bbe7967c765eefc1505106.tar.gz
emacs-27f6ee2a8dd9b1db89bbe7967c765eefc1505106.zip
Integrate version 1.100 branch ready for development towards 1.101.
Copied from Perforce Change: 37426 ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
-rw-r--r--mps/code/bttest.c12
-rw-r--r--mps/code/cbstest.c2
-rw-r--r--mps/code/comm.gmk9
-rw-r--r--mps/code/commpost.nmk14
-rw-r--r--mps/code/commpre.nmk10
-rw-r--r--mps/code/config.h8
-rw-r--r--mps/code/finaltest.c301
-rw-r--r--mps/code/fmtdytst.c65
-rw-r--r--mps/code/fmtdytst.h18
-rw-r--r--mps/code/fri4gc.gmk5
-rw-r--r--mps/code/poolams.c1
-rw-r--r--mps/code/steptest.c558
-rw-r--r--mps/code/teletest.c4
-rwxr-xr-xmps/code/w3build.bat44
-rw-r--r--mps/code/w3i3mv.nmk22
-rw-r--r--mps/code/xcppgc.gmk4
16 files changed, 835 insertions, 242 deletions
diff --git a/mps/code/bttest.c b/mps/code/bttest.c
index 736a0f23c3e..3c5e44833c6 100644
--- a/mps/code/bttest.c
+++ b/mps/code/bttest.c
@@ -223,17 +223,17 @@ static void help(void)
223 "d destroy the current BT\n" 223 "d destroy the current BT\n"
224 "s <i> set the bit index 'i'\n" 224 "s <i> set the bit index 'i'\n"
225 "r <i> reset the bit index 'i'\n" 225 "r <i> reset the bit index 'i'\n"
226 "g <i> get the bit index 'i'\n" 226 "g <i> get the bit index 'i'\n");
227 "sr [<i> <i>] set the specified range\n" 227 printf("sr [<i> <i>] set the specified range\n"
228 "rr [<i> <i>] reset the specified range\n" 228 "rr [<i> <i>] reset the specified range\n"
229 "is [<i> <i>] is the specified range set?\n" 229 "is [<i> <i>] is the specified range set?\n"
230 "ir [<i> <i>] is the specified range reset?\n" 230 "ir [<i> <i>] is the specified range reset?\n");
231 "f <l> [<i> <i>] find a reset range of length 'l'.\n" 231 printf("f <l> [<i> <i>] find a reset range of length 'l'.\n"
232 "fh <l> [<i> <i>] find a reset range length 'l', working downwards\n" 232 "fh <l> [<i> <i>] find a reset range length 'l', working downwards\n"
233 "fl <l> [<i> <i>] find a reset range of length at least 'l'\n" 233 "fl <l> [<i> <i>] find a reset range of length at least 'l'\n"
234 "q quit\n" 234 "q quit\n"
235 "? print this message\n" 235 "? print this message\n");
236 "\n" 236 printf("\n"
237 "No way of testing BTSize, BTRangesSame, or BTCopyInvertRange.\n"); 237 "No way of testing BTSize, BTRangesSame, or BTCopyInvertRange.\n");
238} 238}
239 239
diff --git a/mps/code/cbstest.c b/mps/code/cbstest.c
index 0e2f4a42fa6..393a17c162d 100644
--- a/mps/code/cbstest.c
+++ b/mps/code/cbstest.c
@@ -607,7 +607,7 @@ extern int main(int argc, char *argv[])
607 "failed to allocate block"); 607 "failed to allocate block");
608 dummyBlock = (Addr)p; /* avoid pun */ 608 dummyBlock = (Addr)p; /* avoid pun */
609 609
610 printf("Allocated block [%p, %p)\n", dummyBlock, 610 printf("Allocated block [%p, %p)\n", (void*)dummyBlock,
611 (char *)dummyBlock + ArraySize); 611 (char *)dummyBlock + ArraySize);
612 612
613 checkCBS(cbs, allocTable, dummyBlock); 613 checkCBS(cbs, allocTable, dummyBlock);
diff --git a/mps/code/comm.gmk b/mps/code/comm.gmk
index 1714cf46d5a..b7cc3011a55 100644
--- a/mps/code/comm.gmk
+++ b/mps/code/comm.gmk
@@ -266,7 +266,7 @@ endif
266 266
267all: mpmss sacss amcss amcsshe amsss amssshe segsmss awlut awluthe \ 267all: mpmss sacss amcss amcsshe amsss amssshe segsmss awlut awluthe \
268 mpsicv lockcov poolncv locv qs apss \ 268 mpsicv lockcov poolncv locv qs apss \
269 finalcv arenacv bttest teletest \ 269 finalcv finaltest arenacv bttest teletest \
270 abqtest cbstest btcv mv2test messtest steptest \ 270 abqtest cbstest btcv mv2test messtest steptest \
271 eventcnv mps.a 271 eventcnv mps.a
272 272
@@ -277,7 +277,7 @@ swall: mmsw.a replaysw
277# bttest & teletest cannot be run unattended 277# bttest & teletest cannot be run unattended
278# mv2test cannot be run because MV2 is broken 278# mv2test cannot be run because MV2 is broken
279testrun: mpmss apss sacss amcss amcsshe amsss amssshe segsmss awlut awluthe \ 279testrun: mpmss apss sacss amcss amcsshe amsss amssshe segsmss awlut awluthe \
280 mpsicv lockcov poolncv locv qs finalcv arenacv \ 280 mpsicv lockcov poolncv locv qs finalcv finaltest arenacv \
281 abqtest cbstest btcv messtest steptest 281 abqtest cbstest btcv messtest steptest
282 $(^:%=date && $(PFM)/$(VARIETY)/% &&) true 282 $(^:%=date && $(PFM)/$(VARIETY)/% &&) true
283 283
@@ -288,7 +288,7 @@ testrun: mpmss apss sacss amcss amcsshe amsss amssshe segsmss awlut awluthe \
288 288
289mpmss sacss amcss amcssth amcsshe amsss amssshe segsmss awlut awlutth \ 289mpmss sacss amcss amcssth amcsshe amsss amssshe segsmss awlut awlutth \
290 awluthe mpsicv lockcov poolncv locv qs apss \ 290 awluthe mpsicv lockcov poolncv locv qs apss \
291 finalcv arenacv bttest teletest \ 291 finalcv finaltest arenacv bttest teletest \
292 abqtest cbstest btcv mv2test \ 292 abqtest cbstest btcv mv2test \
293 messtest steptest \ 293 messtest steptest \
294 eventcnv replay replaysw \ 294 eventcnv replay replaysw \
@@ -344,6 +344,9 @@ ifdef VARIETY
344$(PFM)/$(VARIETY)/finalcv: $(PFM)/$(VARIETY)/finalcv.o \ 344$(PFM)/$(VARIETY)/finalcv: $(PFM)/$(VARIETY)/finalcv.o \
345 $(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ) 345 $(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ)
346 346
347$(PFM)/$(VARIETY)/finaltest: $(PFM)/$(VARIETY)/finaltest.o \
348 $(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ)
349
347$(PFM)/$(VARIETY)/locv: $(PFM)/$(VARIETY)/locv.o \ 350$(PFM)/$(VARIETY)/locv: $(PFM)/$(VARIETY)/locv.o \
348 $(MPMOBJ) $(LOOBJ) $(TESTLIBOBJ) 351 $(MPMOBJ) $(LOOBJ) $(TESTLIBOBJ)
349 352
diff --git a/mps/code/commpost.nmk b/mps/code/commpost.nmk
index e7be53c65a3..a1f1b971de7 100644
--- a/mps/code/commpost.nmk
+++ b/mps/code/commpost.nmk
@@ -16,7 +16,7 @@
16 16
17all: mpmss.exe amcss.exe amsss.exe amssshe.exe segsmss.exe awlut.exe awluthe.exe\ 17all: mpmss.exe amcss.exe amsss.exe amssshe.exe segsmss.exe awlut.exe awluthe.exe\
18 mpsicv.exe lockutw3.exe lockcov.exe poolncv.exe locv.exe qs.exe apss.exe \ 18 mpsicv.exe lockutw3.exe lockcov.exe poolncv.exe locv.exe qs.exe apss.exe \
19 finalcv.exe arenacv.exe bttest.exe teletest.exe protcv.exe \ 19 finalcv.exe finaltest.exe arenacv.exe bttest.exe teletest.exe protcv.exe \
20 abqtest.exe cbstest.exe btcv.exe mv2test.exe messtest.exe steptest.exe \ 20 abqtest.exe cbstest.exe btcv.exe mv2test.exe messtest.exe steptest.exe \
21 locbwcss.exe locusss.exe \ 21 locbwcss.exe locusss.exe \
22 eventcnv.exe 22 eventcnv.exe
@@ -31,11 +31,11 @@ swall: mmsw.lib replaysw.exe
31 31
32mpmss.exe amcss.exe amcsshe.exe amsss.exe amssshe.exe segsmss.exe awlut.exe awluthe.exe dwstress.exe \ 32mpmss.exe amcss.exe amcsshe.exe amsss.exe amssshe.exe segsmss.exe awlut.exe awluthe.exe dwstress.exe \
33 mpsicv.exe lockutw3.exe lockcov.exe poolncv.exe locv.exe qs.exe apss.exe \ 33 mpsicv.exe lockutw3.exe lockcov.exe poolncv.exe locv.exe qs.exe apss.exe \
34 finalcv.exe arenacv.exe bttest.exe teletest.exe protcv.exe \ 34 finalcv.exe finaltest.exe arenacv.exe bttest.exe teletest.exe protcv.exe \
35 abqtest.exe cbstest.exe btcv.exe mv2test.exe messtest.exe steptest.exe \ 35 abqtest.exe cbstest.exe btcv.exe mv2test.exe messtest.exe steptest.exe \
36 locbwcss.exe locusss.exe \ 36 locbwcss.exe locusss.exe \
37 replay.exe replaysw.exe eventcnv.exe \ 37 replay.exe replaysw.exe eventcnv.exe \
38 mmdw.lib mmsw.lib mps_conf.lib mpsplan.lib: 38 mmdw.lib mmsw.lib mps.lib mpsplan.lib:
39!IFDEF VARIETY 39!IFDEF VARIETY
40 $(MAKE) /nologo /f $(PFM).nmk TARGET=$@ variety 40 $(MAKE) /nologo /f $(PFM).nmk TARGET=$@ variety
41!ELSE 41!ELSE
@@ -106,6 +106,10 @@ $(PFM)\$(VARIETY)\finalcv.exe: $(PFM)\$(VARIETY)\finalcv.obj \
106 $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(DWOBJ) $(DWTESTOBJ) \ 106 $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(DWOBJ) $(DWTESTOBJ) \
107 $(MRGOBJ) $(TESTLIBOBJ) 107 $(MRGOBJ) $(TESTLIBOBJ)
108 108
109$(PFM)\$(VARIETY)\finaltest.exe: $(PFM)\$(VARIETY)\finaltest.obj \
110 $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(DWOBJ) $(DWTESTOBJ) \
111 $(MRGOBJ) $(TESTLIBOBJ)
112
109$(PFM)\$(VARIETY)\locv.exe: $(PFM)\$(VARIETY)\locv.obj \ 113$(PFM)\$(VARIETY)\locv.exe: $(PFM)\$(VARIETY)\locv.obj \
110 $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ) $(LOOBJ) 114 $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ) $(LOOBJ)
111 115
@@ -140,7 +144,7 @@ $(PFM)\$(VARIETY)\amcss.exe: $(PFM)\$(VARIETY)\amcss.obj \
140 $(TESTLIBOBJ) 144 $(TESTLIBOBJ)
141 145
142$(PFM)\$(VARIETY)\amcsshe.exe: $(PFM)\$(VARIETY)\amcsshe.obj \ 146$(PFM)\$(VARIETY)\amcsshe.exe: $(PFM)\$(VARIETY)\amcsshe.obj \
143 $(CONFIGURAOBJ) $(AMCOBJ) $(PLINTHOBJ) $(HETESTOBJ) \ 147 $(MPMOBJ) $(AMCOBJ) $(PLINTHOBJ) $(HETESTOBJ) \
144 $(TESTLIBOBJ) 148 $(TESTLIBOBJ)
145 149
146$(PFM)\$(VARIETY)\amsss.exe: $(PFM)\$(VARIETY)\amsss.obj \ 150$(PFM)\$(VARIETY)\amsss.exe: $(PFM)\$(VARIETY)\amsss.obj \
@@ -228,7 +232,7 @@ $(PFM)\$(VARIETY)\mmdw.lib: $(MPMOBJ) $(AMCOBJ) $(DWOBJ) \
228 $(ECHO) $@ 232 $(ECHO) $@
229 $(LIBMAN) $(LIBFLAGS) /OUT:$@ $** 233 $(LIBMAN) $(LIBFLAGS) /OUT:$@ $**
230 234
231$(PFM)\$(VARIETY)\mps_conf.lib: $(CONFIGURAOBJ) $(AMCOBJ) $(LOOBJ) $(SNCOBJ) \ 235$(PFM)\$(VARIETY)\mps.lib: $(MPMOBJ) $(AMCOBJ) $(LOOBJ) $(SNCOBJ) \
232 $(MVFFOBJ) $(AMSOBJ) $(AWLOBJ) 236 $(MVFFOBJ) $(AMSOBJ) $(AWLOBJ)
233 $(ECHO) $@ 237 $(ECHO) $@
234 $(LIBMAN) $(LIBFLAGS) /OUT:$@ $** 238 $(LIBMAN) $(LIBFLAGS) /OUT:$@ $**
diff --git a/mps/code/commpre.nmk b/mps/code/commpre.nmk
index ca86c24bcf6..495f90d6265 100644
--- a/mps/code/commpre.nmk
+++ b/mps/code/commpre.nmk
@@ -112,16 +112,6 @@ LINKFLAGSWHITE = libcmt.lib
112LINKFLAGSHOT = libcmt.lib 112LINKFLAGSHOT = libcmt.lib
113LINKFLAGSCOOL = libcmt.lib 113LINKFLAGSCOOL = libcmt.lib
114 114
115!elseif "$(TARGET)" == "mps_conf.lib" || "$(TARGET)" == "amcsshe.exe"
116CFLAGSTARGETPRE = /DCONFIG_PROD_CONFIGURA
117CFLAGSTARGETPOST =
118CRTFLAGSW = /ML
119CRTFLAGSH = /ML
120CRTFLAGSC = /MLd
121LINKFLAGSWHITE = libc.lib
122LINKFLAGSHOT = libc.lib
123LINKFLAGSCOOL = libcd.lib
124
125!else 115!else
126CFLAGSTARGETPRE = /DCONFIG_PROD_MPS 116CFLAGSTARGETPRE = /DCONFIG_PROD_MPS
127CFLAGSTARGETPOST = 117CFLAGSTARGETPOST =
diff --git a/mps/code/config.h b/mps/code/config.h
index e5443336a3a..c5dd1405c69 100644
--- a/mps/code/config.h
+++ b/mps/code/config.h
@@ -275,14 +275,6 @@
275#define DONGLE_NONE 275#define DONGLE_NONE
276#define PROD_CHECK_DEFAULT CheckSHALLOW 276#define PROD_CHECK_DEFAULT CheckSHALLOW
277 277
278#elif defined(CONFIG_PROD_CONFIGURA)
279#define MPS_PROD_STRING "configura"
280#define MPS_PROD_CONFIGURA
281#define ARENA_INIT_SPARE_COMMIT_LIMIT ((Size)10uL*1024uL*1024uL)
282#define THREAD_SINGLE
283#define PROTECTION
284#define DONGLE_NONE
285
286#elif defined(CONFIG_PROD_MPS) 278#elif defined(CONFIG_PROD_MPS)
287#define MPS_PROD_STRING "mps" 279#define MPS_PROD_STRING "mps"
288#define MPS_PROD_MPS 280#define MPS_PROD_MPS
diff --git a/mps/code/finaltest.c b/mps/code/finaltest.c
new file mode 100644
index 00000000000..bdfdda4be85
--- /dev/null
+++ b/mps/code/finaltest.c
@@ -0,0 +1,301 @@
1/* finaltest.c: LARGE-SCALE FINALIZATION TEST
2 *
3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * Portions copyright (C) 2002 Global Graphics Software.
6 *
7 * DESIGN
8 *
9 * DEPENDENCIES
10 *
11 * This test uses the dylan object format, but the reliance on this
12 * particular format is not great and could be removed.
13 *
14 * NOTES
15 *
16 * This code was created by first copying <code/finalcv.c>
17 */
18
19#include "testlib.h"
20#include "mps.h"
21#include "mpscamc.h"
22#include "mpsavm.h"
23#include "fmtdy.h"
24#include "fmtdytst.h"
25#include "mpstd.h"
26#ifdef MPS_OS_W3
27#include "mpsw3.h"
28#endif
29#include <stdlib.h>
30
31
32#define testArenaSIZE ((size_t)16<<20)
33#define rootCOUNT 20
34#define maxtreeDEPTH 12
35#define collectionCOUNT 10
36#define genCOUNT 2
37
38/* testChain -- generation parameters for the test */
39
40static mps_gen_param_s testChain[genCOUNT] = {
41 { 150, 0.85 }, { 170, 0.45 } };
42
43
44/* global object counter */
45
46static mps_word_t object_count = 0;
47
48static mps_word_t make_numbered_cons(mps_word_t car, mps_word_t cdr,
49 mps_ap_t ap)
50{
51 mps_word_t cons;
52 die(make_dylan_vector(&cons, ap, 3), "make_dylan_vector");
53 DYLAN_VECTOR_SLOT(cons, 0) = car;
54 DYLAN_VECTOR_SLOT(cons, 1) = cdr;
55 DYLAN_VECTOR_SLOT(cons, 2) = DYLAN_INT(object_count);
56 ++ object_count;
57 return cons;
58}
59
60static mps_word_t make_numbered_tree(mps_word_t depth,
61 mps_ap_t ap)
62{
63 mps_word_t left, right;
64 if (depth < 2) {
65 left = DYLAN_INT(object_count);
66 right = DYLAN_INT(object_count);
67 } else {
68 left = make_numbered_tree(depth-1, ap);
69 right = make_numbered_tree(depth-1, ap);
70 }
71 return make_numbered_cons(left, right, ap);
72}
73
74static void register_numbered_tree(mps_word_t tree, mps_arena_t arena)
75{
76 /* don't finalize ints */
77 if ((tree & 1) == 0) {
78 mps_finalize(arena, (mps_addr_t *)&tree);
79 register_numbered_tree(DYLAN_VECTOR_SLOT(tree, 0), arena);
80 register_numbered_tree(DYLAN_VECTOR_SLOT(tree, 1), arena);
81 }
82}
83
84static mps_word_t make_indirect_cons(mps_word_t car, mps_word_t cdr,
85 mps_ap_t ap)
86{
87 mps_word_t cons, indirect;
88 die(make_dylan_vector(&indirect, ap, 1), "make_dylan_vector");
89 DYLAN_VECTOR_SLOT(indirect, 0) = DYLAN_INT(object_count);
90 die(make_dylan_vector(&cons, ap, 3), "make_dylan_vector");
91 DYLAN_VECTOR_SLOT(cons, 0) = car;
92 DYLAN_VECTOR_SLOT(cons, 1) = cdr;
93 DYLAN_VECTOR_SLOT(cons, 2) = indirect;
94 ++ object_count;
95 return cons;
96}
97
98static mps_word_t make_indirect_tree(mps_word_t depth,
99 mps_ap_t ap)
100{
101 mps_word_t left, right;
102 if (depth < 2) {
103 left = DYLAN_INT(object_count);
104 right = DYLAN_INT(object_count);
105 } else {
106 left = make_indirect_tree(depth-1, ap);
107 right = make_indirect_tree(depth-1, ap);
108 }
109 return make_indirect_cons(left, right, ap);
110}
111
112static void register_indirect_tree(mps_word_t tree, mps_arena_t arena)
113{
114 /* don't finalize ints */
115 if ((tree & 1) == 0) {
116 mps_word_t indirect = DYLAN_VECTOR_SLOT(tree,2);
117 mps_finalize(arena, (mps_addr_t *)&indirect);
118 register_indirect_tree(DYLAN_VECTOR_SLOT(tree, 0), arena);
119 register_indirect_tree(DYLAN_VECTOR_SLOT(tree, 1), arena);
120 }
121}
122
123
124static void *root[rootCOUNT];
125
126static void *test(void *arg, size_t s)
127{
128 mps_ap_t ap;
129 mps_fmt_t fmt;
130 mps_chain_t chain;
131 mps_word_t finals;
132 mps_pool_t amc;
133 mps_root_t mps_root;
134 mps_arena_t arena;
135 mps_message_t message;
136 size_t i;
137
138 arena = (mps_arena_t)arg;
139 (void)s;
140
141 die(mps_fmt_create_A(&fmt, arena, dylan_fmt_A()), "fmt_create\n");
142 die(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create");
143 die(mps_pool_create(&amc, arena, mps_class_amc(), fmt, chain),
144 "pool_create amc\n");
145 die(mps_root_create_table(&mps_root, arena, MPS_RANK_EXACT, (mps_rm_t)0,
146 root, (size_t)rootCOUNT),
147 "root_create\n");
148 die(mps_ap_create(&ap, amc, MPS_RANK_EXACT), "ap_create\n");
149
150 mps_message_type_enable(arena, mps_message_type_finalization());
151
152 mps_arena_park(arena);
153
154 object_count = 0;
155
156 printf("Making some finalized trees of objects.\n");
157 /* make some trees */
158 for(i = 0; i < rootCOUNT; ++i) {
159 root[i] = (void *)make_numbered_tree(maxtreeDEPTH, ap);
160 register_numbered_tree((mps_word_t)root[i], arena);
161 }
162
163 printf("Losing all pointers to the trees.\n");
164 /* clean out the roots */
165 for(i = 0; i < rootCOUNT; ++i) {
166 root[i] = 0;
167 }
168
169 finals = 0;
170
171 while ((finals < object_count) &&
172 (mps_collections(arena) < collectionCOUNT)) {
173 mps_word_t final_this_time = 0;
174 printf("Collecting...");
175 fflush(stdout);
176 die(mps_arena_collect(arena), "collect");
177 printf(" Done.\n");
178 while (mps_message_poll(arena)) {
179 mps_word_t obj;
180 mps_addr_t objaddr;
181 cdie(mps_message_get(&message, arena,
182 mps_message_type_finalization()),
183 "get");
184 mps_message_finalization_ref(&objaddr, arena, message);
185 obj = (mps_word_t)objaddr;
186 mps_message_discard(arena, message);
187 ++ final_this_time;
188 }
189 finals += final_this_time;
190 printf("%lu objects finalized: total %lu of %lu\n",
191 final_this_time, finals, object_count);
192 }
193
194 object_count = 0;
195
196 printf("Making some indirectly finalized trees of objects.\n");
197 /* make some trees */
198 for(i = 0; i < rootCOUNT; ++i) {
199 root[i] = (void *)make_indirect_tree(maxtreeDEPTH, ap);
200 register_indirect_tree((mps_word_t)root[i], arena);
201 }
202
203 printf("Losing all pointers to the trees.\n");
204 /* clean out the roots */
205 for(i = 0; i < rootCOUNT; ++i) {
206 root[i] = 0;
207 }
208
209 finals = 0;
210
211 while ((finals < object_count) &&
212 (mps_collections(arena) < collectionCOUNT)) {
213 mps_word_t final_this_time = 0;
214 printf("Collecting...");
215 fflush(stdout);
216 die(mps_arena_collect(arena), "collect");
217 printf(" Done.\n");
218 while (mps_message_poll(arena)) {
219 mps_word_t obj;
220 mps_addr_t objaddr;
221 cdie(mps_message_get(&message, arena,
222 mps_message_type_finalization()),
223 "get");
224 mps_message_finalization_ref(&objaddr, arena, message);
225 obj = (mps_word_t)objaddr;
226 mps_message_discard(arena, message);
227 ++ final_this_time;
228 }
229 finals += final_this_time;
230 printf("%lu objects finalized: total %lu of %lu\n",
231 final_this_time, finals, object_count);
232 }
233
234 mps_ap_destroy(ap);
235 mps_root_destroy(mps_root);
236 mps_pool_destroy(amc);
237 mps_chain_destroy(chain);
238 mps_fmt_destroy(fmt);
239
240 return NULL;
241}
242
243
244int main(int argc, char **argv)
245{
246 mps_arena_t arena;
247 mps_thr_t thread;
248 void *r;
249
250 die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE),
251 "arena_create\n");
252 die(mps_thread_reg(&thread, arena), "thread_reg\n");
253 mps_tramp(&r, test, arena, 0);
254 mps_thread_dereg(thread);
255 mps_arena_destroy(arena);
256
257 fflush(stdout); /* synchronize */
258 return 0;
259}
260
261
262/* C. COPYRIGHT AND LICENSE
263 *
264 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
265 * All rights reserved. This is an open source license. Contact
266 * Ravenbrook for commercial licensing options.
267 *
268 * Redistribution and use in source and binary forms, with or without
269 * modification, are permitted provided that the following conditions are
270 * met:
271 *
272 * 1. Redistributions of source code must retain the above copyright
273 * notice, this list of conditions and the following disclaimer.
274 *
275 * 2. Redistributions in binary form must reproduce the above copyright
276 * notice, this list of conditions and the following disclaimer in the
277 * documentation and/or other materials provided with the distribution.
278 *
279 * 3. Redistributions in any form must be accompanied by information on how
280 * to obtain complete source code for this software and any accompanying
281 * software that uses this software. The source code must either be
282 * included in the distribution or be available for no more than the cost
283 * of distribution plus a nominal fee, and must be freely redistributable
284 * under reasonable conditions. For an executable file, complete source
285 * code means the source code for all modules it contains. It does not
286 * include source code for modules or files that typically accompany the
287 * major components of the operating system on which the executable file
288 * runs.
289 *
290 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
291 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
292 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
293 * PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE
294 * COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
295 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
296 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
297 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
298 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
299 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
300 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
301 */
diff --git a/mps/code/fmtdytst.c b/mps/code/fmtdytst.c
index ce9c607cac0..9fa6eb2ec32 100644
--- a/mps/code/fmtdytst.c
+++ b/mps/code/fmtdytst.c
@@ -50,14 +50,8 @@ static mps_word_t dylan_make_WV(mps_word_t version, mps_word_t vb,
50 vf); 50 vf);
51} 51}
52 52
53 53static mps_res_t dylan_make_wrapper_wrapper(void)
54mps_res_t dylan_init(mps_addr_t addr, size_t size,
55 mps_addr_t *refs, size_t nr_refs)
56{ 54{
57
58 /* Make sure the size is aligned. */
59 assert((size & (ALIGN-1)) == 0);
60
61 if(ww == NULL) { 55 if(ww == NULL) {
62 ww = malloc(sizeof(mps_word_t) * (BASIC_WRAPPER_SIZE + 1)); 56 ww = malloc(sizeof(mps_word_t) * (BASIC_WRAPPER_SIZE + 1));
63 if(ww == NULL) return MPS_RES_MEMORY; 57 if(ww == NULL) return MPS_RES_MEMORY;
@@ -84,10 +78,23 @@ mps_res_t dylan_init(mps_addr_t addr, size_t size,
84 tvw[WV] = dylan_make_WV(2, 0, 0, 2); /* traceable variable part */ 78 tvw[WV] = dylan_make_WV(2, 0, 0, 2); /* traceable variable part */
85 tvw[WS] = 1; /* no patterns */ 79 tvw[WS] = 1; /* no patterns */
86 } 80 }
81 return MPS_RES_OK;
82}
83
84
85mps_res_t dylan_init(mps_addr_t addr, size_t size,
86 mps_addr_t *refs, size_t nr_refs)
87{
88 mps_res_t res;
89 /* Make sure the size is aligned. */
90 assert((size & (ALIGN-1)) == 0);
91
92 res = dylan_make_wrapper_wrapper();
93 if (res != MPS_RES_OK)
94 return res;
87 95
88 /* If there is enough room, make a vector, otherwise just */ 96 /* If there is enough room, make a vector, otherwise just */
89 /* make a padding object. */ 97 /* make a padding object. */
90
91 if(size >= sizeof(mps_word_t) * 2) { 98 if(size >= sizeof(mps_word_t) * 2) {
92 mps_word_t *p = (mps_word_t *)addr; 99 mps_word_t *p = (mps_word_t *)addr;
93 mps_word_t i, t = (size / sizeof(mps_word_t)) - 2; 100 mps_word_t i, t = (size / sizeof(mps_word_t)) - 2;
@@ -108,6 +115,38 @@ mps_res_t dylan_init(mps_addr_t addr, size_t size,
108 return MPS_RES_OK; 115 return MPS_RES_OK;
109} 116}
110 117
118mps_res_t make_dylan_vector(mps_word_t *v, mps_ap_t ap, size_t slots)
119{
120 mps_res_t res;
121 mps_addr_t addr;
122 mps_word_t *p;
123 size_t size;
124 size_t i;
125
126 res = dylan_make_wrapper_wrapper();
127 if (res != MPS_RES_OK)
128 return res;
129
130 size = (slots + 2) * sizeof(mps_word_t);
131
132 do {
133 MPS_RESERVE_BLOCK(res, addr, ap, size);
134 if (res != MPS_RES_OK)
135 return res;
136
137 p = (mps_word_t *)addr;
138 p[0] = (mps_word_t)tvw; /* install vector wrapper */
139 p[1] = (slots << 2) | 1; /* tag the vector length */
140 /* fill all slots with zero ints. */
141 for (i=0; i<slots; ++i) {
142 DYLAN_VECTOR_SLOT(p, i) = DYLAN_INT(0);
143 }
144 } while (!mps_commit(ap, addr, size));
145
146 *v = (mps_word_t)p;
147 return MPS_RES_OK;
148}
149
111 150
112void dylan_write(mps_addr_t addr, mps_addr_t *refs, size_t nr_refs) 151void dylan_write(mps_addr_t addr, mps_addr_t *refs, size_t nr_refs)
113{ 152{
@@ -158,18 +197,18 @@ mps_bool_t dylan_check(mps_addr_t addr)
158 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>. 197 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
159 * All rights reserved. This is an open source license. Contact 198 * All rights reserved. This is an open source license. Contact
160 * Ravenbrook for commercial licensing options. 199 * Ravenbrook for commercial licensing options.
161 * 200 *
162 * Redistribution and use in source and binary forms, with or without 201 * Redistribution and use in source and binary forms, with or without
163 * modification, are permitted provided that the following conditions are 202 * modification, are permitted provided that the following conditions are
164 * met: 203 * met:
165 * 204 *
166 * 1. Redistributions of source code must retain the above copyright 205 * 1. Redistributions of source code must retain the above copyright
167 * notice, this list of conditions and the following disclaimer. 206 * notice, this list of conditions and the following disclaimer.
168 * 207 *
169 * 2. Redistributions in binary form must reproduce the above copyright 208 * 2. Redistributions in binary form must reproduce the above copyright
170 * notice, this list of conditions and the following disclaimer in the 209 * notice, this list of conditions and the following disclaimer in the
171 * documentation and/or other materials provided with the distribution. 210 * documentation and/or other materials provided with the distribution.
172 * 211 *
173 * 3. Redistributions in any form must be accompanied by information on how 212 * 3. Redistributions in any form must be accompanied by information on how
174 * to obtain complete source code for this software and any accompanying 213 * to obtain complete source code for this software and any accompanying
175 * software that uses this software. The source code must either be 214 * software that uses this software. The source code must either be
@@ -180,7 +219,7 @@ mps_bool_t dylan_check(mps_addr_t addr)
180 * include source code for modules or files that typically accompany the 219 * include source code for modules or files that typically accompany the
181 * major components of the operating system on which the executable file 220 * major components of the operating system on which the executable file
182 * runs. 221 * runs.
183 * 222 *
184 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 223 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
185 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 224 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
186 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 225 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
diff --git a/mps/code/fmtdytst.h b/mps/code/fmtdytst.h
index d8d1d2fa0b2..0e284a42ab8 100644
--- a/mps/code/fmtdytst.h
+++ b/mps/code/fmtdytst.h
@@ -18,6 +18,14 @@ extern mps_bool_t dylan_check(mps_addr_t addr);
18extern void dylan_pad(mps_addr_t addr, size_t size); 18extern void dylan_pad(mps_addr_t addr, size_t size);
19extern int dylan_wrapper_check(mps_word_t *w); 19extern int dylan_wrapper_check(mps_word_t *w);
20 20
21extern mps_res_t make_dylan_vector(mps_word_t *v, mps_ap_t ap, size_t slots);
22
23#define DYLAN_VECTOR_SLOT(o,n) (((mps_word_t *) (o))[(n)+2])
24
25#define DYLAN_INT(n) (((n) << 2) | 1)
26
27#define DYLAN_INT_INT(d) ((d) >> 2)
28
21#endif /* fmtdy_h */ 29#endif /* fmtdy_h */
22 30
23 31
@@ -26,18 +34,18 @@ extern int dylan_wrapper_check(mps_word_t *w);
26 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>. 34 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
27 * All rights reserved. This is an open source license. Contact 35 * All rights reserved. This is an open source license. Contact
28 * Ravenbrook for commercial licensing options. 36 * Ravenbrook for commercial licensing options.
29 * 37 *
30 * Redistribution and use in source and binary forms, with or without 38 * Redistribution and use in source and binary forms, with or without
31 * modification, are permitted provided that the following conditions are 39 * modification, are permitted provided that the following conditions are
32 * met: 40 * met:
33 * 41 *
34 * 1. Redistributions of source code must retain the above copyright 42 * 1. Redistributions of source code must retain the above copyright
35 * notice, this list of conditions and the following disclaimer. 43 * notice, this list of conditions and the following disclaimer.
36 * 44 *
37 * 2. Redistributions in binary form must reproduce the above copyright 45 * 2. Redistributions in binary form must reproduce the above copyright
38 * notice, this list of conditions and the following disclaimer in the 46 * notice, this list of conditions and the following disclaimer in the
39 * documentation and/or other materials provided with the distribution. 47 * documentation and/or other materials provided with the distribution.
40 * 48 *
41 * 3. Redistributions in any form must be accompanied by information on how 49 * 3. Redistributions in any form must be accompanied by information on how
42 * to obtain complete source code for this software and any accompanying 50 * to obtain complete source code for this software and any accompanying
43 * software that uses this software. The source code must either be 51 * software that uses this software. The source code must either be
@@ -48,7 +56,7 @@ extern int dylan_wrapper_check(mps_word_t *w);
48 * include source code for modules or files that typically accompany the 56 * include source code for modules or files that typically accompany the
49 * major components of the operating system on which the executable file 57 * major components of the operating system on which the executable file
50 * runs. 58 * runs.
51 * 59 *
52 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 60 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
53 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 61 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
54 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 62 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
diff --git a/mps/code/fri4gc.gmk b/mps/code/fri4gc.gmk
index b66a381c286..103b2f61a45 100644
--- a/mps/code/fri4gc.gmk
+++ b/mps/code/fri4gc.gmk
@@ -15,8 +15,9 @@ LIBS = -lm -pthread
15 15
16include gc.gmk 16include gc.gmk
17 17
18CFLAGSDEBUG = -g 18CFLAGSCOMPILER := $(subst -pedantic,,$(CFLAGSCOMPILER))
19CFLAGSOPT = -O -g 19CFLAGSDEBUG = -g3
20CFLAGSOPT = -O -g3
20 21
21CC = cc 22CC = cc
22 23
diff --git a/mps/code/poolams.c b/mps/code/poolams.c
index b8650af428e..d649a4794f2 100644
--- a/mps/code/poolams.c
+++ b/mps/code/poolams.c
@@ -1456,6 +1456,7 @@ static Res AMSFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
1456 1456
1457static Res amsBlackenObject(Seg seg, Index i, Addr p, Addr next, void *clos) 1457static Res amsBlackenObject(Seg seg, Index i, Addr p, Addr next, void *clos)
1458{ 1458{
1459 UNUSED(p);
1459 AVER(clos == NULL); 1460 AVER(clos == NULL);
1460 /* Do what amsScanObject does, minus the scanning. */ 1461 /* Do what amsScanObject does, minus the scanning. */
1461 if (AMS_IS_GREY(seg, i)) { 1462 if (AMS_IS_GREY(seg, i)) {
diff --git a/mps/code/steptest.c b/mps/code/steptest.c
index 826b76579d3..a2709b063f2 100644
--- a/mps/code/steptest.c
+++ b/mps/code/steptest.c
@@ -1,9 +1,9 @@
1/* steptest.c: TEST FOR ARENA CLAMPING AND STEPPING 1/* steptest.c: TEST FOR ARENA STEPPING
2 * 2 *
3 * $Id$ 3 * $Id$
4 * Copyright (C) 1998 Ravenbrook Limited. See end of file for license. 4 * Copyright (C) 1998 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * Based on <code/amcss.c>. 6 * Loosely based on <code/amcss.c>.
7 */ 7 */
8 8
9#include "fmtdy.h" 9#include "fmtdy.h"
@@ -23,13 +23,41 @@
23#define avLEN 3 23#define avLEN 3
24#define exactRootsCOUNT 200 24#define exactRootsCOUNT 200
25#define ambigRootsCOUNT 50 25#define ambigRootsCOUNT 50
26#define objCOUNT 1000000 26#define objCOUNT 2000000
27#define genCOUNT 2 27#define clockSetFREQ 10000
28
29#define genCOUNT 3
30#define gen1SIZE 750 /* kB */
31#define gen2SIZE 2000 /* kB */
32#define gen3SIZE 5000 /* kB */
33#define gen1MORTALITY 0.85
34#define gen2MORTALITY 0.60
35#define gen3MORTALITY 0.40
28 36
29/* testChain -- generation parameters for the test */ 37/* testChain -- generation parameters for the test */
30 38
31static mps_gen_param_s testChain[genCOUNT] = { 39static mps_gen_param_s testChain[genCOUNT] = {
32 { 150, 0.85 }, { 170, 0.45 } }; 40 {gen1SIZE, gen1MORTALITY},
41 {gen2SIZE, gen2MORTALITY},
42 {gen3SIZE, gen3MORTALITY},
43};
44
45/* run the test several times, calling mps_arena_step at a different
46 * frequency each time. When we call it often, tracing is never done
47 * during allocation. When we call it never, tracing is always done
48 * during allocation.
49 */
50
51static size_t step_frequencies[] = {
52 1000,
53 5000,
54 10000,
55 1000000000,
56};
57
58#define TESTS (sizeof(step_frequencies) / sizeof(step_frequencies[0]))
59
60static int test_number = 0;
33 61
34 62
35/* objNULL needs to be odd so that it's ignored in exactRoots. */ 63/* objNULL needs to be odd so that it's ignored in exactRoots. */
@@ -40,6 +68,29 @@ static mps_ap_t ap;
40static mps_addr_t exactRoots[exactRootsCOUNT]; 68static mps_addr_t exactRoots[exactRootsCOUNT];
41static mps_addr_t ambigRoots[ambigRootsCOUNT]; 69static mps_addr_t ambigRoots[ambigRootsCOUNT];
42 70
71/* Things we want to measure. Times are all in microseconds. */
72
73double alloc_time; /* Time spent allocating */
74double max_alloc_time; /* Max time taken to allocate one object */
75double step_time; /* Time spent in mps_arena_step returning 1 */
76double max_step_time; /* Max time of mps_arena_step returning 1 */
77double no_step_time; /* Time spent in mps_arena_step returning 0 */
78double max_no_step_time; /* Max time of mps_arena_step returning 0 */
79
80double total_clock_time; /* Time spent reading the clock */
81long clock_reads; /* Number of times clock is read */
82long steps; /* # of mps_arena_step calls returning 1 */
83long no_steps; /* # of mps_arena_step calls returning 0 */
84long alloc_bytes; /* # of bytes allocated */
85long commit_failures; /* # of times mps_commit fails */
86
87
88/* Operating-system dependent timing. Defines two functions, void
89 * prepare_clock(void) and double my_clock(void). my_clock() returns
90 * the number of microseconds of CPU time used so far by the process.
91 * prepare_clock() sets things up so that my_clock() can run
92 * efficiently.
93 */
43 94
44#ifdef MPS_OS_W3 95#ifdef MPS_OS_W3
45 96
@@ -47,7 +98,7 @@ static HANDLE currentProcess;
47 98
48static void prepare_clock(void) 99static void prepare_clock(void)
49{ 100{
50 currentProcess = GetCurrentProcess(); 101 currentProcess = GetCurrentProcess();
51} 102}
52 103
53static double my_clock(void) 104static double my_clock(void)
@@ -55,10 +106,13 @@ static double my_clock(void)
55 FILETIME ctime, etime, ktime, utime; 106 FILETIME ctime, etime, ktime, utime;
56 double dk, du; 107 double dk, du;
57 GetProcessTimes(currentProcess, &ctime, &etime, &ktime, &utime); 108 GetProcessTimes(currentProcess, &ctime, &etime, &ktime, &utime);
58 dk = ktime.dwHighDateTime * 4096.0 * 1024.0 * 1024.0 + ktime.dwLowDateTime; 109 dk = ktime.dwHighDateTime * 4096.0 * 1024.0 * 1024.0 +
110 ktime.dwLowDateTime;
59 dk /= 10.0; 111 dk /= 10.0;
60 du = utime.dwHighDateTime * 4096.0 * 1024.0 * 1024.0 + utime.dwLowDateTime; 112 du = utime.dwHighDateTime * 4096.0 * 1024.0 * 1024.0 +
113 utime.dwLowDateTime;
61 du /= 10.0; 114 du /= 10.0;
115 ++ clock_reads;
62 return (du+dk); 116 return (du+dk);
63} 117}
64 118
@@ -71,208 +125,384 @@ static double my_clock(void)
71 125
72static void prepare_clock(void) 126static void prepare_clock(void)
73{ 127{
128 /* do nothing */
74} 129}
75 130
76static double my_clock(void) 131static double my_clock(void)
77{ 132{
78 struct rusage ru; 133 struct rusage ru;
79 getrusage(RUSAGE_SELF, &ru); 134 getrusage(RUSAGE_SELF, &ru);
135 ++ clock_reads;
80 return ((ru.ru_utime.tv_sec + 136 return ((ru.ru_utime.tv_sec +
81 ru.ru_stime.tv_sec) * 1000000.0 + 137 ru.ru_stime.tv_sec) * 1000000.0 +
82 (ru.ru_utime.tv_usec) + 138 (ru.ru_utime.tv_usec +
83 (ru.ru_stime.tv_usec)); 139 ru.ru_stime.tv_usec));
84} 140}
85#endif 141#endif
86 142
87double alloc_time, step_time, no_step_time, max_step_time, max_no_step_time, max_alloc_time; 143/* Need to calibrate the clock. */
144/* In fact we need to do this repeatedly while the tests run because
145 * on some platforms the time taken to read the clock changes
146 * significantly during program execution. Yes, really (e.g. fri4gc
147 * on thrush.ravenbrook.com on 2002-06-28, clock_time goes from 5.43
148 * us near process start to 7.45 us later). */
88 149
89long steps, no_steps; 150double clock_time; /* current estimate of time to read the clock */
90 151
91long alloc_bytes; 152/* take at least this many microseconds to set the clock */
92long commit_failures; 153#define CLOCK_TIME_SET 10000
93 154
94#define CLOCK_TESTS 100000 155/* set_clock_timing() sets clock_time. */
95 156
96static double clock_timing(void) 157static void set_clock_timing(void)
97{ 158{
98 long i; 159 long i;
99 double t1, t2; 160 double t1, t2, t3;
100 161
101 t2 = 0.0; 162 t2 = 0.0;
102 for (i=0; i<CLOCK_TESTS; ++i) { 163 t3 = my_clock();
164 i = 0;
165 do {
103 t1 = my_clock(); 166 t1 = my_clock();
167 /* do nothing here */
104 t2 += my_clock()-t1; 168 t2 += my_clock()-t1;
169 ++i;
170 } while (t1 < t3 + CLOCK_TIME_SET);
171 clock_time = t2/i;
172 total_clock_time += my_clock() - t3 + clock_time;
173}
174
175/* How much time has elapsed since a recent call to my_clock?
176 * Deducts the calibrated clock timing, clamping to zero.
177 *
178 * The idea is to have code like this:
179 *
180 * t = my_clock();
181 * do_something();
182 * t = time_since(t);
183 *
184 * and the result will be our best estimate of how much CPU time the
185 * call to do_something() took.
186 */
187
188static double time_since(double t)
189{
190 t = my_clock() - t;
191 total_clock_time += clock_time + clock_time;
192 if (t < clock_time)
193 return 0.0;
194 else
195 return (t - clock_time);
196}
197
198/* print a number of microseconds in a useful format. */
199
200#define MAXPRINTABLE 100.0
201#define MINPRINTABLE (MAXPRINTABLE / 1000.0)
202
203static void print_time(char *before, double t, char *after)
204{
205 char prefixes[] = "\0munpfazy"; /* don't print "ks" etc */
206 char *x = prefixes+2; /* start at micro */
207 double ot = t;
208 if (before)
209 printf(before);
210 if (t > MAXPRINTABLE) {
211 while (x[-1] && t > MAXPRINTABLE) {
212 t /= 1000.0;
213 -- x;
214 }
215 if (t < MAXPRINTABLE) {
216 printf("%.3f %cs", t, *x);
217 } else {
218 printf("%.3f s", t/1000.0);
219 }
220 } else {
221 while (x[1] && t < MINPRINTABLE) {
222 t *= 1000.0;
223 ++ x;
224 }
225 if (t > MINPRINTABLE)
226 printf("%.3f %cs", t, *x);
227 else
228 printf("%g s", ot/1000000.0);
105 } 229 }
106 return t2/CLOCK_TESTS; 230 if (after)
231 printf(after);
107} 232}
108 233
234/* Make a single Dylan object */
235
109static mps_addr_t make(void) 236static mps_addr_t make(void)
110{ 237{
111 size_t length = rnd() % (2*avLEN); 238 size_t length = rnd() % (avLEN * 2);
112 size_t size = (length+2) * sizeof(mps_word_t); 239 size_t size = (length+2) * sizeof(mps_word_t);
113 mps_addr_t p; 240 mps_addr_t p;
114 mps_res_t res; 241 mps_res_t res;
115 242
116 alloc_bytes += size; 243 alloc_bytes += size;
117 244
118 for(;;) { 245 for(;;) {
119 mps_bool_t commit_res; 246 mps_bool_t commit_res;
120 double t1 = my_clock(); 247 double t1, t2;
121 MPS_RESERVE_BLOCK(res, p, ap, size); 248 t1 = my_clock();
122 t1 = my_clock() - t1; 249 MPS_RESERVE_BLOCK(res, p, ap, size);
123 alloc_time += t1; 250 t1 = time_since(t1); /* reserve time */
124 if (t1 > max_alloc_time) 251 if(res)
125 max_alloc_time = t1; 252 die(res, "MPS_RESERVE_BLOCK");
126 if(res) 253 res = dylan_init(p, size, exactRoots, exactRootsCOUNT);
127 die(res, "MPS_RESERVE_BLOCK"); 254 if(res)
128 res = dylan_init(p, size, exactRoots, exactRootsCOUNT); 255 die(res, "dylan_init");
129 if(res) 256 t2 = my_clock();
130 die(res, "dylan_init"); 257 commit_res = mps_commit(ap, p, size);
131 t1 = my_clock(); 258 t2 = time_since(t2); /* commit time */
132 commit_res = mps_commit(ap, p, size); 259 t1 += t2; /* total MPS time for this allocation */
133 t1 = my_clock() - t1; 260 alloc_time += t1;
134 alloc_time += t1; 261 if (t1 > max_alloc_time)
135 if (t1 > max_alloc_time) 262 max_alloc_time = t1;
136 max_alloc_time = t1; 263 if (commit_res)
137 if (commit_res) 264 break;
138 break; 265 else
139 else 266 ++ commit_failures;
140 ++ commit_failures; 267 }
141 }
142 268
143 return p; 269 return p;
144} 270}
145 271
272/* call mps_arena_step() */
273
146static void test_step(mps_arena_t arena) 274static void test_step(mps_arena_t arena)
147{ 275{
148 mps_bool_t res; 276 mps_bool_t res;
149 double t1 = my_clock(); 277 double t1 = my_clock();
150 res = mps_arena_step(arena, 0.1); 278 res = mps_arena_step(arena, 0.1);
151 t1 = my_clock() - t1; 279 t1 = time_since(t1);
152 if (res) { 280 if (res) {
153 if (t1 > max_step_time) 281 if (t1 > max_step_time)
154 max_step_time = t1; 282 max_step_time = t1;
155 step_time += t1; 283 step_time += t1;
156 ++ steps; 284 ++ steps;
157 } else { 285 } else {
158 if (t1 > max_no_step_time) 286 if (t1 > max_no_step_time)
159 max_no_step_time = t1; 287 max_no_step_time = t1;
160 no_step_time += t1; 288 no_step_time += t1;
161 ++ no_steps; 289 ++ no_steps;
162 } 290 }
163} 291}
164 292
165/* test -- the body of the test */ 293/* test -- the body of the test */
166 294
167static void *test(void *arg, size_t s) 295static void *test(void *arg, size_t s)
168{ 296{
169 mps_arena_t arena; 297 mps_arena_t arena;
170 mps_fmt_t format; 298 mps_fmt_t format;
171 mps_chain_t chain; 299 mps_chain_t chain;
172 mps_root_t exactRoot, ambigRoot; 300 mps_root_t exactRoot, ambigRoot;
173 unsigned long objs; size_t i; 301 unsigned long objs; size_t i;
174 302 mps_message_t message;
175 arena = (mps_arena_t)arg; 303 size_t live, condemned, not_condemned;
176 (void)s; /* unused */ 304 size_t messages;
177 305 mps_word_t collections, old_collections;
178 die(dylan_fmt(&format, arena), "fmt_create"); 306 double total_mps_time, total_time;
179 die(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); 307 double t1;
180 308
181 die(mps_pool_create(&pool, arena, mps_class_amc(), format, chain), 309 arena = (mps_arena_t)arg;
182 "pool_create(amc)"); 310 (void)s; /* unused */
183 311
184 die(mps_ap_create(&ap, pool, MPS_RANK_EXACT), "BufferCreate"); 312 die(dylan_fmt(&format, arena), "fmt_create");
185 313 die(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create");
186 for(i = 0; i < exactRootsCOUNT; ++i) 314
187 exactRoots[i] = objNULL; 315 die(mps_pool_create(&pool, arena, mps_class_amc(), format, chain),
188 for(i = 0; i < ambigRootsCOUNT; ++i) 316 "pool_create(amc)");
189 ambigRoots[i] = (mps_addr_t)rnd(); 317
190 318 die(mps_ap_create(&ap, pool, MPS_RANK_EXACT), "BufferCreate");
191 die(mps_root_create_table_masked(&exactRoot, arena, 319
192 MPS_RANK_EXACT, (mps_rm_t)0, 320 for(i = 0; i < exactRootsCOUNT; ++i)
193 &exactRoots[0], exactRootsCOUNT, 321 exactRoots[i] = objNULL;
194 (mps_word_t)1), 322 for(i = 0; i < ambigRootsCOUNT; ++i)
195 "root_create_table(exact)"); 323 ambigRoots[i] = (mps_addr_t)rnd();
196 die(mps_root_create_table(&ambigRoot, arena, 324
197 MPS_RANK_AMBIG, (mps_rm_t)0, 325 die(mps_root_create_table_masked(&exactRoot, arena,
198 &ambigRoots[0], ambigRootsCOUNT), 326 MPS_RANK_EXACT, (mps_rm_t)0,
199 "root_create_table(ambig)"); 327 &exactRoots[0], exactRootsCOUNT,
200 328 (mps_word_t)1),
201 objs = 0; 329 "root_create_table(exact)");
202 steps = no_steps = 0; 330 die(mps_root_create_table(&ambigRoot, arena,
203 alloc_bytes = 0; 331 MPS_RANK_AMBIG, (mps_rm_t)0,
204 commit_failures = 0; 332 &ambigRoots[0], ambigRootsCOUNT),
205 alloc_time = step_time = no_step_time = 0.0; 333 "root_create_table(ambig)");
206 max_alloc_time = max_step_time = max_no_step_time = 0.0; 334
207 335 printf("Stepping every %lu allocations.\n",
208 while(objs < objCOUNT) { 336 (unsigned long)step_frequencies[test_number]);
209 size_t r; 337
210 338 mps_message_type_enable(arena, mps_message_type_gc());
211 r = (size_t)rnd(); 339
212 if(r & 1) { 340 /* zero all our counters and timers. */
213 i = (r >> 1) % exactRootsCOUNT; 341
214 if(exactRoots[i] != objNULL) 342 objs = 0;
215 cdie(dylan_check(exactRoots[i]), "dying root check"); 343 clock_reads = 0;
216 exactRoots[i] = make(); 344 steps = no_steps = 0;
217 if(exactRoots[(exactRootsCOUNT-1) - i] != objNULL) 345 alloc_bytes = 0;
218 dylan_write(exactRoots[(exactRootsCOUNT-1) - i], 346 commit_failures = 0;
219 exactRoots, exactRootsCOUNT); 347 alloc_time = step_time = no_step_time = 0.0;
220 } else { 348 max_alloc_time = max_step_time = max_no_step_time = 0.0;
221 i = (r >> 1) % ambigRootsCOUNT; 349 total_clock_time = 0.0;
222 ambigRoots[(ambigRootsCOUNT-1) - i] = make(); 350 collections = old_collections = 0;
223 /* Create random interior pointers */ 351
224 ambigRoots[i] = (mps_addr_t)((char *)(ambigRoots[i/2]) + 1); 352 t1 = my_clock();
225 }
226 353
227 if(objs % 1000 == 0) { 354 while(objs < objCOUNT) {
228 test_step(arena); 355 size_t r;
356
357 r = (size_t)rnd();
358 if(r & 1) {
359 i = (r >> 1) % exactRootsCOUNT;
360 if(exactRoots[i] != objNULL)
361 cdie(dylan_check(exactRoots[i]), "dying root check");
362 exactRoots[i] = make();
363 if(exactRoots[(exactRootsCOUNT-1) - i] != objNULL)
364 dylan_write(exactRoots[(exactRootsCOUNT-1) - i],
365 exactRoots, exactRootsCOUNT);
366 } else {
367 i = (r >> 1) % ambigRootsCOUNT;
368 ambigRoots[(ambigRootsCOUNT-1) - i] = make();
369 /* Create random interior pointers */
370 ambigRoots[i] = (mps_addr_t)((char *)(ambigRoots[i/2]) + 1);
371 }
372
373 ++objs;
374
375 if (objs % step_frequencies[test_number] == 0)
376 test_step(arena);
377
378 if (objs % clockSetFREQ == 0)
379 set_clock_timing();
380
381 collections = mps_collections(arena);
382 if (collections > old_collections) {
383 old_collections = collections;
384 putchar('.');
385 fflush(stdout);
386 }
229 } 387 }
230 388
231 ++objs; 389 total_time = time_since(t1) - total_clock_time;
232 }
233 390
234 printf("%ld objects (%ld bytes) allocated\n", objs, alloc_bytes); 391 if (collections > 0)
235 printf("commit failed %ld times\n", commit_failures); 392 printf("\n");
236 printf("allocation took %.0f us, mean %.2f us, max %.0f us\n",
237 alloc_time, alloc_time / objs, max_alloc_time);
238 printf("%ld steps took %.0f us, mean %.2f us, max %.0f us\n",
239 steps, step_time, step_time / steps, max_step_time);
240 printf("%ld non-steps took %.0f us, mean %.2f us, max %.0f us\n",
241 no_steps, no_step_time, no_step_time / no_steps, max_no_step_time);
242 393
243 printf("clock timing %.2f us\n", clock_timing()); 394 messages = live = condemned = not_condemned = 0;
395 while (mps_message_get(&message, arena, mps_message_type_gc())) {
396 ++ messages;
397 live += mps_message_gc_live_size(arena, message);
398 condemned += mps_message_gc_condemned_size(arena, message);
399 not_condemned += mps_message_gc_not_condemned_size(arena,
400 message);
401 mps_message_discard(arena, message);
402 }
403 if (collections != messages) {
404 printf("%lu collections but %lu messages\n",
405 (unsigned long)collections, (unsigned long)messages);
406 collections = messages;
407 }
244 408
245 mps_ap_destroy(ap); 409 total_mps_time = alloc_time + step_time + no_step_time;
246 mps_root_destroy(exactRoot); 410 printf("Collection statistics:\n");
247 mps_root_destroy(ambigRoot); 411 printf(" %lu collections\n", (unsigned long)collections);
248 mps_pool_destroy(pool); 412 printf(" %lu bytes condemned.\n", (unsigned long)condemned);
249 mps_chain_destroy(chain); 413 printf(" %lu bytes not condemned.\n",
250 mps_fmt_destroy(format); 414 (unsigned long)not_condemned);
415 printf(" %lu bytes survived.\n", (unsigned long)live);
416 if (condemned) {
417 printf(" Mortality %5.2f%%.\n",
418 (1.0 - ((double)live)/condemned) * 100.0);
419 printf(" Condemned fraction %5.2f%%.\n",
420 ((double)condemned/(condemned + not_condemned)) * 100.0);
421 }
422 if (collections) {
423 printf(" Condemned per collection %lu bytes.\n",
424 (unsigned long)condemned/collections);
425 printf(" Reclaimed per collection %lu bytes.\n",
426 (unsigned long)(condemned - live)/collections);
427 }
251 428
252 return NULL; 429 printf("Allocation statistics:\n");
430 printf(" %ld objects (%ld bytes) allocated.\n", objs, alloc_bytes);
431 printf(" Commit failed %ld times.\n", commit_failures);
432
433 printf("Timings:\n");
434 print_time(" Allocation took ", alloc_time, "");
435 print_time(", mean ", alloc_time / objs, "");
436 print_time(", max ", max_alloc_time, ".\n");
437 if (steps) {
438 printf(" %ld steps took ", steps);
439 print_time("", step_time, "");
440 print_time(", mean ", step_time/steps, "");
441 print_time(", max ", max_step_time, ".\n");
442 }
443 if (no_steps) {
444 printf(" %ld non-steps took ", no_steps);
445 print_time("", no_step_time, "");
446 print_time(", mean ", no_step_time / no_steps, "");
447 print_time(", max ", max_no_step_time, ".\n");
448 }
449 if (alloc_time > 0.0)
450 printf(" Allocated %.2f bytes per us.\n",
451 (double)alloc_bytes/alloc_time);
452 if (step_time > 0.0) {
453 printf(" Reclaimed %.2f bytes per us of step.\n",
454 (double)(condemned - live)/step_time);
455 if (collections > 0) {
456 printf(" Took %.2f steps ", (double)steps/collections);
457 print_time("(", step_time / collections, ") per collection.\n");
458 }
459 }
460 print_time(" Total time ", total_time, ".\n");
461 print_time(" Total MPS time ", total_mps_time, "");
462 printf(" (%5.2f%%, ", total_mps_time * 100.0 / total_time);
463 print_time("", total_mps_time/alloc_bytes, " per byte, ");
464 print_time("", total_mps_time/objs, " per object)\n");
465 print_time(" (adjusted for clock timing: ",
466 total_clock_time,
467 " spent reading the clock;\n");
468 printf(" %lu clock reads; ", (unsigned long)clock_reads);
469 print_time("", total_clock_time / clock_reads, " per read;");
470 print_time(" recently measured as ", clock_time, ").\n");
471 mps_ap_destroy(ap);
472 mps_root_destroy(exactRoot);
473 mps_root_destroy(ambigRoot);
474 mps_pool_destroy(pool);
475 mps_chain_destroy(chain);
476 mps_fmt_destroy(format);
477
478 return NULL;
253} 479}
254 480
255int main(int argc, char **argv) 481int main(int argc, char **argv)
256{ 482{
257 mps_arena_t arena; 483 prepare_clock();
258 mps_thr_t thread; 484
259 void *r; 485 randomize(argc, argv);
260 486
261 prepare_clock(); 487 while (test_number < TESTS) {
262 488 mps_arena_t arena;
263 randomize(argc, argv); 489 mps_thr_t thread;
264 490 void *r;
265 die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE), 491
266 "arena_create"); 492 set_clock_timing();
267 die(mps_arena_commit_limit_set(arena, testArenaSIZE), "set limit"); 493 die(mps_arena_create(&arena, mps_arena_class_vm(),
268 die(mps_thread_reg(&thread, arena), "thread_reg"); 494 testArenaSIZE),
269 mps_tramp(&r, test, arena, 0); 495 "arena_create");
270 mps_thread_dereg(thread); 496 die(mps_thread_reg(&thread, arena), "thread_reg");
271 mps_arena_destroy(arena); 497 mps_tramp(&r, test, arena, 0);
498 mps_thread_dereg(thread);
499 mps_arena_destroy(arena);
500 ++ test_number;
501 }
272 502
273 fflush(stdout); /* synchronize */ 503 fflush(stdout); /* synchronize */
274 fprintf(stderr, "\nConclusion: Failed to find any defects.\n"); 504 fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
275 return 0; 505 return 0;
276} 506}
277 507
278 508
@@ -281,18 +511,18 @@ int main(int argc, char **argv)
281 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>. 511 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
282 * All rights reserved. This is an open source license. Contact 512 * All rights reserved. This is an open source license. Contact
283 * Ravenbrook for commercial licensing options. 513 * Ravenbrook for commercial licensing options.
284 * 514 *
285 * Redistribution and use in source and binary forms, with or without 515 * Redistribution and use in source and binary forms, with or without
286 * modification, are permitted provided that the following conditions are 516 * modification, are permitted provided that the following conditions are
287 * met: 517 * met:
288 * 518 *
289 * 1. Redistributions of source code must retain the above copyright 519 * 1. Redistributions of source code must retain the above copyright
290 * notice, this list of conditions and the following disclaimer. 520 * notice, this list of conditions and the following disclaimer.
291 * 521 *
292 * 2. Redistributions in binary form must reproduce the above copyright 522 * 2. Redistributions in binary form must reproduce the above copyright
293 * notice, this list of conditions and the following disclaimer in the 523 * notice, this list of conditions and the following disclaimer in the
294 * documentation and/or other materials provided with the distribution. 524 * documentation and/or other materials provided with the distribution.
295 * 525 *
296 * 3. Redistributions in any form must be accompanied by information on how 526 * 3. Redistributions in any form must be accompanied by information on how
297 * to obtain complete source code for this software and any accompanying 527 * to obtain complete source code for this software and any accompanying
298 * software that uses this software. The source code must either be 528 * software that uses this software. The source code must either be
@@ -303,7 +533,7 @@ int main(int argc, char **argv)
303 * include source code for modules or files that typically accompany the 533 * include source code for modules or files that typically accompany the
304 * major components of the operating system on which the executable file 534 * major components of the operating system on which the executable file
305 * runs. 535 * runs.
306 * 536 *
307 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 537 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
308 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 538 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
309 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 539 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
diff --git a/mps/code/teletest.c b/mps/code/teletest.c
index 571e4e83fc3..ab2a742a891 100644
--- a/mps/code/teletest.c
+++ b/mps/code/teletest.c
@@ -110,8 +110,8 @@ static void doHelp(void)
110 "read -> <old> Read filter\n" 110 "read -> <old> Read filter\n"
111 "set <mask> -> <old> <new> Set filter\n" 111 "set <mask> -> <old> <new> Set filter\n"
112 "reset <mask> -> <old> <new> Reset filter\n" 112 "reset <mask> -> <old> <new> Reset filter\n"
113 "flip <mask> -> <old> <new> Toggle filter\n" 113 "flip <mask> -> <old> <new> Toggle filter\n");
114 "intern <string> -> <id> Intern string\n" 114 (void)printf("intern <string> -> <id> Intern string\n"
115 "label <address> <id> Label address\n" 115 "label <address> <id> Label address\n"
116 "flush Flush buffer\n" 116 "flush Flush buffer\n"
117 "help Print this message\n" 117 "help Print this message\n"
diff --git a/mps/code/w3build.bat b/mps/code/w3build.bat
new file mode 100755
index 00000000000..25e4cb72c76
--- /dev/null
+++ b/mps/code/w3build.bat
@@ -0,0 +1,44 @@
1@rem impl.bat.gathconf: GATHERING A RELEASE FOR CONFIGURA
2@rem
3@rem $HopeName: !gathconf.bat(trunk.1) $
4@rem Copyright (C) 2000 Harlequin Limited. All rights reserved.
5
6rmdir /s w3i3mv
7nmake /f w3i3mv.nmk VARIETY=we mps.lib mpsplan.lib
8nmake /f w3i3mv.nmk VARIETY=wi mps.lib mpsplan.lib
9nmake /f w3i3mv.nmk VARIETY=ce mps.lib mpsplan.lib
10nmake /f w3i3mv.nmk VARIETY=ci mps.lib mpsplan.lib
11mkdir release
12mkdir release\include
13mkdir release\lib
14mkdir release\lib\w3i3
15mkdir release\lib\w3i3\we
16mkdir release\lib\w3i3\ce
17mkdir release\lib\w3i3\wi
18mkdir release\lib\w3i3\ci
19mkdir release\src
20copy mps.h release\include
21copy mpsavm.h release\include
22copy mpsacl.h release\include
23copy mpscamc.h release\include
24copy mpscams.h release\include
25copy mpscawl.h release\include
26copy mpsclo.h release\include
27copy mpscmv.h release\include
28copy mpscmvff.h release\include
29copy mpscsnc.h release\include
30copy mpsio.h release\include
31copy mpslib.h release\include
32copy mpstd.h release\include
33copy mpsw3.h release\include
34copy mpswin.h release\include
35copy w3i3mv\we\mps.lib release\lib\w3i3\we
36copy w3i3mv\ce\mps.lib release\lib\w3i3\ce
37copy w3i3mv\we\mpsplan.lib release\lib\w3i3\we
38copy w3i3mv\ce\mpsplan.lib release\lib\w3i3\ce
39copy w3i3mv\wi\mps.lib release\lib\w3i3\wi
40copy w3i3mv\ci\mps.lib release\lib\w3i3\ci
41copy w3i3mv\wi\mpsplan.lib release\lib\w3i3\wi
42copy w3i3mv\ci\mpsplan.lib release\lib\w3i3\ci
43copy mpsliban.c release\src
44copy mpsioan.c release\src
diff --git a/mps/code/w3i3mv.nmk b/mps/code/w3i3mv.nmk
index 41636b37faf..f3b98dbdea7 100644
--- a/mps/code/w3i3mv.nmk
+++ b/mps/code/w3i3mv.nmk
@@ -27,14 +27,6 @@ SW = <ring> <mpm> <bt> <protocol> <boot> \
27 <event> <seg> <sac> <poolmrg> <message> <mpsioan> \ 27 <event> <seg> <sac> <poolmrg> <message> <mpsioan> \
28 <poolams> <poolamsi> <dbgpool> <dbgpooli> \ 28 <poolams> <poolamsi> <dbgpool> <dbgpooli> \
29 <abq> <meter> <cbs> <poolmv2> <splay> <version> <poolmvff> 29 <abq> <meter> <cbs> <poolmv2> <splay> <version> <poolmvff>
30CONFIGURA = <ring> <mpm> <bt> <protocol> <boot> \
31 <arenavm> <arenacl> <locus> <arena> <global> <tract> <reserv> \
32 <pool> <poolabs> <poolmfs> <poolmv> \
33 <root> <format> <buffer> <walk> \
34 <ref> <trace> <protw3> <proti3> <prmci3w3> <shield> <vmw3> \
35 <thw3i3> <ssw3i3> <mpsi> <mpsiw3> <ld> <spi3> \
36 <event> <seg> <sac> <poolmrg> <message> <dbgpool> <dbgpooli> \
37 <abq> <meter> <cbs> <splay> <version> <poolmvff>
38PLINTH = <mpsliban> <mpsioan> 30PLINTH = <mpsliban> <mpsioan>
39AMC = <poolamc> 31AMC = <poolamc>
40AMS = <poolams> <poolamsi> 32AMS = <poolams> <poolamsi>
@@ -70,8 +62,6 @@ PLINTHOBJ0 = $(PLINTH:<=w3i3mv\he\)
70PLINTHOBJ = $(PLINTHOBJ0:>=.obj) 62PLINTHOBJ = $(PLINTHOBJ0:>=.obj)
71SWOBJ0 = $(SW:<=w3i3mv\he\) 63SWOBJ0 = $(SW:<=w3i3mv\he\)
72SWOBJ = $(SWOBJ0:>=.obj) 64SWOBJ = $(SWOBJ0:>=.obj)
73CONFIGURAOBJ0 = $(CONFIGURA:<=w3i3mv\he\)
74CONFIGURAOBJ = $(CONFIGURAOBJ0:>=.obj)
75AMSOBJ0 = $(AMS:<=w3i3mv\he\) 65AMSOBJ0 = $(AMS:<=w3i3mv\he\)
76AMSOBJ = $(AMSOBJ0:>=.obj) 66AMSOBJ = $(AMSOBJ0:>=.obj)
77AMCOBJ0 = $(AMC:<=w3i3mv\he\) 67AMCOBJ0 = $(AMC:<=w3i3mv\he\)
@@ -103,8 +93,6 @@ PLINTHOBJ0 = $(PLINTH:<=w3i3mv\ce\)
103PLINTHOBJ = $(PLINTHOBJ0:>=.obj) 93PLINTHOBJ = $(PLINTHOBJ0:>=.obj)
104SWOBJ0 = $(SW:<=w3i3mv\ce\) 94SWOBJ0 = $(SW:<=w3i3mv\ce\)
105SWOBJ = $(SWOBJ0:>=.obj) 95SWOBJ = $(SWOBJ0:>=.obj)
106CONFIGURAOBJ0 = $(CONFIGURA:<=w3i3mv\ce\)
107CONFIGURAOBJ = $(CONFIGURAOBJ0:>=.obj)
108AMSOBJ0 = $(AMS:<=w3i3mv\ce\) 96AMSOBJ0 = $(AMS:<=w3i3mv\ce\)
109AMSOBJ = $(AMSOBJ0:>=.obj) 97AMSOBJ = $(AMSOBJ0:>=.obj)
110AMCOBJ0 = $(AMC:<=w3i3mv\ce\) 98AMCOBJ0 = $(AMC:<=w3i3mv\ce\)
@@ -136,8 +124,6 @@ PLINTHOBJ0 = $(PLINTH:<=w3i3mv\hi\)
136PLINTHOBJ = $(PLINTHOBJ0:>=.obj) 124PLINTHOBJ = $(PLINTHOBJ0:>=.obj)
137SWOBJ0 = $(SW:<=w3i3mv\hi\) 125SWOBJ0 = $(SW:<=w3i3mv\hi\)
138SWOBJ = $(SWOBJ0:>=.obj) 126SWOBJ = $(SWOBJ0:>=.obj)
139CONFIGURAOBJ0 = $(CONFIGURA:<=w3i3mv\hi\)
140CONFIGURAOBJ = $(CONFIGURAOBJ0:>=.obj)
141AMSOBJ0 = $(AMS:<=w3i3mv\hi\) 127AMSOBJ0 = $(AMS:<=w3i3mv\hi\)
142AMSOBJ = $(AMSOBJ0:>=.obj) 128AMSOBJ = $(AMSOBJ0:>=.obj)
143AMCOBJ0 = $(AMC:<=w3i3mv\hi\) 129AMCOBJ0 = $(AMC:<=w3i3mv\hi\)
@@ -169,8 +155,6 @@ PLINTHOBJ0 = $(PLINTH:<=w3i3mv\ci\)
169PLINTHOBJ = $(PLINTHOBJ0:>=.obj) 155PLINTHOBJ = $(PLINTHOBJ0:>=.obj)
170SWOBJ0 = $(SW:<=w3i3mv\ci\) 156SWOBJ0 = $(SW:<=w3i3mv\ci\)
171SWOBJ = $(SWOBJ0:>=.obj) 157SWOBJ = $(SWOBJ0:>=.obj)
172CONFIGURAOBJ0 = $(CONFIGURA:<=w3i3mv\ci\)
173CONFIGURAOBJ = $(CONFIGURAOBJ0:>=.obj)
174AMSOBJ0 = $(AMS:<=w3i3mv\ci\) 158AMSOBJ0 = $(AMS:<=w3i3mv\ci\)
175AMSOBJ = $(AMSOBJ0:>=.obj) 159AMSOBJ = $(AMSOBJ0:>=.obj)
176AMCOBJ0 = $(AMC:<=w3i3mv\ci\) 160AMCOBJ0 = $(AMC:<=w3i3mv\ci\)
@@ -202,8 +186,6 @@ PLINTHOBJ0 = $(PLINTH:<=w3i3mv\ti\)
202PLINTHOBJ = $(PLINTHOBJ0:>=.obj) 186PLINTHOBJ = $(PLINTHOBJ0:>=.obj)
203SWOBJ0 = $(SW:<=w3i3mv\ti\) 187SWOBJ0 = $(SW:<=w3i3mv\ti\)
204SWOBJ = $(SWOBJ0:>=.obj) 188SWOBJ = $(SWOBJ0:>=.obj)
205CONFIGURAOBJ0 = $(CONFIGURA:<=w3i3mv\ti\)
206CONFIGURAOBJ = $(CONFIGURAOBJ0:>=.obj)
207AMSOBJ0 = $(AMS:<=w3i3mv\ti\) 189AMSOBJ0 = $(AMS:<=w3i3mv\ti\)
208AMSOBJ = $(AMSOBJ0:>=.obj) 190AMSOBJ = $(AMSOBJ0:>=.obj)
209AMCOBJ0 = $(AMC:<=w3i3mv\ti\) 191AMCOBJ0 = $(AMC:<=w3i3mv\ti\)
@@ -235,8 +217,6 @@ PLINTHOBJ0 = $(PLINTH:<=w3i3mv\wi\)
235PLINTHOBJ = $(PLINTHOBJ0:>=.obj) 217PLINTHOBJ = $(PLINTHOBJ0:>=.obj)
236SWOBJ0 = $(SW:<=w3i3mv\wi\) 218SWOBJ0 = $(SW:<=w3i3mv\wi\)
237SWOBJ = $(SWOBJ0:>=.obj) 219SWOBJ = $(SWOBJ0:>=.obj)
238CONFIGURAOBJ0 = $(CONFIGURA:<=w3i3mv\wi\)
239CONFIGURAOBJ = $(CONFIGURAOBJ0:>=.obj)
240AMSOBJ0 = $(AMS:<=w3i3mv\wi\) 220AMSOBJ0 = $(AMS:<=w3i3mv\wi\)
241AMSOBJ = $(AMSOBJ0:>=.obj) 221AMSOBJ = $(AMSOBJ0:>=.obj)
242AMCOBJ0 = $(AMC:<=w3i3mv\wi\) 222AMCOBJ0 = $(AMC:<=w3i3mv\wi\)
@@ -268,8 +248,6 @@ PLINTHOBJ0 = $(PLINTH:<=w3i3mv\we\)
268PLINTHOBJ = $(PLINTHOBJ0:>=.obj) 248PLINTHOBJ = $(PLINTHOBJ0:>=.obj)
269SWOBJ0 = $(SW:<=w3i3mv\we\) 249SWOBJ0 = $(SW:<=w3i3mv\we\)
270SWOBJ = $(SWOBJ0:>=.obj) 250SWOBJ = $(SWOBJ0:>=.obj)
271CONFIGURAOBJ0 = $(CONFIGURA:<=w3i3mv\we\)
272CONFIGURAOBJ = $(CONFIGURAOBJ0:>=.obj)
273AMSOBJ0 = $(AMS:<=w3i3mv\we\) 251AMSOBJ0 = $(AMS:<=w3i3mv\we\)
274AMSOBJ = $(AMSOBJ0:>=.obj) 252AMSOBJ = $(AMSOBJ0:>=.obj)
275AMCOBJ0 = $(AMC:<=w3i3mv\we\) 253AMCOBJ0 = $(AMC:<=w3i3mv\we\)
diff --git a/mps/code/xcppgc.gmk b/mps/code/xcppgc.gmk
index 476dcf60f30..a160a700224 100644
--- a/mps/code/xcppgc.gmk
+++ b/mps/code/xcppgc.gmk
@@ -24,7 +24,9 @@ CC = cc
24# inline function. 24# inline function.
25# .types: sys/types.h uses 'long long' even under -ansi. 25# .types: sys/types.h uses 'long long' even under -ansi.
26CFLAGSCOMPILER := $(subst -Wstrict-prototypes,,$(CFLAGSCOMPILER)) \ 26CFLAGSCOMPILER := $(subst -Wstrict-prototypes,,$(CFLAGSCOMPILER)) \
27 -Wno-unused -Wno-long-long 27 -Wno-unused -Wno-long-long -no-cpp-precomp
28CFLAGSDEBUG := $(subst -g -ggdb3,-g3,$(CFLAGSDEBUG))
29CFLAGSOPT := $(subst -g -ggdb3,-g3,$(CFLAGSOPT))
28 30
29include comm.gmk 31include comm.gmk
30 32