Make parsing unboxed calls more declarative.

This commit is contained in:
Eric Dobson 2013-09-19 08:51:46 -07:00
parent 957e856a14
commit a41e70375e
2 changed files with 7 additions and 12 deletions

View File

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

View File

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