JavaExceptionTableEntry.st
author cg
Mon, 06 May 1996 09:01:58 +0000
changeset 47 b5f63f59c2c1
parent 6 b23a6474754f
child 91 9b325648aa77
permissions -rw-r--r--
some net primitives added

Object subclass:#JavaExceptionTableEntry
	instanceVariableNames:'startPC endPC handlerPC catchType'
	classVariableNames:''
	poolDictionaries:''
	category:'Java-Support'
!


!JavaExceptionTableEntry class methodsFor:'instance creation'!

startPC:start_pc endPC:end_pc handlerPC:handler_pc catchType:catch_type
    ^ self new startPC:start_pc endPC:end_pc handlerPC:handler_pc catchType:catch_type

    "Created: 16.4.1996 / 12:11:13 / cg"
! !

!JavaExceptionTableEntry methodsFor:'private accessing'!

handlerPCFor:exception at:pc in:aMethod
    "if there is a handler for exceptionClass, with given pc,
     return the handler-PC; otherwise, return nil."

    |cls ref|

    (pc between:startPC and:endPC) ifTrue:[
        catchType == 0 ifTrue:[^ handlerPC].
        cls := aMethod class.
        ref := cls constantPool at:catchType.
        (ref isKindOf:JavaClass) ifFalse:[
            self halt.
            ^ nil
        ].
        (exception class isKindOf:ref) ifTrue:[
            ^ handlerPC
        ].
        ^ nil
    ].
    ^ nil
!

startPC:start_pc endPC:end_pc handlerPC:handler_pc catchType:catch_type
    startPC := start_pc.
    endPC := end_pc.
    handlerPC := handler_pc.
    catchType := catch_type

    "Created: 16.4.1996 / 12:11:45 / cg"
! !

!JavaExceptionTableEntry class methodsFor:'documentation'!

version
    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaExceptionTableEntry.st,v 1.2 1996/05/06 09:01:58 cg Exp $'
! !