[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 06/07: Remove free-ref, free-set!
From: |
Andy Wingo |
Subject: |
[Guile-commits] 06/07: Remove free-ref, free-set! |
Date: |
Mon, 22 Jan 2018 02:04:26 -0500 (EST) |
wingo pushed a commit to branch master
in repository guile.
commit b09bbfe3c082548347125c0da52104c5bb8049e3
Author: Andy Wingo <address@hidden>
Date: Mon Jan 22 07:49:19 2018 +0100
Remove free-ref, free-set!
* libguile/vm-engine.c (free-ref, free-set!): Remove ops.
* module/language/cps/effects-analysis.scm:
* module/system/vm/assembler.scm:
* module/system/vm/disassembler.scm (code-annotation):
* module/language/cps/compile-bytecode.scm (compile-function): Remove
support for free-ref / free-set!.
---
libguile/vm-engine.c | 33 ++++----------------------------
module/language/cps/compile-bytecode.scm | 5 -----
module/language/cps/effects-analysis.scm | 5 -----
module/system/vm/assembler.scm | 2 --
module/system/vm/disassembler.scm | 2 --
5 files changed, 4 insertions(+), 43 deletions(-)
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 61fb389..63f4b89 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -322,8 +322,6 @@
VM_VALIDATE (x, SCM_CHARP, proc, char)
#define VM_VALIDATE_STRING(obj, proc) \
VM_VALIDATE (obj, scm_is_string, proc, string)
-#define VM_VALIDATE_VARIABLE(obj, proc) \
- VM_VALIDATE (obj, SCM_VARIABLEP, proc, variable)
#define VM_VALIDATE_INDEX(u64, size, proc) \
VM_ASSERT (u64 < size, vm_error_out_of_range_uint64 (proc, u64))
@@ -1536,34 +1534,11 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
NEXT (3);
}
- /* free-ref dst:12 src:12 _:8 idx:24
- *
- * Load free variable IDX from the closure SRC into local slot DST.
- */
- VM_DEFINE_OP (55, free_ref, "free-ref", OP2 (X8_S12_S12, X8_C24) | OP_DST)
+ VM_DEFINE_OP (55, unused_55, NULL, NOP)
+ VM_DEFINE_OP (56, unused_56, NULL, NOP)
{
- scm_t_uint16 dst, src;
- scm_t_uint32 idx;
- UNPACK_12_12 (op, dst, src);
- UNPACK_24 (ip[1], idx);
- /* CHECK_FREE_VARIABLE (src); */
- SP_SET (dst, SCM_PROGRAM_FREE_VARIABLE_REF (SP_REF (src), idx));
- NEXT (2);
- }
-
- /* free-set! dst:12 src:12 _:8 idx:24
- *
- * Set free variable IDX from the closure DST to SRC.
- */
- VM_DEFINE_OP (56, free_set, "free-set!", OP2 (X8_S12_S12, X8_C24))
- {
- scm_t_uint16 dst, src;
- scm_t_uint32 idx;
- UNPACK_12_12 (op, dst, src);
- UNPACK_24 (ip[1], idx);
- /* CHECK_FREE_VARIABLE (src); */
- SCM_PROGRAM_FREE_VARIABLE_SET (SP_REF (dst), idx, SP_REF (src));
- NEXT (2);
+ vm_error_bad_instruction (op);
+ abort (); /* never reached */
}
diff --git a/module/language/cps/compile-bytecode.scm
b/module/language/cps/compile-bytecode.scm
index f14f48f..8e6388a 100644
--- a/module/language/cps/compile-bytecode.scm
+++ b/module/language/cps/compile-bytecode.scm
@@ -172,8 +172,6 @@
(emit-word-ref/immediate asm (from-sp dst) (from-sp (slot obj)) idx))
(($ $primcall 'pointer-ref/immediate (annotation . idx) (obj))
(emit-pointer-ref/immediate asm (from-sp dst) (from-sp (slot obj))
idx))
- (($ $primcall 'free-ref idx (closure))
- (emit-free-ref asm (from-sp dst) (from-sp (slot closure)) idx))
(($ $primcall 'char->integer #f (src))
(emit-char->integer asm (from-sp dst) (from-sp (slot src))))
(($ $primcall 'integer->char #f (src))
@@ -302,9 +300,6 @@
(($ $primcall 'pointer-set!/immediate (annotation . idx) (obj val))
(emit-pointer-set!/immediate asm (from-sp (slot obj)) idx
(from-sp (slot val))))
- (($ $primcall 'free-set! idx (closure value))
- (emit-free-set! asm (from-sp (slot closure)) (from-sp (slot value))
- idx))
(($ $primcall 'string-set! #f (string index char))
(emit-string-set! asm (from-sp (slot string)) (from-sp (slot index))
(from-sp (slot char))))
diff --git a/module/language/cps/effects-analysis.scm
b/module/language/cps/effects-analysis.scm
index aea0d58..3c52225 100644
--- a/module/language/cps/effects-analysis.scm
+++ b/module/language/cps/effects-analysis.scm
@@ -450,11 +450,6 @@ the LABELS that are clobbered by the effects of LABEL."
((f32-set! obj bv n x) (&write-object (annotation->memory-kind
param)))
((f64-set! obj bv n x) (&write-object (annotation->memory-kind
param))))
-;; Closures.
-(define-primitive-effects* param
- ((free-ref closure) (&read-field &closure param))
- ((free-set! closure val) (&write-field &closure param)))
-
;; Modules.
(define-primitive-effects
((current-module) (&read-object &module))
diff --git a/module/system/vm/assembler.scm b/module/system/vm/assembler.scm
index da12511..33645a2 100644
--- a/module/system/vm/assembler.scm
+++ b/module/system/vm/assembler.scm
@@ -198,8 +198,6 @@
emit-bind-kwargs
emit-bind-rest
emit-make-closure
- emit-free-ref
- emit-free-set!
emit-current-module
emit-resolve
emit-define!
diff --git a/module/system/vm/disassembler.scm
b/module/system/vm/disassembler.scm
index 8664039..286a0f1 100644
--- a/module/system/vm/disassembler.scm
+++ b/module/system/vm/disassembler.scm
@@ -275,8 +275,6 @@ address of that offset."
(list "~A" (builtin-index->name idx)))
(((or 'static-ref 'static-set!) _ target)
(list "address@hidden" (dereference-scm target)))
- (((or 'free-ref 'free-set!) _ _ index)
- (list "free var ~a" index))
(('resolve-module dst name public)
(list "~a" (if (zero? public) "private" "public")))
(('toplevel-box _ var-offset mod-offset sym-offset bound?)
- [Guile-commits] branch master updated (310c34e -> 3f736c4), Andy Wingo, 2018/01/22
- [Guile-commits] 01/07: Instruction explosion for struct-ref, struct-set!, Andy Wingo, 2018/01/22
- [Guile-commits] 02/07: Introduce make-struct/simple, Andy Wingo, 2018/01/22
- [Guile-commits] 03/07: Lower "make-struct/simple" to CPS, Andy Wingo, 2018/01/22
- [Guile-commits] 04/07: Remove optimizer and backend support for struct ops, Andy Wingo, 2018/01/22
- [Guile-commits] 06/07: Remove free-ref, free-set!,
Andy Wingo <=
- [Guile-commits] 07/07: Remove unneeded assembly shuffle routines., Andy Wingo, 2018/01/22
- [Guile-commits] 05/07: Remove VM struct-ref, etc instructions, Andy Wingo, 2018/01/22