mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 08:47:35 +02:00
Test optimization changes
This commit is contained in:
parent
4e9a209f43
commit
4c2b56b19e
1 changed files with 10 additions and 9 deletions
|
@ -1458,9 +1458,10 @@
|
||||||
ast)
|
ast)
|
||||||
(else
|
(else
|
||||||
(cps ast '%halt)))))
|
(cps ast '%halt)))))
|
||||||
ast-cps))
|
; ast-cps))
|
||||||
;; TODO: use for temporary testing of optimizations
|
;; TODO: use for temporary testing of optimizations
|
||||||
; (cps-optimize-01 ast-cps)))
|
;; eventually will want to call this explicitly from cyclone.scm
|
||||||
|
(cps-optimize-01 ast-cps)))
|
||||||
|
|
||||||
;; CPS optimizations
|
;; CPS optimizations
|
||||||
|
|
||||||
|
@ -1469,13 +1470,13 @@
|
||||||
(define (cps-optimize-01 exp)
|
(define (cps-optimize-01 exp)
|
||||||
(define (opt-lambda exp)
|
(define (opt-lambda exp)
|
||||||
(let ((body (car (lambda->exp exp)))) ;; Single expr after CPS
|
(let ((body (car (lambda->exp exp)))) ;; Single expr after CPS
|
||||||
(trace:error `(DEBUG
|
;(trace:error `(DEBUG
|
||||||
,exp
|
; ,exp
|
||||||
,body
|
; ,body
|
||||||
,(if (and (pair? body) (app? body) (lambda? (car body)))
|
; ,(if (and (pair? body) (app? body) (lambda? (car body)))
|
||||||
(list (app->args body)
|
; (list (app->args body)
|
||||||
(lambda->formals exp))
|
; (lambda->formals exp))
|
||||||
#f)))
|
; #f)))
|
||||||
(cond
|
(cond
|
||||||
;; Does the function just call its continuation?
|
;; Does the function just call its continuation?
|
||||||
((and (pair? body)
|
((and (pair? body)
|
||||||
|
|
Loading…
Add table
Reference in a new issue