[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Order of evaluation in PUSH (& PUSHNEW)
- To: "Scott E. Fahlman" <Fahlman@c.cs.cmu.edu>
- Subject: Re: Order of evaluation in PUSH (& PUSHNEW)
- From: larus%paris.Berkeley.EDU@berkeley.edu (James Larus)
- Date: Thu, 21 May 87 09:43:16 PDT
- Cc: firstname.lastname@example.org, email@example.com
- In-reply-to: Your message of Thu, 21 May 87 00:33:00 EDT. <FAHLMAN.12304040661.BABYL@C.CS.CMU.EDU>
Leaving the order of evaluation of actual parameters unspecified (a la
Scheme) would help some serial, as well as parallel, implementations.
Consider a machine that uses registers for passing parameters and
evaluating expressions. If a compiler is free to reorder the
evaluation of expressions, it can evaluate the more complex ones using
the (empty) registers, then evaluate the other ones directly into
their target registers. From personal experience on SPUR, this
freedom would produce noticeably better code and reduce the number of
temporaries that have to be allocated by the register allocator.
Of course, some existing programs would break. But a good argument
can be made that these programs were dependent an implementation
PS Did the CL committee ever decide which sentence actually *requires*
left-to-right evaluation of formals?