mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-17 09:47:33 +02:00
Experimental change to only emit assignments for used args
Having other compilation issues but want to get this checked in since we need this functionality
This commit is contained in:
parent
1e91243b16
commit
b6c5a9007a
1 changed files with 16 additions and 7 deletions
|
@ -1824,6 +1824,7 @@
|
||||||
(cps?
|
(cps?
|
||||||
(let ((i 0)
|
(let ((i 0)
|
||||||
(cstr "")
|
(cstr "")
|
||||||
|
;;;(scm-args (ast:lambda-formals->list exp))
|
||||||
(args formals-as-list))
|
(args formals-as-list))
|
||||||
;; Strip off extra varargs since we will load them
|
;; Strip off extra varargs since we will load them
|
||||||
;; up using a different technique
|
;; up using a different technique
|
||||||
|
@ -1834,14 +1835,22 @@
|
||||||
;; Generate code to unpack args into locals w/expected names
|
;; Generate code to unpack args into locals w/expected names
|
||||||
(for-each
|
(for-each
|
||||||
(lambda (arg)
|
(lambda (arg)
|
||||||
(set! cstr (string-append
|
;;;(lambda (scm-arg arg)
|
||||||
cstr
|
;;;(trace:error `(DEBUG ,scm-arg ARG ,arg))
|
||||||
arg
|
;;;(let ((var (adb:get scm-arg)))
|
||||||
" = args["
|
;;; (when (and (> (adbv:ref-count var) 0)
|
||||||
(number->string i)
|
;;; (not (null? (adbv:ref-by var))))
|
||||||
"];"
|
(set! cstr (string-append
|
||||||
))
|
cstr
|
||||||
|
arg
|
||||||
|
" = args["
|
||||||
|
(number->string i)
|
||||||
|
"];"
|
||||||
|
) ;))
|
||||||
(set! i (+ i 1)))
|
(set! i (+ i 1)))
|
||||||
|
;;;(if has-closure?
|
||||||
|
;;; (cdr scm-args)
|
||||||
|
;;; scm-args))
|
||||||
(if has-closure?
|
(if has-closure?
|
||||||
(cdr args)
|
(cdr args)
|
||||||
args))
|
args))
|
||||||
|
|
Loading…
Add table
Reference in a new issue