[squeak-dev] The Trunk: System-cbc.146.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] The Trunk: System-cbc.146.mcz

commits-2
Andreas Raab uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-cbc.146.mcz

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

Name: System-cbc.146
Author: cbc
Time: 9 September 2009, 11:14:36 am
UUID: 34e15b6a-dd90-f446-8142-a1cc416881a5
Ancestors: System-ar.145

Fixed MessageTally>>spyEvery:on: to work with BlockClosure and BlockContext (by removing hard reference to BlockClosure).

=============== Diff against System-ar.145 ===============

Item was changed:
  ----- Method: MessageTally>>spyEvery:on: (in category 'initialize-release') -----
  spyEvery: millisecs on: aBlock
  "Create a spy and spy on the given block at the specified rate."
  "Spy only on the active process (in which aBlock is run)"
 
  | myDelay startTime time0 observedProcess |
+ aBlock isBlock
- (aBlock isMemberOf: BlockContext)
  ifFalse: [self error: 'spy needs a block here'].
  self class: aBlock receiver class method: aBlock method.
  "set up the probe"
  observedProcess _ Processor activeProcess.
  myDelay := Delay forMilliseconds: millisecs.
  time0 := Time millisecondClockValue.
  gcStats := SmalltalkImage current getVMParameters.
  Timer := [
  [true] whileTrue: [
  startTime := Time millisecondClockValue.
  myDelay wait.
  self tally: Processor preemptedProcess suspendedContext
  in: (ShowProcesses ifTrue: [
  observedProcess == Processor preemptedProcess ifTrue: [observedProcess] ifFalse: [nil]])
  "tally can be > 1 if ran a long primitive"
  by: (Time millisecondClockValue - startTime) // millisecs].
  nil] newProcess.
  Timer priority: Processor timingPriority-1.
  "activate the probe and evaluate the block"
  Timer resume.
  ^ aBlock ensure: [
  "Collect gc statistics"
  SmalltalkImage current getVMParameters keysAndValuesDo: [ :idx :gcVal |
  gcStats at: idx put: (gcVal - (gcStats at: idx))].
  "cancel the probe and return the value"
  Timer terminate.
  time := Time millisecondClockValue - time0]!