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

Remove backend support for cached-module-box et al.

* module/language/cps/compile-bytecode.scm (compile-function): Remove
  unused assemblers for cached-module-box, cached-toplevel-box, and
  cache-current-module!.
* module/language/cps/effects-analysis.scm (&cache): New memory kind.
  (cache-current-module!): Set &cache memory, not &box.
  (resolve-module, lookup-module, cache-ref, cache-set!): Add effect
  annotations.
* module/system/vm/assembler.scm (emit-cache-current-module!)
  (emit-cached-toplevel-box, emit-cached-module-box): Remove
  assemblers.
* module/system/vm/disassembler.scm (code-annotation, fold-code-range):
  Remove special cases for toplevel-box and module-box.
* module/system/xref.scm (program-callee-rev-vars): Add a FIXME for the
  future.
This commit is contained in:
Andy Wingo 2018-05-14 13:21:16 +02:00
parent 667d808f58
commit 77e7bea4c2
5 changed files with 17 additions and 50 deletions

View file

@ -143,10 +143,6 @@
(emit-current-module asm (from-sp dst)))
(($ $primcall 'current-thread)
(emit-current-thread asm (from-sp dst)))
(($ $primcall 'cached-toplevel-box (scope name bound?))
(emit-cached-toplevel-box asm (from-sp dst) scope name bound?))
(($ $primcall 'cached-module-box (mod name public? bound?) ())
(emit-cached-module-box asm (from-sp dst) mod name public? bound?))
(($ $primcall 'define! #f (sym))
(emit-define! asm (from-sp dst) (from-sp (slot sym))))
(($ $primcall 'resolve (bound?) (name))
@ -285,8 +281,6 @@
(define (compile-effect label exp k)
(match exp
(($ $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))

View file

@ -188,7 +188,10 @@
&closure
;; Indicates a dependency on a raw bitmask, measured in 32-bit units.
&bitmask)
&bitmask
;; Indicates a dependency on the value of a cache cell.
&cache)
(define-inlinable (&field kind field)
(ash (logior (ash field &memory-kind-bits) kind) &effect-kind-bits))
@ -454,12 +457,19 @@ the LABELS that are clobbered by the effects of LABEL."
;; Modules.
(define-primitive-effects
((current-module) (&read-object &module))
((cache-current-module! m) (&write-object &box))
((cache-current-module! m) (&write-object &cache))
((resolve name) (&read-object &module) &type-check)
((resolve-module mod) (&read-object &module) &type-check)
((lookup mod name) (&read-object &module) &type-check)
((cached-toplevel-box) &type-check)
((cached-module-box) &type-check)
((define! name) (&read-object &module)))
;; Cache cells.
(define-primitive-effects
((cache-ref) (&read-object &cache))
((cache-set! x) (&write-object &cache)))
;; Numbers.
(define-primitive-effects
((heap-numbers-equal? . _))