1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 01:00:20 +02:00

Add cache-ref, cache-set! macro-instructions

* module/system/vm/assembler.scm (<cache-cell>): Remove "scope" member.
  Just be an opaque key comparable with equal?.
  (intern-cache-cell): Remove scope arg.
  (intern-module-cache-cell): Remove; callers use intern-cache-cell now.
  (cache-current-module!, cached-toplevel-box, cached-module-box): Create
  cache keys that by construction won't collide between types.
  (cache-ref, cache-set!): Add new macro assemblers.
* module/language/cps/reify-primitives.scm:
* module/language/cps/compile-bytecode.scm: Add cases for new macro
  instructions.
This commit is contained in:
Andy Wingo 2018-05-14 11:13:58 +02:00
parent fb344a25d5
commit f6de1b0620
3 changed files with 22 additions and 14 deletions

View file

@ -175,6 +175,8 @@
(($ $primcall 'tail-pointer-ref/immediate (annotation . idx) (obj))
(emit-tail-pointer-ref/immediate asm (from-sp dst) (from-sp (slot obj))
idx))
(($ $primcall 'cache-ref key ())
(emit-cache-ref asm (from-sp dst) key))
(($ $primcall 'resolve-module public? (name))
(emit-resolve-module asm (from-sp dst) (from-sp (slot name)) public?))
(($ $primcall 'lookup #f (mod name))
@ -285,6 +287,8 @@
(($ $values ()) #f)
(($ $primcall 'cache-current-module! (scope) (mod))
(emit-cache-current-module! asm (from-sp (slot mod)) scope))
(($ $primcall 'cache-set! key (val))
(emit-cache-set! asm key (from-sp (slot val))))
(($ $primcall 'scm-set! annotation (obj idx val))
(emit-scm-set! asm (from-sp (slot obj)) (from-sp (slot idx))
(from-sp (slot val))))