mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
CPS optimization
This commit is contained in:
parent
cfc875f01f
commit
e1d7ac548f
1 changed files with 9 additions and 6 deletions
|
@ -233,12 +233,14 @@
|
|||
(cond
|
||||
; Core forms:
|
||||
((ast:lambda? exp)
|
||||
;(let ((fnc (adb:get id)))
|
||||
;; TODO: simplify if necessary
|
||||
(ast:%make-lambda
|
||||
(ast:lambda-id exp)
|
||||
(ast:lambda-args exp)
|
||||
(opt:contract (ast:lambda-body exp))));)
|
||||
(let* ((id (ast:lambda-id exp))
|
||||
(fnc (adb:get id)))
|
||||
(if (adbf:simple fnc)
|
||||
(opt:contract (caar (ast:lambda-body exp))) ;; Optimize-out the lambda
|
||||
(ast:%make-lambda
|
||||
(ast:lambda-id exp)
|
||||
(ast:lambda-args exp)
|
||||
(opt:contract (ast:lambda-body exp))))))
|
||||
((const? exp) exp)
|
||||
((ref? exp) exp)
|
||||
((prim? exp) exp)
|
||||
|
@ -267,6 +269,7 @@
|
|||
(analyze-cps ast)
|
||||
(trace:info "---------------- cps analysis db:")
|
||||
(trace:info (adb:get-db))
|
||||
;ast ;; DEBUGGING!!!
|
||||
(opt:contract ast)
|
||||
)
|
||||
))
|
||||
|
|
Loading…
Add table
Reference in a new issue