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

static-patch! replaces link-procedure!

* libguile/vm-engine.c (static-patch!): Replace link-procedure! with
  this more versatile primitive.
* module/system/vm/assembler.scm (intern-constant): Emit static-patch!
  for static procedures and for strings.
* module/system/vm/disassembler.scm (code-annotation): Remove annotation
  for link-procedure!.  There can be no annotation for static-patch!, as
  neither operand is guaranteed to be a SCM value.
This commit is contained in:
Andy Wingo 2013-10-31 09:44:59 +01:00
parent 11eff82685
commit 2ab2a10d50
3 changed files with 18 additions and 24 deletions

View file

@ -548,16 +548,14 @@ table, its existing label is used directly."
(reverse inits))))
((stringbuf? obj) '())
((static-procedure? obj)
`((make-non-immediate 1 ,label)
(link-procedure! 1 ,(static-procedure-code obj))))
`((static-patch! ,label 1 ,(static-procedure-code obj))))
((cache-cell? obj) '())
((symbol? obj)
`((make-non-immediate 1 ,(recur (symbol->string obj)))
(string->symbol 1 1)
(static-set! 1 ,label 0)))
((string? obj)
`((make-non-immediate 1 ,(recur (make-stringbuf obj)))
(static-set! 1 ,label 1)))
`((static-patch! ,label 1 ,(recur (make-stringbuf obj)))))
((keyword? obj)
`((static-ref 1 ,(recur (keyword->symbol obj)))
(symbol->keyword 1 1)