diff options
| author | Vibhav Pant | 2017-01-26 01:02:16 +0530 |
|---|---|---|
| committer | Vibhav Pant | 2017-01-26 01:02:16 +0530 |
| commit | 4e6140b28324a9a63d54084c920206d00aed094e (patch) | |
| tree | c3ea7654fced7be18f0d8081ebe7f32d070decf8 | |
| parent | 19cb3985a3795539b51d70625904e95a6e581eef (diff) | |
| download | emacs-4e6140b28324a9a63d54084c920206d00aed094e.tar.gz emacs-4e6140b28324a9a63d54084c920206d00aed094e.zip | |
* lisp/emacs-lisp/disass.el: Display jump tables for switch.
| -rw-r--r-- | lisp/emacs-lisp/disass.el | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el index 97e45e070d0..22c1c962a39 100644 --- a/lisp/emacs-lisp/disass.el +++ b/lisp/emacs-lisp/disass.el | |||
| @@ -221,9 +221,17 @@ OBJ should be a call to BYTE-CODE generated by the byte compiler." | |||
| 221 | ((memq op '(byte-constant byte-constant2)) | 221 | ((memq op '(byte-constant byte-constant2)) |
| 222 | ;; it's a constant | 222 | ;; it's a constant |
| 223 | (setq arg (car arg)) | 223 | (setq arg (car arg)) |
| 224 | ;; but if the value of the constant is compiled code, then | 224 | ;; if the succeeding op is byte-switch, display the jump table |
| 225 | ;; recursively disassemble it. | 225 | ;; used |
| 226 | (cond ((or (byte-code-function-p arg) | 226 | (cond ((eq (car-safe (car-safe (cdr lap))) 'byte-switch) |
| 227 | (insert (format "<jump-table-%s ( " (hash-table-test arg))) | ||
| 228 | (maphash #'(lambda (value tag) | ||
| 229 | (insert (format "%s %s " value (cadr tag)))) | ||
| 230 | arg) | ||
| 231 | (insert ")>")) | ||
| 232 | ;; if the value of the constant is compiled code, then | ||
| 233 | ;; recursively disassemble it. | ||
| 234 | ((or (byte-code-function-p arg) | ||
| 227 | (and (consp arg) (functionp arg) | 235 | (and (consp arg) (functionp arg) |
| 228 | (assq 'byte-code arg)) | 236 | (assq 'byte-code arg)) |
| 229 | (and (eq (car-safe arg) 'macro) | 237 | (and (eq (car-safe arg) 'macro) |