[Vm-dev] VM Maker: VMMaker.oscog-eem.1834.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri Apr 22 20:06:24 UTC 2016
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1834.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.1834
Author: eem
Time: 22 April 2016, 1:04:12.789614 pm
UUID: 858a9c54-959b-4d7e-b9b3-5f083d37f488
Ancestors: VMMaker.oscog-eem.1833
1834: Charles Babbage begins the conceptual design of the "Analytical Engine", a mechanical forerunner of the modern computer.
Fix slips in my versions of the offset time primitives. They need to pop argumentCount + 1, not argumentCount.
=============== Diff against VMMaker.oscog-eem.1833 ===============
Item was changed:
----- Method: InterpreterPrimitives>>primitiveUtcAndTimezoneOffset (in category 'system control primitives') -----
primitiveUtcAndTimezoneOffset
"Answer an array with UTC microseconds since the Smalltalk epoch and the
current seconds offset from GMT in the local time zone. Any pointer object
with two or more slots) may be supplied as a parameter."
| resultArray |
argumentCount > 0
ifTrue:
[argumentCount > 1 ifTrue: [^self primitiveFailFor: PrimErrBadNumArgs].
resultArray := self stackTop.
((objectMemory isPointers: resultArray)
and: [(objectMemory lengthOf: resultArray) >= 2]) ifFalse:
[^self primitiveFailFor: PrimErrBadArgument]]
ifFalse: [resultArray := objectMemory instantiateClass: objectMemory classArray indexableSize: 2].
"N.B. No pushRemappableOop:/popRemappableOop in Cog because positive64BitIntegerFor: et al use
eeInstantiate... allocators which are guaranteed not to do a GC."
objectMemory
storePointerUnchecked: 1 ofObject: resultArray withValue: (objectMemory integerObjectOf: self ioLocalSecondsOffset);
storePointer: 0 ofObject: resultArray withValue: (self positive64BitIntegerFor: self ioUTCMicroseconds).
+ self pop: argumentCount + 1 thenPush: resultArray!
- self pop: argumentCount thenPush: resultArray!
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.
This is a named (not numbered) primitive in the null module (ie the VM)"
| epochDelta resultArray |
<export: true>
<var: #epochDelta declareC: 'static usqLong epochDelta = 2177452800000000ULL'>
self cCode: '' inSmalltalk: [epochDelta := 2177452800000000].
argumentCount > 0
ifTrue:
[argumentCount > 1 ifTrue: [^self primitiveFailFor: PrimErrBadNumArgs].
resultArray := self stackTop.
((objectMemory isPointers: resultArray)
and: [(objectMemory lengthOf: resultArray) >= 2]) ifFalse:
[^self primitiveFailFor: PrimErrBadArgument]]
ifFalse: [resultArray := objectMemory instantiateClass: objectMemory classArray indexableSize: 2].
"N.B. No pushRemappableOop:/popRemappableOop in Cog because positive64BitIntegerFor: et al use
eeInstantiate... allocators which are guaranteed not to do a GC."
objectMemory
storePointerUnchecked: 1 ofObject: resultArray withValue: (objectMemory integerObjectOf: self ioLocalSecondsOffset);
storePointer: 0 ofObject: resultArray withValue: (self positive64BitIntegerFor: self ioUTCMicroseconds - epochDelta).
+ self pop: argumentCount + 1 thenPush: resultArray!
- self pop: argumentCount thenPush: resultArray!
More information about the Vm-dev
mailing list