[FIX][ENH] Even faster Exception handling 'unwind' behaviour

Tim Rowledge tim at sumeru.stanford.edu
Fri Sep 8 23:16:53 UTC 2000


A couple of simple changes that make an appreciable improvement in
unwind speed; on my P3/600 linux machine, it seems to be about a 20%
improvement and on my StrongARM/202 it appears to be 60%.

tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
REALITY.DAT not found. Atempting to restore Universe......
-------------- next part --------------
'From Squeak2.8 of 13 June 2000 [latest update: #2348] on 8 September 2000 at 10:59:15 pm'!

!ContextPart methodsFor: 'private-exceptions' stamp: 'TPR 9/8/2000 22:49'!
unwindTo: aContext

	| ctx returnValue unwindBlock |
	ctx := self.

	[(ctx _ ctx findNextUnwindContextUpTo: aContext) isNil] whileFalse: [
		unwindBlock := ctx tempAt: 1.
		unwindBlock == nil
			ifFalse: [returnValue := unwindBlock value]].

	^returnValue! !


!BlockContext methodsFor: 'private' stamp: 'TPR 9/8/2000 22:50'!
aboutToReturn: result through: firstUnwindContext
"Use the passed in context as the first marked context; evaluate the unwind blcok and then scan upwards for the next unwind marked method context"
	| ctx unwindBlock |
	ctx _ firstUnwindContext.
	[ctx isNil] whileFalse: [
		unwindBlock := ctx tempAt: 1.
		unwindBlock == nil
			ifFalse: [unwindBlock value].
		ctx _ ctx findNextUnwindContextUpTo: home].

	thisContext swapSender: home sender.
	^result! !



More information about the Squeak-dev mailing list