[Vm-dev] VM Maker: VMMaker.oscog-dtl.1730.mcz
Eliot Miranda
eliot.miranda at gmail.com
Fri Mar 18 20:31:23 UTC 2016
Hi David,
On Wed, Mar 16, 2016 at 6:07 PM, <commits at source.squeak.org> wrote:
>
> 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.
>
Feel free to move the code over.
>
> =============== 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
> !
>
>
--
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160318/8a1b4e9b/attachment-0001.htm
More information about the Vm-dev
mailing list