diff --git a/mps/code/airtest.c b/mps/code/airtest.c index 302f91bb716..eea742def46 100644 --- a/mps/code/airtest.c +++ b/mps/code/airtest.c @@ -128,7 +128,8 @@ static void test_main(void *marker, int interior, int stack) if (stack) { res = mps_root_create_stack(®_root, scheme_arena, mps_rank_ambig(), - 0, thread, sizeof(mps_word_t) - 1, 0, marker); + 0, thread, mps_scan_area_tagged, + sizeof(mps_word_t) - 1, 0, marker); if (res != MPS_RES_OK) error("Couldn't create root"); } diff --git a/mps/code/amcssth.c b/mps/code/amcssth.c index bd06dc9b2c6..80320261aec 100644 --- a/mps/code/amcssth.c +++ b/mps/code/amcssth.c @@ -140,7 +140,8 @@ static void *kid_thread(void *arg) die(mps_thread_reg(&thread, (mps_arena_t)arena), "thread_reg"); die(mps_root_create_stack(®_root, arena, mps_rank_ambig(), - 0, thread, sizeof(mps_word_t) - 1, 0, marker), + 0, thread, mps_scan_area_tagged, + sizeof(mps_word_t) - 1, 0, marker), "root_create"); die(mps_ap_create(&ap, cl->pool, mps_rank_exact()), "BufferCreate(fooey)"); @@ -318,7 +319,8 @@ static void test_arena(int mode) "root_create_table(ambig)"); die(mps_thread_reg(&thread, arena), "thread_reg"); die(mps_root_create_stack(®_root, arena, mps_rank_ambig(), - 0, thread, sizeof(mps_word_t) - 1, 0, marker), + 0, thread, mps_scan_area_tagged, + sizeof(mps_word_t) - 1, 0, marker), "root_create"); die(mps_pool_create(&amc_pool, arena, mps_class_amc(), format, chain), diff --git a/mps/code/awlut.c b/mps/code/awlut.c index 93575df854a..1b2a430af47 100644 --- a/mps/code/awlut.c +++ b/mps/code/awlut.c @@ -268,7 +268,8 @@ static void *setup(void *v, size_t s) thr = guff->thr; die(mps_root_create_stack(&stack, arena, mps_rank_ambig(), - 0, thr, sizeof(mps_word_t) - 1, 0, v), + 0, thr, mps_scan_area_tagged, + sizeof(mps_word_t) - 1, 0, v), "Root Create\n"); die(mps_fmt_create_A(&dylanfmt, arena, dylan_fmt_A()), "Format Create\n"); diff --git a/mps/code/awluthe.c b/mps/code/awluthe.c index e8b22f6ebb9..b5b4f4db07f 100644 --- a/mps/code/awluthe.c +++ b/mps/code/awluthe.c @@ -272,7 +272,8 @@ static void *setup(void *v, size_t s) thr = guff->thr; die(mps_root_create_stack(&stack, arena, mps_rank_ambig(), - 0, thr, sizeof(mps_word_t) - 1, 0, v), + 0, thr, mps_scan_area_tagged, + sizeof(mps_word_t) - 1, 0, v), "Root Create\n"); die(EnsureHeaderFormat(&dylanfmt, arena), "EnsureHeaderFormat"); die(EnsureHeaderWeakFormat(&dylanweakfmt, arena), "EnsureHeaderWeakFormat"); diff --git a/mps/code/awlutth.c b/mps/code/awlutth.c index b9b60aff962..fad46a29844 100644 --- a/mps/code/awlutth.c +++ b/mps/code/awlutth.c @@ -255,7 +255,8 @@ static void *setup(void *v, size_t s) thr = guff->thr; die(mps_root_create_stack(&stack, arena, mps_rank_ambig(), - 0, thr, sizeof(mps_word_t) - 1, 0, v), + 0, thr, mps_scan_area_tagged, + sizeof(mps_word_t) - 1, 0, v), "Root Create\n"); die(mps_fmt_create_A(&dylanfmt, arena, dylan_fmt_A()), "Format Create\n"); diff --git a/mps/code/gcbench.c b/mps/code/gcbench.c index 2a61a8662c5..0451cd9fbc0 100644 --- a/mps/code/gcbench.c +++ b/mps/code/gcbench.c @@ -178,7 +178,8 @@ static void *start(void *p) { RESMUST(mps_thread_reg(&thread->mps_thread, arena)); RESMUST(mps_root_create_stack(&thread->reg_root, arena, mps_rank_ambig(), (mps_rm_t)0, thread->mps_thread, - sizeof(mps_word_t) - 1, 0, &marker)); + mps_scan_area_tagged, + sizeof(mps_word_t) - 1, 0, &marker)); RESMUST(mps_ap_create_k(&thread->ap, pool, mps_args_none)); thread->fn(thread); mps_ap_destroy(thread->ap); diff --git a/mps/code/mpm.h b/mps/code/mpm.h index 3fcd56d2c77..fb5f772ae99 100644 --- a/mps/code/mpm.h +++ b/mps/code/mpm.h @@ -963,6 +963,7 @@ extern Res RootCreateReg(Root *rootReturn, Arena arena, void *p, size_t s); extern Res RootCreateRegMasked(Root *rootReturn, Arena arena, Rank rank, Thread thread, + mps_area_scan_t scan_area, Word mask, Word pattern, Word *stackBot); extern Res RootCreateFmt(Root *rootReturn, Arena arena, diff --git a/mps/code/mps.h b/mps/code/mps.h index 92a02399f10..c1fd1e5f0eb 100644 --- a/mps/code/mps.h +++ b/mps/code/mps.h @@ -693,6 +693,7 @@ extern mps_res_t mps_root_create_reg(mps_root_t *, mps_arena_t, mps_reg_scan_t, void *, size_t); extern mps_res_t mps_root_create_stack(mps_root_t *, mps_arena_t, mps_rank_t, mps_rm_t, mps_thr_t, + mps_area_scan_t, mps_word_t, mps_word_t, void *); extern void mps_root_destroy(mps_root_t); diff --git a/mps/code/mpsi.c b/mps/code/mpsi.c index c55b4763890..42db2008cfc 100644 --- a/mps/code/mpsi.c +++ b/mps/code/mpsi.c @@ -1450,10 +1450,13 @@ mps_res_t mps_root_create_reg(mps_root_t *mps_root_o, mps_arena_t arena, } +/* FIXME: re-document */ mps_res_t mps_root_create_stack(mps_root_t *mps_root_o, mps_arena_t arena, mps_rank_t mps_rank, mps_rm_t mps_rm, - mps_thr_t thread, mps_word_t mask, - mps_word_t pattern, void *reg_scan_p) + mps_thr_t thread, + mps_area_scan_t scan_area, + mps_word_t mask, mps_word_t pattern, + void *stack) { Rank rank = (Rank)mps_rank; Root root; @@ -1462,15 +1465,16 @@ mps_res_t mps_root_create_stack(mps_root_t *mps_root_o, mps_arena_t arena, ArenaEnter(arena); AVER(mps_root_o != NULL); - AVER(reg_scan_p != NULL); /* stackBot */ - AVER(AddrIsAligned(reg_scan_p, sizeof(Word))); + AVER(stack != NULL); /* stackBot */ + AVER(AddrIsAligned(stack, sizeof(Word))); AVER(rank == mps_rank_ambig()); AVER(mps_rm == (mps_rm_t)0); AVER((~mask & pattern) == 0); /* See .root-mode. */ res = RootCreateRegMasked(&root, arena, rank, thread, - mask, pattern, (Word *)reg_scan_p); + scan_area, mask, pattern, + (Word *)stack); ArenaLeave(arena); diff --git a/mps/code/mpsicv.c b/mps/code/mpsicv.c index aa563683f4f..10b98060ce5 100644 --- a/mps/code/mpsicv.c +++ b/mps/code/mpsicv.c @@ -604,7 +604,8 @@ int main(int argc, char *argv[]) } else { die(mps_root_create_stack(®_root, arena, mps_rank_ambig(), (mps_rm_t)0, - thread, sizeof(mps_word_t) - 1, 0, marker), + thread, mps_scan_area_tagged, + sizeof(mps_word_t) - 1, 0, marker), "root_create_stack"); } diff --git a/mps/code/root.c b/mps/code/root.c index 4433df89033..f1fb45f82d5 100644 --- a/mps/code/root.c +++ b/mps/code/root.c @@ -352,7 +352,9 @@ Res RootCreateReg(Root *rootReturn, Arena arena, Res RootCreateRegMasked(Root *rootReturn, Arena arena, Rank rank, Thread thread, - Word mask, Word pattern, Word *stackBot) + mps_area_scan_t scan_area, + Word mask, Word pattern, + Word *stackBot) { union RootUnion theUnion; @@ -364,7 +366,7 @@ Res RootCreateRegMasked(Root *rootReturn, Arena arena, AVER((~mask & pattern) == 0); theUnion.regMasked.thread = thread; - theUnion.regMasked.scan_area = mps_scan_area_tagged; + theUnion.regMasked.scan_area = scan_area; theUnion.regMasked.tag.mask = mask; theUnion.regMasked.tag.pattern = pattern; theUnion.regMasked.stackBot = stackBot; diff --git a/mps/code/tagtest.c b/mps/code/tagtest.c index 76d8b5ec792..7f27d45fc09 100644 --- a/mps/code/tagtest.c +++ b/mps/code/tagtest.c @@ -209,13 +209,15 @@ static void test(int mode, void *marker) case MODE_CONS: /* Scan words tagged "cons" -- everything will live. */ die(mps_root_create_stack(&root, arena, mps_rank_ambig(), 0, thread, - TAG_MASK, tag_cons, marker), "root"); + mps_scan_area_tagged, TAG_MASK, tag_cons, + marker), "root"); expected = 0; break; case MODE_INVALID: /* Scan words tagged "invalid" -- everything will die. */ die(mps_root_create_stack(&root, arena, mps_rank_ambig(), 0, thread, - TAG_MASK, tag_invalid, marker), "root"); + mps_scan_area_tagged, TAG_MASK, tag_invalid, + marker), "root"); expected = OBJCOUNT; break; } diff --git a/mps/code/zcoll.c b/mps/code/zcoll.c index 64fd5406018..16b403be2f4 100644 --- a/mps/code/zcoll.c +++ b/mps/code/zcoll.c @@ -576,7 +576,8 @@ static void StackScan(mps_arena_t arena, int on) Insist(root_stackreg == NULL); die(mps_root_create_stack(&root_stackreg, arena, mps_rank_ambig(), (mps_rm_t)0, stack_thr, - sizeof(mps_word_t) - 1, 0, stack_start), + mps_scan_area_tagged, + sizeof(mps_word_t) - 1, 0, stack_start), "root_stackreg"); Insist(root_stackreg != NULL); } else { @@ -764,7 +765,8 @@ static void *testscriptB(void *arg, size_t s) stack_thr = thr; die(mps_root_create_stack(&root_stackreg, arena, mps_rank_ambig(), (mps_rm_t)0, stack_thr, - sizeof(mps_word_t) - 1, 0, stack_start), + mps_scan_area_tagged, + sizeof(mps_word_t) - 1, 0, stack_start), "root_stackreg"); diff --git a/mps/code/zmess.c b/mps/code/zmess.c index ff7cb526509..60a9c4a1e99 100644 --- a/mps/code/zmess.c +++ b/mps/code/zmess.c @@ -332,6 +332,7 @@ static void *testscriptB(void *arg, size_t s) /* root_stackreg: stack & registers are ambiguous roots = mutator's workspace */ die(mps_root_create_stack(&root_stackreg, arena, mps_rank_ambig(), (mps_rm_t)0, thr, + mps_scan_area_tagged, sizeof(mps_word_t) - 1, 0, &stack_starts_here), "root_stackreg");