author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sun, 20 Oct 2013 01:05:27 +0200 | |
changeset 3333 | fb37a7b53ed6 |
parent 3168 | 6e86e974bb40 |
child 3443 | 78ceb5df3dcd |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1991 by Claus Gittinger |
1796 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
1140 | 12 |
"{ Package: 'stx:libcomp' }" |
13 |
||
0 | 14 |
ByteCodeCompiler subclass:#Decompiler |
1800 | 15 |
instanceVariableNames:'hasLineNo bytes literals index listStream outputStream' |
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'System-Compiler' |
|
0 | 19 |
! |
20 |
||
378 | 21 |
!Decompiler class methodsFor:'documentation'! |
0 | 22 |
|
135
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
23 |
copyright |
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
24 |
" |
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
25 |
COPYRIGHT (c) 1991 by Claus Gittinger |
1796 | 26 |
All Rights Reserved |
0 | 27 |
|
135
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
28 |
This software is furnished under a license and may be used |
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
29 |
only in accordance with the terms of that license and with the |
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
30 |
inclusion of the above copyright notice. This software may not |
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
31 |
be provided or otherwise made available to, or used by, any |
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
32 |
other person. No title to or ownership of the software is |
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
33 |
hereby transferred. |
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
34 |
" |
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
35 |
! |
0 | 36 |
|
135
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
37 |
documentation |
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
38 |
" |
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
39 |
only for stx-debugging. Not for public eyes. |
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
40 |
|
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
41 |
Decompiler decompile:(someClass compiledMethodAt:#someSelector) |
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
42 |
" |
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
4
diff
changeset
|
43 |
! ! |
0 | 44 |
|
378 | 45 |
!Decompiler class methodsFor:'decompiling'! |
0 | 46 |
|
47 |
decompile:aMethod |
|
1789 | 48 |
^ self decompile:aMethod to:Transcript |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
49 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
50 |
" |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
51 |
Decompiler decompile:(FileBrowser compiledMethodAt:#initialize) |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
52 |
Decompiler decompile:(Decompiler compiledMethodAt:#decompile:to:) |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
53 |
" |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
54 |
|
1789 | 55 |
"Modified: / 06-08-2006 / 15:31:39 / cg" |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
56 |
! |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
57 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
58 |
decompile:aMethod to:aStream |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
59 |
^ (self new) decompile:aMethod to:aStream |
0 | 60 |
|
61 |
"Decompiler decompile:(FileBrowser compiledMethodAt:#initialize)" |
|
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
62 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
63 |
"Created: 16.4.1996 / 20:25:55 / cg" |
0 | 64 |
! ! |
65 |
||
66 |
!Decompiler methodsFor:'decompiling'! |
|
67 |
||
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
68 |
decompile:aMethod to:aStream |
1800 | 69 |
|nBytes byte sym sel lineNr who method insnIndex1 insnIndex2 n nCol| |
206 | 70 |
|
1800 | 71 |
nCol := 7. |
532 | 72 |
listStream := nil. |
73 |
outputStream := aStream. |
|
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
74 |
|
384
92c963b7922b
handle decompilation of wrapped methods
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
75 |
(method := aMethod) isNil ifTrue:[ |
278 | 76 |
aStream showCR:'nil method'. |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
77 |
^ self |
206 | 78 |
]. |
2431 | 79 |
method := method originalMethodIfWrapped. |
206 | 80 |
|
1360 | 81 |
aStream cr. |
82 |
aStream show:'decompiling '. |
|
83 |
||
2423 | 84 |
method isMethod ifTrue:[ |
85 |
who := method who. |
|
86 |
who notNil ifTrue:[ |
|
87 |
classToCompileFor := who at:1. |
|
88 |
aStream showCR:(classToCompileFor name , '>>' , (who at:2)). |
|
89 |
] |
|
206 | 90 |
]. |
1360 | 91 |
aStream show:('nA: ' , method numArgs printString). |
92 |
aStream show:(' nV: ' , method numVars printString). |
|
93 |
aStream show:(' nT: ' , method stackSize printString). |
|
94 |
aStream cr. |
|
95 |
aStream cr. |
|
206 | 96 |
|
384
92c963b7922b
handle decompilation of wrapped methods
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
97 |
bytes := method byteCode. |
206 | 98 |
bytes isNil ifTrue:[ |
740 | 99 |
method isLazyMethod ifTrue:[ |
100 |
method := method asExecutableMethod. |
|
101 |
bytes := method byteCode. |
|
102 |
aStream showCR:'(lazyMethod; showing resulting code when compiled on first invokation)'. |
|
103 |
aStream cr. |
|
104 |
]. |
|
105 |
]. |
|
106 |
bytes isNil ifTrue:[ |
|
278 | 107 |
aStream showCR:'no bytecode'. |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
108 |
^ self |
206 | 109 |
]. |
384
92c963b7922b
handle decompilation of wrapped methods
Claus Gittinger <cg@exept.de>
parents:
378
diff
changeset
|
110 |
literals := method literals. |
206 | 111 |
index := 1. |
112 |
nBytes := bytes size. |
|
113 |
[index <= nBytes] whileTrue:[ |
|
532 | 114 |
listStream := '' writeStream. |
115 |
||
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
116 |
self showPC. |
532 | 117 |
insnIndex1 := index. |
118 |
||
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
119 |
sym := self symbolicCodeFor:(bytes at:index). |
532 | 120 |
listStream show:sym. |
206 | 121 |
" |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
122 |
extra notNil ifTrue:[Transcript show:(extra printString)]. |
206 | 123 |
" |
347
c41b9c9c0e50
oops - sendWIDTH & sendHEIGHT have lineNumber info
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
124 |
index := index + 1. |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
125 |
hasLineNo ifTrue:[ |
347
c41b9c9c0e50
oops - sendWIDTH & sendHEIGHT have lineNumber info
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
126 |
lineNr := bytes at:index. |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
127 |
index := index + 1. |
3106
119f0ff4b41d
Fixed Decompiler: correctly show LINE16 pseudo insn...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2753
diff
changeset
|
128 |
sym == #LINE16 ifTrue:[ |
119f0ff4b41d
Fixed Decompiler: correctly show LINE16 pseudo insn...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2753
diff
changeset
|
129 |
lineNr := (lineNr << 8) + (bytes at:index). |
119f0ff4b41d
Fixed Decompiler: correctly show LINE16 pseudo insn...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2753
diff
changeset
|
130 |
index := index + 1. |
119f0ff4b41d
Fixed Decompiler: correctly show LINE16 pseudo insn...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2753
diff
changeset
|
131 |
|
119f0ff4b41d
Fixed Decompiler: correctly show LINE16 pseudo insn...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2753
diff
changeset
|
132 |
]. |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
133 |
] ifFalse:[ |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
134 |
lineNr := nil |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
135 |
]. |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
136 |
extra notNil ifTrue:[ |
532 | 137 |
listStream show:' '. |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
138 |
byte := bytes at:index. |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
139 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
140 |
"compute argument showXXX selector from extra ..." |
206 | 141 |
|
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
142 |
sel := 'show' , extra , ':'. |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
143 |
sel at:5 put:(sel at:5) asUppercase. |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
144 |
self perform:sel asSymbol with:byte |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
145 |
]. |
532 | 146 |
insnIndex2 := index-1. |
147 |
||
148 |
insnIndex1 to:insnIndex2 do:[:i | |
|
149 |
outputStream show:((bytes at:i) printStringRadix:16 size:2 fill:$0). |
|
150 |
outputStream show:' '. |
|
151 |
]. |
|
152 |
n := (insnIndex2-insnIndex1) * 3. |
|
1800 | 153 |
outputStream spaces:(nCol*3 - n). |
532 | 154 |
outputStream show:(listStream contents). |
155 |
||
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
156 |
lineNr notNil ifTrue:[ |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
157 |
aStream show:'['; show:lineNr; show:']' |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
158 |
]. |
278 | 159 |
aStream showCR:'' |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
160 |
] |
206 | 161 |
|
1789 | 162 |
"Created: / 16-04-1996 / 20:27:18 / cg" |
2431 | 163 |
"Modified: / 22-10-2010 / 11:48:15 / cg" |
3106
119f0ff4b41d
Fixed Decompiler: correctly show LINE16 pseudo insn...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2753
diff
changeset
|
164 |
"Modified: / 12-04-2013 / 01:35:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 165 |
! |
166 |
||
217 | 167 |
showAbsOffset:byte |
168 |
|offs b2| |
|
169 |
||
170 |
index := index + 1. |
|
171 |
b2 := (bytes at:index). |
|
172 |
offs := byte + (b2 bitShift:8). |
|
173 |
index := index + 1. |
|
293 | 174 |
listStream show:offs printString. |
175 |
listStream show:' ('. |
|
176 |
listStream show:offs printString. |
|
177 |
listStream show:')' |
|
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
178 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
179 |
"Modified: 16.4.1996 / 20:27:53 / cg" |
217 | 180 |
! |
181 |
||
182 |
showAbsOffsetLevel:byte |
|
183 |
|offs b2| |
|
184 |
||
185 |
index := index + 1. |
|
186 |
b2 := (bytes at:index). |
|
187 |
offs := byte + (b2 bitShift:8). |
|
188 |
index := index + 1. |
|
293 | 189 |
listStream show:offs printString. |
190 |
listStream show:' ('. |
|
191 |
listStream show:offs printString. |
|
192 |
listStream show:')'. |
|
217 | 193 |
self showNvarNargsAt:index. |
194 |
index := index + 2 |
|
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
195 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
196 |
"Modified: 16.4.1996 / 20:27:57 / cg" |
217 | 197 |
! |
198 |
||
1793 | 199 |
showExtraOp:op |
200 |
"/ listStream show:(op printString); show:' '. |
|
201 |
||
1800 | 202 |
index := index + 1. |
1793 | 203 |
op == 0 ifTrue:[ |
1800 | 204 |
listStream show:'SEND_VL '. |
205 |
self showLineNo:(bytes at:index). |
|
206 |
listStream show:' nargs:' , (bytes at:index) printString; show:' '. |
|
207 |
index := index + 1. |
|
208 |
self showLiteral32:0. |
|
209 |
^ self. |
|
1793 | 210 |
]. |
211 |
op == 1 ifTrue:[ |
|
1800 | 212 |
listStream show:'SUPERSEND_VL '. |
213 |
self showLineNo:(bytes at:index). |
|
214 |
listStream show:' nargs:' , (bytes at:index) printString; show:' '. |
|
215 |
index := index + 1. |
|
216 |
self showLiteral32:0. |
|
217 |
self showLiteral32:0. |
|
218 |
^ self. |
|
1793 | 219 |
]. |
220 |
op == 2 ifTrue:[ |
|
221 |
listStream show:'PUSH_VL_LIT '. |
|
222 |
self showLiteral32:0. |
|
223 |
^ self. |
|
224 |
]. |
|
2128
3cdbf4f6704f
Change #halt: to #shouldImplement or #assert:
Stefan Vogel <sv@exept.de>
parents:
1826
diff
changeset
|
225 |
self shouldImplement. |
1793 | 226 |
op == 3 ifTrue:[ |
227 |
]. |
|
228 |
op == 4 ifTrue:[ |
|
229 |
]. |
|
230 |
! |
|
231 |
||
217 | 232 |
showIndex:byte |
293 | 233 |
listStream show:byte printString. |
217 | 234 |
index := index + 1 |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
235 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
236 |
"Modified: 16.4.1996 / 20:27:59 / cg" |
217 | 237 |
! |
238 |
||
239 |
showIndexLevel:byte |
|
240 |
self showIndex:byte. |
|
241 |
self showNvarNargsAt:index. |
|
242 |
index := index + 2 |
|
243 |
! |
|
244 |
||
245 |
showInstvarIndex:byte |
|
293 | 246 |
listStream show:byte printString. |
217 | 247 |
classToCompileFor notNil ifTrue:[ |
293 | 248 |
listStream show:'('. |
763 | 249 |
listStream show:(classToCompileFor allInstVarNames at:byte ifAbsent:'???? [' , byte printString ,']'). |
293 | 250 |
listStream show:')'. |
217 | 251 |
]. |
252 |
index := index + 1 |
|
253 |
||
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
254 |
"Modified: 16.4.1996 / 20:28:06 / cg" |
217 | 255 |
! |
256 |
||
257 |
showLevelIndex:byte |
|
1148 | 258 |
|lvl idx| |
259 |
||
260 |
lvl := byte. |
|
261 |
index := index + 1. |
|
262 |
idx := bytes at:index. |
|
263 |
||
264 |
listStream show:idx printString. |
|
217 | 265 |
index := index + 1. |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
266 |
|
1148 | 267 |
listStream show:' lvl: '; show:lvl printString. |
217 | 268 |
! |
269 |
||
270 |
showLineNo:byte |
|
293 | 271 |
listStream show:' line:' , byte printString. |
217 | 272 |
index := index + 1 |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
273 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
274 |
"Modified: 16.4.1996 / 20:28:10 / cg" |
217 | 275 |
! |
276 |
||
277 |
showLit1:ignored |
|
278 |
self showLit:1 |
|
279 |
! |
|
280 |
||
281 |
showLit2:ignored |
|
282 |
self showLit:2 |
|
283 |
! |
|
284 |
||
285 |
showLit3:ignored |
|
286 |
self showLit:3 |
|
287 |
! |
|
288 |
||
289 |
showLit4:ignored |
|
290 |
self showLit:4 |
|
291 |
! |
|
292 |
||
293 |
showLit5:ignored |
|
294 |
self showLit:5 |
|
295 |
! |
|
296 |
||
297 |
showLit6:ignored |
|
298 |
self showLit:6 |
|
299 |
! |
|
300 |
||
301 |
showLit7:ignored |
|
302 |
self showLit:7 |
|
303 |
! |
|
304 |
||
305 |
showLit8:ignored |
|
306 |
self showLit:8 |
|
307 |
! |
|
308 |
||
309 |
showLit9:ignored |
|
310 |
self showLit:9 |
|
311 |
! |
|
312 |
||
313 |
showLit:litIndex |
|
314 |
|lit| |
|
315 |
||
573 | 316 |
lit := literals at:litIndex ifAbsent:'*** badIndex ***'. |
217 | 317 |
lit isBehavior ifTrue:[ |
293 | 318 |
listStream show:lit name |
217 | 319 |
] ifFalse:[ |
378 | 320 |
lit isBlock ifTrue:[ |
321 |
listStream show:'[a block]' |
|
322 |
] ifFalse:[ |
|
1796 | 323 |
(lit isNumber or:[lit isString or:[lit isSymbol]]) ifTrue:[ |
324 |
listStream show:lit storeString |
|
325 |
] ifFalse:[ |
|
326 |
listStream show:'{', lit printString , '}' |
|
327 |
] |
|
378 | 328 |
] |
217 | 329 |
] |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
330 |
|
1796 | 331 |
"Modified: / 08-08-2006 / 00:45:46 / cg" |
217 | 332 |
! |
333 |
||
334 |
showLiteral16:byte |
|
335 |
|litIndex| |
|
336 |
||
337 |
litIndex := bytes wordAt:index MSB:false. |
|
338 |
self showLit:litIndex. |
|
339 |
index := index + 2 |
|
340 |
! |
|
341 |
||
1793 | 342 |
showLiteral32:byte |
343 |
|litIndex| |
|
344 |
||
345 |
litIndex := bytes doubleWordAt:index MSB:false. |
|
346 |
self showLit:litIndex. |
|
347 |
index := index + 4 |
|
348 |
! |
|
349 |
||
217 | 350 |
showLiteral:byte |
351 |
index := index + 1. |
|
352 |
self showLit:byte |
|
353 |
! |
|
354 |
||
355 |
showLiteralAt:index |
|
356 |
|offs| |
|
357 |
||
358 |
offs := bytes at:index. |
|
359 |
self showLit:offs |
|
360 |
! |
|
361 |
||
362 |
showLongOffset:byte |
|
363 |
|offs| |
|
364 |
||
365 |
index := index + 1. |
|
366 |
(byte > 127) ifTrue:[ |
|
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
367 |
offs := byte - 256 - 128 |
217 | 368 |
] ifFalse:[ |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
369 |
offs := byte + 128 |
217 | 370 |
]. |
293 | 371 |
listStream show:offs printString. |
372 |
listStream show:' ('. |
|
373 |
listStream show:(index + offs) printString. |
|
374 |
listStream show:')' |
|
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
375 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
376 |
"Modified: 16.4.1996 / 20:28:30 / cg" |
217 | 377 |
! |
378 |
||
379 |
showLongOffsetLevel:byte |
|
380 |
self showLongOffset:byte. |
|
381 |
self showNvarNargsAt:index. |
|
382 |
index := index + 2 |
|
383 |
! |
|
384 |
||
385 |
showLsendArgs:byte |
|
386 |
|litIndex| |
|
387 |
||
293 | 388 |
listStream show:byte printString. |
389 |
listStream show:' '. |
|
217 | 390 |
index := index + 1. |
391 |
litIndex := bytes wordAt:index MSB:false. |
|
293 | 392 |
listStream show:(literals at:litIndex) printString. |
217 | 393 |
index := index + 2 |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
394 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
395 |
"Modified: 16.4.1996 / 20:28:35 / cg" |
217 | 396 |
! |
397 |
||
1141 | 398 |
showLsuperSendArgs:byte |
399 |
|litIndex| |
|
400 |
||
401 |
listStream show:byte printString. |
|
402 |
listStream show:' '. |
|
403 |
index := index + 1. |
|
404 |
litIndex := bytes wordAt:index MSB:false. |
|
405 |
listStream show:(literals at:litIndex) printString. |
|
406 |
index := index + 2. |
|
407 |
||
408 |
litIndex := bytes wordAt:index MSB:false. |
|
409 |
listStream show:(literals at:litIndex) printString. |
|
410 |
index := index + 2 |
|
411 |
! |
|
412 |
||
217 | 413 |
showNumber16:byte |
293 | 414 |
listStream show:(bytes signedWordAt:index MSB:false) printString. |
217 | 415 |
index := index + 2 |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
416 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
417 |
"Modified: 16.4.1996 / 20:28:37 / cg" |
217 | 418 |
! |
419 |
||
420 |
showNumber:byte |
|
767 | 421 |
listStream show:byte signExtendedByteValue printString. |
217 | 422 |
index := index + 1 |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
423 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
424 |
"Modified: 16.4.1996 / 20:28:38 / cg" |
217 | 425 |
! |
426 |
||
427 |
showNvarNargsAt:index |
|
293 | 428 |
listStream show:' nv='. |
429 |
listStream show:(bytes at:index) printString. |
|
430 |
listStream show:' na='. |
|
431 |
listStream show:(bytes at:(index + 1)) printString |
|
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
432 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
433 |
"Modified: 16.4.1996 / 20:28:40 / cg" |
217 | 434 |
! |
435 |
||
436 |
showOffset:byte |
|
437 |
|offs| |
|
438 |
||
439 |
index := index + 1. |
|
440 |
(byte > 127) ifTrue:[ |
|
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
441 |
offs := byte - 256 |
217 | 442 |
] ifFalse:[ |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
443 |
offs := byte |
217 | 444 |
]. |
293 | 445 |
listStream show:(offs printString). |
446 |
listStream show:' ('. |
|
447 |
listStream show:(index + offs) printString. |
|
448 |
listStream show:')' |
|
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
449 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
450 |
"Modified: 16.4.1996 / 20:28:43 / cg" |
217 | 451 |
! |
452 |
||
453 |
showOffsetLevel:byte |
|
454 |
self showOffset:byte. |
|
455 |
self showNvarNargsAt:index. |
|
456 |
index := index + 2 |
|
457 |
! |
|
458 |
||
459 |
showPC |
|
532 | 460 |
outputStream show:(index printStringRadix:10 size:3 fill:(Character space)). |
461 |
outputStream show:': '. |
|
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
462 |
|
532 | 463 |
"Modified: 4.6.1997 / 12:07:33 / cg" |
217 | 464 |
! |
465 |
||
466 |
showSendArgs:byte |
|
293 | 467 |
listStream show:byte printString. |
468 |
listStream show:' '. |
|
217 | 469 |
index := index + 1. |
470 |
self showLiteralAt:index. |
|
471 |
index := index + 1 |
|
472 |
||
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
473 |
"Modified: 16.4.1996 / 20:28:50 / cg" |
217 | 474 |
! |
475 |
||
246
abf09d4821fe
new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents:
217
diff
changeset
|
476 |
showSpecialGlobal:byte |
abf09d4821fe
new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents:
217
diff
changeset
|
477 |
|specialIndex| |
abf09d4821fe
new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents:
217
diff
changeset
|
478 |
|
abf09d4821fe
new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents:
217
diff
changeset
|
479 |
specialIndex := bytes at:index. |
abf09d4821fe
new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents:
217
diff
changeset
|
480 |
index := index + 1. |
293 | 481 |
"/ listStream show:specialIndex printString. |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
482 |
|
532 | 483 |
listStream |
484 |
show:((self specialGlobals) at:specialIndex + 1) |
|
485 |
||
486 |
"Modified: 4.6.1997 / 12:18:45 / cg" |
|
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
487 |
! |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
488 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
489 |
showSpecialSend:byte |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
490 |
|specialIndex| |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
491 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
492 |
specialIndex := bytes at:index. |
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
493 |
index := index + 1. |
293 | 494 |
"/ listStream show:specialIndex printString. |
495 |
listStream show:'#'. |
|
532 | 496 |
listStream show:((self specialSends) at:specialIndex + 1) |
401 | 497 |
|
532 | 498 |
"Modified: 4.6.1997 / 12:34:01 / cg" |
246
abf09d4821fe
new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents:
217
diff
changeset
|
499 |
! |
abf09d4821fe
new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents:
217
diff
changeset
|
500 |
|
217 | 501 |
showSuperSendArgs:byte |
293 | 502 |
listStream show:byte printString. |
503 |
listStream show:' '. |
|
217 | 504 |
index := index + 1. |
505 |
self showLiteralAt:index. |
|
506 |
index := index + 1. |
|
293 | 507 |
listStream show:' '. |
217 | 508 |
self showLiteralAt:index. |
509 |
index := index + 1 |
|
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
510 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
511 |
"Modified: 16.4.1996 / 20:28:58 / cg" |
217 | 512 |
! |
513 |
||
514 |
showVeryLongOffset:byte |
|
515 |
|offs| |
|
516 |
||
517 |
index := index + 1. |
|
518 |
(byte > 127) ifTrue:[ |
|
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
519 |
offs := byte - 256 - 256 |
217 | 520 |
] ifFalse:[ |
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
521 |
offs := byte + 256 |
217 | 522 |
]. |
293 | 523 |
listStream show:offs printString. |
524 |
listStream show:' ('. |
|
525 |
listStream show:(index + offs) printString. |
|
526 |
listStream show:')' |
|
250
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
527 |
|
6c26bc3fb154
allow decompile onto a stream
Claus Gittinger <cg@exept.de>
parents:
246
diff
changeset
|
528 |
"Modified: 16.4.1996 / 20:29:00 / cg" |
217 | 529 |
! |
530 |
||
531 |
showVeryLongOffsetLevel:byte |
|
532 |
self showVeryLongOffset:byte. |
|
533 |
self showNvarNargsAt:index. |
|
534 |
index := index + 2 |
|
535 |
! |
|
536 |
||
0 | 537 |
symbolicCodeFor:aByte |
401 | 538 |
|syms extras lnos sym| |
0 | 539 |
|
540 |
syms := #( retTop " 0 " |
|
342 | 541 |
retNil |
542 |
retTrue |
|
543 |
retFalse |
|
544 |
ret0 |
|
545 |
retSelf " 5 " |
|
551 | 546 |
over |
344 | 547 |
homeRetTop |
342 | 548 |
LINE |
3106
119f0ff4b41d
Fixed Decompiler: correctly show LINE16 pseudo insn...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2753
diff
changeset
|
549 |
LINE16 |
342 | 550 |
pushNil " 10 " |
551 |
pushTrue |
|
552 |
pushFalse |
|
553 |
sendSelf |
|
554 |
pushLit |
|
555 |
pushSelf " 15 " |
|
556 |
pushNum |
|
557 |
pushNum16 |
|
558 |
drop |
|
559 |
send |
|
560 |
superSend " 20 " |
|
561 |
send0 |
|
562 |
send1 |
|
563 |
send2 |
|
564 |
send3 |
|
565 |
sendDrop " 25 " |
|
566 |
sendDrop0 |
|
567 |
sendDrop1 |
|
568 |
sendDrop2 |
|
569 |
sendDrop3 |
|
570 |
pushMethodArg " 30 " |
|
571 |
pushMethodVar |
|
572 |
pushBlockArg |
|
573 |
pushBlockVar |
|
574 |
pushInstVar |
|
575 |
pushClassVar " 35 " |
|
576 |
pushGlobal |
|
577 |
storeMethodVar |
|
578 |
storeBlockVar |
|
579 |
storeInstVar |
|
580 |
storeClassVar " 40 " |
|
356
bb3beb18de1f
6empty slots in GLOBL/CLASSVAR bytecodes removed
Claus Gittinger <cg@exept.de>
parents:
347
diff
changeset
|
581 |
storeGlobal |
342 | 582 |
pushOuterBlockArg |
583 |
pushOuter1BlockArg |
|
584 |
pushOuter2BlockArg |
|
585 |
equal " 45 " |
|
586 |
notEqual |
|
587 |
dup |
|
588 |
equal0 |
|
589 |
notEqual0 |
|
590 |
falseJump " 50 " |
|
591 |
trueJump |
|
592 |
nilJump |
|
593 |
notNilJump |
|
594 |
jump |
|
595 |
makeBlock " 55 " |
|
596 |
zeroJump |
|
597 |
notZeroJump |
|
598 |
eqJump |
|
599 |
notEqJump |
|
600 |
falseJump " 60 " |
|
601 |
trueJump |
|
602 |
nilJump |
|
603 |
notNilJump |
|
604 |
jump |
|
605 |
makeBlock " 65 " |
|
606 |
zeroJump |
|
607 |
notZeroJump |
|
608 |
eqJump |
|
609 |
notEqJump |
|
610 |
falseJump " 70 " |
|
611 |
trueJump |
|
612 |
nilJump |
|
613 |
notNilJump |
|
614 |
jump |
|
615 |
makeBlock " 75 " |
|
616 |
zeroJump |
|
617 |
notZeroJump |
|
618 |
eqJump |
|
619 |
notEqJump |
|
620 |
pushMethodVar1 " 80 " |
|
621 |
pushMethodVar2 |
|
622 |
pushMethodVar3 |
|
623 |
pushMethodVar4 |
|
624 |
pushMethodVar5 |
|
625 |
pushMethodVar6 " 85 " |
|
626 |
pushMethodArg1 |
|
627 |
pushMethodArg2 |
|
628 |
pushMethodArg3 |
|
629 |
pushMethodArg4 |
|
630 |
pushInstVar1 " 90 " |
|
631 |
pushInstVar2 |
|
632 |
pushInstVar3 |
|
633 |
pushInstVar4 |
|
634 |
pushInstVar5 |
|
635 |
pushInstVar6 " 95 " |
|
636 |
pushInstVar7 |
|
637 |
pushInstVar8 |
|
638 |
pushInstVar9 |
|
639 |
pushInstVar10 |
|
640 |
storeMethodVar1 " 100 " |
|
641 |
storeMethodVar2 |
|
642 |
storeMethodVar3 |
|
643 |
storeMethodVar4 |
|
644 |
storeMethodVar5 |
|
645 |
storeMethodVar6 " 105 " |
|
401 | 646 |
nil |
647 |
nil |
|
648 |
nil |
|
649 |
nil |
|
342 | 650 |
storeInstVar1 " 110 " |
651 |
storeInstVar2 |
|
652 |
storeInstVar3 |
|
653 |
storeInstVar4 |
|
654 |
storeInstVar5 |
|
655 |
storeInstVar6 " 115 " |
|
656 |
storeInstVar7 |
|
657 |
storeInstVar8 |
|
658 |
storeInstVar9 |
|
659 |
storeInstVar10 |
|
660 |
push0 " 120 " |
|
661 |
push1 |
|
662 |
pushMinus1 |
|
663 |
sendPlus1 |
|
664 |
sendMinus1 |
|
665 |
incMethodVar " 125 " |
|
666 |
decMethodVar |
|
667 |
retNum |
|
668 |
pushOuterBlockVar "16r80" |
|
669 |
storeOuterBlockVar |
|
655 | 670 |
'send1 #=' " 130 " |
671 |
'send1 #+' |
|
672 |
'send1 #~=' |
|
673 |
'send1 #-' |
|
674 |
'send0 #class' |
|
675 |
'send1 #at:' " 135 " |
|
676 |
'send2 #at:put:' |
|
677 |
'send1 #bitAnd:' |
|
678 |
'send1 #bitOr:' |
|
342 | 679 |
push2 |
680 |
pushBlockArg1 " 140 " |
|
681 |
pushBlockArg2 |
|
682 |
pushBlockArg3 |
|
683 |
pushBlockArg4 |
|
684 |
pushContext "16r90" |
|
655 | 685 |
'send1 #>' " 145 " |
686 |
'send1 #>=' |
|
687 |
'send1 #<' |
|
688 |
'send1 #<=' |
|
401 | 689 |
nil |
690 |
nil " 150 " |
|
655 | 691 |
'send0 #value' |
692 |
'send1 #value:' |
|
693 |
'send0 #size' |
|
401 | 694 |
nil |
695 |
nil " 155 " |
|
342 | 696 |
make0Block |
697 |
makeNILBlock |
|
401 | 698 |
nil " 158 " |
699 |
nil " 159 " |
|
342 | 700 |
retMvar1 " 160 " "16rA0" |
701 |
retMvar2 |
|
702 |
retMvar3 |
|
703 |
retMvar4 |
|
704 |
retMvar5 |
|
705 |
retMvar6 " 165 " |
|
706 |
retIvar1 |
|
707 |
retIvar2 |
|
708 |
retIvar3 |
|
709 |
retIvar4 |
|
710 |
retIvar5 " 170 " |
|
711 |
retIvar6 |
|
712 |
retIvar7 |
|
713 |
retIvar8 |
|
714 |
retMarg1 |
|
715 |
retMarg2 " 175 " |
|
716 |
pushClassInstVar |
|
717 |
storeClassInstVar |
|
1140 | 718 |
'send2 #value:value:' |
342 | 719 |
not |
720 |
sendSelf0 " 180 " |
|
721 |
sendSelf1 |
|
722 |
sendSelf2 |
|
723 |
sendSelf3 |
|
724 |
sendSelfDrop0 |
|
725 |
sendSelfDrop1 " 185 " |
|
726 |
sendSelfDrop2 |
|
727 |
sendSelfDrop3 |
|
728 |
isNil |
|
729 |
notNil |
|
730 |
falseJumpAbs " 190 " |
|
731 |
trueJumpAbs |
|
732 |
nilJumpAbs |
|
733 |
notNilJumpAbs |
|
734 |
jumpAbs |
|
735 |
makeBlockAbs " 195 " |
|
736 |
zeroJumpAbs |
|
737 |
notZeroJumpAbs |
|
738 |
eqJumpAbs |
|
739 |
notEqJumpAbs " 199 " |
|
740 |
pushGlobal " 200 " |
|
741 |
pushLLit |
|
742 |
jmpFalseL |
|
743 |
jmpTrueL |
|
1793 | 744 |
vl_op |
342 | 745 |
lsend " 205 " |
746 |
lsuperSend |
|
747 |
lsendSelf |
|
748 |
pushGT0 |
|
749 |
nil |
|
750 |
sendArrayNew " 210 " |
|
655 | 751 |
'send0 #basicNew' |
342 | 752 |
sendGT0 |
655 | 753 |
'send0 #new' |
342 | 754 |
sendBasicNewN |
755 |
sendNewN " 215 " |
|
756 |
sendLogAnd |
|
757 |
sendLogOr |
|
758 |
pushGlobL |
|
759 |
storeGlobL |
|
760 |
nil " 220 " |
|
761 |
nil |
|
762 |
pushLit1 |
|
763 |
pushLit2 |
|
764 |
pushLit3 |
|
765 |
pushLit4 |
|
766 |
pushLit5 |
|
767 |
pushLit6 |
|
768 |
pushLit7 |
|
769 |
pushLit8 |
|
655 | 770 |
'send1 #*' " 230 " |
342 | 771 |
sendSpecial " 231 " |
772 |
pushBlockVar1 |
|
773 |
pushBlockVar2 |
|
774 |
pushBlockVar3 |
|
775 |
storeBlockVar1 |
|
776 |
storeBlockVar2 |
|
777 |
storeBlockVar3 |
|
778 |
refCheck |
|
2751 | 779 |
pushMethodLocal |
780 |
storeMethodLocal " 240 " |
|
3168 | 781 |
storeBlockLocal " 241 " |
782 |
storeOuterBlockLocal " 242 " |
|
783 |
swap " 243 " |
|
342 | 784 |
). |
0 | 785 |
|
786 |
lnos := #( false " 0 " |
|
342 | 787 |
false |
788 |
false |
|
789 |
false |
|
790 |
false |
|
791 |
false " 5 " |
|
792 |
false |
|
793 |
false |
|
794 |
true |
|
3106
119f0ff4b41d
Fixed Decompiler: correctly show LINE16 pseudo insn...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2753
diff
changeset
|
795 |
true |
342 | 796 |
false " 10 " |
797 |
false |
|
798 |
false |
|
799 |
true |
|
800 |
false |
|
801 |
false " 15 " |
|
802 |
false |
|
803 |
false |
|
804 |
false |
|
805 |
true |
|
806 |
true " 20 " |
|
807 |
true |
|
808 |
true |
|
809 |
true |
|
810 |
true |
|
811 |
true " 25 " |
|
812 |
true |
|
813 |
true |
|
814 |
true |
|
815 |
true |
|
816 |
false " 30 " |
|
817 |
false |
|
818 |
false |
|
819 |
false |
|
820 |
false |
|
821 |
false " 35 " |
|
822 |
false |
|
823 |
false |
|
824 |
false |
|
825 |
false |
|
826 |
false " 40 " |
|
827 |
false |
|
828 |
false |
|
829 |
false |
|
830 |
false |
|
831 |
false " 45 " |
|
832 |
false |
|
833 |
false |
|
834 |
false |
|
835 |
false |
|
836 |
false " 50 " |
|
837 |
false |
|
838 |
false |
|
839 |
false |
|
840 |
false |
|
841 |
false " 55 " |
|
842 |
false |
|
843 |
false |
|
844 |
false |
|
845 |
false |
|
846 |
false " 60 " |
|
847 |
false |
|
848 |
false |
|
849 |
false |
|
850 |
false |
|
851 |
false " 65 " |
|
852 |
false |
|
853 |
false |
|
854 |
false |
|
855 |
false |
|
856 |
false " 70 " |
|
857 |
false |
|
858 |
false |
|
859 |
false |
|
860 |
false |
|
861 |
false " 75 " |
|
862 |
false |
|
863 |
false |
|
864 |
false |
|
865 |
false |
|
866 |
false " 80 " |
|
867 |
false |
|
868 |
false |
|
869 |
false |
|
870 |
false |
|
871 |
false " 85 " |
|
872 |
false |
|
873 |
false |
|
874 |
false |
|
875 |
false |
|
876 |
false " 90 " |
|
877 |
false |
|
878 |
false |
|
879 |
false |
|
880 |
false |
|
881 |
false " 95 " |
|
882 |
false |
|
883 |
false |
|
884 |
false |
|
885 |
false |
|
886 |
false " 100 " |
|
887 |
false |
|
888 |
false |
|
889 |
false |
|
890 |
false |
|
891 |
false " 105 " |
|
347
c41b9c9c0e50
oops - sendWIDTH & sendHEIGHT have lineNumber info
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
892 |
true |
c41b9c9c0e50
oops - sendWIDTH & sendHEIGHT have lineNumber info
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
893 |
true |
c41b9c9c0e50
oops - sendWIDTH & sendHEIGHT have lineNumber info
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
894 |
true |
c41b9c9c0e50
oops - sendWIDTH & sendHEIGHT have lineNumber info
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
895 |
true |
342 | 896 |
false " 110 " |
897 |
false |
|
898 |
false |
|
899 |
false |
|
900 |
false |
|
901 |
false " 115 " |
|
902 |
false |
|
903 |
false |
|
904 |
false |
|
905 |
false |
|
906 |
false " 120 " |
|
907 |
false |
|
908 |
false |
|
909 |
true |
|
910 |
true |
|
911 |
true " 125 " |
|
912 |
true |
|
913 |
false |
|
1148 | 914 |
false "/ 128 pushOuterBlockVar |
342 | 915 |
false |
916 |
true " 130 " |
|
917 |
true |
|
918 |
true |
|
919 |
true |
|
920 |
false |
|
921 |
true " 135 " |
|
922 |
true |
|
923 |
true |
|
924 |
true |
|
925 |
false |
|
926 |
false " 140 " |
|
927 |
false |
|
928 |
false |
|
929 |
false |
|
930 |
false |
|
931 |
true " 145 " |
|
932 |
true |
|
933 |
true |
|
934 |
true |
|
935 |
true |
|
936 |
true " 150 " |
|
937 |
true |
|
938 |
true |
|
939 |
true |
|
940 |
true |
|
941 |
true " 155 " |
|
942 |
false |
|
943 |
false |
|
944 |
true |
|
945 |
true |
|
946 |
false " 160 " |
|
947 |
false |
|
948 |
false |
|
949 |
false |
|
950 |
false |
|
951 |
false " 165 " |
|
952 |
false |
|
953 |
false |
|
954 |
false |
|
955 |
false |
|
956 |
false " 170 " |
|
957 |
false |
|
958 |
false |
|
959 |
false |
|
960 |
false |
|
961 |
false " 175 " |
|
962 |
false |
|
963 |
false |
|
1140 | 964 |
true |
342 | 965 |
true |
966 |
true " 180 " |
|
967 |
true |
|
968 |
true |
|
969 |
true |
|
970 |
true |
|
971 |
true " 185 " |
|
972 |
true |
|
973 |
true |
|
974 |
false |
|
975 |
false |
|
976 |
false " 190 " |
|
977 |
false |
|
978 |
false |
|
979 |
false |
|
980 |
false |
|
981 |
false " 195 " |
|
982 |
false |
|
983 |
false |
|
984 |
false |
|
985 |
false " 199 " |
|
986 |
false " 200 " |
|
987 |
false |
|
988 |
false |
|
989 |
false |
|
990 |
false |
|
991 |
true " 205 " |
|
992 |
true |
|
1258 | 993 |
true |
342 | 994 |
true |
995 |
false |
|
996 |
false " 210 " " arrayNew " |
|
997 |
true " basicNew " |
|
998 |
true " > 0 " |
|
999 |
true " new " |
|
1000 |
true " basicNew: " |
|
1001 |
true " 215 " " new: " |
|
1002 |
true |
|
1003 |
true |
|
1004 |
false |
|
1005 |
false |
|
1006 |
false " 220 " |
|
1007 |
false |
|
1008 |
false |
|
1009 |
false |
|
1010 |
false |
|
1011 |
false " 225 " |
|
1012 |
false |
|
1013 |
false |
|
1014 |
false |
|
1015 |
false " 229 " |
|
1016 |
true " 230 " |
|
1017 |
true " 231 " |
|
1018 |
false |
|
1019 |
false |
|
1020 |
false |
|
1021 |
false |
|
1022 |
false |
|
1023 |
false |
|
1024 |
false |
|
1025 |
false |
|
1026 |
false " 240 " |
|
2751 | 1027 |
false " 241 " |
2753 | 1028 |
false " 242 " |
3168 | 1029 |
false " 243 " |
342 | 1030 |
). |
0 | 1031 |
|
1032 |
extras := #(nil " 0 " |
|
342 | 1033 |
nil |
1034 |
nil |
|
1035 |
nil |
|
1036 |
nil |
|
1037 |
nil " 5 " |
|
1038 |
nil |
|
1039 |
nil |
|
1040 |
nil |
|
1041 |
nil |
|
1042 |
nil " 10 " |
|
1043 |
nil |
|
1044 |
nil |
|
1045 |
sendArgs |
|
1046 |
literal |
|
1047 |
nil " 15 " |
|
1048 |
number |
|
1049 |
number16 |
|
1050 |
nil |
|
1051 |
sendArgs |
|
1052 |
superSendArgs " 20 " |
|
1053 |
literal |
|
1054 |
literal |
|
1055 |
literal |
|
1056 |
literal |
|
1057 |
sendArgs " 25 " |
|
1058 |
literal |
|
1059 |
literal |
|
1060 |
literal |
|
1061 |
literal |
|
1062 |
index " 30 " |
|
1063 |
index |
|
1064 |
index |
|
1065 |
index |
|
1066 |
instvarIndex |
|
356
bb3beb18de1f
6empty slots in GLOBL/CLASSVAR bytecodes removed
Claus Gittinger <cg@exept.de>
parents:
347
diff
changeset
|
1067 |
literal " 35 " |
bb3beb18de1f
6empty slots in GLOBL/CLASSVAR bytecodes removed
Claus Gittinger <cg@exept.de>
parents:
347
diff
changeset
|
1068 |
literal |
342 | 1069 |
index |
1070 |
index |
|
1071 |
instvarIndex |
|
356
bb3beb18de1f
6empty slots in GLOBL/CLASSVAR bytecodes removed
Claus Gittinger <cg@exept.de>
parents:
347
diff
changeset
|
1072 |
literal " 40 " |
bb3beb18de1f
6empty slots in GLOBL/CLASSVAR bytecodes removed
Claus Gittinger <cg@exept.de>
parents:
347
diff
changeset
|
1073 |
literal |
573 | 1074 |
levelIndex |
342 | 1075 |
index |
1076 |
index |
|
1077 |
nil " 45 " |
|
1078 |
nil |
|
1079 |
nil |
|
1080 |
nil |
|
1081 |
nil |
|
1082 |
offset " 50 " |
|
1083 |
offset |
|
1084 |
offset |
|
1085 |
offset |
|
1086 |
offset |
|
1087 |
offsetLevel " 55 " |
|
1088 |
offset |
|
1089 |
offset |
|
1090 |
offset |
|
1091 |
offset |
|
1092 |
longOffset " 60 " |
|
1093 |
longOffset |
|
1094 |
longOffset |
|
1095 |
longOffset |
|
1096 |
longOffset |
|
1097 |
longOffsetLevel " 65 " |
|
1098 |
longOffset |
|
1099 |
longOffset |
|
1100 |
longOffset |
|
1101 |
longOffset |
|
1102 |
veryLongOffset " 70 " |
|
1103 |
veryLongOffset |
|
1104 |
veryLongOffset |
|
1105 |
veryLongOffset |
|
1106 |
veryLongOffset |
|
1107 |
veryLongOffsetLevel " 75 " |
|
1108 |
veryLongOffset |
|
1109 |
veryLongOffset |
|
1110 |
veryLongOffset |
|
1111 |
veryLongOffset |
|
1112 |
nil " 80 " |
|
1113 |
nil |
|
1114 |
nil |
|
1115 |
nil |
|
1116 |
nil |
|
1117 |
nil " 85 " |
|
1118 |
nil |
|
1119 |
nil |
|
1120 |
nil |
|
1121 |
nil |
|
1122 |
nil " 90 " |
|
1123 |
nil |
|
1124 |
nil |
|
1125 |
nil |
|
1126 |
nil |
|
1127 |
nil " 95 " |
|
1128 |
nil |
|
1129 |
nil |
|
1130 |
nil |
|
1131 |
nil |
|
1132 |
nil " 100 " |
|
1133 |
nil |
|
1134 |
nil |
|
1135 |
nil |
|
1136 |
nil |
|
1137 |
nil " 105 " |
|
1138 |
nil |
|
1139 |
nil |
|
1140 |
nil |
|
1141 |
nil |
|
1142 |
nil " 110 " |
|
1143 |
nil |
|
1144 |
nil |
|
1145 |
nil |
|
1146 |
nil |
|
1147 |
nil " 115 " |
|
1148 |
nil |
|
1149 |
nil |
|
1150 |
nil |
|
1151 |
nil |
|
1152 |
nil " 120 " |
|
1153 |
nil |
|
1154 |
nil |
|
1155 |
nil |
|
1156 |
nil |
|
1157 |
index " 125 " |
|
1158 |
index |
|
1159 |
number |
|
1148 | 1160 |
levelIndex "/ 128 pushOuterBlockVar |
573 | 1161 |
levelIndex |
342 | 1162 |
nil " 130 " |
1163 |
nil |
|
1164 |
nil |
|
1165 |
nil |
|
1166 |
nil |
|
1167 |
nil " 135 " |
|
1168 |
nil |
|
1169 |
nil |
|
1170 |
nil |
|
1171 |
nil |
|
1172 |
nil " 140 " |
|
1173 |
nil |
|
1174 |
nil |
|
1175 |
nil |
|
1176 |
nil |
|
1177 |
nil " 145 " |
|
1178 |
nil |
|
1179 |
nil |
|
1180 |
nil |
|
1181 |
nil |
|
1182 |
nil " 150 " |
|
1183 |
nil |
|
1184 |
nil |
|
1185 |
nil |
|
1186 |
nil |
|
1187 |
nil " 155 " |
|
1188 |
nil |
|
1189 |
nil |
|
1190 |
nil |
|
1191 |
nil |
|
1192 |
nil " 160 " |
|
1193 |
nil |
|
1194 |
nil |
|
1195 |
nil |
|
1196 |
nil |
|
1197 |
nil " 165 " |
|
1198 |
nil |
|
1199 |
nil |
|
1200 |
nil |
|
1201 |
nil |
|
1202 |
nil " 170 " |
|
1203 |
nil |
|
1204 |
nil |
|
1205 |
nil |
|
1206 |
nil |
|
1207 |
nil " 175 " |
|
1208 |
index |
|
1209 |
index |
|
1210 |
nil |
|
1211 |
nil |
|
1212 |
literal " 180 " |
|
1213 |
literal |
|
1214 |
literal |
|
1215 |
literal |
|
1216 |
literal |
|
1217 |
literal " 185 " |
|
1218 |
literal |
|
1219 |
literal |
|
1220 |
nil |
|
1221 |
nil |
|
1222 |
absOffset " 190 " |
|
1223 |
absOffset |
|
1224 |
absOffset |
|
1225 |
absOffset |
|
1226 |
absOffset |
|
573 | 1227 |
absOffsetLevel " 195 " |
342 | 1228 |
absOffset |
1229 |
absOffset |
|
1230 |
absOffset |
|
1231 |
absOffset " 199 " |
|
1232 |
specialGlobal " 200 " |
|
1233 |
literal16 |
|
1234 |
nil |
|
1235 |
nil |
|
1793 | 1236 |
extraOp |
342 | 1237 |
lsendArgs " 205 " |
1238 |
lsuperSendArgs |
|
1258 | 1239 |
lsendArgs |
342 | 1240 |
nil |
1241 |
nil |
|
1242 |
nil " 210 " |
|
1243 |
nil |
|
1244 |
nil |
|
1245 |
nil |
|
1246 |
nil |
|
1247 |
nil " 215 " |
|
1248 |
nil |
|
1249 |
nil |
|
356
bb3beb18de1f
6empty slots in GLOBL/CLASSVAR bytecodes removed
Claus Gittinger <cg@exept.de>
parents:
347
diff
changeset
|
1250 |
literal16 |
bb3beb18de1f
6empty slots in GLOBL/CLASSVAR bytecodes removed
Claus Gittinger <cg@exept.de>
parents:
347
diff
changeset
|
1251 |
literal16 |
342 | 1252 |
nil " 220 " |
1253 |
nil |
|
1254 |
lit1 |
|
1255 |
lit2 |
|
1256 |
lit3 |
|
1257 |
lit4 " 225 " |
|
1258 |
lit5 |
|
1259 |
lit6 |
|
1260 |
lit7 |
|
1261 |
lit8 |
|
1262 |
nil " 230 " |
|
1263 |
specialSend " 231 " |
|
1264 |
nil |
|
1265 |
nil |
|
1266 |
nil |
|
1267 |
nil |
|
1268 |
nil |
|
1269 |
nil |
|
1270 |
nil |
|
1271 |
index |
|
1272 |
index " 240 " |
|
2751 | 1273 |
index " 241 " |
2753 | 1274 |
levelIndex " 242 " |
3168 | 1275 |
nil " 243 " |
342 | 1276 |
). |
0 | 1277 |
|
401 | 1278 |
sym := syms at:(aByte + 1). |
1279 |
sym isNil ifTrue:[ |
|
1280 |
extra := nil. |
|
1281 |
hasLineNo := nil. |
|
1282 |
] ifFalse:[ |
|
1283 |
extra := extras at:(aByte + 1). |
|
1284 |
hasLineNo := lnos at:(aByte + 1). |
|
1285 |
]. |
|
3168 | 1286 |
^ sym. |
164 | 1287 |
|
2751 | 1288 |
"Modified: / 02-09-1995 / 00:12:11 / claus" |
2753 | 1289 |
"Modified: / 25-10-2011 / 21:58:24 / cg" |
3106
119f0ff4b41d
Fixed Decompiler: correctly show LINE16 pseudo insn...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2753
diff
changeset
|
1290 |
"Modified: / 12-04-2013 / 01:31:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 1291 |
! ! |
217 | 1292 |
|
378 | 1293 |
!Decompiler class methodsFor:'documentation'! |
217 | 1294 |
|
1295 |
version |
|
3168 | 1296 |
^ '$Header: /cvs/stx/stx/libcomp/Decompiler.st,v 1.49 2013-05-10 15:31:06 stefan Exp $' |
2423 | 1297 |
! |
1298 |
||
1299 |
version_CVS |
|
3168 | 1300 |
^ '$Header: /cvs/stx/stx/libcomp/Decompiler.st,v 1.49 2013-05-10 15:31:06 stefan Exp $' |
217 | 1301 |
! ! |
3106
119f0ff4b41d
Fixed Decompiler: correctly show LINE16 pseudo insn...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2753
diff
changeset
|
1302 |