[Vm-dev] VM Maker: VMMaker.oscog-tfel.1691.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Feb 22 09:14:38 UTC 2016
Tim Felgentreff uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-tfel.1691.mcz
==================== Summary ====================
Name: VMMaker.oscog-tfel.1691
Author: tfel
Time: 22 February 2016, 10:13:26.026346 am
UUID: cb86b38a-7db8-484c-9407-70223d2da428
Ancestors: VMMaker.oscog-eem.1690
- call super in BitBltSimulator>>halftoneAt:
- implement asInteger on CObjectAccessor, so simulation code works
- fix InterpreterPrimitives>>primitiveUtcWithOffset to work in Simulator
- add a test case to run the full simulation for a few million bytecodes
=============== Diff against VMMaker.oscog-eem.1690 ===============
Item was changed:
----- Method: BitBltSimulator>>halftoneAt: (in category 'memory access') -----
halftoneAt: idx
^self
cCode: [(halftoneBase + (idx \\ halftoneHeight * 4)) long32At: 0]
+ inSmalltalk: [super halftoneAt: idx]!
- inSmalltalk: [self long32At: halftoneBase + (idx \\ halftoneHeight * 4)]!
Item was added:
+ ----- Method: CObjectAccessor>>asInteger (in category 'converting') -----
+ asInteger
+
+ ^ self!
Item was added:
+ TestCase subclass: #FullSimulationTest
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'VMMaker-Tests'!
Item was added:
+ ----- Method: FullSimulationTest>>testSimulate2MillionBytecodes (in category 'as yet unclassified') -----
+ testSimulate2MillionBytecodes
+ <timeout: 120>
+ | vm om |
+ vm := StackInterpreterSimulator newWithOptions: #(#ObjectMemory #Spur32BitMemoryManager ).
+ om := vm objectMemory.
+ vm desiredNumStackPages: 8. "Makes simulation faster by creating fewer stack pages."
+ vm openOn: Smalltalk imageName.
+ vm instVarNamed: 'assertVEPAES' put: false. "This makes the simulation faster by turning off some expensive asserts"
+ [[vm runForNBytes: 1500000]
+ on: Halt , ProvideAnswerNotification "This exception handler ignores some halts and confirmers occurring during simulation"
+ do: [:ex |
+ ex messageText == #primitiveExecuteMethodArgsArray
+ ifTrue: [ex resume].
+ ex messageText = 'clear transcript?'
+ ifTrue: [ex resume: false].
+ ex pass]] ensure: [Display restore].!
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.
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>
+ self cCode: '' inSmalltalk: [epochDelta := 2177452800000000].
utcMicroseconds := self ioUTCMicroseconds.
offset := self ioLocalMicroseconds - utcMicroseconds.
offset := offset / 1000000.
objectMemory pushRemappableOop: (self positive64BitIntegerFor: utcMicroseconds - epochDelta).
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 storePointer: 0 ofObject: resultArray withValue: objectMemory popRemappableOop.
- self storePointerUnchecked: 1 ofObject: resultArray withValue: (objectMemory integerObjectOf: offset).
self pop: 1 thenPush: resultArray
!
Item was changed:
----- Method: StackInterpreter class>>initializeClassIndices (in category 'initialization') -----
initializeClassIndices
"Class Class"
SuperclassIndex := 0.
MethodDictionaryIndex := 1.
InstanceSpecificationIndex := 2.
"Fields of a message dictionary"
+ MethodArrayIndex := 1.
- MethodArrayIndex := 1.
SelectorStart := 2.
"Newspeak extensions"
"Fields of a Mixin (also defined by Behavior)"
EnclosingMixinIndex := NewspeakVM ifTrue: [3]. "(Class instVarIndexFor: 'mixinSlot') - 1"
"Fields of a MixinApplication (also defined by Behavior)"
MixinIndex := NewspeakVM ifTrue: [3]. "(Class instVarIndexFor: 'mixinSlot') - 1"
EnclosingObjectIndex := NewspeakVM ifTrue: [4]. "(Class instVarIndexFor: 'enclosingObjectSlot') - 1"
!
More information about the Vm-dev
mailing list