1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-12 06:41:13 +02:00

Rename gc-pointer-ref to pointer-ref

The pointer dereferencing instructions will keep the pointer alive by
referencing a containing object.

* module/language/cps/compile-bytecode.scm:
* libguile/vm-engine.c:
* module/language/cps/cse.scm:
* module/language/cps/effects-analysis.scm:
* module/language/cps/reify-primitives.scm:
* module/language/cps/slot-allocation.scm:
* module/language/cps/specialize-primcalls.scm:
* module/language/cps/types.scm:
* module/system/vm/assembler.scm:
* module/system/vm/debug.scm: Rename instructions.
This commit is contained in:
Andy Wingo 2018-01-14 13:40:05 +01:00
parent 13cafca168
commit 73f55cb9ae
10 changed files with 21 additions and 29 deletions

View file

@ -1421,7 +1421,7 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
NEXT (1);
}
VM_DEFINE_OP (45, gc_pointer_ref_immediate, "gc-pointer-ref/immediate", OP1 (X8_S8_S8_C8) | OP_DST)
VM_DEFINE_OP (45, pointer_ref_immediate, "pointer-ref/immediate", OP1 (X8_S8_S8_C8) | OP_DST)
{
scm_t_uint8 dst, obj, idx;
@ -1432,7 +1432,7 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
NEXT (1);
}
VM_DEFINE_OP (46, gc_pointer_set_immediate, "gc-pointer-set!/immediate", OP1 (X8_S8_C8_S8))
VM_DEFINE_OP (46, pointer_set_immediate, "pointer-set!/immediate", OP1 (X8_S8_C8_S8))
{
scm_t_uint8 obj, idx, val;

View file

@ -170,8 +170,8 @@
(from-sp (slot idx))))
(($ $primcall 'word-ref/immediate (annotation . idx) (obj))
(emit-word-ref/immediate asm (from-sp dst) (from-sp (slot obj)) idx))
(($ $primcall 'gc-pointer-ref/immediate (annotation . idx) (obj))
(emit-gc-pointer-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 'struct-ref/immediate idx (struct))
(emit-struct-ref/immediate asm (from-sp dst) (from-sp (slot struct))
idx))
@ -347,8 +347,8 @@
(($ $primcall 'word-set!/immediate (annotation . idx) (obj val))
(emit-word-set!/immediate asm (from-sp (slot obj)) idx
(from-sp (slot val))))
(($ $primcall 'gc-pointer-set!/immediate (annotation . idx) (obj val))
(emit-gc-pointer-set!/immediate asm (from-sp (slot obj)) idx
(($ $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))

View file

@ -256,7 +256,7 @@ false. It could be that both true and false proofs are available."
((scm-set!/immediate p s x) (x <- scm-ref/immediate p s))
((word-set! p s i x) (x <- word-ref p s i))
((word-set!/immediate p s x) (x <- word-ref/immediate p s))
((gc-pointer-set!/immediate p s x) (x <- gc-pointer-ref/immediate p s))
((pointer-set!/immediate p s x) (x <- pointer-ref/immediate p s))
((s <- allocate-struct #f v n) (v <- struct-vtable #f s))
((s <- allocate-struct/immediate n v) (v <- struct-vtable #f s))

View file

@ -381,11 +381,11 @@ the LABELS that are clobbered by the effects of LABEL."
((ann . idx)
(&write-field
(annotation->memory-kind ann) idx))))
((gc-pointer-ref/immediate obj) (match param
((pointer-ref/immediate obj) (match param
((ann . idx)
(&read-field
(annotation->memory-kind ann) idx))))
((gc-pointer-set!/immediate obj val)
((pointer-set!/immediate obj val)
(match param
((ann . idx)
(&write-field

View file

@ -337,7 +337,7 @@
(setk label ($kargs names vars
($continue kop src
($primcall 'load-u64 n ())))))))))
;; Assume gc-pointer-ref/immediate is within u8 range.
;; Assume pointer-ref/immediate is within u8 range.
(((or 'word-ref/immediate 'scm-ref/immediate) obj)
(match param
((ann . idx)

View file

@ -768,8 +768,8 @@ are comparable with eqv?. A tmp slot may be used."
's8-ref 's16-ref 's32-ref 's64-ref
'bv-s8-ref 'bv-s16-ref 'bv-s32-ref 'bv-s64-ref))
(intmap-add representations var 's64))
(($ $primcall (or 'gc-pointer-ref/immediate))
(intmap-add representations var 'gcptr))
(($ $primcall (or 'pointer-ref/immediate))
(intmap-add representations var 'ptr))
(_
(intmap-add representations var 'scm))))
(vars
@ -854,7 +854,7 @@ are comparable with eqv?. A tmp slot may be used."
(#f slot-map)
(slot
(let ((desc (match (intmap-ref representations var)
((or 'u64 'f64 's64) slot-desc-live-raw)
((or 'u64 'f64 's64 'ptr) slot-desc-live-raw)
('scm slot-desc-live-scm))))
(logior slot-map (ash desc (* 2 slot)))))))
live-vars 0))

View file

@ -127,8 +127,7 @@
(('allocate-words (? uint? n)) (allocate-words/immediate n ()))
(('scm-ref o (? uint? i)) (scm-ref/immediate i (o)))
(('scm-set! o (? uint? i) x) (scm-set!/immediate i (o x)))
;; Assume gc-pointer-ref/immediate can always be emitted
;; directly.
;; Assume pointer-ref/immediate can always be emitted directly.
(('word-ref o (? uint? i)) (word-ref/immediate i (o)))
(('word-set! o (? uint? i) x) (word-set!/immediate i (o x)))
(('add x (? num? y)) (add/immediate y (x)))

View file

@ -783,16 +783,9 @@ minimum, and maximum."
((annotation . idx)
(restrict! obj (annotation->type annotation) (1+ idx) +inf.0))))
(define-type-inferrer/param (gc-pointer-ref/immediate param obj result)
(match param
((annotation . idx)
(restrict! obj (annotation->type annotation) (1+ idx) +inf.0)
(define! result &other-heap-object -inf.0 +inf.0))))
(define-type-inferrer/param (pointer-ref/immediate param obj result)
(define! result &other-heap-object -inf.0 +inf.0))
(define-type-inferrer/param (gc-pointer-set!/immediate param obj word)
(match param
((annotation . idx)
(restrict! obj (annotation->type annotation) (1+ idx) +inf.0))))

View file

@ -155,8 +155,8 @@
emit-word-ref/immediate
emit-word-set!/immediate
emit-gc-pointer-ref/immediate
emit-gc-pointer-set!/immediate
emit-pointer-ref/immediate
emit-pointer-set!/immediate
emit-u8-ref
emit-s8-ref
@ -2152,7 +2152,7 @@ procedure with label @var{rw-init}. @var{rw-init} may be false. If
((f64) 1)
((u64) 2)
((s64) 3)
((gc-ptr) 4)
((ptr) 4)
(else (error "what!" representation)))))
(put-uleb128 names-port (logior (ash slot 3) tag)))
(lp definitions))))))

View file

@ -388,7 +388,7 @@ section of the ELF image. Returns an ELF symbol, or @code{#f}."
((1) 'f64)
((2) 'u64)
((3) 's64)
((4) 'gcptr)
((4) 'ptr)
(else 'unknown))))
(cons (vector name def-offset slot representation)
(lp pos names)))))))))))