Make parsing unboxed calls more declarative.

original commit: a41e70375e07376b84294beb07b2e97ff0174b57
This commit is contained in:
Eric Dobson 2013-09-19 08:51:46 -07:00
parent 71d6323895
commit bb230e0939
2 changed files with 7 additions and 12 deletions

View File

@ -394,9 +394,8 @@
#:with opt #`(let*-values (exp.bindings ...)
(unsafe-make-flrectangular exp.real-binding exp.imag-binding)))
(pattern (#%plain-app op:unboxed-fun args:expr ...)
;no need to optimize op
#:with (~var call (float-complex-call-site-opt-expr #'op.unboxed-info)) #'(args ...)
(pattern (#%plain-app op:unboxed-fun .
(~var call (float-complex-call-site-opt-expr #'op.unboxed-info)))
#:do [(log-arity-raising-opt "call to fun with unboxed args")]
#:with opt #'(let*-values (call.bindings ...) (op call.args ...)))

View File

@ -28,15 +28,11 @@
#:literal-sets (kernel-literals)
#:attributes (opt)
(pattern (#%plain-app
(~and let-e (letrec-values
bindings
loop-fun:id)) ; sole element of the body
args:expr ...)
#:with (~var operator (unboxed-let-opt-expr-internal #t)) #'let-e
#:with loop-fun2:unboxed-fun #'loop-fun
#:do [(log-optimization "unboxed let loop" arity-raising-opt-msg #'loop-fun2)]
#:with (~var call (float-complex-call-site-opt-expr #'loop-fun2.unboxed-info))
#'(args ...)
(~and (letrec-values _ :id) ; sole element of the body is an id
(~var operator (unboxed-let-opt-expr-internal #t))
(letrec-values _ loop-fun:unboxed-fun)) .
(~var call (float-complex-call-site-opt-expr #'loop-fun.unboxed-info)))
#:do [(log-optimization "unboxed let loop" arity-raising-opt-msg #'loop-fun)]
#:with opt #'(let*-values
(((op) operator.opt) call.bindings ...)
(op call.args ...))))