mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 16:57:35 +02:00
Added (cannot-inline) property
This commit is contained in:
parent
82e14fe9c4
commit
43bb787f7e
1 changed files with 15 additions and 0 deletions
|
@ -138,6 +138,7 @@
|
||||||
mutated-by-set
|
mutated-by-set
|
||||||
reassigned assigned-value
|
reassigned assigned-value
|
||||||
app-fnc-count app-arg-count
|
app-fnc-count app-arg-count
|
||||||
|
cannot-inline
|
||||||
inlinable mutated-indirectly
|
inlinable mutated-indirectly
|
||||||
cont
|
cont
|
||||||
def-in-loop
|
def-in-loop
|
||||||
|
@ -163,6 +164,8 @@
|
||||||
(app-fnc-count adbv:app-fnc-count adbv:set-app-fnc-count!)
|
(app-fnc-count adbv:app-fnc-count adbv:set-app-fnc-count!)
|
||||||
;; Number of times variable is passed as an app-argument
|
;; Number of times variable is passed as an app-argument
|
||||||
(app-arg-count adbv:app-arg-count adbv:set-app-arg-count!)
|
(app-arg-count adbv:app-arg-count adbv:set-app-arg-count!)
|
||||||
|
;; Variable cannot be inlined
|
||||||
|
(cannot-inline adbv:cannot-inline adbv:set-cannot-inline!)
|
||||||
;; Can a ref be safely inlined?
|
;; Can a ref be safely inlined?
|
||||||
(inlinable adbv:inlinable adbv:set-inlinable!)
|
(inlinable adbv:inlinable adbv:set-inlinable!)
|
||||||
;; Is the variable mutated indirectly? (EG: set-car! of a cdr)
|
;; Is the variable mutated indirectly? (EG: set-car! of a cdr)
|
||||||
|
@ -216,6 +219,7 @@
|
||||||
#f ; assigned-value
|
#f ; assigned-value
|
||||||
0 ; app-fnc-count
|
0 ; app-fnc-count
|
||||||
0 ; app-arg-count
|
0 ; app-arg-count
|
||||||
|
#f ; cannot-inline
|
||||||
#t ; inlinable
|
#t ; inlinable
|
||||||
'() ; mutated-indirectly
|
'() ; mutated-indirectly
|
||||||
#f ; cont
|
#f ; cont
|
||||||
|
@ -595,6 +599,8 @@
|
||||||
)
|
)
|
||||||
(let ((e (cadr exp)))
|
(let ((e (cadr exp)))
|
||||||
(when (ref? e)
|
(when (ref? e)
|
||||||
|
(with-var! e (lambda (var)
|
||||||
|
(adbv:set-cannot-inline! var #t)))
|
||||||
(with-var e (lambda (var)
|
(with-var e (lambda (var)
|
||||||
(if (adbv:assigned-value var)
|
(if (adbv:assigned-value var)
|
||||||
(set! e (adbv:assigned-value var))))))
|
(set! e (adbv:assigned-value var))))))
|
||||||
|
@ -1165,6 +1171,15 @@
|
||||||
;; opportunities for optimization because it takes a global
|
;; opportunities for optimization because it takes a global
|
||||||
;; approach rather than considering the specific variables
|
;; approach rather than considering the specific variables
|
||||||
;; involved for any given optimization.
|
;; involved for any given optimization.
|
||||||
|
;
|
||||||
|
; TODO: this one is experimental, not sure if it really helps at all. still,
|
||||||
|
; there may well be cases where inlining the var being mutated will cause problems!
|
||||||
|
;(for-each
|
||||||
|
; (lambda (v)
|
||||||
|
; (with-var v (lambda (var)
|
||||||
|
; (if (adbv:cannot-inline var)
|
||||||
|
; (set! cannot-inline #t)))))
|
||||||
|
; args)
|
||||||
(for-each
|
(for-each
|
||||||
(lambda (v)
|
(lambda (v)
|
||||||
(with-var v (lambda (var)
|
(with-var v (lambda (var)
|
||||||
|
|
Loading…
Add table
Reference in a new issue