better handler search
authorClaus Gittinger <cg@exept.de>
Fri, 14 Nov 1997 16:20:03 +0100
changeset 3110 9a1e3a736e14
parent 3109 2ac640e610aa
child 3111 a23fa6d08ce7
better handler search
Exception.st
--- a/Exception.st	Fri Nov 14 10:34:10 1997 +0100
+++ b/Exception.st	Fri Nov 14 16:20:03 1997 +0100
@@ -767,45 +767,19 @@
 
                 ((ex1 class == self class)
                 or:[ex1 species == self species]) ifTrue:[
-                    c := c sender.
-                    (c notNil and:[c receiver == ex1]) ifTrue:[
-                        c := c sender.
-                        c notNil ifTrue:[
-
-                            "/ the common case (really ?) first
-                            ((raiseReceiver := c receiver) == theSignal) ifTrue:[
-                                (c selector startsWith:'raise') ifTrue:[
-                                    h := ex1 handlerContext.
-                                    h notNil ifTrue:[
-                                        activeHandlers isNil ifTrue:[
-                                            activeHandlers := OrderedCollection new
-                                        ].
+		    (ex1 signal == theSignal) ifTrue:[
+                        h := ex1 handlerContext.
+                        h notNil ifTrue:[
+                            r := h receiver.
+                            (r notNil and:[r accepts:theSignal]) ifTrue:[
+                                activeHandlers isNil ifTrue:[
+                                    activeHandlers := OrderedCollection new
+                                ].
 
-                                        lastHandler := h.
-                                        activeHandlers add:lastHandler.
-                                        inHandler := true.
-                                        c := lastHandler.
-                                    ]
-                                ]
-                            ] ifFalse:[
-                                raiseReceiver isSignal ifTrue:[
-                                    (c selector startsWith:'raise') ifTrue:[
-                                        h := ex1 handlerContext.
-                                        h notNil ifTrue:[
-                                            r := h receiver.
-                                            (r notNil and:[r accepts:theSignal]) ifTrue:[
-
-                                                activeHandlers isNil ifTrue:[
-                                                    activeHandlers := OrderedCollection new
-                                                ].
-                                                lastHandler := h.
-                                                activeHandlers add:lastHandler.
-                                                inHandler := true.
-                                                c := lastHandler.
-                                            ]
-                                        ]    
-                                    ]    
-                                ]    
+                                lastHandler := h.
+                                activeHandlers add:lastHandler.
+                                inHandler := true.
+                                c := lastHandler.
                             ]
                         ]
                     ]
@@ -889,6 +863,7 @@
         "/ if it is not the NoHandlerSignal, raise it ...
         "/ passing the receiver as parameter.
         "/
+'a' printCR.
         signal ~~ (noHandlerSignal := Signal noHandlerSignal) ifTrue:[
             noHandlerSignal notNil ifTrue:[
                 any ifTrue:[
@@ -897,6 +872,7 @@
                     msg := 'unhandled'
                 ].
                 msg := msg , ' exception: (' , errorString , ')'.
+'b' printCR.
                 ^ noHandlerSignal 
                       raiseRequestWith:self 
                            errorString:msg
@@ -970,6 +946,6 @@
 !Exception class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Exception.st,v 1.60 1997-11-11 14:39:26 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Exception.st,v 1.61 1997-11-14 15:20:03 cg Exp $'
 ! !
 Exception initialize!