mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-28 14:00:31 +02:00
rename <application> to <call>
* doc/ref/compiler.texi (The Scheme Compiler): Update docs. * libguile/expand.h: * libguile/expand.c: * module/language/tree-il.scm: Rename <application> to <call>. Change the external representation from (apply proc arg ...) to (call proc arg ...). * libguile/memoize.c: * module/ice-9/psyntax-pp.scm: * module/ice-9/psyntax.scm: * module/language/brainfuck/compile-tree-il.scm: * module/language/ecmascript/compile-tree-il.scm: * module/language/elisp/compile-tree-il.scm: * module/language/tree-il/analyze.scm: * module/language/tree-il/compile-glil.scm: * module/language/tree-il/fix-letrec.scm: * module/language/tree-il/inline.scm: * module/language/tree-il/primitives.scm: * test-suite/tests/tree-il.test: Update all callers.
This commit is contained in:
parent
d31d703fd4
commit
7081d4f981
16 changed files with 447 additions and 447 deletions
|
@ -63,15 +63,15 @@
|
|||
(begin (void) (const 1))
|
||||
(program () (std-prelude 0 0 #f) (label _) (const 1) (call return 1)))
|
||||
(assert-tree-il->glil
|
||||
(apply (primitive +) (void) (const 1))
|
||||
(call (primitive +) (void) (const 1))
|
||||
(program () (std-prelude 0 0 #f) (label _) (void) (call add1 1) (call return 1))))
|
||||
|
||||
(with-test-prefix "application"
|
||||
(assert-tree-il->glil
|
||||
(apply (toplevel foo) (const 1))
|
||||
(call (toplevel foo) (const 1))
|
||||
(program () (std-prelude 0 0 #f) (label _) (toplevel ref foo) (const 1) (call tail-call 1)))
|
||||
(assert-tree-il->glil
|
||||
(begin (apply (toplevel foo) (const 1)) (void))
|
||||
(begin (call (toplevel foo) (const 1)) (void))
|
||||
(program () (std-prelude 0 0 #f) (label _) (call new-frame 0) (toplevel ref foo) (const 1) (mv-call 1 ,l1)
|
||||
(call drop 1) (branch br ,l2)
|
||||
(label ,l3) (mv-bind 0 #f)
|
||||
|
@ -79,7 +79,7 @@
|
|||
(void) (call return 1))
|
||||
(and (eq? l1 l3) (eq? l2 l4)))
|
||||
(assert-tree-il->glil
|
||||
(apply (toplevel foo) (apply (toplevel bar)))
|
||||
(call (toplevel foo) (call (toplevel bar)))
|
||||
(program () (std-prelude 0 0 #f) (label _) (toplevel ref foo) (call new-frame 0) (toplevel ref bar) (call call 0)
|
||||
(call tail-call 1))))
|
||||
|
||||
|
@ -98,7 +98,7 @@
|
|||
(eq? l1 l3) (eq? l2 l4))
|
||||
|
||||
(assert-tree-il->glil
|
||||
(apply (primitive null?) (if (toplevel foo) (const 1) (const 2)))
|
||||
(call (primitive null?) (if (toplevel foo) (const 1) (const 2)))
|
||||
(program () (std-prelude 0 0 #f) (label _) (toplevel ref foo) (branch br-if-not ,l1)
|
||||
(const 1) (branch br ,l2)
|
||||
(label ,l3) (const 2) (label ,l4)
|
||||
|
@ -115,7 +115,7 @@
|
|||
(program () (std-prelude 0 0 #f) (label _) (const #f) (call return 1)))
|
||||
|
||||
(assert-tree-il->glil
|
||||
(apply (primitive null?) (primitive +))
|
||||
(call (primitive null?) (primitive +))
|
||||
(program () (std-prelude 0 0 #f) (label _) (toplevel ref +) (call null? 1)
|
||||
(call return 1))))
|
||||
|
||||
|
@ -135,7 +135,7 @@
|
|||
(unbind)))
|
||||
|
||||
(assert-tree-il->glil
|
||||
(let (x) (y) ((const 1)) (apply (primitive null?) (lexical x y)))
|
||||
(let (x) (y) ((const 1)) (call (primitive null?) (lexical x y)))
|
||||
(program () (std-prelude 0 1 #f) (label _)
|
||||
(const 1) (bind (x #f 0)) (lexical #t #f set 0)
|
||||
(lexical #t #f ref 0) (call null? 1) (call return 1)
|
||||
|
@ -145,7 +145,7 @@
|
|||
(assert-tree-il->glil
|
||||
;; unreferenced sets may be optimized away -- make sure they are ref'd
|
||||
(let (x) (y) ((const 1))
|
||||
(set! (lexical x y) (apply (primitive 1+) (lexical x y))))
|
||||
(set! (lexical x y) (call (primitive 1+) (lexical x y))))
|
||||
(program () (std-prelude 0 1 #f) (label _)
|
||||
(const 1) (bind (x #t 0)) (lexical #t #t box 0)
|
||||
(lexical #t #t ref 0) (call add1 1) (lexical #t #t set 0)
|
||||
|
@ -154,7 +154,7 @@
|
|||
|
||||
(assert-tree-il->glil
|
||||
(let (x) (y) ((const 1))
|
||||
(begin (set! (lexical x y) (apply (primitive 1+) (lexical x y)))
|
||||
(begin (set! (lexical x y) (call (primitive 1+) (lexical x y)))
|
||||
(lexical x y)))
|
||||
(program () (std-prelude 0 1 #f) (label _)
|
||||
(const 1) (bind (x #t 0)) (lexical #t #t box 0)
|
||||
|
@ -164,8 +164,8 @@
|
|||
|
||||
(assert-tree-il->glil
|
||||
(let (x) (y) ((const 1))
|
||||
(apply (primitive null?)
|
||||
(set! (lexical x y) (apply (primitive 1+) (lexical x y)))))
|
||||
(call (primitive null?)
|
||||
(set! (lexical x y) (call (primitive 1+) (lexical x y)))))
|
||||
(program () (std-prelude 0 1 #f) (label _)
|
||||
(const 1) (bind (x #t 0)) (lexical #t #t box 0)
|
||||
(lexical #t #t ref 0) (call add1 1) (lexical #t #t set 0) (void)
|
||||
|
@ -186,7 +186,7 @@
|
|||
(const #f) (call return 1)))
|
||||
|
||||
(assert-tree-il->glil
|
||||
(apply (primitive null?) (@ (foo) bar))
|
||||
(call (primitive null?) (@ (foo) bar))
|
||||
(program () (std-prelude 0 0 #f) (label _)
|
||||
(module public ref (foo) bar)
|
||||
(call null? 1) (call return 1)))
|
||||
|
@ -204,7 +204,7 @@
|
|||
(const #f) (call return 1)))
|
||||
|
||||
(assert-tree-il->glil
|
||||
(apply (primitive null?) (@@ (foo) bar))
|
||||
(call (primitive null?) (@@ (foo) bar))
|
||||
(program () (std-prelude 0 0 #f) (label _)
|
||||
(module private ref (foo) bar)
|
||||
(call null? 1) (call return 1))))
|
||||
|
@ -223,7 +223,7 @@
|
|||
(const #f) (call return 1)))
|
||||
|
||||
(assert-tree-il->glil
|
||||
(apply (primitive null?) (set! (@ (foo) bar) (const 2)))
|
||||
(call (primitive null?) (set! (@ (foo) bar) (const 2)))
|
||||
(program () (std-prelude 0 0 #f) (label _)
|
||||
(const 2) (module public set (foo) bar)
|
||||
(void) (call null? 1) (call return 1)))
|
||||
|
@ -241,7 +241,7 @@
|
|||
(const #f) (call return 1)))
|
||||
|
||||
(assert-tree-il->glil
|
||||
(apply (primitive null?) (set! (@@ (foo) bar) (const 2)))
|
||||
(call (primitive null?) (set! (@@ (foo) bar) (const 2)))
|
||||
(program () (std-prelude 0 0 #f) (label _)
|
||||
(const 2) (module private set (foo) bar)
|
||||
(void) (call null? 1) (call return 1))))
|
||||
|
@ -260,7 +260,7 @@
|
|||
(const #f) (call return 1)))
|
||||
|
||||
(assert-tree-il->glil
|
||||
(apply (primitive null?) (toplevel bar))
|
||||
(call (primitive null?) (toplevel bar))
|
||||
(program () (std-prelude 0 0 #f) (label _)
|
||||
(toplevel ref bar)
|
||||
(call null? 1) (call return 1))))
|
||||
|
@ -279,7 +279,7 @@
|
|||
(const #f) (call return 1)))
|
||||
|
||||
(assert-tree-il->glil
|
||||
(apply (primitive null?) (set! (toplevel bar) (const 2)))
|
||||
(call (primitive null?) (set! (toplevel bar) (const 2)))
|
||||
(program () (std-prelude 0 0 #f) (label _)
|
||||
(const 2) (toplevel set bar)
|
||||
(void) (call null? 1) (call return 1))))
|
||||
|
@ -298,7 +298,7 @@
|
|||
(const #f) (call return 1)))
|
||||
|
||||
(assert-tree-il->glil
|
||||
(apply (primitive null?) (define bar (const 2)))
|
||||
(call (primitive null?) (define bar (const 2)))
|
||||
(program () (std-prelude 0 0 #f) (label _)
|
||||
(const 2) (toplevel define bar)
|
||||
(void) (call null? 1) (call return 1))))
|
||||
|
@ -315,7 +315,7 @@
|
|||
(const #f) (call return 1)))
|
||||
|
||||
(assert-tree-il->glil
|
||||
(apply (primitive null?) (const 2))
|
||||
(call (primitive null?) (const 2))
|
||||
(program () (std-prelude 0 0 #f) (label _)
|
||||
(const 2) (call null? 1) (call return 1))))
|
||||
|
||||
|
@ -323,7 +323,7 @@
|
|||
;; simple bindings -> let
|
||||
(assert-tree-il->glil
|
||||
(letrec (x y) (x1 y1) ((const 10) (const 20))
|
||||
(apply (toplevel foo) (lexical x x1) (lexical y y1)))
|
||||
(call (toplevel foo) (lexical x x1) (lexical y y1)))
|
||||
(program () (std-prelude 0 2 #f) (label _)
|
||||
(const 10) (const 20)
|
||||
(bind (x #f 0) (y #f 1))
|
||||
|
@ -335,8 +335,8 @@
|
|||
|
||||
;; complex bindings -> box and set! within let
|
||||
(assert-tree-il->glil
|
||||
(letrec (x y) (x1 y1) ((apply (toplevel foo)) (apply (toplevel bar)))
|
||||
(apply (primitive +) (lexical x x1) (lexical y y1)))
|
||||
(letrec (x y) (x1 y1) ((call (toplevel foo)) (call (toplevel bar)))
|
||||
(call (primitive +) (lexical x x1) (lexical y y1)))
|
||||
(program () (std-prelude 0 4 #f) (label _)
|
||||
(void) (void) ;; what are these?
|
||||
(bind (x #t 0) (y #t 1))
|
||||
|
@ -351,8 +351,8 @@
|
|||
|
||||
;; complex bindings in letrec* -> box and set! in order
|
||||
(assert-tree-il->glil
|
||||
(letrec* (x y) (x1 y1) ((apply (toplevel foo)) (apply (toplevel bar)))
|
||||
(apply (primitive +) (lexical x x1) (lexical y y1)))
|
||||
(letrec* (x y) (x1 y1) ((call (toplevel foo)) (call (toplevel bar)))
|
||||
(call (primitive +) (lexical x x1) (lexical y y1)))
|
||||
(program () (std-prelude 0 2 #f) (label _)
|
||||
(void) (void) ;; what are these?
|
||||
(bind (x #t 0) (y #t 1))
|
||||
|
@ -470,7 +470,7 @@
|
|||
(const #t) (call return 1)))
|
||||
|
||||
(assert-tree-il->glil
|
||||
(apply (primitive null?) (begin (const #f) (const 2)))
|
||||
(call (primitive null?) (begin (const #f) (const 2)))
|
||||
(program () (std-prelude 0 0 #f) (label _)
|
||||
(const 2) (call null? 1) (call return 1))))
|
||||
|
||||
|
@ -512,10 +512,10 @@
|
|||
|
||||
(with-test-prefix "apply"
|
||||
(assert-tree-il->glil
|
||||
(apply (primitive @apply) (toplevel foo) (toplevel bar))
|
||||
(call (primitive @apply) (toplevel foo) (toplevel bar))
|
||||
(program () (std-prelude 0 0 #f) (label _) (toplevel ref foo) (toplevel ref bar) (call tail-apply 2)))
|
||||
(assert-tree-il->glil
|
||||
(begin (apply (primitive @apply) (toplevel foo) (toplevel bar)) (void))
|
||||
(begin (call (primitive @apply) (toplevel foo) (toplevel bar)) (void))
|
||||
(program () (std-prelude 0 0 #f) (label _)
|
||||
(call new-frame 0) (toplevel ref apply) (toplevel ref foo) (toplevel ref bar) (mv-call 2 ,l1)
|
||||
(call drop 1) (branch br ,l2) (label ,l3) (mv-bind 0 #f)
|
||||
|
@ -523,7 +523,7 @@
|
|||
(void) (call return 1))
|
||||
(and (eq? l1 l3) (eq? l2 l4)))
|
||||
(assert-tree-il->glil
|
||||
(apply (toplevel foo) (apply (toplevel @apply) (toplevel bar) (toplevel baz)))
|
||||
(call (toplevel foo) (call (toplevel @apply) (toplevel bar) (toplevel baz)))
|
||||
(program () (std-prelude 0 0 #f) (label _)
|
||||
(toplevel ref foo)
|
||||
(call new-frame 0) (toplevel ref bar) (toplevel ref baz) (call apply 2)
|
||||
|
@ -531,10 +531,10 @@
|
|||
|
||||
(with-test-prefix "call/cc"
|
||||
(assert-tree-il->glil
|
||||
(apply (primitive @call-with-current-continuation) (toplevel foo))
|
||||
(call (primitive @call-with-current-continuation) (toplevel foo))
|
||||
(program () (std-prelude 0 0 #f) (label _) (toplevel ref foo) (call tail-call/cc 1)))
|
||||
(assert-tree-il->glil
|
||||
(begin (apply (primitive @call-with-current-continuation) (toplevel foo)) (void))
|
||||
(begin (call (primitive @call-with-current-continuation) (toplevel foo)) (void))
|
||||
(program () (std-prelude 0 0 #f) (label _)
|
||||
(call new-frame 0) (toplevel ref call-with-current-continuation) (toplevel ref foo) (mv-call 1 ,l1)
|
||||
(call drop 1) (branch br ,l2) (label ,l3) (mv-bind 0 #f)
|
||||
|
@ -542,8 +542,8 @@
|
|||
(void) (call return 1))
|
||||
(and (eq? l1 l3) (eq? l2 l4)))
|
||||
(assert-tree-il->glil
|
||||
(apply (toplevel foo)
|
||||
(apply (toplevel @call-with-current-continuation) (toplevel bar)))
|
||||
(call (toplevel foo)
|
||||
(call (toplevel @call-with-current-continuation) (toplevel bar)))
|
||||
(program () (std-prelude 0 0 #f) (label _)
|
||||
(toplevel ref foo)
|
||||
(toplevel ref bar) (call call/cc 1)
|
||||
|
@ -580,9 +580,9 @@
|
|||
'(lambda ()
|
||||
(lambda-case
|
||||
(((x y) #f #f #f () (x1 y1))
|
||||
(apply (toplevel +)
|
||||
(lexical x x1)
|
||||
(lexical y y1)))
|
||||
(call (toplevel +)
|
||||
(lexical x x1)
|
||||
(lexical y y1)))
|
||||
#f))))))
|
||||
(and (equal? (map strip-source leaves)
|
||||
(list (make-lexical-ref #f 'y 'y1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue