[Vm-dev] VM Maker: VMMaker.oscog-eem.3057.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Sep 6 01:45:47 UTC 2021


Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.3057.mcz

==================== Summary ====================

Name: VMMaker.oscog-eem.3057
Author: eem
Time: 5 September 2021, 6:45:35.1444 pm
UUID: 6b8c61a5-14be-45c1-affd-a59a0c6a668d
Ancestors: VMMaker.oscog-eem.3056

Leak checking: eek is as useful (as a breakpoint) in production as in the simulator.

=============== Diff against VMMaker.oscog-eem.3056 ===============

Item was changed:
  ObjectMemory subclass: #NewObjectMemory
+ 	instanceVariableNames: 'coInterpreter freeStart reserveStart scavengeThreshold needGCFlag edenBytes checkForLeaks statGCEndUsecs heapMap leakDetected'
- 	instanceVariableNames: 'coInterpreter freeStart reserveStart scavengeThreshold needGCFlag edenBytes checkForLeaks statGCEndUsecs heapMap'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'VMMaker-Interpreter'!
  
  !NewObjectMemory commentStamp: '<historical>' prior: 0!
  I am a refinement of ObjectMemory that eliminates the need for pushRemappableOop:/popRemappableOop in the interpreter proper.  Certain primitives that do major allocation may still want to provoke a garbage collection and hence may still need to remap private pointers.  But the interpreter subclass of this class does not have to provided it reserves sufficient space for it to make progress to the next scavenge point (send or backward branch).!

Item was changed:
  ----- Method: NewObjectMemory class>>mustBeGlobal: (in category 'translation') -----
  mustBeGlobal: var
  	"Answer if a variable must be global and exported.  Used for inst vars that are accessed from VM support code."
  
  	^(super mustBeGlobal: var)
+ 	   or: [#('checkForLeaks' 'leakDetected') includes: var]!
- 	   or: ['checkForLeaks' = var]!

Item was changed:
  ----- Method: NewObjectMemory>>eek (in category 'memory access') -----
  eek
+ 	<inline: #never>
+ 	leakDetected := true!
- 	<inline: true>!

Item was changed:
  ----- Method: NewObjectMemory>>initialize (in category 'initialization') -----
  initialize
  	"Initialize NewObjectMemory when simulating the VM inside Smalltalk."
  	super initialize.
  	checkForLeaks := 0.
+ 	needGCFlag := leakDetected := false.
- 	needGCFlag := false.
  	heapMap := CogCheck32BitHeapMap new!

Item was changed:
  CogClass subclass: #SpurMemoryManager
(excessive size, no diff calculated)

Item was changed:
  ----- Method: SpurMemoryManager class>>mustBeGlobal: (in category 'translation') -----
  mustBeGlobal: var
  	"Answer if a variable must be global and exported.  Used for inst vars that are accessed from VM support code."
  
+ 	^#('checkForLeaks' 'maxOldSpaceSize' 'leakDetected') includes: var!
- 	^#('checkForLeaks' 'maxOldSpaceSize') includes: var!

Item was changed:
  ----- Method: SpurMemoryManager>>eek (in category 'debug support') -----
  eek
+ 	<inline: #never>
+ 	leakDetected := true!
- 	<inline: true>!

Item was changed:
  ----- Method: SpurMemoryManager>>initialize (in category 'initialization') -----
  initialize
  	"We can put all initializations that set something to 0 or to false here.
  	 In C all global variables are initialized to 0, and 0 is false."
  	| moreThanEnough |
  	remapBuffer := Array new: RemapBufferSize.
  	remapBufferCount := extraRootCount := 0. "see below"
  	freeListsMask := totalFreeOldSpace := lowSpaceThreshold := 0.
  	checkForLeaks := 0.
+ 	needGCFlag := signalLowSpace := marking := leakDetected := false.
- 	needGCFlag := signalLowSpace := marking := false.
  	becomeEffectsFlags := gcPhaseInProgress := validatedIntegerClassFlags := 0.
  	statScavenges := statIncrGCs := statFullGCs := 0.
  	statMaxAllocSegmentTime := 0.
  	statMarkUsecs := statSweepUsecs := statScavengeGCUsecs := statIncrGCUsecs := statFullGCUsecs := statCompactionUsecs := statGCEndUsecs := gcSweepEndUsecs := 0.
  	statSGCDeltaUsecs := statIGCDeltaUsecs := statFGCDeltaUsecs := 0.
  	statGrowMemory := statShrinkMemory := statRootTableCount := statAllocatedBytes := 0.
  	statRootTableOverflows := statMarkCount := statCompactPassCount := statCoalesces := 0.
  
  	"We can initialize things that are allocated but are lazily initialized."
  	unscannedEphemerons := SpurContiguousObjStack new.
  
  	"we can initialize things that are virtual in C."
  	scavenger := SpurGenerationScavenger simulatorClass new manager: self; yourself.
  	segmentManager := SpurSegmentManager simulatorClass new manager: self; yourself.
  	compactor := self class compactorClass simulatorClass new manager: self; yourself.
  
  	"We can also initialize here anything that is only for simulation."
  	heapMap := CogCheck32BitHeapMap new.
  
  	"N.B. We *don't* initialize extraRoots because we don't simulate it."
  
  	"This is needed on 64-bits. We don't want a simulation creating a huge heap by default.
  	 By default use 512Mb on 64-bits, 256Mb on 32-bits."
  	moreThanEnough := 1024 * 1024 * 1024 / (16 / self wordSize). "One million dollars, ha ha ha ha ha,... ha, ha ha ha ha, ..."
  	maxOldSpaceSize := self class initializationOptions
  							ifNotNil: [:initOpts| initOpts at: #maxOldSpaceSize ifAbsent: [moreThanEnough]]
  							ifNil: [moreThanEnough]!



More information about the Vm-dev mailing list