2151
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
3 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
4 |
SWING Research Group, Czech Technical University in Prague
|
|
5 |
|
|
6 |
Parts of the code written by Claus Gittinger are under following
|
|
7 |
license:
|
|
8 |
|
|
9 |
This software is furnished under a license and may be used
|
|
10 |
only in accordance with the terms of that license and with the
|
|
11 |
inclusion of the above copyright notice. This software may not
|
|
12 |
be provided or otherwise made available to, or used by, any
|
|
13 |
other person. No title to or ownership of the software is
|
|
14 |
hereby transferred.
|
|
15 |
|
|
16 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
|
|
17 |
|
|
18 |
Permission is hereby granted, free of charge, to any person
|
|
19 |
obtaining a copy of this software and associated documentation
|
|
20 |
files (the 'Software'), to deal in the Software without
|
|
21 |
restriction, including without limitation the rights to use,
|
|
22 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
23 |
copies of the Software, and to permit persons to whom the
|
|
24 |
Software is furnished to do so, subject to the following
|
|
25 |
conditions:
|
|
26 |
|
|
27 |
The above copyright notice and this permission notice shall be
|
|
28 |
included in all copies or substantial portions of the Software.
|
|
29 |
|
|
30 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
31 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
32 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
33 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
34 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
35 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
36 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
37 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
38 |
|
|
39 |
[1] Code written at SWING Research Group contain a signature
|
|
40 |
of one of the above copright owners.
|
|
41 |
"
|
713
|
42 |
"{ Package: 'stx:libjava' }"
|
|
43 |
|
621
|
44 |
JavaDecompiler subclass:#JavaByteCodeEnumerator
|
|
45 |
instanceVariableNames:'literalAction'
|
|
46 |
classVariableNames:''
|
|
47 |
poolDictionaries:''
|
713
|
48 |
category:'Languages-Java-Support-Decompiling'
|
621
|
49 |
!
|
|
50 |
|
2151
|
51 |
!JavaByteCodeEnumerator class methodsFor:'documentation'!
|
|
52 |
|
|
53 |
copyright
|
|
54 |
"
|
|
55 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
56 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
57 |
SWING Research Group, Czech Technical University in Prague
|
|
58 |
|
|
59 |
Parts of the code written by Claus Gittinger are under following
|
|
60 |
license:
|
|
61 |
|
|
62 |
This software is furnished under a license and may be used
|
|
63 |
only in accordance with the terms of that license and with the
|
|
64 |
inclusion of the above copyright notice. This software may not
|
|
65 |
be provided or otherwise made available to, or used by, any
|
|
66 |
other person. No title to or ownership of the software is
|
|
67 |
hereby transferred.
|
|
68 |
|
|
69 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
|
|
70 |
|
|
71 |
Permission is hereby granted, free of charge, to any person
|
|
72 |
obtaining a copy of this software and associated documentation
|
|
73 |
files (the 'Software'), to deal in the Software without
|
|
74 |
restriction, including without limitation the rights to use,
|
|
75 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
76 |
copies of the Software, and to permit persons to whom the
|
|
77 |
Software is furnished to do so, subject to the following
|
|
78 |
conditions:
|
|
79 |
|
|
80 |
The above copyright notice and this permission notice shall be
|
|
81 |
included in all copies or substantial portions of the Software.
|
|
82 |
|
|
83 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
84 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
85 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
86 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
87 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
88 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
89 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
90 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
91 |
|
|
92 |
[1] Code written at SWING Research Group contain a signature
|
|
93 |
of one of the above copright owners.
|
|
94 |
|
|
95 |
"
|
|
96 |
! !
|
621
|
97 |
|
|
98 |
!JavaByteCodeEnumerator methodsFor:'accessing'!
|
|
99 |
|
|
100 |
literalAction
|
|
101 |
"return the value of the instance variable 'literalAction' (automatically generated)"
|
|
102 |
|
|
103 |
^ literalAction
|
|
104 |
|
|
105 |
"Created: / 9.11.1999 / 15:27:37 / cg"
|
|
106 |
!
|
|
107 |
|
|
108 |
literalAction:something
|
|
109 |
"set the value of the instance variable 'literalAction' (automatically generated)"
|
|
110 |
|
|
111 |
literalAction := something.
|
|
112 |
|
|
113 |
"Created: / 9.11.1999 / 15:27:37 / cg"
|
|
114 |
! !
|
|
115 |
|
|
116 |
!JavaByteCodeEnumerator methodsFor:'operand decoding'!
|
|
117 |
|
|
118 |
constIndexByte
|
|
119 |
lastConstIndex := code at:pc.
|
|
120 |
pc := pc + 1.
|
|
121 |
|
|
122 |
lastConstant := javaMethod constantPool at:lastConstIndex ifAbsent:nil.
|
|
123 |
literalAction notNil ifTrue:[
|
|
124 |
literalAction value:pc-2 value:lastConstIndex value:lastConstant
|
|
125 |
].
|
|
126 |
|
|
127 |
"Created: / 9.11.1999 / 15:26:42 / cg"
|
|
128 |
"Modified: / 9.11.1999 / 15:29:24 / cg"
|
|
129 |
!
|
|
130 |
|
|
131 |
constIndexShort
|
|
132 |
lastConstIndex := code wordAt:pc MSB:true.
|
|
133 |
pc := pc + 2.
|
|
134 |
|
|
135 |
lastConstant := javaMethod constantPool at:lastConstIndex ifAbsent:nil.
|
|
136 |
|
|
137 |
literalAction notNil ifTrue:[
|
|
138 |
literalAction value:pc-3 value:lastConstIndex value:lastConstant
|
|
139 |
].
|
|
140 |
|
|
141 |
"Created: / 9.11.1999 / 15:27:32 / cg"
|
|
142 |
"Modified: / 9.11.1999 / 15:29:31 / cg"
|
|
143 |
! !
|
|
144 |
|
|
145 |
!JavaByteCodeEnumerator methodsFor:'processing'!
|
|
146 |
|
|
147 |
instructionHookPC:pc op:op spec:spec
|
|
148 |
"/ self halt.
|
|
149 |
|
|
150 |
"Created: / 9.11.1999 / 15:35:39 / cg"
|
625
|
151 |
"Modified: / 9.11.1999 / 17:21:18 / cg"
|
|
152 |
!
|
|
153 |
|
|
154 |
remember_invokeinterface
|
|
155 |
"/ self halt.
|
|
156 |
|
|
157 |
"Created: / 9.11.1999 / 17:20:58 / cg"
|
|
158 |
"Modified: / 9.11.1999 / 17:22:04 / cg"
|
|
159 |
!
|
|
160 |
|
|
161 |
remember_invokenonvirtual
|
|
162 |
"/ self halt.
|
|
163 |
|
|
164 |
"Created: / 9.11.1999 / 17:21:06 / cg"
|
|
165 |
"Modified: / 9.11.1999 / 17:21:51 / cg"
|
|
166 |
!
|
|
167 |
|
|
168 |
remember_invokestatic
|
|
169 |
"/ self halt.
|
|
170 |
|
|
171 |
"Modified: / 9.11.1999 / 17:22:00 / cg"
|
|
172 |
"Created: / 9.11.1999 / 17:22:14 / cg"
|
|
173 |
!
|
|
174 |
|
|
175 |
remember_invokevirtual
|
|
176 |
"/ self halt.
|
|
177 |
|
|
178 |
"Created: / 9.11.1999 / 17:21:08 / cg"
|
|
179 |
"Modified: / 9.11.1999 / 17:22:00 / cg"
|
621
|
180 |
! !
|
|
181 |
|
|
182 |
!JavaByteCodeEnumerator class methodsFor:'documentation'!
|
|
183 |
|
|
184 |
version
|
2151
|
185 |
^ '$Id: JavaByteCodeEnumerator.st,v 1.4 2011-08-18 18:42:48 vrany Exp $'
|
|
186 |
!
|
|
187 |
|
|
188 |
version_SVN
|
|
189 |
^ '$Id: JavaByteCodeEnumerator.st,v 1.4 2011-08-18 18:42:48 vrany Exp $'
|
2108
|
190 |
! !
|