some net primitives added
authorcg
Mon, 06 May 1996 09:01:58 +0000
changeset 47 b5f63f59c2c1
parent 46 db9b84631d43
child 48 1e12f315ed97
some net primitives added
Java.st
JavaExceptionTableEntry.st
--- a/Java.st	Fri May 03 21:41:03 1996 +0000
+++ b/Java.st	Mon May 06 09:01:58 1996 +0000
@@ -16,6 +16,22 @@
     ^ self at:aString
 ! !
 
+!Java class methodsFor:'class initialization'!
+
+initAllClasses
+     self allClassesDo:[:cls |
+        cls isInitialized ifFalse:[
+            cls classInit
+        ]
+     ]
+
+!
+
+reinitAllClasses
+     self markAllClassesUninitialized.
+     self initAllClasses
+! !
+
 !Java class methodsFor:'enumerating'!
 
 allClassesDo:aBlock
@@ -126,5 +142,5 @@
 !Java class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/Java.st,v 1.6 1996/05/03 18:54:57 cg Exp $'
+    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/Java.st,v 1.7 1996/05/06 09:01:54 cg Exp $'
 ! !
--- a/JavaExceptionTableEntry.st	Fri May 03 21:41:03 1996 +0000
+++ b/JavaExceptionTableEntry.st	Mon May 06 09:01:58 1996 +0000
@@ -16,6 +16,28 @@
 
 !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.
@@ -28,5 +50,5 @@
 !JavaExceptionTableEntry class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaExceptionTableEntry.st,v 1.1 1996/04/16 13:34:03 cg Exp $'
+    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaExceptionTableEntry.st,v 1.2 1996/05/06 09:01:58 cg Exp $'
 ! !