From 56d639bfe5193e6e0988fdf12f337e08bde0a924 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Wed, 1 Nov 2017 15:27:38 +0100 Subject: [PATCH] builtin-ref takes immediate parameter * module/language/cps/compile-bytecode.scm (compile-function): * module/language/cps/reify-primitives.scm (builtin-ref): * module/language/cps/slot-allocation.scm (compute-needs-slot): Builtin-ref uses immediate parameter. --- module/language/cps/compile-bytecode.scm | 4 ++-- module/language/cps/reify-primitives.scm | 5 ++--- module/language/cps/slot-allocation.scm | 2 -- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/module/language/cps/compile-bytecode.scm b/module/language/cps/compile-bytecode.scm index a259a25a0..43c5ccbba 100644 --- a/module/language/cps/compile-bytecode.scm +++ b/module/language/cps/compile-bytecode.scm @@ -201,8 +201,8 @@ (($ $primcall 'ulsh/immediate #f (x y)) (emit-ulsh/immediate asm (from-sp dst) (from-sp (slot x)) (constant y))) - (($ $primcall 'builtin-ref #f (name)) - (emit-builtin-ref asm (from-sp dst) (constant name))) + (($ $primcall 'builtin-ref idx ()) + (emit-builtin-ref asm (from-sp dst) idx)) (($ $primcall 'scm->f64 #f (src)) (emit-scm->f64 asm (from-sp dst) (from-sp (slot src)))) (($ $primcall 'load-f64 val ()) diff --git a/module/language/cps/reify-primitives.scm b/module/language/cps/reify-primitives.scm index 580f80327..29a78aa95 100644 --- a/module/language/cps/reify-primitives.scm +++ b/module/language/cps/reify-primitives.scm @@ -95,9 +95,8 @@ (define (builtin-ref cps idx k src) (with-cps cps - ($ (with-cps-constants ((idx idx)) - (build-term - ($continue k src ($primcall 'builtin-ref #f (idx)))))))) + (build-term + ($continue k src ($primcall 'builtin-ref idx ()))))) (define (reify-clause cps ktail) (with-cps cps diff --git a/module/language/cps/slot-allocation.scm b/module/language/cps/slot-allocation.scm index b37b43e0c..279e843a9 100644 --- a/module/language/cps/slot-allocation.scm +++ b/module/language/cps/slot-allocation.scm @@ -340,8 +340,6 @@ the definitions that are live before and after LABEL, as intsets." 'ursh/immediate 'ulsh/immediate) #f (x y)) (defs+ x)) - (($ $primcall 'builtin-ref #f (idx)) - defs) (_ (defs+* (get-uses label)))))) (($ $kreceive arity k)