mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-25 04:55:04 +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
|
(cond
|
||||||
; Core forms:
|
; Core forms:
|
||||||
((ast:lambda? exp)
|
((ast:lambda? exp)
|
||||||
;(let ((fnc (adb:get id)))
|
(let* ((id (ast:lambda-id exp))
|
||||||
;; TODO: simplify if necessary
|
(fnc (adb:get id)))
|
||||||
(ast:%make-lambda
|
(if (adbf:simple fnc)
|
||||||
(ast:lambda-id exp)
|
(opt:contract (caar (ast:lambda-body exp))) ;; Optimize-out the lambda
|
||||||
(ast:lambda-args exp)
|
(ast:%make-lambda
|
||||||
(opt:contract (ast:lambda-body exp))));)
|
(ast:lambda-id exp)
|
||||||
|
(ast:lambda-args exp)
|
||||||
|
(opt:contract (ast:lambda-body exp))))))
|
||||||
((const? exp) exp)
|
((const? exp) exp)
|
||||||
((ref? exp) exp)
|
((ref? exp) exp)
|
||||||
((prim? exp) exp)
|
((prim? exp) exp)
|
||||||
|
@ -267,6 +269,7 @@
|
||||||
(analyze-cps ast)
|
(analyze-cps ast)
|
||||||
(trace:info "---------------- cps analysis db:")
|
(trace:info "---------------- cps analysis db:")
|
||||||
(trace:info (adb:get-db))
|
(trace:info (adb:get-db))
|
||||||
|
;ast ;; DEBUGGING!!!
|
||||||
(opt:contract ast)
|
(opt:contract ast)
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
|
|
Loading…
Add table
Reference in a new issue