[m-rev.] for review: fix nondet stack segments

Zoltan Somogyi zs at csse.unimelb.edu.au
Wed Aug 6 18:33:45 AEST 2008


On 06-Aug-2008, Peter Wang <novalazy at gmail.com> wrote:
> +    ** Pop off the nondet stack segments until maxfr is within the bounds of
> +    ** the top segment.
> +    ** XXX we could avoid rewinding all the way if we'll be needing to create a
> +    ** new segment anyway
> +    */
> +    MR_rewind_nondetstack_segments(old_maxfr);

You could make this return a pointer to a zone to reuse, or NULL.

> +    for (;;) {
> +        zone = MR_CONTEXT(MR_ctxt_nondetstack_zone);
> +        /*
> +        ** XXX why is maxfr sometimes slightly past MR_zone_extend_threshold?
> +        ** That's why we test against MR_zone_redzone.
> +        */

Is this executed before or after maxfr is incremented? If before, the only
way to answer that question is to search the runtime and some representative
compiler-generated code for assignments to MR_maxfr_word.

> +        if (maxfr >= zone->MR_zone_min &&
> +            maxfr < (MR_Word *) zone->MR_zone_redzone)
> +        {
> +            break;
> +        }
> +
> +        MR_unget_zone(zone);
> +
> +        list = MR_CONTEXT(MR_ctxt_prev_nondetstack_zones);
> +        assert(list);

This should be

	assert(list != NULL);

Have you tested the diff on a SPARC, to check for any problems caused
by register windows?

The rest looks ok.

Zoltan.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list