author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sat, 16 Feb 2013 19:08:45 +0100 | |
changeset 2353 | fa7400d022a0 |
parent 2261 | 5407ec1e59e4 |
child 2380 | 9195eccdcbd9 |
child 2396 | fadc6d7a2f5b |
permissions | -rw-r--r-- |
454 | 1 |
" |
2151 | 2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
3 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
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:
2261
diff
changeset
|
5 |
|
2151 | 6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
7 |
SWING Research Group, Czech Technical University in Prague |
454 | 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. |
|
2151 | 15 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
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:
2261
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:
2261
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:
2261
diff
changeset
|
19 |
as of 1.9.2010 |
2151 | 20 |
" |
713 | 21 |
"{ Package: 'stx:libjava' }" |
22 |
||
6 | 23 |
Object subclass:#JavaExceptionTableEntry |
24 |
instanceVariableNames:'startPC endPC handlerPC catchType' |
|
25 |
classVariableNames:'' |
|
26 |
poolDictionaries:'' |
|
713 | 27 |
category:'Languages-Java-Support' |
6 | 28 |
! |
29 |
||
454 | 30 |
!JavaExceptionTableEntry class methodsFor:'documentation'! |
31 |
||
32 |
copyright |
|
33 |
" |
|
2151 | 34 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
35 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
36 |
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:
2261
diff
changeset
|
37 |
|
2151 | 38 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
39 |
SWING Research Group, Czech Technical University in Prague |
454 | 40 |
|
41 |
This software is furnished under a license and may be used |
|
42 |
only in accordance with the terms of that license and with the |
|
43 |
inclusion of the above copyright notice. This software may not |
|
44 |
be provided or otherwise made available to, or used by, any |
|
45 |
other person. No title to or ownership of the software is |
|
46 |
hereby transferred. |
|
2151 | 47 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
48 |
[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:
2261
diff
changeset
|
49 |
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:
2261
diff
changeset
|
50 |
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:
2261
diff
changeset
|
51 |
as of 1.9.2010 |
2151 | 52 |
|
53 |
" |
|
454 | 54 |
! ! |
6 | 55 |
|
135 | 56 |
!JavaExceptionTableEntry class methodsFor:'instance creation'! |
6 | 57 |
|
58 |
startPC:start_pc endPC:end_pc handlerPC:handler_pc catchType:catch_type |
|
59 |
^ self new startPC:start_pc endPC:end_pc handlerPC:handler_pc catchType:catch_type |
|
60 |
||
61 |
"Created: 16.4.1996 / 12:11:13 / cg" |
|
62 |
! ! |
|
63 |
||
135 | 64 |
!JavaExceptionTableEntry methodsFor:'accessing'! |
65 |
||
66 |
catchType |
|
67 |
"return the value of the instance variable 'catchType' (automatically generated)" |
|
68 |
||
69 |
^ catchType |
|
70 |
||
71 |
"Created: 7.2.1997 / 21:01:23 / cg" |
|
72 |
! |
|
73 |
||
74 |
endPC |
|
75 |
"return the value of the instance variable 'endPC' (automatically generated)" |
|
76 |
||
77 |
^ endPC |
|
78 |
||
79 |
"Created: 7.2.1997 / 20:53:23 / cg" |
|
80 |
! |
|
81 |
||
82 |
handlerPC |
|
83 |
"return the value of the instance variable 'handlerPC' (automatically generated)" |
|
84 |
||
85 |
^ handlerPC |
|
86 |
||
87 |
"Created: 7.2.1997 / 20:06:31 / cg" |
|
88 |
! |
|
89 |
||
90 |
startPC |
|
91 |
"return the value of the instance variable 'startPC' (automatically generated)" |
|
92 |
||
93 |
^ startPC |
|
94 |
||
95 |
"Created: 7.2.1997 / 20:53:20 / cg" |
|
96 |
! ! |
|
97 |
||
164 | 98 |
!JavaExceptionTableEntry methodsFor:'printing & storing'! |
99 |
||
100 |
displayString |
|
226 | 101 |
^ super displayString , '(' , catchType displayString, |
102 |
' in ' , startPC printString , '..' , |
|
164 | 103 |
endPC printString , '->' , |
104 |
handlerPC printString , ')' |
|
105 |
||
226 | 106 |
"Modified: 15.8.1997 / 03:33:51 / cg" |
2151 | 107 |
! |
108 |
||
109 |
printOn: aStream |
|
110 |
super printOn: aStream. |
|
111 |
aStream nextPut:$(. |
|
112 |
catchType printOn: aStream. |
|
113 |
aStream nextPutAll:' in ' , startPC printString , '..' , |
|
114 |
endPC printString , '->' , |
|
115 |
handlerPC printString , ')' |
|
116 |
||
117 |
"Modified: / 15-08-1997 / 03:33:51 / cg" |
|
118 |
"Created: / 25-02-2011 / 09:08:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
164 | 119 |
! ! |
120 |
||
6 | 121 |
!JavaExceptionTableEntry methodsFor:'private accessing'! |
122 |
||
47 | 123 |
handlerPCFor:exception at:pc in:aMethod |
124 |
"if there is a handler for exceptionClass, with given pc, |
|
125 |
return the handler-PC; otherwise, return nil." |
|
126 |
||
107 | 127 |
|cls| |
2151 | 128 |
"JV+MH@2011-02-25: You may wonder why there is endPC - 1: |
129 |
The Java VM Spec, 3rd edition, sec 4.7.3, page 78: |
|
47 | 130 |
|
2151 | 131 |
The fact that end_pc is exclusive is a historical mistake in the design of the |
132 |
Java virtual machine: if the Java virtual machine code for a method is exactly |
|
133 |
65535 bytes long and ends with an instruction that is 1 byte long, then that |
|
134 |
instruction cannot be protected by an exception handler. A compiler writer can |
|
135 |
work around this bug by limiting the maximum size of the generated Java |
|
136 |
virtual machine code for any method, instance initialization method, or static |
|
137 |
initializer (the size of any code array) to 65534 bytes. |
|
138 |
||
139 |
" |
|
140 |
||
141 |
(pc between:startPC and:endPC - 1) ifTrue:[ |
|
107 | 142 |
(catchType == 0) ifTrue:[^ handlerPC]. |
122 | 143 |
(catchType isNil) ifTrue:[^ handlerPC]. |
100 | 144 |
cls := aMethod javaClass. |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
145 |
exception notNil ifTrue:[ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
146 |
catchType := catchType javaClass. |
2151 | 147 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
148 |
(catchType isKindOf:JavaClass) ifFalse:[ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
149 |
self halt. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
150 |
^ nil |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
151 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
152 |
(exception isKindOf:catchType) ifTrue:[ |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
153 |
^ handlerPC |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
154 |
]. |
47 | 155 |
^ nil |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
156 |
] |
47 | 157 |
]. |
158 |
^ nil |
|
255 | 159 |
|
2151 | 160 |
"Modified: / 07-01-1998 / 15:30:14 / cg" |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
161 |
"Modified: / 03-09-2012 / 18:50:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
47 | 162 |
! |
163 |
||
6 | 164 |
startPC:start_pc endPC:end_pc handlerPC:handler_pc catchType:catch_type |
165 |
startPC := start_pc. |
|
166 |
endPC := end_pc. |
|
167 |
handlerPC := handler_pc. |
|
168 |
catchType := catch_type |
|
169 |
||
170 |
"Created: 16.4.1996 / 12:11:45 / cg" |
|
171 |
! ! |
|
172 |
||
135 | 173 |
!JavaExceptionTableEntry class methodsFor:'documentation'! |
6 | 174 |
|
175 |
version |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
176 |
^ '$Header: /cvs/stx/stx/libjava/JavaExceptionTableEntry.st,v 1.19 2013-02-16 18:08:32 vrany Exp $' |
2237 | 177 |
! |
178 |
||
179 |
version_CVS |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
180 |
^ '$Header: /cvs/stx/stx/libjava/JavaExceptionTableEntry.st,v 1.19 2013-02-16 18:08:32 vrany Exp $' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
181 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
182 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
183 |
version_HG |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
184 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
185 |
^ '$Changeset: <not expanded> $' |
2151 | 186 |
! |
187 |
||
188 |
version_SVN |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
189 |
^ '§Id§' |
2108 | 190 |
! ! |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
191 |