guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. 159399850de811f23e45d


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. 159399850de811f23e45d439aecf452b0137d847
Date: Fri, 19 Jun 2009 00:39:37 +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=159399850de811f23e45d439aecf452b0137d847

The branch, master has been updated
       via  159399850de811f23e45d439aecf452b0137d847 (commit)
       via  81e002fcb90c99ac2840dcde81f286772b1fb1a2 (commit)
      from  0ba0b3848913ca871235ad4b2f8ef184bf8f552b (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 159399850de811f23e45d439aecf452b0137d847
Author: Ludovic Courtès <address@hidden>
Date:   Fri Jun 19 02:35:57 2009 +0200

    Fix decompilation of the `load-array' instruction.
    
    This allows, e.g., ",c #u8(1 2 3)" at the REPL to actually work instead
    of failing to decode `load-array'.
    
    * module/language/assembly/decompile-bytecode.scm (decode-bytecode):
      Account for the `load-array' instruction, which is followed by a
      bytevector instead of a string.  We should find a more elegant way to
      do that.

commit 81e002fcb90c99ac2840dcde81f286772b1fb1a2
Author: Ludovic Courtès <address@hidden>
Date:   Fri Jun 19 02:14:22 2009 +0200

    Fix the REPL's `,compile' command.
    
    * module/system/repl/command.scm (compile): Use `guile:disassemble'
      instead of the former `disassemble-objcode'.

-----------------------------------------------------------------------

Summary of changes:
 module/language/assembly/decompile-bytecode.scm |   19 +++++++++++++++----
 module/system/repl/command.scm                  |    2 +-
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/module/language/assembly/decompile-bytecode.scm 
b/module/language/assembly/decompile-bytecode.scm
index 2ad3bc6..fdf27ec 100644
--- a/module/language/assembly/decompile-bytecode.scm
+++ b/module/language/assembly/decompile-bytecode.scm
@@ -22,6 +22,7 @@
   #:use-module (system vm instruction)
   #:use-module (system base pmatch)
   #:use-module (srfi srfi-4)
+  #:use-module (rnrs bytevector)
   #:use-module (language assembly)
   #:export (decompile-bytecode))
 
@@ -97,14 +98,24 @@
               ((eq? inst 'load-program)
                (decode-load-program pop))
               ((< (instruction-length inst) 0)
-               (let* ((len (let* ((a (pop)) (b (pop)) (c (pop)))
+               (let* ((make-sequence
+                       (if (eq? inst 'load-array)
+                           make-bytevector
+                           make-string))
+                      (sequence-set!
+                       (if (eq? inst 'load-array)
+                           bytevector-u8-set!
+                           (lambda (str pos value)
+                             (string-set! str pos (integer->char value)))))
+
+                      (len (let* ((a (pop)) (b (pop)) (c (pop)))
                              (+ (ash a 16) (ash b 8) c)))
-                      (str (make-string len)))
+                      (seq (make-sequence len)))
                  (let lp ((i 0))
                    (if (= i len)
-                       `(,inst ,str)
+                       `(,inst ,seq)
                        (begin
-                         (string-set! str i (integer->char (pop)))
+                         (sequence-set! seq i (pop))
                          (lp (1+ i)))))))
               (else
                ;; fixed length
diff --git a/module/system/repl/command.scm b/module/system/repl/command.scm
index 47f1a9a..e6b4929 100644
--- a/module/system/repl/command.scm
+++ b/module/system/repl/command.scm
@@ -266,7 +266,7 @@ Generate compiled code.
   -O    Enable optimization
   -D    Add debug information"
   (let ((x (apply repl-compile repl (repl-parse repl form) opts)))
-    (cond ((objcode? x) (disassemble-objcode x))
+    (cond ((objcode? x) (guile:disassemble x))
           (else (repl-print repl x)))))
 
 (define guile:compile-file compile-file)


hooks/post-receive
-- 
GNU Guile




reply via email to

[Prev in Thread] Current Thread [Next in Thread]