[m-dev.] for review: --optimize-mostly-det-tailcalls
Thomas Conway
conway at cs.mu.OZ.AU
Mon Jun 7 09:29:47 AEST 1999
On Sun, Jun 06, 1999 at 01:14:41PM EST, Zoltan Somogyi wrote:
> +code_info__may_use_nondet_tailcall(NoCheckTailCall, CheckTailCall) -->
> code_info__get_fail_info(FailInfo),
> - { FailInfo = fail_info(ResumePoints, ResumeKnown, _, _, _) },
> - (
> - { ResumeKnown = resume_point_known },
> - { stack__top_det(ResumePoints, TopResumePoint) },
> - { TopResumePoint = stack_only(_, do_fail) }
> + { FailInfo = fail_info(ResumePoints0, ResumeKnown, _, _, _) },
> + {
> + stack__pop(ResumePoints0, ResumePoint1, ResumePoints1),
> + stack__is_empty(ResumePoints1),
> + ResumePoint1 = stack_only(_, do_fail)
> ->
> - { MayTailCall = yes }
> + (
> + ResumeKnown = resume_point_known,
> + NoCheckTailCall = yes,
> + CheckTailCall = no
> + ;
> + ResumeKnown = resume_point_unknown,
> + NoCheckTailCall = no,
> + CheckTailCall = yes
> + )
> ;
> - { MayTailCall = no }
> - ).
> + NoCheckTailCall = no,
> + CheckTailCall = no
> + }.
These variable names are very confusing, since NoCheckTailCall sounds
very much like it should be the negation of CheckTailCall. Using an
enumeration or two rather than bools would help.
Apart from this issue, this change looks okay.
--
Thomas Conway )O+ | Master, I go hunting.
Mercurian | -- Le Guin, A Wizard of Earthsea
<conway at cs.mu.oz.au> |
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list