[Pkg] The Trunk: Kernel-dtl.569.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Apr 15 01:49:17 UTC 2011


David T. Lewis uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-dtl.569.mcz

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

Name: Kernel-dtl.569
Author: dtl
Time: 14 April 2011, 9:48:42.876 pm
UUID: c1d30608-4cc8-4db7-204a-2bf7a46c1508
Ancestors: Kernel-cmm.568

If the VM supports primitiveMillisecondClockMask, use this at image startup time to obtain the millisecond clock mask value, otherwise use a default of 16r1FFFFFFF. Maintain the mask value in a class variable for speed, and use this for duration calculations associated with the millisecond clock.

Background - the millisecond clock in the VM rolls over when its value exceeds the mask value. The image may calculate durations (e.g. socket timeout values) using the millisecond clock, in which case the mask value is used to detect clock rollover. By making the mask value available through a primitive, the image can be assured that its mask value is the same as that being used in the VM. If the primitive is not available, the image should assume use of the traditional mask value 16r1FFFFFFF.

=============== Diff against Kernel-cmm.568 ===============

Item was changed:
  ----- Method: DateAndTime class>>startUp: (in category 'initialize-release') -----
  startUp: resuming
  	resuming ifFalse: [ ^ self ].
+ 	Time initializeMillisecondClockMask.
  	OffsetsAreValid := false.
  	[
  		self initializeOffsets.
  		OffsetsAreValid := true
  	] forkAt: Processor userInterruptPriority.!

Item was changed:
  Magnitude subclass: #Time
  	instanceVariableNames: 'seconds nanos'
+ 	classVariableNames: 'MillisecondClockMask'
- 	classVariableNames: ''
  	poolDictionaries: 'ChronologyConstants'
  	category: 'Kernel-Chronology'!
  
  !Time commentStamp: 'dew 10/23/2004 17:58' prior: 0!
  This represents a particular point in time during any given day.  For example, '5:19:45 pm'.
  
  If you need a point in time on a particular day, use DateAndTime.  If you need a duration of time, use Duration.
  !

Item was added:
+ ----- Method: Time class>>initializeMillisecondClockMask (in category 'clock') -----
+ initializeMillisecondClockMask
+ 	"Initialize cached value from the VM, or set to nil if VM cannot support the request"
+ 
+ 	MillisecondClockMask := self primMillisecondClockMask
+ !

Item was changed:
  ----- Method: Time class>>millisecondClockMask (in category 'general inquiries') -----
  millisecondClockMask
+ 	"Answer the mask used for millisecond clock rollover in the virtual machine.
+ 	Answer a default if the VM cannot supply the value."
+ 
+ 	^MillisecondClockMask ifNil: [16r1FFFFFFF]
+ !
- 	"The VM mask for the max. millisecond clock value.
- 	This should be primitive but it ain't so it's copied inline from the Interpreter."
- 	 ^16r1FFFFFFF!

Item was changed:
  ----- Method: Time class>>milliseconds:since: (in category 'squeak protocol') -----
  milliseconds: currentTime since: lastTime
  	"Answer the elapsed time since last recorded in milliseconds.
  	Compensate for rollover."
  
  	| delta |
  	delta := currentTime - lastTime.
  	^ delta < 0
+ 		ifTrue: [self millisecondClockMask + delta]
- 		ifTrue: [Time millisecondClockMask + delta]
  		ifFalse: [delta]!

Item was added:
+ ----- Method: Time class>>primMillisecondClockMask (in category 'clock') -----
+ primMillisecondClockMask
+ 	"Answer the mask value used for millisecond clock rollover in the
+ 	virtual machine, or nil if the VM cannot support the request."
+ 
+ 	<primitive: 'primitiveMillisecondClockMask'>
+ 	^nil!



More information about the Packages mailing list