mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 16:57:35 +02:00
Experiment with always inlining certain prims
This commit is contained in:
parent
c3b31e0181
commit
45d040c955
1 changed files with 12 additions and 4 deletions
|
@ -602,10 +602,12 @@
|
||||||
(one-instance-of-new-mutable-obj?
|
(one-instance-of-new-mutable-obj?
|
||||||
(cdr exp)
|
(cdr exp)
|
||||||
(ast:lambda-formals->list (car exp)))
|
(ast:lambda-formals->list (car exp)))
|
||||||
(inline-prim-call?
|
(or
|
||||||
(ast:lambda-body (car exp))
|
(prim-calls-inlinable? (cdr exp))
|
||||||
(prim-calls->arg-variables (cdr exp))
|
(inline-prim-call?
|
||||||
(ast:lambda-formals->list (car exp)))))
|
(ast:lambda-body (car exp))
|
||||||
|
(prim-calls->arg-variables (cdr exp))
|
||||||
|
(ast:lambda-formals->list (car exp))))))
|
||||||
)
|
)
|
||||||
(let ((args (cdr exp)))
|
(let ((args (cdr exp)))
|
||||||
(for-each
|
(for-each
|
||||||
|
@ -656,6 +658,12 @@
|
||||||
Cyc-compilation-environment
|
Cyc-compilation-environment
|
||||||
)))
|
)))
|
||||||
|
|
||||||
|
(define (prim-calls-inlinable? prim-calls)
|
||||||
|
(every
|
||||||
|
(lambda (prim-call)
|
||||||
|
(prim:immutable-args/result? (car prim-call)))
|
||||||
|
prim-calls))
|
||||||
|
|
||||||
;; Check each pair of primitive call / corresponding lambda arg,
|
;; Check each pair of primitive call / corresponding lambda arg,
|
||||||
;; and verify that if the primitive call creates a new mutable
|
;; and verify that if the primitive call creates a new mutable
|
||||||
;; object, that only one instance of the object will be created.
|
;; object, that only one instance of the object will be created.
|
||||||
|
|
Loading…
Add table
Reference in a new issue