Eliot Miranda uploaded a new version of Cog to project VM Maker: http://source.squeak.org/VMMaker/Cog-eem.344.mcz ==================== Summary ==================== Name: Cog-eem.344 Author: eem Time: 29 June 2017, 4:44:41.921001 pm UUID: 57f1233e-14ba-4fa9-a5da-818ec53d837c Ancestors: Cog-eem.343 Move SimulatorHarness into VMMaker. It is useful in tests. Fix Spur32BitPreen>>reportSizes given the changes to total heap size in VMMaker.oscog-eem.2237 & VMMaker.oscog-eem.2244. =============== Diff against Cog-eem.343 =============== Item was removed: - Object subclass: #SimulatorHarness - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: 'VMObjectIndices' - category: 'Cog-Bootstrapping'! Item was removed: - ----- Method: SimulatorHarness>>deny: (in category 'testing') ----- - deny: aBooleanOrBlock - aBooleanOrBlock value ifTrue: [AssertionFailure signal: 'Assertion failed']! Item was removed: - ----- Method: SimulatorHarness>>interpreter:object:perform:withArguments: (in category 'bootstrap methods') ----- - interpreter: sim object: receiver perform: selector withArguments: arguments - "Interpret an expression in oldHeap using oldInterpreter. - Answer the result." - | fp savedpc savedsp savedStackPages result startByteCount | - self assert: ({receiver. selector}, arguments allSatisfy: - [:oop| oop isInteger and: [sim objectMemory addressCouldBeOop: oop]]). - savedpc := sim localIP. - savedsp := sim localSP. - savedStackPages := Set with: sim stackPage. - sim internalPush: receiver. - arguments do: [:arg| sim internalPush: arg]. - sim - argumentCount: arguments size; - messageSelector: selector. - fp := sim localFP. - startByteCount := sim byteCount. - "sim byteCount = 66849 ifTrue: [self halt]." - sim normalSend. - sim incrementByteCount. "otherwise, send is not counted" - ["sim printFrame: sim localFP WithSP: sim localSP" - "sim setBreakSelector: #elementsForwardIdentityTo:" - "sim byteCount = 66849 ifTrue: [self halt]." - "(sim byteCount > 7508930 and: [sim localFP = -16r27894]) ifTrue: - [self halt]." - fp = sim localFP] whileFalse: - [sim singleStep. - (savedStackPages includes: sim stackPage) ifFalse: "If the stack gets deep something has probably gone wrong..." - [savedStackPages size > 20 ifTrue: [self halt]. - savedStackPages add: sim stackPage]]. - result := sim internalPopStack. - self assert: savedsp = sim localSP. - self assert: sim localIP - 1 = savedpc. - sim localIP: savedpc. - ^result! Item was removed: - ----- Method: SimulatorHarness>>withExecutableInterpreter:do: (in category 'bootstrap methods') ----- - withExecutableInterpreter: sim do: aBlock - "With the oldInterpreter ready to execute code, evaluate aBlock, - then return the interpreter (and the heap) to the ``just snapshotted'' state." - | savedpc savedfp initialContext finalContext | - sim - initStackPages; - loadInitialContext; - internalizeIPandSP. - savedpc := sim localIP. - savedfp := sim localFP. - "sim printHeadFrame." - aBlock value. - "sim printHeadFrame." - sim - internalPush: sim localIP; - externalizeIPandSP. - "now undo the execution state" - self assert: sim localFP = savedfp. - initialContext := sim frameContext: savedfp. - finalContext := sim voidVMStateForSnapshotFlushingExternalPrimitivesIf: false. - self assert: initialContext = finalContext. - self assert: sim localIP = savedpc. - sim objectMemory - storePointer: SuspendedContextIndex - ofObject: sim activeProcess - withValue: finalContext! Item was changed: ----- Method: Spur32BitPreen>>reportSizes (in category 'bootstrap image') ----- reportSizes | change oldHeapSize newHeapSize | oldHeapSize := oldHeap oldSpaceSize. + newHeap segmentManager computeTotalHeapSizeIncludingBridges. "To avoid assert fail" newHeapSize := newHeap oldSpaceSize. change := newHeapSize - oldHeapSize / oldHeapSize. Transcript nextPutAll: 'done.'; cr; nextPutAll: 'old heap size: '; nextPutAll: oldHeapSize asStringWithCommas; tab; nextPutAll: 'initial new heap size: '; nextPutAll: newHeapSize asStringWithCommas; cr; nextPutAll: 'change: '; print: change * 100.0 maxDecimalPlaces: 2; nextPut: $%; cr; flush. newHeapSize := newHeap endOfMemory - newHeap scavenger eden limit - newHeap totalFreeListBytes. change := newHeapSize - oldHeapSize / oldHeapSize. Transcript nextPutAll: 'final new heap size: '; nextPutAll: newHeapSize asStringWithCommas; tab; nextPutAll: 'change: '; print: change * 100.0 maxDecimalPlaces: 2; nextPut: $%; cr; flush! |
Free forum by Nabble | Edit this page |