Matthew Fulmer uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mtf.456.mcz
==================== Summary ====================
Name: Kernel-mtf.456
Author: mtf
Time: 3 June 2010, 11:05:37.324 am
UUID: b1e05e80-6bc8-47fd-adda-82388483e604
Ancestors: Kernel-mtf.455
Added a utility method to Behavior for testing whether a method is compiled correctly without overwriting the incorrectly compiled method if not
=============== Diff against Kernel-mtf.455 ===============
Item was added:
+ ----- Method: Behavior>>sourceMatchesBytecodeAt: (in category 'testing') -----
+ sourceMatchesBytecodeAt: selector
+ "Answers true if the source code at the selector compiles to the bytecode at the selector, and false otherwise. Implemented to detect an error where Monticello did not recompile sources when the class shape changed"
+ "This code was copied from #recompile:from:, with few changes. Several methods would benefit from a method which turned a selector and class into a CompiledMethod, without installing it into the methodDictionary"
+
+ | method trailer methodNode |
+ method := self compiledMethodAt: selector.
+ trailer := method trailer.
+ methodNode := self compilerClass new
+ compile: (self sourceCodeAt: selector)
+ in: self
+ notifying: nil
+ ifFail: [^ false]. "Assume OK after proceed from SyntaxError"
+ selector == methodNode selector ifFalse: [self error: 'selector changed!!'].
+ ^ (methodNode generate: trailer) = method!
Matthew Fulmer uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mtf.456.mcz
==================== Summary ====================
Name: Kernel-mtf.456
Author: mtf
Time: 3 June 2010, 11:05:37.324 am
UUID: b1e05e80-6bc8-47fd-adda-82388483e604
Ancestors: Kernel-mtf.455
Added a utility method to Behavior for testing whether a method is compiled correctly without overwriting the incorrectly compiled method if not
=============== Diff against Kernel-mtf.455 ===============
Item was added:
+ ----- Method: Behavior>>sourceMatchesBytecodeAt: (in category 'testing') -----
+ sourceMatchesBytecodeAt: selector
+ "Answers true if the source code at the selector compiles to the bytecode at the selector, and false otherwise. Implemented to detect an error where Monticello did not recompile sources when the class shape changed"
+ "This code was copied from #recompile:from:, with few changes. Several methods would benefit from a method which turned a selector and class into a CompiledMethod, without installing it into the methodDictionary"
+
+ | method trailer methodNode |
+ method := self compiledMethodAt: selector.
+ trailer := method trailer.
+ methodNode := self compilerClass new
+ compile: (self sourceCodeAt: selector)
+ in: self
+ notifying: nil
+ ifFail: [^ false]. "Assume OK after proceed from SyntaxError"
+ selector == methodNode selector ifFalse: [self error: 'selector changed!!'].
+ ^ (methodNode generate: trailer) = method!
Matthew Fulmer uploaded a new version of Exceptions to project The Trunk:
http://source.squeak.org/trunk/Exceptions-mtf.28.mcz
==================== Summary ====================
Name: Exceptions-mtf.28
Author: mtf
Time: 3 June 2010, 9:46:39.119 am
UUID: e317b25a-109f-492d-95e1-90d163e9d7bf
Ancestors: Exceptions-nice.27
Added the option to make error handlers be re-entrant, and made a test case for it. Depends on Kernel-mtf.455. The default behavior is completely unchanged.
This is needed for preserving Tweak island semantics in the presence of syncSends and error resignalling.
=============== Diff against Exceptions-nice.27 ===============
Item was added:
+ TestCase subclass: #ExceptionsTest
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Exceptions-Extensions'!
Item was added:
+ ----- Method: ExceptionsTest>>testHandlerReentrancy (in category 'as yet unclassified') -----
+ testHandlerReentrancy
+
+ | callingOrder |
+ "Handlers are not re-entrant by default, so inner is not activated twice"
+ callingOrder := String streamContents: [:stream |
+ [[stream nextPut: $s. Notification signal]
+
+ "Inner handler"
+ on: Notification do: [:ex |
+ stream nextPut: $i.
+ ex pass]]
+
+ "outer handler"
+ on: Notification do: [:ex |
+ stream nextPut: $o.
+ Notification signal]].
+
+ self assert: callingOrder = 'sio'.
+
+ "Now make inner re-entrant"
+ callingOrder := String streamContents: [:stream |
+ [[stream nextPut: $s. Notification signal]
+
+ "Inner handler"
+ on: Notification do: [:ex |
+ stream nextPut: $i.
+ ex rearmHandlerDuring: [ex pass]]]
+
+ "outer handler"
+ on: Notification do: [:ex |
+ stream nextPut: $o.
+ Notification signal]].
+
+ self assert: callingOrder = 'sioi'.!
Item was added:
+ ----- Method: Exception>>rearmHandlerDuring: (in category 'handling') -----
+ rearmHandlerDuring: aBlock
+ "Make the current error handler re-entrant while it is running aBlock. Only works in a closure-enabled image"
+
+ ^ handlerContext rearmHandlerDuring: aBlock!
Matthew Fulmer uploaded a new version of Exceptions to project The Trunk:
http://source.squeak.org/trunk/Exceptions-mtf.28.mcz
==================== Summary ====================
Name: Exceptions-mtf.28
Author: mtf
Time: 3 June 2010, 9:46:39.119 am
UUID: e317b25a-109f-492d-95e1-90d163e9d7bf
Ancestors: Exceptions-nice.27
Added the option to make error handlers be re-entrant, and made a test case for it. Depends on Kernel-mtf.455. The default behavior is completely unchanged.
This is needed for preserving Tweak island semantics in the presence of syncSends and error resignalling.
=============== Diff against Exceptions-nice.27 ===============
Item was added:
+ TestCase subclass: #ExceptionsTest
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Exceptions-Extensions'!
Item was added:
+ ----- Method: ExceptionsTest>>testHandlerReentrancy (in category 'as yet unclassified') -----
+ testHandlerReentrancy
+
+ | callingOrder |
+ "Handlers are not re-entrant by default, so inner is not activated twice"
+ callingOrder := String streamContents: [:stream |
+ [[stream nextPut: $s. Notification signal]
+
+ "Inner handler"
+ on: Notification do: [:ex |
+ stream nextPut: $i.
+ ex pass]]
+
+ "outer handler"
+ on: Notification do: [:ex |
+ stream nextPut: $o.
+ Notification signal]].
+
+ self assert: callingOrder = 'sio'.
+
+ "Now make inner re-entrant"
+ callingOrder := String streamContents: [:stream |
+ [[stream nextPut: $s. Notification signal]
+
+ "Inner handler"
+ on: Notification do: [:ex |
+ stream nextPut: $i.
+ ex rearmHandlerDuring: [ex pass]]]
+
+ "outer handler"
+ on: Notification do: [:ex |
+ stream nextPut: $o.
+ Notification signal]].
+
+ self assert: callingOrder = 'sioi'.!
Item was added:
+ ----- Method: Exception>>rearmHandlerDuring: (in category 'handling') -----
+ rearmHandlerDuring: aBlock
+ "Make the current error handler re-entrant while it is running aBlock. Only works in a closure-enabled image"
+
+ ^ handlerContext rearmHandlerDuring: aBlock!
Matthew Fulmer uploaded a new version of Exceptions to project The Trunk:
http://source.squeak.org/trunk/Exceptions-mtf.28.mcz
==================== Summary ====================
Name: Exceptions-mtf.28
Author: mtf
Time: 3 June 2010, 9:46:39.119 am
UUID: e317b25a-109f-492d-95e1-90d163e9d7bf
Ancestors: Exceptions-nice.27
Added the option to make error handlers be re-entrant, and made a test case for it. Depends on Kernel-mtf.455. The default behavior is completely unchanged.
This is needed for preserving Tweak island semantics in the presence of syncSends and error resignalling.
=============== Diff against Exceptions-nice.27 ===============
Item was added:
+ TestCase subclass: #ExceptionsTest
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Exceptions-Extensions'!
Item was added:
+ ----- Method: ExceptionsTest>>testHandlerReentrancy (in category 'as yet unclassified') -----
+ testHandlerReentrancy
+
+ | callingOrder |
+ "Handlers are not re-entrant by default, so inner is not activated twice"
+ callingOrder := String streamContents: [:stream |
+ [[stream nextPut: $s. Notification signal]
+
+ "Inner handler"
+ on: Notification do: [:ex |
+ stream nextPut: $i.
+ ex pass]]
+
+ "outer handler"
+ on: Notification do: [:ex |
+ stream nextPut: $o.
+ Notification signal]].
+
+ self assert: callingOrder = 'sio'.
+
+ "Now make inner re-entrant"
+ callingOrder := String streamContents: [:stream |
+ [[stream nextPut: $s. Notification signal]
+
+ "Inner handler"
+ on: Notification do: [:ex |
+ stream nextPut: $i.
+ ex rearmHandlerDuring: [ex pass]]]
+
+ "outer handler"
+ on: Notification do: [:ex |
+ stream nextPut: $o.
+ Notification signal]].
+
+ self assert: callingOrder = 'sioi'.!
Item was added:
+ ----- Method: Exception>>rearmHandlerDuring: (in category 'handling') -----
+ rearmHandlerDuring: aBlock
+ "Make the current error handler re-entrant while it is running aBlock. Only works in a closure-enabled image"
+
+ ^ handlerContext rearmHandlerDuring: aBlock!
Matthew Fulmer uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mtf.455.mcz
==================== Summary ====================
Name: Kernel-mtf.455
Author: mtf
Time: 3 June 2010, 9:41:09.471 am
UUID: 515e8964-f471-4ac6-bcec-47e74b833f86
Ancestors: Kernel-mtf.454
Added a support method for making error handlers re-entrant. Needed for preserving Tweak island semantics in the presence of syncSends and error resignalling
=============== Diff against Kernel-mtf.454 ===============
Item was added:
+ ----- Method: ContextPart>>rearmHandlerDuring: (in category 'private-exceptions') -----
+ rearmHandlerDuring: aBlock
+ "Sent to handler (on:do:) contexts only. Makes me re-entrant for the duration of aBlock. Only works in a closure-enabled image"
+
+ ^ [self tempAt: 3 put: true. aBlock value]
+ ensure: [self tempAt: 3 put: false]!
Matthew Fulmer uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mtf.455.mcz
==================== Summary ====================
Name: Kernel-mtf.455
Author: mtf
Time: 3 June 2010, 9:41:09.471 am
UUID: 515e8964-f471-4ac6-bcec-47e74b833f86
Ancestors: Kernel-mtf.454
Added a support method for making error handlers re-entrant. Needed for preserving Tweak island semantics in the presence of syncSends and error resignalling
=============== Diff against Kernel-mtf.454 ===============
Item was added:
+ ----- Method: ContextPart>>rearmHandlerDuring: (in category 'private-exceptions') -----
+ rearmHandlerDuring: aBlock
+ "Sent to handler (on:do:) contexts only. Makes me re-entrant for the duration of aBlock. Only works in a closure-enabled image"
+
+ ^ [self tempAt: 3 put: true. aBlock value]
+ ensure: [self tempAt: 3 put: false]!
Matthew Fulmer uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mtf.455.mcz
==================== Summary ====================
Name: Kernel-mtf.455
Author: mtf
Time: 3 June 2010, 9:41:09.471 am
UUID: 515e8964-f471-4ac6-bcec-47e74b833f86
Ancestors: Kernel-mtf.454
Added a support method for making error handlers re-entrant. Needed for preserving Tweak island semantics in the presence of syncSends and error resignalling
=============== Diff against Kernel-mtf.454 ===============
Item was added:
+ ----- Method: ContextPart>>rearmHandlerDuring: (in category 'private-exceptions') -----
+ rearmHandlerDuring: aBlock
+ "Sent to handler (on:do:) contexts only. Makes me re-entrant for the duration of aBlock. Only works in a closure-enabled image"
+
+ ^ [self tempAt: 3 put: true. aBlock value]
+ ensure: [self tempAt: 3 put: false]!