author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 04 Aug 2014 16:13:14 +0100 | |
changeset 3196 | d617b4590431 |
parent 3083 | ccde6af7278c |
child 3228 | a35cc585bb5a |
permissions | -rw-r--r-- |
454 | 1 |
" |
2151 | 2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
454 | 3 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
4 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
5 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
7 |
SWING Research Group, Czech Technical University in Prague |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
8 |
|
454 | 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. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
15 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
16 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
17 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
18 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
19 |
as of 1.9.2010 |
2151 | 20 |
" |
680 | 21 |
"{ Package: 'stx:libjava' }" |
22 |
||
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
23 |
Context variableSubclass:#JavaContext |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
24 |
instanceVariableNames:'exArg exPC byteCode constPool acqrMonitors' |
28 | 25 |
classVariableNames:'' |
26 |
poolDictionaries:'' |
|
713 | 27 |
category:'Languages-Java-Support' |
28 | 28 |
! |
29 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
30 |
Object subclass:#FinallyToken |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
31 |
instanceVariableNames:'context exception selector value' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
32 |
classVariableNames:'' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
33 |
poolDictionaries:'' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
34 |
privateIn:JavaContext |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
35 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
36 |
|
454 | 37 |
!JavaContext class methodsFor:'documentation'! |
38 |
||
39 |
copyright |
|
40 |
" |
|
2151 | 41 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
454 | 42 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
43 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
44 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
45 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
46 |
SWING Research Group, Czech Technical University in Prague |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
47 |
|
454 | 48 |
This software is furnished under a license and may be used |
49 |
only in accordance with the terms of that license and with the |
|
50 |
inclusion of the above copyright notice. This software may not |
|
51 |
be provided or otherwise made available to, or used by, any |
|
52 |
other person. No title to or ownership of the software is |
|
53 |
hereby transferred. |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
54 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
55 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
56 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
57 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
58 |
as of 1.9.2010 |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
59 |
|
2151 | 60 |
" |
61 |
! ! |
|
62 |
||
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
63 |
!JavaContext class methodsFor:'accessing'! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
64 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
65 |
finallyTokenClass |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
66 |
^FinallyToken |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
67 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
68 |
"Created: / 18-04-2013 / 23:46:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
69 |
! ! |
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
70 |
|
2151 | 71 |
!JavaContext methodsFor:'* As yet uncategorized *'! |
72 |
||
73 |
markForException |
|
74 |
"set the exception handler flag in the receiver. |
|
75 |
The JVM needs this to enter an exception handler instead of restarting |
|
76 |
from the beginning (when the context is restarted). |
|
77 |
- a highly internal mechanism and not for public use." |
|
78 |
" |
|
79 |
%{ /* NOCONTEXT */ |
|
80 |
#ifdef __JAVA_EX_PEND |
|
81 |
/* actually no longer - only a non-nil exPC is now used as marker */ |
|
82 |
__INST(flags) = (OBJ)((INT)__INST(flags) | __MASKSMALLINT(__JAVA_EX_PEND)); |
|
83 |
#endif |
|
84 |
%} |
|
454 | 85 |
" |
86 |
||
2151 | 87 |
"Modified: / 13-12-1995 / 19:05:22 / cg" |
88 |
"Modified: / 25-10-2010 / 17:19:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
89 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
90 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
91 |
shouldExecuteFinallyOnUnwind |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
92 |
"Return true, if a finally block should be executed |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
93 |
upon force unwind" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
94 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
95 |
| m pc | |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
96 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
97 |
m := self method. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
98 |
pc := self pc. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
99 |
self assert: m notNil. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
100 |
m hasFinally ifFalse:[ ^ false ]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
101 |
^(method handlerFor: nil at: pc) notNil. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
102 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
103 |
"Created: / 10-04-2012 / 11:09:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
454 | 104 |
! ! |
28 | 105 |
|
106 |
!JavaContext methodsFor:'ST context mimicri'! |
|
107 |
||
261 | 108 |
arg1Index |
109 |
"the java stack contains the receiver in a non-static |
|
110 |
method, as slot 0. Therefore, the first arg is found at slot2 |
|
111 |
if this is for a non-static method" |
|
252 | 112 |
|
113 |
self method isStatic ifTrue:[ |
|
261 | 114 |
^ 1 |
252 | 115 |
]. |
261 | 116 |
^ 2 |
117 |
! |
|
118 |
||
119 |
argAt:n |
|
120 |
"return the i'th argument (1..nArgs)" |
|
121 |
||
122 |
^ self at:(self arg1Index - 1 + n) |
|
252 | 123 |
|
124 |
"Created: / 2.1.1998 / 17:54:13 / cg" |
|
125 |
"Modified: / 2.1.1998 / 21:39:30 / cg" |
|
126 |
! |
|
117 | 127 |
|
252 | 128 |
argAt:n put:value |
261 | 129 |
"change the i'th argument (1..nArgs)" |
216 | 130 |
|
261 | 131 |
^ super argAt:(self arg1Index - 1 + n) put:value |
252 | 132 |
|
133 |
"Created: / 2.1.1998 / 17:54:34 / cg" |
|
134 |
"Modified: / 2.1.1998 / 21:35:19 / cg" |
|
135 |
! |
|
136 |
||
137 |
args |
|
138 |
"return an array filled with the arguments of this context" |
|
139 |
||
261 | 140 |
|n| |
28 | 141 |
|
252 | 142 |
n := self numArgs. |
143 |
n == 0 ifTrue:[ |
|
261 | 144 |
"/ little optimization here - avoid creating empty containers |
255 | 145 |
^ #() |
252 | 146 |
]. |
147 |
||
261 | 148 |
^ (Array new:n) replaceFrom:1 to:n with:self startingAt:(self arg1Index). |
252 | 149 |
|
150 |
"Created: / 2.1.1998 / 17:54:57 / cg" |
|
151 |
"Modified: / 2.1.1998 / 21:34:44 / cg" |
|
152 |
! |
|
153 |
||
154 |
lineNumber |
|
155 |
|nr pc| |
|
156 | 156 |
|
252 | 157 |
pc := self pc. |
43 | 158 |
|
211 | 159 |
"/ 'ask line for pc:' print. pc printCR. |
255 | 160 |
pc isNil ifTrue:[ |
363 | 161 |
nr := self lineNumberFromMethod. |
162 |
nr notNil ifTrue:[ |
|
163 |
^ nr |
|
164 |
]. |
|
2150 | 165 |
" '-> 0 [a]' printCR. " |
363 | 166 |
^0 |
255 | 167 |
]. |
43 | 168 |
|
252 | 169 |
nr := self method lineNumberForPC:pc. |
255 | 170 |
nr isNil ifTrue:[ |
363 | 171 |
nr := self lineNumberFromMethod. |
172 |
nr notNil ifTrue:[ |
|
173 |
^ nr |
|
174 |
]. |
|
2150 | 175 |
" '-> 0 [b]' printCR. " |
363 | 176 |
^ 0 |
255 | 177 |
]. |
211 | 178 |
"/ '-> ' print. nr printCR. |
210 | 179 |
^ nr. |
28 | 180 |
|
252 | 181 |
"Created: / 1.5.1996 / 15:05:47 / cg" |
261 | 182 |
"Modified: / 15.1.1998 / 15:25:29 / cg" |
28 | 183 |
! |
184 |
||
252 | 185 |
lineNumberFromMethod |
186 |
|m| |
|
187 |
||
188 |
m := self method. |
|
189 |
m notNil ifTrue:[ |
|
255 | 190 |
^ m lineNumber |
252 | 191 |
]. |
192 |
^ nil |
|
28 | 193 |
|
252 | 194 |
"Created: / 4.1.1998 / 23:34:45 / cg" |
195 |
"Modified: / 4.1.1998 / 23:35:55 / cg" |
|
196 |
! |
|
197 |
||
198 |
method |
|
199 |
"the method may be found in the interpreter temps ..." |
|
200 |
||
614 | 201 |
method isJavaMethod ifTrue:[^ method]. |
252 | 202 |
^ super method |
203 |
||
204 |
"Created: / 1.5.1996 / 15:03:43 / cg" |
|
614 | 205 |
"Modified: / 25.9.1999 / 23:26:40 / cg" |
28 | 206 |
! |
207 |
||
208 |
numArgs |
|
252 | 209 |
"return the number of args. |
210 |
Redefined since Java keeps the receiver of a non-static method |
|
261 | 211 |
at local slot 1." |
28 | 212 |
|
252 | 213 |
|n| |
198 | 214 |
|
252 | 215 |
n := super numArgs. |
216 |
self method isStatic ifFalse:[ |
|
255 | 217 |
n := n - 1 |
252 | 218 |
]. |
219 |
^ n |
|
28 | 220 |
|
252 | 221 |
"Created: / 2.1.1998 / 22:21:24 / cg" |
28 | 222 |
! |
223 |
||
261 | 224 |
numTemps |
225 |
"return the number of temporary variables of the Method. |
|
226 |
Redefined since Java keeps the receiver of a non-static method |
|
227 |
at local slot 1." |
|
228 |
||
229 |
|n| |
|
230 |
||
231 |
n := self size - super numVars - super numArgs. |
|
232 |
^ n |
|
233 |
||
234 |
"Created: / 13.1.1998 / 16:52:32 / cg" |
|
235 |
"Modified: / 13.1.1998 / 17:23:27 / cg" |
|
236 |
! |
|
237 |
||
32 | 238 |
pc |
252 | 239 |
lineNr isNil ifTrue:[^ nil]. |
429 | 240 |
^ lineNr bitAnd:16rFFFF |
28 | 241 |
|
252 | 242 |
"Created: / 4.1.1998 / 23:33:48 / cg" |
429 | 243 |
"Modified: / 10.11.1998 / 13:20:12 / cg" |
244 |
! |
|
245 |
||
252 | 246 |
selector |
247 |
"the selector can be extracted from the method. |
|
248 |
the method may be found in the interpreter temps ..." |
|
249 |
||
250 |
|s m| |
|
251 |
||
252 |
selector isNil ifTrue:[ |
|
253 |
m := self method. |
|
254 |
m notNil ifTrue:[ |
|
255 |
^ m name |
|
256 |
] |
|
257 |
]. |
|
258 |
^ super selector |
|
259 |
||
260 |
"Modified: / 30.12.1997 / 17:22:06 / cg" |
|
261 |
"Created: / 30.12.1997 / 17:23:47 / cg" |
|
125 | 262 |
! |
263 |
||
252 | 264 |
setPC:newPC |
265 |
lineNr := newPC |
|
266 |
||
267 |
"Created: / 5.1.1998 / 00:09:02 / cg" |
|
261 | 268 |
! |
269 |
||
270 |
temporaries |
|
271 |
"return an array filled with the arguments and variables of this context" |
|
272 |
||
273 |
|n nSkipped| |
|
274 |
||
275 |
"/ the flas-numVars includes the receiver and args |
|
276 |
nSkipped := super numVars "self numArgs + self numVars". |
|
277 |
"/ but my context setup is args+numvars. |
|
278 |
nSkipped := super numArgs + super numVars. |
|
279 |
||
280 |
n := self size - nSkipped. |
|
281 |
n == 0 ifTrue:[ |
|
363 | 282 |
"/ little optimization here - avaoid creating empty containers |
283 |
^ #() |
|
261 | 284 |
]. |
285 |
||
286 |
^ (Array new:n) replaceFrom:1 to:n with:self startingAt:nSkipped+1. |
|
287 |
||
288 |
"Created: / 13.1.1998 / 15:44:12 / cg" |
|
289 |
"Modified: / 13.1.1998 / 17:22:54 / cg" |
|
290 |
! |
|
291 |
||
2150 | 292 |
vars |
261 | 293 |
"return an array filled with the local variables of this context" |
294 |
||
295 |
|nonVars mySize| |
|
296 |
||
297 |
mySize := self numVars. |
|
298 |
mySize == 0 ifTrue:[ |
|
363 | 299 |
"/ little optimization here - avaoid creating empty containers |
300 |
^ #() |
|
261 | 301 |
]. |
302 |
nonVars := (self arg1Index-1) + self numArgs. |
|
303 |
^ (Array new:mySize) replaceFrom:1 to:mySize with:self startingAt:nonVars+1 |
|
304 |
||
305 |
"Created: / 13.1.1998 / 16:48:16 / cg" |
|
252 | 306 |
! ! |
307 |
||
2151 | 308 |
!JavaContext methodsFor:'accessing'! |
309 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
310 |
acquiredMonitors |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
311 |
^acqrMonitors |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
312 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
313 |
"Created: / 08-11-2011 / 12:23:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
314 |
"Modified (format): / 27-08-2012 / 16:46:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
315 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
316 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
317 |
acquiredMonitorsDo: aBlock |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
318 |
"/ acqrMonitors isNil ifTrue: [ ^self ]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
319 |
"/ acqrMonitors copy reverseDo: aBlock. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
320 |
aBlock value: self receiver. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
321 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
322 |
"Created: / 08-11-2011 / 15:03:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
323 |
"Modified: / 26-08-2012 / 19:28:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
324 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
325 |
|
3196
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3083
diff
changeset
|
326 |
addMonitor:mon |
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3083
diff
changeset
|
327 |
self assert:(acqrMonitors isNil or:[ acqrMonitors isOrderedCollection ]). |
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3083
diff
changeset
|
328 |
acqrMonitors isNil ifTrue:[ |
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3083
diff
changeset
|
329 |
acqrMonitors := Stack new |
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3083
diff
changeset
|
330 |
]. |
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3083
diff
changeset
|
331 |
acqrMonitors push:mon. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
332 |
self markForUnwind. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
333 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
334 |
"Created: / 08-11-2011 / 14:19:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
335 |
"Modified: / 17-11-2011 / 19:13:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
3196
d617b4590431
(Class reading) optimization [2/4]: rewrite slow ifNil:... by faster isNil ifTrue:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3083
diff
changeset
|
336 |
"Modified: / 04-08-2014 / 15:54:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
337 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
338 |
|
2902
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2887
diff
changeset
|
339 |
argsAndVars |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2887
diff
changeset
|
340 |
"return an array filled with the arguments and variables of this context" |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2887
diff
changeset
|
341 |
|
3083 | 342 |
|rawArgsAndVars| |
343 |
||
344 |
rawArgsAndVars := self method originalMethodIfWrapped methodArgAndVarValuesInContext: self. |
|
345 |
self method isStatic ifFalse:[^ rawArgsAndVars copyFrom:2]. |
|
346 |
^ rawArgsAndVars |
|
2902
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2887
diff
changeset
|
347 |
|
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2887
diff
changeset
|
348 |
"Created: / 04-11-2013 / 18:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2887
diff
changeset
|
349 |
! |
b7070e447ed0
Fixes for displaying local variables in debugger.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2887
diff
changeset
|
350 |
|
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
351 |
methodFromClass |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
352 |
"Return the up-to-date method. Actyally, it fetches the method |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
353 |
from receiver's class" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
354 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
355 |
|c sender sendersSelector m| |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
356 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
357 |
"mhmh - maybe I am a context for an unbound method (as generated by doIt); |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
358 |
look in the sender's context. Consider this a kludge. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
359 |
Future versions of ST/X's message lookup may store the method in |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
360 |
the context. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
361 |
" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
362 |
sender := self sender. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
363 |
sender notNil ifTrue:[ |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
364 |
sendersSelector := sender selector. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
365 |
sendersSelector notNil ifTrue:[ |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
366 |
(sendersSelector startsWith:'valueWithReceiver:') ifTrue:[ |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
367 |
m := sender receiver. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
368 |
m isMethod ifTrue:[ |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
369 |
method := m. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
370 |
^ m |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
371 |
] |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
372 |
] |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
373 |
] |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
374 |
]. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
375 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
376 |
c := self searchClass. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
377 |
" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
378 |
the below cannot happen in normal circumstances |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
379 |
(added to avoid recursive errors in case of a broken sender chain) |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
380 |
" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
381 |
c isBehavior ifFalse:[ |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
382 |
'Context [error]: non class in searchClass' errorPrintCR. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
383 |
' selector: ' errorPrint. selector errorPrint. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
384 |
' receiver: ' errorPrint. receiver errorPrintCR. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
385 |
^ nil |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
386 |
]. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
387 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
388 |
c := c whichClassIncludesSelector:selector. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
389 |
c notNil ifTrue:[ |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
390 |
method := c compiledMethodAt:selector. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
391 |
^ method |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
392 |
]. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
393 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
394 |
^ nil |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
395 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
396 |
"Created: / 09-08-2013 / 02:25:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
397 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
398 |
|
2151 | 399 |
programmingLanguage |
400 |
||
401 |
^JavaLanguage instance |
|
402 |
||
403 |
"Created: / 17-03-2011 / 10:17:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
404 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
405 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
406 |
removeMonitor: mon |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
407 |
| poppedObject | |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
408 |
acqrMonitors isNil ifTrue: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
409 |
Logger |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
410 |
log: ('removeMonitor: called but no monitors in acqrMonitors (%1)' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
411 |
bindWith: self) |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
412 |
severity: #warn |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
413 |
facility: #JVM. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
414 |
self breakPoint: #mh. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
415 |
^ self. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
416 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
417 |
poppedObject := acqrMonitors top. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
418 |
self assert: (poppedObject == mon). |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
419 |
acqrMonitors remove: mon |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
420 |
ifAbsent: [ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
421 |
Logger |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
422 |
log: ('removeMonitor: called but no such monitor in acqrMonitors (%1)' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
423 |
bindWith: self) |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
424 |
severity: #warn |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
425 |
facility: #JVM. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
426 |
self breakPoint: #mh. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
427 |
^ self. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
428 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
429 |
acqrMonitors isEmpty ifTrue: [self unmarkForUnwind]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
430 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
431 |
"Created: / 08-11-2011 / 14:19:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
432 |
"Modified: / 08-11-2011 / 21:39:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
433 |
"Modified: / 17-11-2011 / 19:14:29 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
2151 | 434 |
! ! |
435 |
||
252 | 436 |
!JavaContext methodsFor:'exception handler support'! |
117 | 437 |
|
255 | 438 |
exceptionArg:aJavaException |
511 | 439 |
exArg := aJavaException. |
440 |
||
441 |
"Created: / 7.1.1998 / 21:36:56 / cg" |
|
442 |
! |
|
443 |
||
444 |
exceptionArg:aJavaException pc:newPc |
|
445 |
exArg := aJavaException. |
|
446 |
exPC := newPc. |
|
255 | 447 |
|
448 |
"Created: / 7.1.1998 / 21:36:56 / cg" |
|
28 | 449 |
! ! |
450 |
||
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
451 |
!JavaContext methodsFor:'non local control flow'! |
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
452 |
|
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
453 |
restart |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
454 |
"Update the bytecode before restarting so |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
455 |
bytecode interpreter can execute new code, if any" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
456 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
457 |
| m | |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
458 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
459 |
m := self methodFromClass. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
460 |
m notNil ifTrue:[ |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
461 |
byteCode := m byteCode. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
462 |
constPool := m constantPool. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
463 |
]. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
464 |
^super restart. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
465 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
466 |
"Created: / 19-04-2013 / 13:33:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
467 |
"Modified: / 09-08-2013 / 02:33:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
468 |
! |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
469 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
470 |
return |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
471 |
selector last == $V ifTrue:[ ^ self return:nil ]. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
472 |
selector last == $; ifTrue:[ ^ self return:nil ]. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
473 |
selector last == $D ifTrue:[ ^ self return:0.0 ]. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
474 |
selector last == $F ifTrue:[ ^ self return:0.0 asShortFloat ]. |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
475 |
^self return: 0 |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
476 |
|
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
477 |
"Created: / 18-04-2013 / 23:52:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
478 |
! |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
479 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
480 |
unwindAndRestartForJavaException |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
481 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
482 |
"Called by JavaVM>>throwException: unwinds the stack |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
483 |
up to this context and restarts it so an exception handler |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
484 |
executes" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
485 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
486 |
| con wasMarked | |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
487 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
488 |
"Each context that has a monitor acquired has |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
489 |
and unwind action that release all monitors acquired. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
490 |
However, we DONT want my monitors to be released, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
491 |
so we temporarily unmark this context for unwind and |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
492 |
then mark it again, eventually" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
493 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
494 |
wasMarked := self isUnwindContext. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
495 |
wasMarked ifTrue:[self unmarkForUnwind]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
496 |
self senderIsNil ifFalse:[ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
497 |
con := thisContext evaluateUnwindActionsUpTo:self. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
498 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
499 |
wasMarked ifTrue:[self markForUnwind]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
500 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
501 |
"oops, if nil, I am not on the calling chain; |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
502 |
(bad bad, unwind action have already been performed. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
503 |
should we check for this situation first and NOT evaluate |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
504 |
the unwind actions in this case ?) |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
505 |
" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
506 |
con isNil ifTrue:[ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
507 |
" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
508 |
tried to return to a context which is already dead |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
509 |
(i.e. the method/block has already executed a return) |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
510 |
" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
511 |
^ self invalidReturnOrRestartError:#'unwindAndRestart:' with:nil |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
512 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
513 |
" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
514 |
now, that all unwind-actions are done, I can use the |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
515 |
low-level restart ... |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
516 |
" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
517 |
^ self restart |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
518 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
519 |
"Created: / 08-11-2011 / 22:00:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
520 |
! ! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
521 |
|
28 | 522 |
!JavaContext methodsFor:'printing & storing'! |
523 |
||
2729
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
524 |
printOn:aStream |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
525 |
"append a brief description (excl. arguments) of the receiver onto aStream" |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
526 |
|
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
527 |
self printReceiverOn:aStream. |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
528 |
"/ aStream nextPutAll:' '. |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
529 |
aStream nextPutAll:' >> '. |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
530 |
|
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
531 |
aStream bold. |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
532 |
self selector printOn:aStream. "show as string (as symbol looks too ugly in browser ...)" |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
533 |
"/ self selector storeOn:aStream. "show as symbol" |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
534 |
aStream normal. |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
535 |
aStream space. |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
536 |
(method notNil and:[method isWrapped]) ifTrue:[ |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
537 |
aStream nextPutAll:'(wrapped) ' |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
538 |
]. |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
539 |
aStream nextPutAll:' ['; nextPutAll:(self method lineNumberForPC0: lineNr) printString; nextPutAll:']' . |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
540 |
|
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
541 |
"Created: / 12-09-2013 / 23:02:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
542 |
! |
ac412f6ea6d4
More support for method's source display. Not yet working.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2726
diff
changeset
|
543 |
|
252 | 544 |
receiverPrintString |
2150 | 545 |
"return a string describing the receiver of the context" |
52 | 546 |
|
680 | 547 |
|receiverClass receiverClassName newString implementorClass searchClass| |
28 | 548 |
|
363 | 549 |
"/ %{ |
550 |
"/ /* |
|
551 |
"/ * special handling for (invalid) free objects. |
|
552 |
"/ * these only appear if some primitiveCode does not correctly use SEND macros, |
|
553 |
"/ * which may lead to sends to free objects. In normal operation, this 'cannot' happen. |
|
2150 | 554 |
"/ */ |
363 | 555 |
"/ if (__isNonNilObject(__INST(receiver)) && (__qClass(__INST(receiver))==nil)) { |
556 |
"/ receiverClassName = __MKSTRING("FreeObject"); |
|
557 |
"/ } |
|
558 |
"/ %}. |
|
680 | 559 |
"/ receiverClassName notNil ifTrue:[^ receiverClassName]. |
228 | 560 |
|
252 | 561 |
receiverClass := receiver class. |
680 | 562 |
"/ java has no class-methods ... |
563 |
receiverClass := receiverClass theNonMetaclass. |
|
564 |
||
565 |
receiverClassName := receiverClass nameInBrowser. |
|
252 | 566 |
(receiverClass == SmallInteger) ifTrue:[ |
2150 | 567 |
newString := '(' , receiver printString , ') ' , receiverClassName |
228 | 568 |
] ifFalse:[ |
2150 | 569 |
newString := receiverClassName |
228 | 570 |
]. |
571 |
||
252 | 572 |
" |
573 |
kludge to avoid slow search for containing class |
|
574 |
" |
|
575 |
(selector ~~ #doIt and:[selector ~~ #doIt:]) ifTrue:[ |
|
2150 | 576 |
implementorClass := self methodClass. |
252 | 577 |
]. |
578 |
implementorClass notNil ifTrue: [ |
|
2150 | 579 |
(implementorClass ~~ receiverClass) ifTrue: [ |
580 |
newString := newString , '>>>', |
|
581 |
implementorClass nameInBrowser printString |
|
582 |
] |
|
252 | 583 |
] ifFalse:[ |
2150 | 584 |
searchClass := self searchClass. |
585 |
searchClass ~~ receiverClass ifTrue:[ |
|
586 |
newString := newString , '>>>' , searchClass nameInBrowser |
|
587 |
]. |
|
252 | 588 |
"/ " |
589 |
"/ kludge for doIt - these unbound methods are not |
|
590 |
"/ found in the classes methodDictionary |
|
591 |
"/ " |
|
592 |
"/ (selector ~~ #doIt and:[selector ~~ #doIt:]) ifTrue:[ |
|
593 |
"/ newString := newString , '>>>**NONE**' |
|
594 |
"/ ] |
|
28 | 595 |
]. |
596 |
||
252 | 597 |
^ newString |
28 | 598 |
! ! |
599 |
||
343 | 600 |
!JavaContext methodsFor:'queries'! |
601 |
||
602 |
hasStackToShow |
|
603 |
"private interface to the debugger. |
|
604 |
Smalltalk contexts return false here - other language frames |
|
605 |
(i.e. Java frames) may want to show the evaluation stack" |
|
606 |
||
607 |
^ true |
|
608 |
||
609 |
"Modified: / 13.5.1997 / 16:31:12 / cg" |
|
610 |
"Created: / 7.5.1998 / 01:23:57 / cg" |
|
611 |
! |
|
612 |
||
346 | 613 |
isJavaContext |
614 |
"return true, if this is a javaContext." |
|
615 |
||
616 |
^ true |
|
617 |
||
618 |
"Created: / 8.5.1998 / 21:23:47 / cg" |
|
619 |
! |
|
620 |
||
343 | 621 |
stackFrame |
622 |
"private interface to the debugger." |
|
623 |
||
624 |
^ (1 to:self size) collect:[:i | self at:i] |
|
625 |
||
626 |
"Created: / 7.5.1998 / 01:26:19 / cg" |
|
627 |
! ! |
|
628 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
629 |
!JavaContext::FinallyToken methodsFor:'accessing'! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
630 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
631 |
context |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
632 |
^ context |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
633 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
634 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
635 |
context:something |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
636 |
context := something. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
637 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
638 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
639 |
exception |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
640 |
^ exception |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
641 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
642 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
643 |
exception:something |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
644 |
exception := something. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
645 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
646 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
647 |
selector |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
648 |
^ selector |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
649 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
650 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
651 |
selector:something |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
652 |
selector := something. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
653 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
654 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
655 |
value |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
656 |
^ value |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
657 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
658 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
659 |
value:something |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
660 |
value := something. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
661 |
! ! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
662 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
663 |
!JavaContext::FinallyToken methodsFor:'actions'! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
664 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
665 |
pass |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
666 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
667 |
selector == #return ifTrue:[ |
2841
6fa1bcf9c997
JavaClass>>#name vs. #binaryName refactoring
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
668 |
thisContext evaluateUnwindActionsUpTo:context. |
6fa1bcf9c997
JavaClass>>#name vs. #binaryName refactoring
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
669 |
context return |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
670 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
671 |
selector == #return: ifTrue:[ |
2841
6fa1bcf9c997
JavaClass>>#name vs. #binaryName refactoring
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
672 |
thisContext evaluateUnwindActionsUpTo:context. |
6fa1bcf9c997
JavaClass>>#name vs. #binaryName refactoring
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2732
diff
changeset
|
673 |
context return: value |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
674 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
675 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
676 |
self error:'Should never be reached'. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
677 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
678 |
"Created: / 04-04-2012 / 20:24:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2843
36f000314bcd
Fix in mixed exception handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2841
diff
changeset
|
679 |
"Modified: / 10-10-2013 / 10:13:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
680 |
! ! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
681 |
|
129 | 682 |
!JavaContext class methodsFor:'documentation'! |
28 | 683 |
|
684 |
version |
|
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
685 |
^ '$Header: /cvs/stx/stx/libjava/JavaContext.st,v 1.42 2013-09-06 00:41:22 vrany Exp $' |
2304
73806b718f4e
fixed: #version_SVN ($ to §)
Claus Gittinger <cg@exept.de>
parents:
2168
diff
changeset
|
686 |
! |
73806b718f4e
fixed: #version_SVN ($ to §)
Claus Gittinger <cg@exept.de>
parents:
2168
diff
changeset
|
687 |
|
73806b718f4e
fixed: #version_SVN ($ to §)
Claus Gittinger <cg@exept.de>
parents:
2168
diff
changeset
|
688 |
version_CVS |
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
689 |
^ '$Header: /cvs/stx/stx/libjava/JavaContext.st,v 1.42 2013-09-06 00:41:22 vrany Exp $' |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
690 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
691 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
692 |
version_HG |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
693 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
694 |
^ '$Changeset: <not expanded> $' |
2151 | 695 |
! |
696 |
||
697 |
version_SVN |
|
2731
13f5be2bf83b
Merged d87e89dd5276 and fe83a843a7bf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
698 |
^ 'Id' |
2108 | 699 |
! ! |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2304
diff
changeset
|
700 |