guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 01/01: Compile fluid-set! to VM opcode


From: Andy Wingo
Subject: [Guile-commits] 01/01: Compile fluid-set! to VM opcode
Date: Sun, 27 Nov 2016 20:57:57 +0000 (UTC)

wingo pushed a commit to branch master
in repository guile.

commit 8bd5dae8c372ffd5bd1866720acbddc2aa77cb65
Author: Andy Wingo <address@hidden>
Date:   Sun Nov 27 21:54:14 2016 +0100

    Compile fluid-set! to VM opcode
    
    * libguile/vm-engine.c (fluid-set!): Fix name of opcode to correspond
      with name of Tree-IL primitive.  Fixes compilation of fluid-set! to
      actually use the fluid-set! opcode.
    * doc/ref/vm.texi (Dynamic Environment Instructions): Update.
    * module/language/cps/compile-bytecode.scm (compile-function): Add
      fluid-set! case.
    * module/system/vm/assembler.scm: Update export name for
      emit-fluid-set!.
---
 doc/ref/vm.texi                          |    2 +-
 libguile/vm-engine.c                     |    2 +-
 module/language/cps/compile-bytecode.scm |    2 ++
 module/system/vm/assembler.scm           |    2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/doc/ref/vm.texi b/doc/ref/vm.texi
index e870f73..60bce9e 100644
--- a/doc/ref/vm.texi
+++ b/doc/ref/vm.texi
@@ -1196,7 +1196,7 @@ balanced with @code{pop-fluid}.
 Reference the fluid in @var{src}, and place the value in @var{dst}.
 @end deftypefn
 
address@hidden Instruction {} fluid-set s12:@var{fluid} s12:@var{val}
address@hidden Instruction {} fluid-set! s12:@var{fluid} s12:@var{val}
 Set the value of the fluid in @var{dst} to the value in @var{src}.
 @end deftypefn
 
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index cfb60f2..03cca8d 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -2196,7 +2196,7 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
    *
    * Set the value of the fluid in DST to the value in SRC.
    */
-  VM_DEFINE_OP (75, fluid_set, "fluid-set", OP1 (X8_S12_S12))
+  VM_DEFINE_OP (75, fluid_set, "fluid-set!", OP1 (X8_S12_S12))
     {
       scm_t_uint16 a, b;
       size_t num;
diff --git a/module/language/cps/compile-bytecode.scm 
b/module/language/cps/compile-bytecode.scm
index 5e56b40..7755b1e 100644
--- a/module/language/cps/compile-bytecode.scm
+++ b/module/language/cps/compile-bytecode.scm
@@ -364,6 +364,8 @@
                            (from-sp (slot val))))
         (($ $primcall 'unwind ())
          (emit-unwind asm))
+        (($ $primcall 'fluid-set! (fluid value))
+         (emit-fluid-set! asm (from-sp (slot fluid)) (from-sp (slot value))))
         (($ $primcall 'atomic-box-set! (box val))
          (emit-atomic-box-set! asm (from-sp (slot box)) (from-sp (slot val))))
         (($ $primcall 'handle-interrupts ())
diff --git a/module/system/vm/assembler.scm b/module/system/vm/assembler.scm
index 5b89b04..a3d7839 100644
--- a/module/system/vm/assembler.scm
+++ b/module/system/vm/assembler.scm
@@ -124,7 +124,7 @@
             emit-pop-fluid
             emit-current-thread
             emit-fluid-ref
-            emit-fluid-set
+            emit-fluid-set!
             emit-string-length
             emit-string-ref
             emit-string->number



reply via email to

[Prev in Thread] Current Thread [Next in Thread]