mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-25 13:05:05 +02:00
Added constant folding back
This commit is contained in:
parent
9a9bb4079f
commit
69a54ecb6a
1 changed files with 7 additions and 8 deletions
|
@ -62,7 +62,7 @@
|
||||||
adbf:side-effects adbf:set-side-effects!
|
adbf:side-effects adbf:set-side-effects!
|
||||||
)
|
)
|
||||||
(begin
|
(begin
|
||||||
#;(define
|
(define
|
||||||
*contract-env*
|
*contract-env*
|
||||||
(let ((env (create-environment '() '())))
|
(let ((env (create-environment '() '())))
|
||||||
(eval '(define Cyc-fast-plus +) env)
|
(eval '(define Cyc-fast-plus +) env)
|
||||||
|
@ -719,13 +719,12 @@
|
||||||
fnc
|
fnc
|
||||||
(map (lambda (e) (opt:contract e)) (cdr exp)))))
|
(map (lambda (e) (opt:contract e)) (cdr exp)))))
|
||||||
;; Perform constant folding if possible
|
;; Perform constant folding if possible
|
||||||
;;(if (and (prim-call? exp)
|
(if (and (prim-call? exp)
|
||||||
;; (precompute-prim-app? result))
|
(precompute-prim-app? result))
|
||||||
;; (with-handler ;; Safety check, keep going if eval fails
|
(with-handler ;; Safety check, keep going if eval fails
|
||||||
;; (lambda (err) result)
|
(lambda (err) result)
|
||||||
;; (eval result *contract-env*))
|
(eval result *contract-env*))
|
||||||
;; result))
|
result))
|
||||||
result)
|
|
||||||
))))
|
))))
|
||||||
(else
|
(else
|
||||||
(error "CPS optimize [1] - Unknown expression" exp))))
|
(error "CPS optimize [1] - Unknown expression" exp))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue