[squeak-dev] The Trunk: Tools-eem.456.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Mar 12 18:50:39 UTC 2013


Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.456.mcz

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

Name: Tools-eem.456
Author: eem
Time: 12 March 2013, 11:49:59.729 am
UUID: 042dd3bc-af5b-4e0b-a1f3-aeb484e9438d
Ancestors: Tools-fbs.455

Make runUntil faster w.r.t. updates (inline the business end
of doStep, eliminating the update overhead).
Show the execute cursor while its doing its thang.

=============== Diff against Tools-fbs.455 ===============

Item was changed:
  ----- Method: Debugger>>runUntil (in category 'code pane menu') -----
  runUntil
+ 	"Step until an expression evaluates to other than false, reporting an error if it doesn't evaluate to true.
- 	"Step until an expression evaluates to other than false, reporting an erroer if it doesn't evaluate to true.
  	 Remember the expression in an inst var.  If shift is pressed when the expression is supplied, don't update the UI.
  	 If shift is pressed while stepping, stop stepping.  Using a user interrupt to break out would be more natural
  	 but Squeak currently doesn't provide a UserInterrupt expection.  It should do."
  	| expression receiver context method value lastUpdate updateUI breakOnShift |
  	expression := UIManager default 
  					request: 'run until expression is true (shift to disable ui update; shift to break).'
  					initialAnswer: (untilExpression ifNil: 'boolean expression').
  	(expression isNil or: [expression isEmpty]) ifTrue:
  		[^self].
  	updateUI := breakOnShift := Sensor shiftPressed not.
  	untilExpression := expression.
  	context := self selectedContext.
  	receiver := context receiver.
  	method := receiver class evaluatorClass new 
  				compiledMethodFor: untilExpression
  				in: context
  				to: receiver
  				notifying: nil
  				ifFail: [^ #failedDoit]
  				logged: false.
  
  	lastUpdate := Time millisecondClockValue.
+ 	Cursor execute showWhile:
+ 		[[self selectedContext == context
+ 		  and: [(value := receiver with: context executeMethod: method) == false]] whileTrue:
+ 			[interruptedProcess completeStep: self selectedContext.
+ 			 self selectedContext == context ifTrue:
+ 				[self resetContext: interruptedProcess stepToSendOrReturn changeContents: false].
+ 			 Time millisecondClockValue - lastUpdate > 50 ifTrue:
+ 				[updateUI ifTrue:
+ 					[self changed: #contentsSelection.
+ 					 World displayWorldSafely].
+ 				 breakOnShift
+ 					ifTrue: [Sensor shiftPressed ifTrue:
+ 								[self changed: #contentsSelection.
+ 								 self updateInspectors.
+ 								 ^self]]
+ 					ifFalse: [Sensor shiftPressed ifFalse: [breakOnShift := true]].
+ 				 lastUpdate := Time millisecondClockValue]]].
+ 	self changed: #contentsSelection.
+ 	self updateInspectors.
- 	[self selectedContext == context
- 	 and: [(value := receiver with: context executeMethod: method) == false]] whileTrue:
- 		[self doStep.
- 		 Time millisecondClockValue - lastUpdate > 50 ifTrue:
- 			[updateUI ifTrue: [World displayWorldSafely].
- 			 breakOnShift
- 				ifTrue: [Sensor shiftPressed ifTrue: [^self]]
- 				ifFalse: [Sensor shiftPressed ifFalse: [breakOnShift := true]].
- 			 lastUpdate := Time millisecondClockValue]].
  	(value ~~ false and: [value ~~ true]) ifTrue:
  		[UIManager default inform: 'expression ', (untilExpression contractTo: 40), ' answered ', (value printString contractTo: 20), '!!!!']!



More information about the Squeak-dev mailing list