mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-13 17:20:21 +02:00
intern arbitrary constants
(Best-ability ChangeLog annotation added by Christine Lemmer-Webber.) * libguile/loader.c (load_thunk_from_memory): Refactor, adding "constants" argument and passing to "init" if appropriate. (load_thunk_from_file): Call "load-thunk-from-memory" with "constants" set to #f. (scm_load_thunk_from_memory): Instead of a bytevector, accept a cons of "(bytevector . constants)", where constants is either a vector or #f. Pass this into "load_thunk_from_memory". * module/language/bytecode/spec.scm: Adapt printer. * module/language/cps/compile-bytecode.scm (compile-bytecode): New variable. * module/system/repl/command.scm (disassemble): Adapt to expect pair which includes bytevector as its car. * module/system/vm/assembler.scm <asm>: Add "to-file?" slot. (fresh-block): New variable. (make-assembler): Adapt to expect "to-file?" keyword argument. (intern-constant): Support "asm-to-file?" in checks. (emit-init-constants, link-data): Likewise. (link-assembly): Update logic for handling "(bytevector . constants)" pair, as well as the expectations of its invocation by compile-bytecode.
This commit is contained in:
parent
1ba3d7854c
commit
4e96211eb6
4 changed files with 46 additions and 15 deletions
|
@ -37,6 +37,7 @@
|
|||
(define-language bytecode
|
||||
#:title "Bytecode"
|
||||
#:compilers `((value . ,bytecode->value))
|
||||
#:printer (lambda (bytecode port) (put-bytevector port bytecode))
|
||||
#:printer (lambda (x port)
|
||||
(put-bytevector port (car x)))
|
||||
#:reader get-bytevector-all
|
||||
#:for-humans? #f)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue