[Vm-dev] VM Maker: VMMaker-dtl.285.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Aug 17 00:14:55 UTC 2012


David T. Lewis uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker-dtl.285.mcz

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

Name: VMMaker-dtl.285
Author: dtl
Time: 16 August 2012, 8:13:30.924 pm
UUID: 77f7c9f9-69b4-4347-b6da-ccaab24e473e
Ancestors: VMMaker-dtl.284

VMMaker 4.9.10

For compatibility with Cog, add implementations of primitiveUTCMicrosecondClock and primitiveLocalMicrosecondClock derived from the existing primitiveUtcWithOffset, and install them as numbered primitives. The available microsecond primitives are now:

primitiveUtcWithOffset
	"Answer an array with UTC microseconds since the Posix epoch and
	the current seconds offset from GMT in the local time zone.
	This is a named (not numbered) primitive in the null module (ie the VM)"

primitiveUTCMicrosecondClock
	"Answer the UTC microseconds since the Smalltalk epoch. The value is
	derived from the Posix epoch (see primitiveUTCMicrosecondClock) with a
	constant offset corresponding to elapsed microseconds between the two
	epochs according to RFC 868."

primitiveLocalMicrosecondClock
	"Answer the local microseconds since the Smalltalk epoch. The value is
	derived from the Posix epoch (see primitiveUTCMicrosecondClock) with a
	constant offset corresponding to elapsed microseconds between the two
	epochs according to RFC 868, and with an offset duration corresponding to
	the current offset of local time from UTC."

=============== Diff against VMMaker-dtl.284 ===============

Item was changed:
  ----- Method: Interpreter class>>initializePrimitiveTable (in category 'initialization') -----
(excessive size, no diff calculated)

Item was added:
+ ----- Method: InterpreterPrimitives>>primitiveLocalMicrosecondClock (in category 'system control primitives') -----
+ primitiveLocalMicrosecondClock
+ 	"Answer the local microseconds since the Smalltalk epoch. The value is
+ 	derived from the Posix epoch (see primitiveUTCMicrosecondClock) with a
+ 	constant offset corresponding to elapsed microseconds between the two
+ 	epochs according to RFC 868, and with an offset duration corresponding to
+ 	the current offset of local time from UTC."
+ 	
+ 	| clock offset offsetMillis epochDelta uSecs |
+ 
+ 	<export: true>
+ 	<var: #clock type: 'usqLong'>
+ 	<var: #offset type: 'int'>
+ 	<var: #offsetMillis type: 'usqLong'>
+ 	<var: #epochDelta declareC: 'static usqLong epochDelta= 2177452800000000ULL'>
+ 	(self cCode: 'ioUtcWithOffset(&clock, &offset)' inSmalltalk: [-1]) = -1
+ 		ifTrue: [^ self primitiveFail].
+ 	clock := clock + epochDelta. "adjust for nominal Smalltalk epoch"
+ 	offsetMillis := offset.
+ 	offsetMillis := offsetMillis * 1000000.
+ 	clock := clock + offsetMillis. "adjust for local time offset"
+ 	uSecs := self positive64BitIntegerFor: clock.
+ 	self pop: 1 thenPush: uSecs.
+ !

Item was added:
+ ----- Method: InterpreterPrimitives>>primitiveUTCMicrosecondClock (in category 'system control primitives') -----
+ primitiveUTCMicrosecondClock
+ 	"Answer the UTC microseconds since the Smalltalk epoch. The value is
+ 	derived from the Posix epoch (see primitiveUTCMicrosecondClock) with a
+ 	constant offset corresponding to elapsed microseconds between the two
+ 	epochs according to RFC 868."
+ 	| clock offset epochDelta uSecs |
+ 
+ 	<export: true>
+ 	<var: #clock type: 'usqLong'>
+ 	<var: #offset type: 'int'>
+ 	<var: #epochDelta declareC: 'static usqLong epochDelta= 2177452800000000ULL'>
+ 	(self cCode: 'ioUtcWithOffset(&clock, &offset)' inSmalltalk: [-1]) = -1
+ 		ifTrue: [^ self primitiveFail].
+ 	clock := clock + epochDelta.
+ 	uSecs := self positive64BitIntegerFor: clock.
+ 	self pop: 1 thenPush: uSecs.
+ !

Item was changed:
  ----- Method: VMMaker class>>versionString (in category 'version testing') -----
  versionString
  
  	"VMMaker versionString"
  
+ 	^'4.9.10'!
- 	^'4.9.9'!



More information about the Vm-dev mailing list