Move more call-site optimization structure into the syntax class.

This commit is contained in:
Eric Dobson 2013-10-26 09:31:09 -07:00
parent af6bc6e8e2
commit 69f690f4b9
2 changed files with 11 additions and 12 deletions

View File

@ -410,7 +410,7 @@
(~var call (float-complex-call-site-opt-expr #'op.unboxed-info)))
#:do [(log-unboxing-opt "unboxed call site")
(log-arity-raising-opt "call to fun with unboxed args")]
#:with opt #'(let*-values (call.bindings ...) (op call.args ...)))
#:with opt ((attribute call.opt-app) #'op))
(pattern :float-complex-arith-opt-expr))
@ -494,18 +494,19 @@
;; We cannot log opt here because this doesn't see the full original syntax
(define-syntax-class (float-complex-call-site-opt-expr unboxed-info)
#:commit
#:attributes ((bindings 1) (args 1))
#:attributes (opt-app)
;; call site of a function with unboxed parameters
;; the calling convention is: real parts of unboxed, imag parts, boxed
(pattern (orig-args:expr ...)
#:with (unboxed-args ...) unboxed-info
#:with ((bindings ...) (args ...))
(syntax-parse #'((unboxed-args orig-args) ...)
[(e:possibly-unboxed ...)
#'((e.bindings ... ...)
(e.real-binding ... ...
e.imag-binding ... ...
e.boxed-binding ... ...))])))
#:attr opt-app
(λ (op)
(syntax-parse #'((unboxed-args orig-args) ...)
[(e:possibly-unboxed ...)
#`(let*-values (e.bindings ... ...)
(#,op e.real-binding ... ...
e.imag-binding ... ...
e.boxed-binding ... ...))]))))
(define-syntax-class/specialize float-complex-arith-opt-expr (float-complex-arith-expr* #t))

View File

@ -36,9 +36,7 @@
(~var call (float-complex-call-site-opt-expr #'loop-fun.unboxed-info)))
#:do [(log-opt "unboxed call site" "Complex number unboxing")
(log-optimization "unboxed let loop" arity-raising-opt-msg #'loop-fun)]
#:with opt #'(let*-values
(((op) operator.opt) call.bindings ...)
(op call.args ...))))
#:with opt #`(let*-values (((op) operator.opt)) #,((attribute call.opt-app) #'op))))
;; does the bulk of the work
;; detects which let bindings can be unboxed, same for arguments of let-bound