author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 16 Jan 2013 22:06:41 +0000 | |
branch | refactoring-vmdata |
changeset 1977 | 526315e0a801 |
parent 1914 | 6d0f663767ee |
child 2069 | 75d40b7b986f |
permissions | -rw-r--r-- |
752 | 1 |
" |
877 | 2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
1152 | 3 |
|
1155 | 4 |
New code and modifications done at SWING Research Group [1]: |
1152 | 5 |
|
877 | 6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
7 |
SWING Research Group, Czech Technical University in Prague |
|
8 |
||
752 | 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. |
|
877 | 15 |
|
1155 | 16 |
[1] Code written at SWING Research Group contains a signature |
17 |
of one of the above copright owners. For exact set of such code, |
|
18 |
see the differences between this version and version stx:libjava |
|
1152 | 19 |
as of 1.9.2010 |
752 | 20 |
" |
21 |
"{ Package: 'stx:libjava' }" |
|
22 |
||
23 |
Context variableSubclass:#JavaContext |
|
1093 | 24 |
instanceVariableNames:'exArg exPC byteCode constPool acqrMonitors' |
752 | 25 |
classVariableNames:'' |
26 |
poolDictionaries:'' |
|
27 |
category:'Languages-Java-Support' |
|
28 |
! |
|
29 |
||
1455 | 30 |
Object subclass:#FinallyToken |
31 |
instanceVariableNames:'context exception selector value' |
|
32 |
classVariableNames:'' |
|
33 |
poolDictionaries:'' |
|
34 |
privateIn:JavaContext |
|
35 |
! |
|
36 |
||
752 | 37 |
!JavaContext class methodsFor:'documentation'! |
38 |
||
39 |
copyright |
|
40 |
" |
|
877 | 41 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
1152 | 42 |
|
1155 | 43 |
New code and modifications done at SWING Research Group [1]: |
1152 | 44 |
|
877 | 45 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
46 |
SWING Research Group, Czech Technical University in Prague |
|
47 |
||
752 | 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. |
|
877 | 54 |
|
1155 | 55 |
[1] Code written at SWING Research Group contains a signature |
56 |
of one of the above copright owners. For exact set of such code, |
|
57 |
see the differences between this version and version stx:libjava |
|
1152 | 58 |
as of 1.9.2010 |
877 | 59 |
|
60 |
" |
|
752 | 61 |
! ! |
62 |
||
63 |
!JavaContext methodsFor:'* As yet uncategorized *'! |
|
64 |
||
65 |
markForException |
|
66 |
"set the exception handler flag in the receiver. |
|
67 |
The JVM needs this to enter an exception handler instead of restarting |
|
68 |
from the beginning (when the context is restarted). |
|
69 |
- a highly internal mechanism and not for public use." |
|
70 |
" |
|
71 |
%{ /* NOCONTEXT */ |
|
72 |
#ifdef __JAVA_EX_PEND |
|
73 |
/* actually no longer - only a non-nil exPC is now used as marker */ |
|
74 |
__INST(flags) = (OBJ)((INT)__INST(flags) | __MASKSMALLINT(__JAVA_EX_PEND)); |
|
75 |
#endif |
|
76 |
%} |
|
77 |
" |
|
78 |
||
79 |
"Modified: / 13-12-1995 / 19:05:22 / cg" |
|
80 |
"Modified: / 25-10-2010 / 17:19:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1461 | 81 |
! |
82 |
||
83 |
shouldExecuteFinallyOnUnwind |
|
84 |
"Return true, if a finally block should be executed |
|
85 |
upon force unwind" |
|
86 |
||
87 |
| m pc | |
|
88 |
||
89 |
m := self method. |
|
90 |
pc := self pc. |
|
91 |
self assert: m notNil. |
|
92 |
m hasFinally ifFalse:[ ^ false ]. |
|
93 |
^(method handlerFor: nil at: pc) notNil. |
|
94 |
||
95 |
"Created: / 10-04-2012 / 11:09:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
752 | 96 |
! ! |
97 |
||
98 |
!JavaContext methodsFor:'ST context mimicri'! |
|
99 |
||
100 |
arg1Index |
|
101 |
"the java stack contains the receiver in a non-static |
|
102 |
method, as slot 0. Therefore, the first arg is found at slot2 |
|
103 |
if this is for a non-static method" |
|
104 |
||
105 |
self method isStatic ifTrue:[ |
|
106 |
^ 1 |
|
107 |
]. |
|
108 |
^ 2 |
|
109 |
! |
|
110 |
||
111 |
argAt:n |
|
112 |
"return the i'th argument (1..nArgs)" |
|
113 |
||
114 |
^ self at:(self arg1Index - 1 + n) |
|
115 |
||
116 |
"Created: / 2.1.1998 / 17:54:13 / cg" |
|
117 |
"Modified: / 2.1.1998 / 21:39:30 / cg" |
|
118 |
! |
|
119 |
||
120 |
argAt:n put:value |
|
121 |
"change the i'th argument (1..nArgs)" |
|
122 |
||
123 |
^ super argAt:(self arg1Index - 1 + n) put:value |
|
124 |
||
125 |
"Created: / 2.1.1998 / 17:54:34 / cg" |
|
126 |
"Modified: / 2.1.1998 / 21:35:19 / cg" |
|
127 |
! |
|
128 |
||
129 |
args |
|
130 |
"return an array filled with the arguments of this context" |
|
131 |
||
132 |
|n| |
|
133 |
||
134 |
n := self numArgs. |
|
135 |
n == 0 ifTrue:[ |
|
136 |
"/ little optimization here - avoid creating empty containers |
|
137 |
^ #() |
|
138 |
]. |
|
139 |
||
140 |
^ (Array new:n) replaceFrom:1 to:n with:self startingAt:(self arg1Index). |
|
141 |
||
142 |
"Created: / 2.1.1998 / 17:54:57 / cg" |
|
143 |
"Modified: / 2.1.1998 / 21:34:44 / cg" |
|
144 |
! |
|
145 |
||
146 |
argsAndVars |
|
147 |
"return an array filled with the arguments and variables of this context" |
|
148 |
||
149 |
|n| |
|
150 |
||
151 |
n := self numArgs + self numVars. |
|
152 |
n == 0 ifTrue:[ |
|
153 |
"/ little optimization here - avoid creating empty containers |
|
154 |
^ #() |
|
155 |
]. |
|
156 |
^ (Array new:n) replaceFrom:1 to:n with:self startingAt:(self arg1Index). |
|
157 |
||
158 |
"Created: / 2.1.1998 / 17:55:14 / cg" |
|
159 |
"Modified: / 13.1.1998 / 15:44:56 / cg" |
|
160 |
! |
|
161 |
||
162 |
lineNumber |
|
163 |
|nr pc| |
|
164 |
||
165 |
pc := self pc. |
|
166 |
||
167 |
"/ 'ask line for pc:' print. pc printCR. |
|
168 |
pc isNil ifTrue:[ |
|
169 |
nr := self lineNumberFromMethod. |
|
170 |
nr notNil ifTrue:[ |
|
171 |
^ nr |
|
172 |
]. |
|
173 |
" '-> 0 [a]' printCR. " |
|
174 |
^0 |
|
175 |
]. |
|
176 |
||
177 |
nr := self method lineNumberForPC:pc. |
|
178 |
nr isNil ifTrue:[ |
|
179 |
nr := self lineNumberFromMethod. |
|
180 |
nr notNil ifTrue:[ |
|
181 |
^ nr |
|
182 |
]. |
|
183 |
" '-> 0 [b]' printCR. " |
|
184 |
^ 0 |
|
185 |
]. |
|
186 |
"/ '-> ' print. nr printCR. |
|
187 |
^ nr. |
|
188 |
||
189 |
"Created: / 1.5.1996 / 15:05:47 / cg" |
|
190 |
"Modified: / 15.1.1998 / 15:25:29 / cg" |
|
191 |
! |
|
192 |
||
193 |
lineNumberFromMethod |
|
194 |
|m| |
|
195 |
||
196 |
m := self method. |
|
197 |
m notNil ifTrue:[ |
|
198 |
^ m lineNumber |
|
199 |
]. |
|
200 |
^ nil |
|
201 |
||
202 |
"Created: / 4.1.1998 / 23:34:45 / cg" |
|
203 |
"Modified: / 4.1.1998 / 23:35:55 / cg" |
|
204 |
! |
|
205 |
||
206 |
method |
|
207 |
"the method may be found in the interpreter temps ..." |
|
208 |
||
209 |
method isJavaMethod ifTrue:[^ method]. |
|
210 |
^ super method |
|
211 |
||
212 |
"Created: / 1.5.1996 / 15:03:43 / cg" |
|
213 |
"Modified: / 25.9.1999 / 23:26:40 / cg" |
|
214 |
! |
|
215 |
||
216 |
numArgs |
|
217 |
"return the number of args. |
|
218 |
Redefined since Java keeps the receiver of a non-static method |
|
219 |
at local slot 1." |
|
220 |
||
221 |
|n| |
|
222 |
||
223 |
n := super numArgs. |
|
224 |
self method isStatic ifFalse:[ |
|
225 |
n := n - 1 |
|
226 |
]. |
|
227 |
^ n |
|
228 |
||
229 |
"Created: / 2.1.1998 / 22:21:24 / cg" |
|
230 |
! |
|
231 |
||
232 |
numTemps |
|
233 |
"return the number of temporary variables of the Method. |
|
234 |
Redefined since Java keeps the receiver of a non-static method |
|
235 |
at local slot 1." |
|
236 |
||
237 |
|n| |
|
238 |
||
239 |
n := self size - super numVars - super numArgs. |
|
240 |
^ n |
|
241 |
||
242 |
"Created: / 13.1.1998 / 16:52:32 / cg" |
|
243 |
"Modified: / 13.1.1998 / 17:23:27 / cg" |
|
244 |
! |
|
245 |
||
246 |
pc |
|
247 |
lineNr isNil ifTrue:[^ nil]. |
|
248 |
^ lineNr bitAnd:16rFFFF |
|
249 |
||
250 |
"Created: / 4.1.1998 / 23:33:48 / cg" |
|
251 |
"Modified: / 10.11.1998 / 13:20:12 / cg" |
|
252 |
! |
|
253 |
||
254 |
quickLineNumber |
|
255 |
"the lineNumber - without decompiling" |
|
256 |
||
257 |
^ self method quickLineNumberForPC:self pc |
|
258 |
||
259 |
"Created: / 10.11.1998 / 14:20:30 / cg" |
|
260 |
! |
|
261 |
||
262 |
selector |
|
263 |
"the selector can be extracted from the method. |
|
264 |
the method may be found in the interpreter temps ..." |
|
265 |
||
266 |
|s m| |
|
267 |
||
268 |
selector isNil ifTrue:[ |
|
269 |
m := self method. |
|
270 |
m notNil ifTrue:[ |
|
271 |
^ m name |
|
272 |
] |
|
273 |
]. |
|
274 |
^ super selector |
|
275 |
||
276 |
"Modified: / 30.12.1997 / 17:22:06 / cg" |
|
277 |
"Created: / 30.12.1997 / 17:23:47 / cg" |
|
278 |
! |
|
279 |
||
280 |
setPC:newPC |
|
281 |
lineNr := newPC |
|
282 |
||
283 |
"Created: / 5.1.1998 / 00:09:02 / cg" |
|
284 |
! |
|
285 |
||
286 |
temporaries |
|
287 |
"return an array filled with the arguments and variables of this context" |
|
288 |
||
289 |
|n nSkipped| |
|
290 |
||
291 |
"/ the flas-numVars includes the receiver and args |
|
292 |
nSkipped := super numVars "self numArgs + self numVars". |
|
293 |
"/ but my context setup is args+numvars. |
|
294 |
nSkipped := super numArgs + super numVars. |
|
295 |
||
296 |
n := self size - nSkipped. |
|
297 |
n == 0 ifTrue:[ |
|
298 |
"/ little optimization here - avaoid creating empty containers |
|
299 |
^ #() |
|
300 |
]. |
|
301 |
||
302 |
^ (Array new:n) replaceFrom:1 to:n with:self startingAt:nSkipped+1. |
|
303 |
||
304 |
"Created: / 13.1.1998 / 15:44:12 / cg" |
|
305 |
"Modified: / 13.1.1998 / 17:22:54 / cg" |
|
306 |
! |
|
307 |
||
308 |
vars |
|
309 |
"return an array filled with the local variables of this context" |
|
310 |
||
311 |
|nonVars mySize| |
|
312 |
||
313 |
mySize := self numVars. |
|
314 |
mySize == 0 ifTrue:[ |
|
315 |
"/ little optimization here - avaoid creating empty containers |
|
316 |
^ #() |
|
317 |
]. |
|
318 |
nonVars := (self arg1Index-1) + self numArgs. |
|
319 |
^ (Array new:mySize) replaceFrom:1 to:mySize with:self startingAt:nonVars+1 |
|
320 |
||
321 |
"Created: / 13.1.1998 / 16:48:16 / cg" |
|
322 |
! ! |
|
323 |
||
324 |
!JavaContext methodsFor:'accessing'! |
|
325 |
||
1093 | 326 |
acquiredMonitors |
1691 | 327 |
^acqrMonitors |
1093 | 328 |
|
329 |
"Created: / 08-11-2011 / 12:23:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1691 | 330 |
"Modified (format): / 27-08-2012 / 16:46:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1093 | 331 |
! |
332 |
||
1096
c543f127c67a
fixed some stupid mistakes, but still not working
hlopkmar
parents:
1095
diff
changeset
|
333 |
acquiredMonitorsDo: aBlock |
1691 | 334 |
"/ acqrMonitors isNil ifTrue: [ ^self ]. |
335 |
"/ acqrMonitors copy reverseDo: aBlock. |
|
336 |
aBlock value: self receiver. |
|
1094 | 337 |
|
338 |
"Created: / 08-11-2011 / 15:03:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1691 | 339 |
"Modified: / 26-08-2012 / 19:28:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1094 | 340 |
! |
341 |
||
1095 | 342 |
addMonitor: mon |
1100 | 343 |
self assert: (acqrMonitors isNil or: [ acqrMonitors isOrderedCollection ]). |
344 |
acqrMonitors ifNil: [ acqrMonitors := Stack new ]. |
|
345 |
acqrMonitors push: mon. |
|
1122 | 346 |
self markForUnwind. |
1093 | 347 |
|
348 |
"Created: / 08-11-2011 / 14:19:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1098 | 349 |
"Modified: / 08-11-2011 / 21:40:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1122 | 350 |
"Modified: / 17-11-2011 / 19:13:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
1093 | 351 |
! |
352 |
||
752 | 353 |
programmingLanguage |
354 |
||
355 |
^JavaLanguage instance |
|
356 |
||
357 |
"Created: / 17-03-2011 / 10:17:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1093 | 358 |
! |
359 |
||
360 |
removeMonitor: mon |
|
1122 | 361 |
| poppedObject | |
1095 | 362 |
acqrMonitors isNil ifTrue: [ |
1100 | 363 |
Logger |
364 |
log: ('removeMonitor: called but no monitors in acqrMonitors (%1)' |
|
365 |
bindWith: self) |
|
366 |
severity: #warn |
|
367 |
facility: #JVM. |
|
368 |
self breakPoint: #mh. |
|
369 |
^ self. |
|
1094 | 370 |
]. |
1100 | 371 |
poppedObject := acqrMonitors top. |
372 |
self assert: (poppedObject == mon). |
|
373 |
acqrMonitors remove: mon |
|
374 |
ifAbsent: [ |
|
375 |
Logger |
|
376 |
log: ('removeMonitor: called but no such monitor in acqrMonitors (%1)' |
|
377 |
bindWith: self) |
|
378 |
severity: #warn |
|
379 |
facility: #JVM. |
|
380 |
self breakPoint: #mh. |
|
381 |
^ self. |
|
1122 | 382 |
]. |
383 |
acqrMonitors isEmpty ifTrue: [self unmarkForUnwind]. |
|
1093 | 384 |
|
385 |
"Created: / 08-11-2011 / 14:19:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
|
1098 | 386 |
"Modified: / 08-11-2011 / 21:39:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1122 | 387 |
"Modified: / 17-11-2011 / 19:14:29 / Marcel Hlopko <hlopkmar@fel.cvut.cz>" |
752 | 388 |
! ! |
389 |
||
390 |
!JavaContext methodsFor:'exception handler support'! |
|
391 |
||
392 |
exceptionArg:aJavaException |
|
393 |
exArg := aJavaException. |
|
394 |
||
395 |
"Created: / 7.1.1998 / 21:36:56 / cg" |
|
396 |
! |
|
397 |
||
398 |
exceptionArg:aJavaException pc:newPc |
|
399 |
exArg := aJavaException. |
|
400 |
exPC := newPc. |
|
401 |
||
402 |
"Created: / 7.1.1998 / 21:36:56 / cg" |
|
403 |
! ! |
|
404 |
||
1098 | 405 |
!JavaContext methodsFor:'non local control flow'! |
406 |
||
407 |
unwindAndRestartForJavaException |
|
1102
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
408 |
|
1098 | 409 |
"Called by JavaVM>>throwException: unwinds the stack |
410 |
up to this context and restarts it so an exception handler |
|
411 |
executes" |
|
1102
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
412 |
|
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
413 |
| con wasMarked | |
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
414 |
|
1098 | 415 |
"Each context that has a monitor acquired has |
416 |
and unwind action that release all monitors acquired. |
|
417 |
However, we DONT want my monitors to be released, |
|
418 |
so we temporarily unmark this context for unwind and |
|
419 |
then mark it again, eventually" |
|
1102
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
420 |
|
1098 | 421 |
wasMarked := self isUnwindContext. |
1102
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
422 |
wasMarked ifTrue:[self unmarkForUnwind]. |
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
423 |
self senderIsNil ifFalse:[ |
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
424 |
con := thisContext evaluateUnwindActionsUpTo:self. |
1098 | 425 |
]. |
1476 | 426 |
wasMarked ifTrue:[self markForUnwind]. |
1102
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
427 |
|
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
428 |
"oops, if nil, I am not on the calling chain; |
1098 | 429 |
(bad bad, unwind action have already been performed. |
1102
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
430 |
should we check for this situation first and NOT evaluate |
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
431 |
the unwind actions in this case ?) |
1098 | 432 |
" |
1102
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
433 |
con isNil ifTrue:[ |
1098 | 434 |
" |
435 |
tried to return to a context which is already dead |
|
1102
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
436 |
(i.e. the method/block has already executed a return) |
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
437 |
" |
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
438 |
^ self invalidReturnOrRestartError:#'unwindAndRestart:' with:nil |
1098 | 439 |
]. |
1102
df54d5b34c6b
i broke something important in last commit - quickly reverting back :)
hlopkmar
parents:
1101
diff
changeset
|
440 |
" |
1098 | 441 |
now, that all unwind-actions are done, I can use the |
442 |
low-level restart ... |
|
443 |
" |
|
444 |
^ self restart |
|
445 |
||
446 |
"Created: / 08-11-2011 / 22:00:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
447 |
! ! |
|
448 |
||
752 | 449 |
!JavaContext methodsFor:'printing & storing'! |
450 |
||
451 |
receiverPrintString |
|
452 |
"return a string describing the receiver of the context" |
|
453 |
||
454 |
|receiverClass receiverClassName newString implementorClass searchClass| |
|
455 |
||
456 |
"/ %{ |
|
457 |
"/ /* |
|
458 |
"/ * special handling for (invalid) free objects. |
|
459 |
"/ * these only appear if some primitiveCode does not correctly use SEND macros, |
|
460 |
"/ * which may lead to sends to free objects. In normal operation, this 'cannot' happen. |
|
461 |
"/ */ |
|
462 |
"/ if (__isNonNilObject(__INST(receiver)) && (__qClass(__INST(receiver))==nil)) { |
|
463 |
"/ receiverClassName = __MKSTRING("FreeObject"); |
|
464 |
"/ } |
|
465 |
"/ %}. |
|
466 |
"/ receiverClassName notNil ifTrue:[^ receiverClassName]. |
|
467 |
||
468 |
receiverClass := receiver class. |
|
469 |
"/ java has no class-methods ... |
|
470 |
receiverClass := receiverClass theNonMetaclass. |
|
471 |
||
472 |
receiverClassName := receiverClass nameInBrowser. |
|
473 |
(receiverClass == SmallInteger) ifTrue:[ |
|
474 |
newString := '(' , receiver printString , ') ' , receiverClassName |
|
475 |
] ifFalse:[ |
|
476 |
newString := receiverClassName |
|
477 |
]. |
|
478 |
||
479 |
" |
|
480 |
kludge to avoid slow search for containing class |
|
481 |
" |
|
482 |
(selector ~~ #doIt and:[selector ~~ #doIt:]) ifTrue:[ |
|
483 |
implementorClass := self methodClass. |
|
484 |
]. |
|
485 |
implementorClass notNil ifTrue: [ |
|
486 |
(implementorClass ~~ receiverClass) ifTrue: [ |
|
487 |
newString := newString , '>>>', |
|
488 |
implementorClass nameInBrowser printString |
|
489 |
] |
|
490 |
] ifFalse:[ |
|
491 |
searchClass := self searchClass. |
|
492 |
searchClass ~~ receiverClass ifTrue:[ |
|
493 |
newString := newString , '>>>' , searchClass nameInBrowser |
|
494 |
]. |
|
495 |
"/ " |
|
496 |
"/ kludge for doIt - these unbound methods are not |
|
497 |
"/ found in the classes methodDictionary |
|
498 |
"/ " |
|
499 |
"/ (selector ~~ #doIt and:[selector ~~ #doIt:]) ifTrue:[ |
|
500 |
"/ newString := newString , '>>>**NONE**' |
|
501 |
"/ ] |
|
502 |
]. |
|
503 |
||
504 |
^ newString |
|
505 |
! ! |
|
506 |
||
507 |
!JavaContext methodsFor:'queries'! |
|
508 |
||
509 |
hasStackToShow |
|
510 |
"private interface to the debugger. |
|
511 |
Smalltalk contexts return false here - other language frames |
|
512 |
(i.e. Java frames) may want to show the evaluation stack" |
|
513 |
||
514 |
^ true |
|
515 |
||
516 |
"Modified: / 13.5.1997 / 16:31:12 / cg" |
|
517 |
"Created: / 7.5.1998 / 01:23:57 / cg" |
|
518 |
! |
|
519 |
||
520 |
isJavaContext |
|
521 |
"return true, if this is a javaContext." |
|
522 |
||
523 |
^ true |
|
524 |
||
525 |
"Created: / 8.5.1998 / 21:23:47 / cg" |
|
526 |
! |
|
527 |
||
528 |
stackFrame |
|
529 |
"private interface to the debugger." |
|
530 |
||
531 |
^ (1 to:self size) collect:[:i | self at:i] |
|
532 |
||
533 |
"Created: / 7.5.1998 / 01:26:19 / cg" |
|
534 |
! ! |
|
535 |
||
1455 | 536 |
!JavaContext::FinallyToken methodsFor:'accessing'! |
537 |
||
538 |
context |
|
539 |
^ context |
|
540 |
! |
|
541 |
||
542 |
context:something |
|
543 |
context := something. |
|
544 |
! |
|
545 |
||
546 |
exception |
|
547 |
^ exception |
|
548 |
! |
|
549 |
||
550 |
exception:something |
|
551 |
exception := something. |
|
552 |
! |
|
553 |
||
554 |
selector |
|
555 |
^ selector |
|
556 |
! |
|
557 |
||
558 |
selector:something |
|
559 |
selector := something. |
|
560 |
! |
|
561 |
||
562 |
value |
|
563 |
^ value |
|
564 |
! |
|
565 |
||
566 |
value:something |
|
567 |
value := something. |
|
568 |
! ! |
|
569 |
||
570 |
!JavaContext::FinallyToken methodsFor:'actions'! |
|
571 |
||
572 |
pass |
|
573 |
||
1459 | 574 |
"First, release all leftover acquired monitors" |
575 |
JavaVM releaseMonitorsOfUnwindingContext: context. |
|
576 |
||
1455 | 577 |
selector == #return ifTrue:[ |
578 |
exception return |
|
579 |
]. |
|
580 |
selector == #return: ifTrue:[ |
|
581 |
exception return: value |
|
582 |
]. |
|
583 |
||
584 |
self error:'Should never be reached'. |
|
585 |
||
586 |
"Created: / 04-04-2012 / 20:24:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
587 |
! ! |
|
588 |
||
752 | 589 |
!JavaContext class methodsFor:'documentation'! |
590 |
||
591 |
version |
|
1864 | 592 |
^ '$Header$' |
593 |
! |
|
594 |
||
595 |
version_HG |
|
596 |
||
597 |
^ '$Changeset: <not expanded> $' |
|
752 | 598 |
! |
599 |
||
600 |
version_SVN |
|
1864 | 601 |
^ '§Id§' |
1093 | 602 |
! ! |