author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 18 Apr 2013 17:46:56 +0200 | |
branch | development |
changeset 2522 | 88de19714cfb |
parent 2429 | ebece4dcaab9 |
child 2588 | 58b1e0fd20e7 |
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 |
|
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
56 |
|
135 | 57 |
!JavaExceptionTableEntry class methodsFor:'instance creation'! |
6 | 58 |
|
59 |
startPC:start_pc endPC:end_pc handlerPC:handler_pc catchType:catch_type |
|
60 |
^ self new startPC:start_pc endPC:end_pc handlerPC:handler_pc catchType:catch_type |
|
61 |
||
62 |
"Created: 16.4.1996 / 12:11:13 / cg" |
|
63 |
! ! |
|
64 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
65 |
|
135 | 66 |
!JavaExceptionTableEntry methodsFor:'accessing'! |
67 |
||
68 |
catchType |
|
69 |
"return the value of the instance variable 'catchType' (automatically generated)" |
|
70 |
||
71 |
^ catchType |
|
72 |
||
73 |
"Created: 7.2.1997 / 21:01:23 / cg" |
|
74 |
! |
|
75 |
||
76 |
endPC |
|
77 |
"return the value of the instance variable 'endPC' (automatically generated)" |
|
78 |
||
79 |
^ endPC |
|
80 |
||
81 |
"Created: 7.2.1997 / 20:53:23 / cg" |
|
82 |
! |
|
83 |
||
84 |
handlerPC |
|
85 |
"return the value of the instance variable 'handlerPC' (automatically generated)" |
|
86 |
||
87 |
^ handlerPC |
|
88 |
||
89 |
"Created: 7.2.1997 / 20:06:31 / cg" |
|
90 |
! |
|
91 |
||
92 |
startPC |
|
93 |
"return the value of the instance variable 'startPC' (automatically generated)" |
|
94 |
||
95 |
^ startPC |
|
96 |
||
97 |
"Created: 7.2.1997 / 20:53:20 / cg" |
|
98 |
! ! |
|
99 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
100 |
|
164 | 101 |
!JavaExceptionTableEntry methodsFor:'printing & storing'! |
102 |
||
103 |
displayString |
|
226 | 104 |
^ super displayString , '(' , catchType displayString, |
105 |
' in ' , startPC printString , '..' , |
|
164 | 106 |
endPC printString , '->' , |
107 |
handlerPC printString , ')' |
|
108 |
||
226 | 109 |
"Modified: 15.8.1997 / 03:33:51 / cg" |
2151 | 110 |
! |
111 |
||
112 |
printOn: aStream |
|
113 |
super printOn: aStream. |
|
114 |
aStream nextPut:$(. |
|
115 |
catchType printOn: aStream. |
|
116 |
aStream nextPutAll:' in ' , startPC printString , '..' , |
|
117 |
endPC printString , '->' , |
|
118 |
handlerPC printString , ')' |
|
119 |
||
120 |
"Modified: / 15-08-1997 / 03:33:51 / cg" |
|
121 |
"Created: / 25-02-2011 / 09:08:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
164 | 122 |
! ! |
123 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
124 |
|
6 | 125 |
!JavaExceptionTableEntry methodsFor:'private accessing'! |
126 |
||
47 | 127 |
handlerPCFor:exception at:pc in:aMethod |
128 |
"if there is a handler for exceptionClass, with given pc, |
|
129 |
return the handler-PC; otherwise, return nil." |
|
130 |
||
107 | 131 |
|cls| |
2151 | 132 |
"JV+MH@2011-02-25: You may wonder why there is endPC - 1: |
133 |
The Java VM Spec, 3rd edition, sec 4.7.3, page 78: |
|
47 | 134 |
|
2151 | 135 |
The fact that end_pc is exclusive is a historical mistake in the design of the |
136 |
Java virtual machine: if the Java virtual machine code for a method is exactly |
|
137 |
65535 bytes long and ends with an instruction that is 1 byte long, then that |
|
138 |
instruction cannot be protected by an exception handler. A compiler writer can |
|
139 |
work around this bug by limiting the maximum size of the generated Java |
|
140 |
virtual machine code for any method, instance initialization method, or static |
|
141 |
initializer (the size of any code array) to 65534 bytes. |
|
142 |
||
143 |
" |
|
144 |
||
145 |
(pc between:startPC and:endPC - 1) ifTrue:[ |
|
107 | 146 |
(catchType == 0) ifTrue:[^ handlerPC]. |
122 | 147 |
(catchType isNil) ifTrue:[^ handlerPC]. |
100 | 148 |
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
|
149 |
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
|
150 |
catchType := catchType javaClass. |
2151 | 151 |
|
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
|
152 |
(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
|
153 |
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
|
154 |
^ 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
|
155 |
]. |
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 |
(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
|
157 |
^ 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
|
158 |
]. |
47 | 159 |
^ 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
|
160 |
] |
47 | 161 |
]. |
162 |
^ nil |
|
255 | 163 |
|
2151 | 164 |
"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
|
165 |
"Modified: / 03-09-2012 / 18:50:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
47 | 166 |
! |
167 |
||
6 | 168 |
startPC:start_pc endPC:end_pc handlerPC:handler_pc catchType:catch_type |
169 |
startPC := start_pc. |
|
170 |
endPC := end_pc. |
|
171 |
handlerPC := handler_pc. |
|
172 |
catchType := catch_type |
|
173 |
||
174 |
"Created: 16.4.1996 / 12:11:45 / cg" |
|
175 |
! ! |
|
176 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
177 |
|
135 | 178 |
!JavaExceptionTableEntry class methodsFor:'documentation'! |
6 | 179 |
|
180 |
version |
|
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
181 |
^ '$Header: /cvs/stx/stx/libjava/JavaExceptionTableEntry.st,v 1.20 2013-02-25 11:15:31 vrany Exp $' |
2237 | 182 |
! |
183 |
||
184 |
version_CVS |
|
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
185 |
^ '$Header: /cvs/stx/stx/libjava/JavaExceptionTableEntry.st,v 1.20 2013-02-25 11:15:31 vrany Exp $' |
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
|
186 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
187 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
188 |
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
|
189 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2261
diff
changeset
|
190 |
^ '$Changeset: <not expanded> $' |
2151 | 191 |
! |
192 |
||
193 |
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
|
194 |
^ '§Id§' |
2108 | 195 |
! ! |
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
|
196 |