Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
41cf13b9
Commit
41cf13b9
authored
Jul 20, 1994
by
Richard M. Stallman
Browse files
(byte-decompile-bytecode-1):
Put a pc value before each insn in the list we return.
parent
76bcdf39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
lisp/emacs-lisp/byte-opt.el
lisp/emacs-lisp/byte-opt.el
+10
-2
No files found.
lisp/emacs-lisp/byte-opt.el
View file @
41cf13b9
...
...
@@ -1083,6 +1083,8 @@
;;; This de-compiler is used for inline expansion of compiled functions,
;;; and by the disassembler.
;;;
;;; This list contains numbers, which are pc values,
;;; before each instruction.
(
defun
byte-decompile-bytecode
(
bytes
constvec
)
"Turns BYTECODE into lapcode, referring to CONSTVEC."
(
let
((
byte-compile-constants
nil
)
...
...
@@ -1101,6 +1103,7 @@
endtag
(
retcount
0
))
(
while
(
not
(
=
ptr
length
))
(
setq
lap
(
cons
ptr
lap
))
(
setq
op
(
aref
bytes
ptr
)
optr
ptr
offset
(
disassemble-offset
))
; this does dynamic-scope magic
...
...
@@ -1135,7 +1138,8 @@
;; take off the dummy nil op that we replaced a trailing "return" with.
(
let
((
rest
lap
))
(
while
rest
(
cond
((
setq
tmp
(
assq
(
car
(
car
rest
))
tags
))
(
cond
((
numberp
(
car
rest
)))
((
setq
tmp
(
assq
(
car
(
car
rest
))
tags
))
;; this addr is jumped to
(
setcdr
rest
(
cons
(
cons
nil
(
cdr
tmp
))
(
cdr
rest
)))
...
...
@@ -1148,7 +1152,11 @@
(
if
endtag
(
setq
lap
(
cons
(
cons
nil
endtag
)
lap
)))
;; remove addrs, lap = ( [ (op . arg) | (TAG tagno) ]* )
(
mapcar
'cdr
(
nreverse
lap
))))
(
mapcar
(
function
(
lambda
(
elt
)
(
if
(
numberp
elt
)
elt
(
cdr
elt
))))
(
nreverse
lap
))))
;;; peephole optimizer
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment