JavaExceptionTableEntry.st
author cg
Mon, 01 Jul 1996 13:43:40 +0000
changeset 100 4b0da648dcc5
parent 91 9b325648aa77
child 107 86a831b6728a
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
b23a6474754f intitial checkin
cg
parents:
diff changeset
     1
Object subclass:#JavaExceptionTableEntry
b23a6474754f intitial checkin
cg
parents:
diff changeset
     2
	instanceVariableNames:'startPC endPC handlerPC catchType'
b23a6474754f intitial checkin
cg
parents:
diff changeset
     3
	classVariableNames:''
b23a6474754f intitial checkin
cg
parents:
diff changeset
     4
	poolDictionaries:''
b23a6474754f intitial checkin
cg
parents:
diff changeset
     5
	category:'Java-Support'
b23a6474754f intitial checkin
cg
parents:
diff changeset
     6
!
b23a6474754f intitial checkin
cg
parents:
diff changeset
     7
b23a6474754f intitial checkin
cg
parents:
diff changeset
     8
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 47
diff changeset
     9
!JavaExceptionTableEntry  class methodsFor:'instance creation'!
6
b23a6474754f intitial checkin
cg
parents:
diff changeset
    10
b23a6474754f intitial checkin
cg
parents:
diff changeset
    11
startPC:start_pc endPC:end_pc handlerPC:handler_pc catchType:catch_type
b23a6474754f intitial checkin
cg
parents:
diff changeset
    12
    ^ self new startPC:start_pc endPC:end_pc handlerPC:handler_pc catchType:catch_type
b23a6474754f intitial checkin
cg
parents:
diff changeset
    13
b23a6474754f intitial checkin
cg
parents:
diff changeset
    14
    "Created: 16.4.1996 / 12:11:13 / cg"
b23a6474754f intitial checkin
cg
parents:
diff changeset
    15
! !
b23a6474754f intitial checkin
cg
parents:
diff changeset
    16
b23a6474754f intitial checkin
cg
parents:
diff changeset
    17
!JavaExceptionTableEntry methodsFor:'private accessing'!
b23a6474754f intitial checkin
cg
parents:
diff changeset
    18
47
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    19
handlerPCFor:exception at:pc in:aMethod
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    20
    "if there is a handler for exceptionClass, with given pc,
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    21
     return the handler-PC; otherwise, return nil."
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    22
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    23
    |cls ref|
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    24
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    25
    (pc between:startPC and:endPC) ifTrue:[
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    26
        catchType == 0 ifTrue:[^ handlerPC].
100
4b0da648dcc5 *** empty log message ***
cg
parents: 91
diff changeset
    27
        cls := aMethod javaClass.
47
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    28
        ref := cls constantPool at:catchType.
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    29
        (ref isKindOf:JavaClass) ifFalse:[
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    30
            self halt.
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    31
            ^ nil
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    32
        ].
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    33
        (exception class isKindOf:ref) ifTrue:[
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    34
            ^ handlerPC
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    35
        ].
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    36
        ^ nil
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    37
    ].
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    38
    ^ nil
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    39
!
b5f63f59c2c1 some net primitives added
cg
parents: 6
diff changeset
    40
6
b23a6474754f intitial checkin
cg
parents:
diff changeset
    41
startPC:start_pc endPC:end_pc handlerPC:handler_pc catchType:catch_type
b23a6474754f intitial checkin
cg
parents:
diff changeset
    42
    startPC := start_pc.
b23a6474754f intitial checkin
cg
parents:
diff changeset
    43
    endPC := end_pc.
b23a6474754f intitial checkin
cg
parents:
diff changeset
    44
    handlerPC := handler_pc.
b23a6474754f intitial checkin
cg
parents:
diff changeset
    45
    catchType := catch_type
b23a6474754f intitial checkin
cg
parents:
diff changeset
    46
b23a6474754f intitial checkin
cg
parents:
diff changeset
    47
    "Created: 16.4.1996 / 12:11:45 / cg"
b23a6474754f intitial checkin
cg
parents:
diff changeset
    48
! !
b23a6474754f intitial checkin
cg
parents:
diff changeset
    49
91
9b325648aa77 resolve rewritten; interpreter fixes
cg
parents: 47
diff changeset
    50
!JavaExceptionTableEntry  class methodsFor:'documentation'!
6
b23a6474754f intitial checkin
cg
parents:
diff changeset
    51
b23a6474754f intitial checkin
cg
parents:
diff changeset
    52
version
100
4b0da648dcc5 *** empty log message ***
cg
parents: 91
diff changeset
    53
    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaExceptionTableEntry.st,v 1.4 1996/07/01 13:41:48 cg Exp $'
6
b23a6474754f intitial checkin
cg
parents:
diff changeset
    54
! !