[m-rev.] for review: fix missed tail call optimisations in java grade

Julien Fischer juliensf at csse.unimelb.edu.au
Mon Jun 15 15:55:34 AEST 2009


On Mon, 15 Jun 2009, Peter Wang wrote:

> Branches: main
>
> Fix a problem in MLDS grades using --det-copy-out (java, il) where dummy
> arguments in predicates would prevent tail calls being marked as such.
>
> Also make a few predicates tail recursive.
>
> compiler/ml_code_gen.m:
>        With the --det-copy-out option, don't list dummy output variables as
>        copy out variables.  This led to `return' statements containing dummy
>        output variables, but a call prior to a `return' statement wouldn't
>        have dummy outputs, so ml_tailcall.m wouldn't recognise the call as a
>        tail call.
>
> compiler/mlds_to_java.m:
>        Delete a hack that drops dummy variables in return statements.
>
> compiler/mercury_compile.m:
>        Make backend_pass_by_preds_2 tail recursive.  Otherwise a compiler
>        built in the java grade runs out of stack space compiling some
>        larger modules.
>
> library/bag.m:
>        Make tail recursion more obvious in a few predicates.

That's fine.

Julien.
--------------------------------------------------------------------------
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