[squeak-dev] The Trunk: Kernel-ul.575.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Apr 30 01:53:27 UTC 2011


Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.575.mcz

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

Name: Kernel-ul.575
Author: ul
Time: 28 April 2011, 12:03:58.259 am
UUID: 33ed898b-6592-984b-b1e6-d9f2a778f216
Ancestors: Kernel-ul.574

- removed support for BlockContexts from ContextPart >> #copyTo:
- added a new method #copyTo:bottomContextDo: which provides access to the bottom context during copying

=============== Diff against Kernel-ul.574 ===============

Item was removed:
- ----- Method: BlockContext>>copyTo:blocks: (in category 'private') -----
- copyTo: aContext blocks: dict
- 	"Copy self and my sender chain down to, but not including, aContext.  End of copied chain will have nil sender.  BlockContexts whose home is also copied will point to the copy.  However, blockContexts that are not on the stack but may be later will not have their home pointing in the new copied thread.  So an error will be raised if one of these tries to return directly to its home."
- 
- 	| copy |
- 	self == aContext ifTrue: [^ nil].
- 	copy := self copy.
- 	(dict at: self home ifAbsentPut: [OrderedCollection new]) add: copy.
- 	self sender ifNotNil: [
- 		copy privSender: (self sender copyTo: aContext blocks: dict)].
- 	^ copy!

Item was changed:
  ----- Method: ContextPart>>copyTo: (in category 'query') -----
  copyTo: aContext
+ 	"Copy self and my sender chain down to, but not including, aContext.  End of copied chain will have nil sender."
- 	"Copy self and my sender chain down to, but not including, aContext.  End of copied chain will have nil sender.  BlockContexts whose home is also copied will point to the copy.  However, blockContexts that are not on the stack but may be later will not have their home pointing in the new copied thread.  So an error will be raised if one of these tries to return directly to its home.  It is best to use BlockClosures instead.  They only hold a ContextTag, which will work for all copies of the original home context."
  
+ 	| copy |
+ 	self == aContext ifTrue: [ ^nil ].
+ 	copy := self copy.
+ 	sender ifNotNil: [ copy privSender: (sender copyTo: aContext) ].
+ 	^copy!
- 	^ self copyTo: aContext blocks: IdentityDictionary new!

Item was removed:
- ----- Method: ContextPart>>copyTo:blocks: (in category 'private') -----
- copyTo: aContext blocks: dict
- 	"Copy self and my sender chain down to, but not including, aContext.  End of copied chain will have nil sender.  BlockContexts whose home is also copied will point to the copy.  However, blockContexts that are not on the stack but may be later will not have their home pointing in the new copied thread.  So an error will be raised if one of these tries to return directly to its home."
- 
- 	| copy |
- 	self == aContext ifTrue: [^ nil].
- 	copy := self copy.
- 	dict at: self ifPresent: [:blocks | blocks do: [:b | b privHome: copy]].
- 	self sender ifNotNil: [
- 		copy privSender: (self sender copyTo: aContext blocks: dict)].
- 	^ copy!

Item was added:
+ ----- Method: ContextPart>>copyTo:bottomContextDo: (in category 'query') -----
+ copyTo: aContext bottomContextDo: aBlock
+ 	"Copy self and my sender chain down to, but not including, aContext.  End of copied chain will have nil sender. Evaluate aBlock with the copy of bottom context when it still points to the original sender."
+ 
+ 	| copy |
+ 	self == aContext ifTrue: [ ^nil ].
+ 	copy := self copy.
+ 	sender
+ 		ifNil: [ aBlock value: copy ]
+ 		ifNotNil: [
+ 			sender == aContext ifTrue: [ aBlock value: copy ].
+ 			copy privSender: (sender copyTo: aContext bottomContextDo: aBlock) ].
+ 	^copy!




More information about the Squeak-dev mailing list