aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/byte-opt.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index cb9f4ffab3a..8b7937b7d80 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -1094,16 +1094,21 @@
1094 1094
1095;; As byte-decompile-bytecode, but updates 1095;; As byte-decompile-bytecode, but updates
1096;; byte-compile-{constants, variables, tag-number}. 1096;; byte-compile-{constants, variables, tag-number}.
1097;; If the optional 3rd arg is true, then `return' opcodes are replaced 1097;; If MAKE-SPLICEABLE is true, then `return' opcodes are replaced
1098;; with `goto's destined for the end of the code. 1098;; with `goto's destined for the end of the code.
1099(defun byte-decompile-bytecode-1 (bytes constvec &optional make-splicable) 1099;; That is for use by the compiler.
1100;; If MAKE-SPLICEABLE is nil, we are being called for the disassembler.
1101;; In that case, we put a pc value into the list
1102;; before each insn (or its label).
1103(defun byte-decompile-bytecode-1 (bytes constvec &optional make-spliceable)
1100 (let ((length (length bytes)) 1104 (let ((length (length bytes))
1101 (ptr 0) optr tag tags op offset 1105 (ptr 0) optr tag tags op offset
1102 lap tmp 1106 lap tmp
1103 endtag 1107 endtag
1104 (retcount 0)) 1108 (retcount 0))
1105 (while (not (= ptr length)) 1109 (while (not (= ptr length))
1106 (setq lap (cons ptr lap)) 1110 (or make-spliceable
1111 (setq lap (cons ptr lap)))
1107 (setq op (aref bytes ptr) 1112 (setq op (aref bytes ptr)
1108 optr ptr 1113 optr ptr
1109 offset (disassemble-offset)) ; this does dynamic-scope magic 1114 offset (disassemble-offset)) ; this does dynamic-scope magic
@@ -1125,7 +1130,7 @@
1125 (car (setq byte-compile-variables 1130 (car (setq byte-compile-variables
1126 (cons (list tmp) 1131 (cons (list tmp)
1127 byte-compile-variables))))))) 1132 byte-compile-variables)))))))
1128 ((and make-splicable 1133 ((and make-spliceable
1129 (eq op 'byte-return)) 1134 (eq op 'byte-return))
1130 (if (= ptr (1- length)) 1135 (if (= ptr (1- length))
1131 (setq op nil) 1136 (setq op nil)