[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, master, updated. release_1-9-10-85-g0a
From: |
Andy Wingo |
Subject: |
[Guile-commits] GNU Guile branch, master, updated. release_1-9-10-85-g0a715b9 |
Date: |
Sun, 02 May 2010 12:16:57 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=0a715b9adcf8e5824e476c44f41a414dd1b551ef
The branch, master has been updated
via 0a715b9adcf8e5824e476c44f41a414dd1b551ef (commit)
from de45d8eef9dc16c3020219886a7e5fd11a553fbb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 0a715b9adcf8e5824e476c44f41a414dd1b551ef
Author: Andy Wingo <address@hidden>
Date: Sun May 2 14:18:58 2010 +0200
Update example disassemblies
* doc/ref/compiler.texi:
* doc/ref/vm.texi: Update example disassemblies for current compiler,
which uses assert-nargs-ee/locals.
-----------------------------------------------------------------------
Summary of changes:
doc/ref/compiler.texi | 32 +++++++++++++-------------------
doc/ref/vm.texi | 34 +++++++++++++++-------------------
2 files changed, 28 insertions(+), 38 deletions(-)
diff --git a/doc/ref/compiler.texi b/doc/ref/compiler.texi
index eb81abd..c54123a 100644
--- a/doc/ref/compiler.texi
+++ b/doc/ref/compiler.texi
@@ -709,33 +709,28 @@ to play around with it at the REPL, as can be seen in
this annotated
example:
@example
-scheme@@(guile-user)> (compile '(+ 32 10) #:to 'assembly)
+scheme@@(guile-user)> (pp (compile '(+ 32 10) #:to 'assembly))
(load-program
- ((:LCASE104 . 6)) ; Labels, unused in this case.
- 16 ; Length of the thunk that was compiled.
+ ((:LCASE16 . 2)) ; Labels, unused in this case.
+ 8 ; Length of the thunk that was compiled.
(load-program ; Metadata thunk.
()
17
#f ; No metadata thunk for the metadata thunk.
(make-eol)
(make-eol)
- (make-int8 6)
- (make-int8 12) ; Liveness extents, source info, and arities,
- (make-int8:0) ; in a format that Guile knows how to parse.
+ (make-int8 2) ; Liveness extents, source info, and arities,
+ (make-int8 8) ; in a format that Guile knows how to parse.
+ (make-int8:0)
(list 0 3)
(list 0 1)
(list 0 3)
(return))
- (assert-nargs-ee 0 0) ; Prologue.
- (reserve-locals 0 0)
+ (assert-nargs-ee/locals 0) ; Prologue.
(make-int8 32) ; Actual code starts here.
(make-int8 10)
(add)
- (return)
- (nop)
- (nop) ; Padding; the metadata thunk is actually
- (nop) ; written after the main text.
- (nop))
+ (return))
@end example
Of course you can switch the REPL to assembly and enter in assembly
@@ -754,12 +749,11 @@ the next step down from assembly:
@example
scheme@@(guile-user)> (compile '(+ 32 10) #:to 'bytecode)
address@hidden #vu8(16 0 0 0 25 0 0 0 ; Header.
- 45 0 0 52 0 0 ; Prologue.
- 10 32 10 10 148 66 ; Actual code.
- 0 0 0 0 ; Padding.
- 17 0 0 0 0 0 0 0 9 9 10 6 10 ; Metadata thunk.
- 12 11 18 0 3 18 0 1 18 0 3 66)
address@hidden #vu8(8 0 0 0 25 0 0 0 ; Header.
+ 95 0 ; Prologue.
+ 10 32 10 10 148 66 17 ; Actual code.
+ 0 0 0 0 0 0 0 9 ; Metadata thunk.
+ 9 10 2 10 8 11 18 0 3 18 0 1 18 0 3 66)
@end example
``Objcode'' is bytecode, but mapped directly to a C structure,
diff --git a/doc/ref/vm.texi b/doc/ref/vm.texi
index 6a7a0a9..2c279bf 100644
--- a/doc/ref/vm.texi
+++ b/doc/ref/vm.texi
@@ -309,31 +309,27 @@ We can see how these concepts tie together by
disassembling the
@smallexample
scheme@@(guile-user)> (define (foo a) (lambda (b) (list foo a b)))
scheme@@(guile-user)> ,x foo
-Disassembly of #<procedure foo (a)>:
-
- 0 (assert-nargs-ee 0 1)
- 3 (reserve-locals 0 1)
- 6 (object-ref 1) ;; #<procedure 85bfec0 at <current
input>:0:16 (b)>
- 8 (local-ref 0) ;; `a'
- 10 (make-closure 0 1)
- 13 (return)
+ 0 (assert-nargs-ee/locals 1)
+ 2 (object-ref 1) ;; #<procedure 8ebec20 at <current
input>:0:17 (b)>
+ 4 (local-ref 0) ;; `a'
+ 6 (make-closure 0 1)
+ 9 (return)
----------------------------------------
-Disassembly of #<procedure 85bfec0 at <current input>:0:16 (b)>:
-
- 0 (assert-nargs-ee 0 1)
- 3 (reserve-locals 0 1)
- 6 (toplevel-ref 1) ;; `foo'
- 8 (free-ref 0) ;; (closure variable)
- 10 (local-ref 0) ;; `b'
- 12 (list 0 3) ;; 3 elements at (unknown
file):0:28
- 15 (return)
+Disassembly of #<procedure 8ebec20 at <current input>:0:17 (b)>:
+
+ 0 (assert-nargs-ee/locals 1)
+ 2 (toplevel-ref 1) ;; `foo'
+ 4 (free-ref 0) ;; (closure variable)
+ 6 (local-ref 0) ;; `b'
+ 8 (list 0 3) ;; 3 elements at (unknown
file):0:29
+ 11 (return)
@end smallexample
First there's some prelude, where @code{foo} checks that it was called with
only
-1 argument. Then at @code{ip} 6, we load up the compiled lambda. @code{Ip} 8
+1 argument. Then at @code{ip} 2, we load up the compiled lambda. @code{Ip} 4
loads up `a', so that it can be captured into a closure by at @code{ip}
-10---binding code (from the compiled lambda) with data (the free-variable
+6---binding code (from the compiled lambda) with data (the free-variable
vector). Finally we return the closure.
The second stanza disassembles the compiled lambda. After the prelude, we note
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, master, updated. release_1-9-10-85-g0a715b9,
Andy Wingo <=