diff options
author | Andy Wingo <wingo@pobox.com> | 2009-10-25 12:41:48 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-10-25 13:12:27 +0100 |
commit | 8b652112048ae2c482993897cdf40c5d9a67a8d2 (patch) | |
tree | 77a6913933bdfe702de01eb12c245509cccd5721 /module/language/assembly/decompile-bytecode.scm | |
parent | df435c83072a79d9fdacbc57d9925ab7c0be5deb (diff) | |
download | guile-8b652112048ae2c482993897cdf40c5d9a67a8d2.tar.gz |
assembly/disassembly support for br-if-nargs-*
* module/language/assembly/compile-bytecode.scm (write-bytecode): Handle
br-if-nargs compilation.
* module/language/assembly/decompile-bytecode.scm (decode-load-program):
And decompile them nicely as well.
* module/language/assembly/disassemble.scm (code-annotation): And,
present the disassembly if br-if-nargs-* nicely.
Diffstat (limited to 'module/language/assembly/decompile-bytecode.scm')
-rw-r--r-- | module/language/assembly/decompile-bytecode.scm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/module/language/assembly/decompile-bytecode.scm b/module/language/assembly/decompile-bytecode.scm index 6c929cb33..555ee12d7 100644 --- a/module/language/assembly/decompile-bytecode.scm +++ b/module/language/assembly/decompile-bytecode.scm @@ -42,6 +42,8 @@ (define (br-instruction? x) (memq x '(br br-if br-if-not br-if-eq br-if-not-eq br-if-null br-if-not-null))) +(define (br-nargs-instruction? x) + (memq x '(br-if-nargs-ne br-if-nargs-lt br-if-nargs-gt))) (define (bytes->s24 a b c) (let ((x (+ (ash a 16) (ash b 8) c))) @@ -84,6 +86,8 @@ (pmatch exp ((,br ,rel1 ,rel2 ,rel3) (guard (br-instruction? br)) (lp (cons `(,br ,(ensure-label rel1 rel2 rel3)) out))) + ((,br ,hi ,lo ,rel1 ,rel2 ,rel3) (guard (br-nargs-instruction? br)) + (lp (cons `(,br ,hi ,lo ,(ensure-label rel1 rel2 rel3)) out))) ((mv-call ,n ,rel1 ,rel2 ,rel3) (lp (cons `(mv-call ,n ,(ensure-label rel1 rel2 rel3)) out))) (else |