[Pkg] The Trunk: Kernel-nice.506.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Oct 11 21:36:33 UTC 2010


Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.506.mcz

==================== Summary ====================

Name: Kernel-nice.506
Author: nice
Time: 11 October 2010, 11:35:57.51 pm
UUID: 814203df-d349-4dfa-9534-37093ec7b0d9
Ancestors: Kernel-dtl.505

Don't feed the exception handler with #valueWithPossibleArgument:, but rather with #cull:
Rationale:
No exception handler expects more than 1 argument, and feeding any over argument with nil is useless anyway.

=============== Diff against Kernel-dtl.505 ===============

Item was added:
+ ----- Method: BlockContext>>cull: (in category 'evaluating') -----
+ cull: firstArg
+ 	"Activate the receiver, with one or zero arguments."
+ 	
+ 	self numArgs >= 1 ifTrue: [ ^self value: firstArg ].
+ 	^self value!

Item was added:
+ ----- Method: BlockContext>>cull:cull: (in category 'evaluating') -----
+ cull: firstArg cull: secondArg
+ 	"Activate the receiver, with two or less arguments."
+ 	
+ 	self numArgs >= 2 ifTrue: [ ^self value: firstArg value: secondArg ].	
+ 	self numArgs = 1 ifTrue: [ ^self value: firstArg ].
+ 	^self value!

Item was added:
+ ----- Method: BlockContext>>cull:cull:cull: (in category 'evaluating') -----
+ cull: firstArg cull: secondArg cull: thirdArg
+ 	"Activate the receiver, with three or less arguments."
+ 	
+ 	self numArgs >= 2 ifTrue: [ 
+ 		self numArgs >= 3 ifTrue: [ ^self value: firstArg value: secondArg value: thirdArg ].
+ 		^self value: firstArg value: secondArg ].
+ 	self numArgs = 1 ifTrue: [ ^self value: firstArg ].
+ 	^self value!

Item was added:
+ ----- Method: BlockContext>>cull:cull:cull:cull: (in category 'evaluating') -----
+ cull: firstArg cull: secondArg cull: thirdArg cull: fourthArg
+ 	"Activate the receiver, with four or less arguments."
+ 	
+ 	self numArgs >= 3 ifTrue: [
+ 		self numArgs >= 4 ifTrue: [
+ 			^self value: firstArg value: secondArg value: thirdArg value: fourthArg ].
+ 		^self value: firstArg value: secondArg value: thirdArg ].
+ 	self numArgs = 2 ifTrue: [ ^self value: firstArg value: secondArg ].	
+ 	self numArgs = 1 ifTrue: [ ^self value: firstArg ].
+ 	^self value!

Item was changed:
  ----- Method: ContextPart>>handleSignal: (in category 'private-exceptions') -----
  handleSignal: exception
  	"Sent to handler (on:do:) contexts only.  If my exception class (first arg) handles exception then execute my handle block (second arg), otherwise forward this message to the next handler context.  If none left, execute exception's defaultAction (see nil>>handleSignal:)."
  
  	| val |
  	(((self tempAt: 1) handles: exception) and: [self tempAt: 3]) ifFalse: [
  		^ self nextHandlerContext handleSignal: exception].
  
  	exception privHandlerContext: self contextTag.
  	self tempAt: 3 put: false.  "disable self while executing handle block"
+ 	val := [(self tempAt: 2) cull: exception ]
- 	val := [(self tempAt: 2) valueWithPossibleArgument: exception ]
  		ensure: [self tempAt: 3 put: true].
  	self return: val.  "return from self if not otherwise directed in handle block"
  !



More information about the Packages mailing list