mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-16 01:07:34 +02:00
Added (self-closure-call? ast self)
This commit is contained in:
parent
c1e8996ddd
commit
eb2ab6b74a
1 changed files with 16 additions and 0 deletions
|
@ -90,6 +90,8 @@
|
||||||
adbf:calls-self? adbf:set-calls-self!
|
adbf:calls-self? adbf:set-calls-self!
|
||||||
with-fnc
|
with-fnc
|
||||||
with-fnc!
|
with-fnc!
|
||||||
|
;; Helpers
|
||||||
|
self-closure-call?
|
||||||
)
|
)
|
||||||
(begin
|
(begin
|
||||||
;; The following two defines allow non-CPS functions to still be considered
|
;; The following two defines allow non-CPS functions to still be considered
|
||||||
|
@ -1782,6 +1784,20 @@
|
||||||
(list (convert exp #f '()))
|
(list (convert exp #f '()))
|
||||||
#f))
|
#f))
|
||||||
|
|
||||||
|
;; Detect closure call of the form:
|
||||||
|
;; (%closure-ref
|
||||||
|
;; (cell-get (%closure-ref self$249 1))
|
||||||
|
;; 0)
|
||||||
|
(define (self-closure-call? ast self)
|
||||||
|
(and-let* (((tagged-list? '%closure-ref ast))
|
||||||
|
((tagged-list? 'cell-get (cadr ast)))
|
||||||
|
(inner-cref (cadadr ast))
|
||||||
|
((tagged-list? '%closure-ref inner-cref))
|
||||||
|
(equal? self (cadr inner-cref))
|
||||||
|
((equal? 0 (caddr ast)))
|
||||||
|
)
|
||||||
|
#t))
|
||||||
|
|
||||||
(define (analyze:find-named-lets exp)
|
(define (analyze:find-named-lets exp)
|
||||||
(define (scan exp lp)
|
(define (scan exp lp)
|
||||||
(cond
|
(cond
|
||||||
|
|
Loading…
Add table
Reference in a new issue