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

commits at source.squeak.org commits at source.squeak.org
Thu Mar 17 01:08:43 UTC 2016


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

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

Name: VMMaker.oscog-dtl.1730
Author: dtl
Time: 16 March 2016, 9:06:26.74934 pm
UUID: ad4e53e1-bdbc-4cb9-b5fb-f1229ca4e19f
Ancestors: VMMaker.oscog-nice.1729

Allow primitiveUtcWithOffset to accept an optional parameter with an array or object with two or more slots to store UTC posix microseconds and time zone offset in seconds. Compatibility with VMM trunk. Note, consider incorporating ioUtcWithOffset from SVN trunk to provide true atomic primitive.

=============== Diff against VMMaker.oscog-nice.1729 ===============

Item was changed:
  ----- Method: InterpreterPrimitives>>primitiveUtcWithOffset (in category 'system control primitives') -----
  primitiveUtcWithOffset
+ 	"Answer an array with UTC microseconds since the Posix epoch and the
+ 	current seconds offset from GMT in the local time zone. An empty two
+ 	element array (or any object with two or more slots) may be supplied
+ 	as a parameter.
- 	"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)"
  	| epochDelta offset resultArray utcMicroseconds |
  
  	<export: true>
  	<var: #epochDelta declareC: 'static usqLong epochDelta= 2177452800000000ULL'>
  	<var: #utcMicroseconds type: #usqLong>
  	<var: #offset type: #sqLong>
+ 	argumentCount > 1 ifTrue: [^self primitiveFailFor: PrimErrBadNumArgs].
  	self cCode: '' inSmalltalk: [epochDelta := 2177452800000000].
  	utcMicroseconds := self ioUTCMicroseconds.
  	offset := self ioLocalMicroseconds - utcMicroseconds.
  	offset := offset / 1000000.
  	objectMemory pushRemappableOop: (self positive64BitIntegerFor: utcMicroseconds - epochDelta).
+ 	argumentCount > 0
+ 		ifTrue: [resultArray := self popStack.
+ 			((objectMemory isPointers: resultArray)
+ 				and: [(objectMemory lengthOf: resultArray) >= 2])
+ 					ifFalse: [^self primitiveFailFor: PrimErrBadArgument]]
+ 		ifFalse: [resultArray := objectMemory instantiateClass: objectMemory classArray indexableSize: 2].
- 	resultArray := objectMemory instantiateClass: objectMemory classArray indexableSize: 2.
  	objectMemory storePointer: 0 ofObject: resultArray withValue: objectMemory popRemappableOop.
  	objectMemory storePointerUnchecked: 1 ofObject: resultArray withValue: (objectMemory integerObjectOf: offset).
  	self pop: 1 thenPush: resultArray
  !



More information about the Vm-dev mailing list