mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-25 13:05:05 +02:00
WIP
This commit is contained in:
parent
32c8ad1949
commit
cb9d143187
1 changed files with 19 additions and 4 deletions
|
@ -893,7 +893,22 @@
|
||||||
(c:body cargs)
|
(c:body cargs)
|
||||||
");")))
|
");")))
|
||||||
(else
|
(else
|
||||||
TODO: need to handle well-known functions:
|
;;TODO: need to handle well-known functions:
|
||||||
|
(let* ((wkf (well-known-lambda (car args)))
|
||||||
|
(fnc (if wkf (adb:get/default (ast:lambda-id wkf) #f) #f))
|
||||||
|
)
|
||||||
|
(when (and wkf fnc
|
||||||
|
(adbf:well-known fnc) ;; not really needed
|
||||||
|
(equal? (adbf:closure-size fnc) 1))
|
||||||
|
(trace:error `(JAE found well-known lambda in closure-ref call
|
||||||
|
,(car args)
|
||||||
|
,wkf
|
||||||
|
TODO: this is not going to work, we are going to need to use ast:lambda-id instead of
|
||||||
|
an allocation ID. make that change in allocate-lambda, disable all WKL code, and make
|
||||||
|
sure it is stable before proceeding...
|
||||||
|
cgen id ,(adbf:cgen-id fnc)
|
||||||
|
)))
|
||||||
|
)
|
||||||
(set-c-call-arity! (c:num-args cargs))
|
(set-c-call-arity! (c:num-args cargs))
|
||||||
(c-code
|
(c-code
|
||||||
(string-append
|
(string-append
|
||||||
|
@ -924,9 +939,9 @@ TODO: need to handle well-known functions:
|
||||||
");")))
|
");")))
|
||||||
(else ;; CPS, IE normal behavior
|
(else ;; CPS, IE normal behavior
|
||||||
(set-c-call-arity! num-cargs)
|
(set-c-call-arity! num-cargs)
|
||||||
TODO: see corresponding code in %closure-ref that outputs return_closcall.
|
;TODO: see corresponding code in %closure-ref that outputs return_closcall.
|
||||||
need to use (well-known-lambda) to check the ref to see if it is a WKL.
|
;need to use (well-known-lambda) to check the ref to see if it is a WKL.
|
||||||
if so, lookup ast and use cgen-id to map back to emit the lambda_gc_ret there
|
;if so, lookup ast and use cgen-id to map back to emit the lambda_gc_ret there
|
||||||
(with-fnc (ast:lambda-id (closure->lam fun)) (lambda (fnc)
|
(with-fnc (ast:lambda-id (closure->lam fun)) (lambda (fnc)
|
||||||
(if (and ;#f
|
(if (and ;#f
|
||||||
(adbf:well-known fnc)
|
(adbf:well-known fnc)
|
||||||
|
|
Loading…
Add table
Reference in a new issue