mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-22 07:09:17 +02:00
Added -no-call-history
flag
Allow for faster executables at the expense of call history.
This commit is contained in:
parent
8cf0745c62
commit
e98e35ee5b
3 changed files with 22 additions and 3 deletions
|
@ -5,6 +5,10 @@
|
||||||
TODO: mention cyclone-winds even though not part of this official release
|
TODO: mention cyclone-winds even though not part of this official release
|
||||||
https://github.com/cyclone-scheme/cyclone-winds
|
https://github.com/cyclone-scheme/cyclone-winds
|
||||||
|
|
||||||
|
Features
|
||||||
|
|
||||||
|
- Added the `-no-call-history` flag to potentially allow for faster executables at the expense of call history.
|
||||||
|
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
|
|
||||||
- Fix `read-u8`, `peek-u8`, and `write-u8` to work with integers (bytes) instead of characters.
|
- Fix `read-u8`, `peek-u8`, and `write-u8` to work with integers (bytes) instead of characters.
|
||||||
|
|
13
cyclone.scm
13
cyclone.scm
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
(define *optimization-level* 2) ;; Default level
|
(define *optimization-level* 2) ;; Default level
|
||||||
(define *optimize:memoize-pure-functions* #t) ;; Memoize pure funcs by default
|
(define *optimize:memoize-pure-functions* #t) ;; Memoize pure funcs by default
|
||||||
|
(define *cgen:track-call-history* #t)
|
||||||
|
|
||||||
; Placeholder for future enhancement to show elapsed time by phase:
|
; Placeholder for future enhancement to show elapsed time by phase:
|
||||||
(define *start* (current-second))
|
(define *start* (current-second))
|
||||||
|
@ -463,6 +464,8 @@
|
||||||
((eq? flag 'memoize-pure-functions)
|
((eq? flag 'memoize-pure-functions)
|
||||||
(and program? ;; Only for programs, because SRFI 69 becomes a new dep
|
(and program? ;; Only for programs, because SRFI 69 becomes a new dep
|
||||||
*optimize:memoize-pure-functions*))
|
*optimize:memoize-pure-functions*))
|
||||||
|
((eq? flag 'track-call-history)
|
||||||
|
*cgen:track-call-history*)
|
||||||
(else #f)))
|
(else #f)))
|
||||||
|
|
||||||
(when (> *optimization-level* 0)
|
(when (> *optimization-level* 0)
|
||||||
|
@ -553,7 +556,8 @@
|
||||||
module-globals
|
module-globals
|
||||||
c-headers
|
c-headers
|
||||||
lib-deps
|
lib-deps
|
||||||
src-file)
|
src-file
|
||||||
|
flag-set?)
|
||||||
(return '())))) ;; No codes to return
|
(return '())))) ;; No codes to return
|
||||||
|
|
||||||
;; Read top-level imports from a program and return a cons of:
|
;; Read top-level imports from a program and return a cons of:
|
||||||
|
@ -769,6 +773,8 @@
|
||||||
(set! *optimize:memoize-pure-functions* #t))
|
(set! *optimize:memoize-pure-functions* #t))
|
||||||
(if (member "-no-memoization-optimizations" args)
|
(if (member "-no-memoization-optimizations" args)
|
||||||
(set! *optimize:memoize-pure-functions* #f))
|
(set! *optimize:memoize-pure-functions* #f))
|
||||||
|
(if (member "-no-call-history" args)
|
||||||
|
(set! *cgen:track-call-history* #f))
|
||||||
;; TODO: place more optimization reading here as necessary
|
;; TODO: place more optimization reading here as necessary
|
||||||
;; End optimizations
|
;; End optimizations
|
||||||
(if (member "-t" args)
|
(if (member "-t" args)
|
||||||
|
@ -811,6 +817,11 @@ Optimization options:
|
||||||
where possible (enabled by default).
|
where possible (enabled by default).
|
||||||
-no-memoization-optimizations Disable the above memoization optimization.
|
-no-memoization-optimizations Disable the above memoization optimization.
|
||||||
|
|
||||||
|
Debug options
|
||||||
|
|
||||||
|
-no-call-history Do not track call history in the compiled code. This
|
||||||
|
allows for a faster runtime at the cost of having
|
||||||
|
no call history in the event of an exception.
|
||||||
")
|
")
|
||||||
(newline))
|
(newline))
|
||||||
((member "-v" args)
|
((member "-v" args)
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
st:->var)
|
st:->var)
|
||||||
(begin
|
(begin
|
||||||
|
|
||||||
|
(define *cgen:track-call-history* #t)
|
||||||
(define *optimize-well-known-lambdas* #f)
|
(define *optimize-well-known-lambdas* #f)
|
||||||
|
|
||||||
(define (emit line)
|
(define (emit line)
|
||||||
|
@ -263,7 +264,8 @@
|
||||||
|
|
||||||
(define (st:->code trace)
|
(define (st:->code trace)
|
||||||
(if (or (not (pair? trace))
|
(if (or (not (pair? trace))
|
||||||
(null? (cdr trace)))
|
(null? (cdr trace))
|
||||||
|
(not *cgen:track-call-history*))
|
||||||
""
|
""
|
||||||
(string-append
|
(string-append
|
||||||
"Cyc_st_add(data, \""
|
"Cyc_st_add(data, \""
|
||||||
|
@ -1848,8 +1850,10 @@
|
||||||
globals
|
globals
|
||||||
c-headers
|
c-headers
|
||||||
required-libs
|
required-libs
|
||||||
src-file)
|
src-file
|
||||||
|
flag-set?)
|
||||||
(set! *global-syms* (append globals (lib:idb:ids import-db)))
|
(set! *global-syms* (append globals (lib:idb:ids import-db)))
|
||||||
|
(set! *cgen:track-call-history* (flag-set? 'track-call-history))
|
||||||
(set! num-lambdas (+ (adb:max-lambda-id) 1))
|
(set! num-lambdas (+ (adb:max-lambda-id) 1))
|
||||||
(set! cgen:mangle-global
|
(set! cgen:mangle-global
|
||||||
(lambda (ident)
|
(lambda (ident)
|
||||||
|
|
Loading…
Add table
Reference in a new issue