diff options
author | Andy Wingo <wingo@pobox.com> | 2013-07-20 20:05:13 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-07-21 17:12:22 +0200 |
commit | 7396d21670f4e5182051e24a7b459712d404c276 (patch) | |
tree | 4acfbe5d94a62f5dcb3cad282db75fb1d5fdcede /module/system/vm/disassembler.scm | |
parent | 2a294c7cd3c27dd3159da840df3d004da4fc4094 (diff) | |
download | guile-7396d21670f4e5182051e24a7b459712d404c276.tar.gz |
RTL: Local 0 is the procedure
* libguile/vm-engine.c: Change the RTL VM to number the procedure as
local 0, and other locals from 1. In the future we will want the FP
to point to local 0 instead of local 1. In the future also we can
elide the procedure for well-known closures (closures in which all
references are known call sites).
(make_closure, free_set): Instead of taking rest arguments, we add a
new free-set! op that initializes closures.
(free_ref): Take the closure as an argument.
* libguile/vm.c (rtl_boot_continuation_code): Remove comments, which
were out of date.
(rtl_apply_code, rtl_values_code): Update comments.
* module/system/vm/assembler.scm (intern-constant, emit-init-constants):
Adapt to locals numbering change.
(begin-kw-arity): For assert-nargs-ee purposes, nreq includes the
procedure.
* module/system/vm/disassembler.scm (code-annotation): Adapt annotation
for assert-nargs-ee/locals.
* test-suite/tests/rtl.test: Adapt tests.
Diffstat (limited to 'module/system/vm/disassembler.scm')
-rw-r--r-- | module/system/vm/disassembler.scm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/module/system/vm/disassembler.scm b/module/system/vm/disassembler.scm index 1c6a0976c..39b5d8cde 100644 --- a/module/system/vm/disassembler.scm +++ b/module/system/vm/disassembler.scm @@ -236,17 +236,19 @@ address of that offset." (('make-long-long-immediate _ high low) (list "~S" (unpack-scm (logior (ash high 32) low)))) (('assert-nargs-ee/locals nargs locals) - (list "~a arg~:p, ~a local~:p" nargs locals)) + ;; The nargs includes the procedure. + (list "~a arg~:p, ~a local~:p" (1- nargs) locals)) (('tail-call nargs proc) (list "~a arg~:p" nargs)) - (('make-closure dst target free ...) + (('make-closure dst target nfree) (let* ((addr (u32-offset->addr (+ offset target) context)) (pdi (find-program-debug-info addr context))) ;; FIXME: Disassemble embedded closures as well. - (list "~A at 0x~X" + (list "~A at 0x~X (~A free var~:p)" (or (and pdi (program-debug-info-name pdi)) "(anonymous procedure)") - addr))) + addr + nfree))) (('make-non-immediate dst target) (list "~@Y" (reference-scm target))) (((or 'static-ref 'static-set!) _ target) |