Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.3333.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.3333 Author: eem Time: 11 August 2023, 5:59:12.558349 pm UUID: 9113291a-a570-49e7-bbef-52142bb19946 Ancestors: VMMaker.oscog-eem.3332
minor clean-up/commentary.
Help myself by documenting what the snapshotPrimitive answers (false for snapshot, true for resume).
Simplify SpurMemoryManager>>#sufficientSpaceAfterGC:. Nuke an unused link reg related utility in the Cogit. Add the CogVMSimulator's fklush method to the STackInterpreterSimulator to ensure that GC progress is printed immediately while simulating.
=============== Diff against VMMaker.oscog-eem.3332 ===============
Item was changed: ----- Method: CoInterpreterPrimitives>>primitiveSnapshot (in category 'system control primitives') ----- primitiveSnapshot "Save a normal snapshot under the same name as it was loaded unless it has been renamed by the last primitiveImageName. + Note that when executed this primitive answers false, but when the resulting image is run afresh, the primitive answers true.
Override to jump to the interpreter because the machine code zone is now void." <inline: false> self snapshot: false. (self iframeMethod: framePointer) = newMethod ifTrue: ["snapshot: has reached the end and built a frame. In the JIT we need to back-up the pc before reentering the interpreter." instructionPointer := instructionPointer - 1]. cogit ceInvokeInterpret "NOTREACHED"!
Item was changed: ----- Method: CoInterpreterPrimitives>>primitiveSnapshotEmbedded (in category 'system control primitives') ----- primitiveSnapshotEmbedded "Save an embedded snapshot. + Note that when executed this primitive answers false, but when the resulting image is run afresh, the primitive answers true.
Override to jump to the interpreter because the machine code zone is now void." <inline: false> self snapshot: true. (self iframeMethod: framePointer) = newMethod ifTrue: ["snapshot: has reached the end and built a frame. In the JIT we need to back-up the pc before reentering the interpreter." instructionPointer := instructionPointer - 1]. cogit ceInvokeInterpret "NOTREACHED"!
Item was removed: - ----- Method: CogARMCompiler>>saveAndRestoreLinkRegUsingCalleeSavedRegNotLiveAtPointOfSendAround: (in category 'abi') ----- - saveAndRestoreLinkRegUsingCalleeSavedRegNotLiveAtPointOfSendAround: aBlock - "Extra1Reg is callee-saved and not live at point of send." - <inline: #always> - | inst | - inst := cogit MoveR: LinkReg R: Extra1Reg. - aBlock value. - cogit MoveR: Extra1Reg R: LinkReg. - ^inst!
Item was removed: - ----- Method: CogARMv8Compiler>>saveAndRestoreLinkRegUsingCalleeSavedRegNotLiveAtPointOfSendAround: (in category 'abi') ----- - saveAndRestoreLinkRegUsingCalleeSavedRegNotLiveAtPointOfSendAround: aBlock - "Extra7Reg is callee-saved and not live at point of send." - <inline: #always> - | inst | - inst := cogit MoveR: LinkReg R: Extra8Reg. - aBlock value. - cogit MoveR: Extra8Reg R: LinkReg!
Item was removed: - ----- Method: CogAbstractInstruction>>saveAndRestoreLinkRegUsingCalleeSavedRegNotLiveAtPointOfSendAround: (in category 'abi') ----- - saveAndRestoreLinkRegUsingCalleeSavedRegNotLiveAtPointOfSendAround: aBlock - "If the processor's ABI includes a link register, generate instructions - to save and restore it in a callee-saved register (if available) or on the stack around aBlock, which is assumed to generate code. - By default, do nothing. RISCs override." - <inline: #always> - ^aBlock value!
Item was changed: ----- Method: InterpreterPrimitives>>primitiveSnapshot (in category 'system control primitives') ----- primitiveSnapshot + "Save a normal snapshot under the same name as it was loaded unless it has been renamed by the last primitiveImageName. + Note that when executed this primitive answers false, but when the resulting image is run afresh, the primitive answers true." - "save a normal snapshot under the same name as it was loaded unless it has been renamed by the last primitiveImageName" <inline: false> self snapshot: false !
Item was added: + ----- Method: SpurMemoryManager>>lowSpaceThreshold (in category 'accessing') ----- + lowSpaceThreshold + ^lowSpaceThreshold!
Item was changed: ----- Method: SpurMemoryManager>>sufficientSpaceAfterGC: (in category 'gc - scavenging') ----- sufficientSpaceAfterGC: numBytes "This is ObjectMemory's funky entry-point into its incremental GC, which is a stop-the-world a young generation reclaimer. In Spur we run the scavenger. Answer if space is not low."
| heapSizePostGC | self assert: numBytes = 0. self scavengingGCTenuringIf: TenureByAge. heapSizePostGC := segmentManager totalOldSpaceCapacity - totalFreeOldSpace. (heapSizePostGC - heapSizeAtPreviousGC) asFloat / heapSizeAtPreviousGC >= heapGrowthToSizeGCRatio ifTrue: [self fullGC] "fullGC will attempt to shrink" ifFalse: "Also attempt to shrink if there is plenty of free space and no need to GC" [totalFreeOldSpace > (shrinkThreshold * 2) ifTrue: [self attemptToShrink. ^true]]. [totalFreeOldSpace < growHeadroom and: [(self growOldSpaceByAtLeast: 0) notNil]] whileTrue: [totalFreeOldSpace >= growHeadroom ifTrue: [^true]]. + "Answer false if space is low" + ^lowSpaceThreshold <= totalFreeOldSpace! - lowSpaceThreshold > totalFreeOldSpace ifTrue: "space is low" - [lowSpaceThreshold := 0. "avoid signalling low space twice" - ^false]. - ^true!
Item was added: + ----- Method: StackInterpreterSimulator>>flush (in category 'debug printing') ----- + flush + transcript flush. + "We *always* want to make transcript visible on flush" + TranscriptStream forceUpdate ifFalse: + [transcript changed: #appendEntry]!
vm-dev@lists.squeakfoundation.org