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

commits at source.squeak.org commits at source.squeak.org
Wed Oct 13 00:10:36 UTC 2021


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

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

Name: VMMaker.oscog-eem.3085
Author: eem
Time: 12 October 2021, 5:10:25.197347 pm
UUID: 8944e76f-f64a-4576-8754-c8dd1d2abf83
Ancestors: VMMaker.oscog-eem.3084

Spur32BitPreen to SpurImagePreener rename.
Nuke the unused inSortedFreeListLink:to:given:
When building a code generator, exclude all simulator classes.

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

Item was removed:
- ----- Method: Spur32BitMMLESimulator>>inSortedFreeListLink:to:given: (in category 'compaction') -----
- inSortedFreeListLink: freeChunk to: nextFree given: prevFree
- 	"thisContext sender selector = #sweepToCoallesceFreeSpaceForPigCompactFrom: ifTrue:
- 		[| pit |
- 			pit := [:label :thing|
- 					coInterpreter print: label; space; printHex: thing.
- 					(thing ~= 0 and: [self isFreeObject: thing]) ifTrue:
- 						[coInterpreter print: ' (free) ']].
- 			pit value: 'link ' value: freeChunk.
- 			pit value: ' to ' value: nextFree.
- 			pit value: ' from ' value: prevFree.
- 			coInterpreter cr]."
- 	"freeChunk = 16r10B0730 ifTrue:
- 		[self halt]."
- 	super inSortedFreeListLink: freeChunk to: nextFree given: prevFree!

Item was removed:
- ----- Method: Spur64BitMMLESimulator>>inSortedFreeListLink:to:given: (in category 'compaction') -----
- inSortedFreeListLink: freeChunk to: nextFree given: prevFree
- 	"thisContext sender selector = #sweepToCoallesceFreeSpaceForPigCompactFrom: ifTrue:
- 		[| pit |
- 			pit := [:label :thing|
- 					coInterpreter print: label; space; printHex: thing.
- 					(thing ~= 0 and: [self isFreeObject: thing]) ifTrue:
- 						[coInterpreter print: ' (free) ']].
- 			pit value: 'link ' value: freeChunk.
- 			pit value: ' to ' value: nextFree.
- 			pit value: ' from ' value: prevFree.
- 			coInterpreter cr]."
- 	"freeChunk = 16r10B0730 ifTrue:
- 		[self halt]."
- 	super inSortedFreeListLink: freeChunk to: nextFree given: prevFree!

Item was changed:
  ----- Method: SpurImageTestResource class>>preenImage (in category 'preening') -----
  preenImage
+ 	"Assume there's a trunk image in ., oscogvm/image or ../oscogvm/image.
- 	"Assume there's a Pharo bootstrap core32.image in ../oscogvm/image/core32.image.
  	 We should find out where the image directory is and write a download script to get it.
  	 But for now assume it's there.  See e.g.
  		https://bintray.com/pharo-project/pharo/Pharo/201701061402-32bit#files"
  	"[self preenImage] timeToRun"
+ 	SpurImagePreener new
- 	Spur32BitPreen new
  		writeDefaultHeader: true;
  		savedWindowSize: 640 at 480;
  		preenImage: self imageNameForTests!

Item was changed:
  ----- Method: SpurMemoryManager class>>initialize (in category 'class initialization') -----
  initialize
  	"SpurMemoryManager initialize"
  	BitsPerByte := 8.
  
  	"Initialize at least the become constants for the Spur bootstrap where the
  	 old ObjectMemory simulator is used before a Spur simulator is created.."
  	self initializeSpurObjectRepresentationConstants.
  
  	"An obj stack is a stack of objects stored in a hidden root slot, such as
  	 the markStack or the ephemeronQueue.  It is a linked list of segments,
  	 with the hot end at the head of the list.  It is a word object.  The stack
  	 pointer is in ObjStackTopx and 0 means empty.  The list goes through
  	 ObjStackNextx. We don't want to shrink objStacks, since they're used
  	 in GC and it's good to keep their memory around.  So unused pages
  	 created by popping emptied pages are kept on the ObjStackFreex list.
  	 ObjStackNextx must be the last field for swizzleObjStackAt:."
  	ObjStackPageSlots := 4092. "+ double header = 16k bytes per page in 32-bits, 32k bytes per page in 64 bits"
  	ObjStackTopx := 0.
  	ObjStackMyx := 1.
  	ObjStackFreex := 2.
  	ObjStackNextx := 3.
  	ObjStackFixedSlots := 4.
  	ObjStackLimit := ObjStackPageSlots - ObjStackFixedSlots.
  	"The hiddenRootsObject contains the classTable pages and up to 8 additional objects.
  	 Currently we use four; the three objStacks (the mark stack, the weaklings and the
  	 mourn queue), and the rememberedSet."
  	MarkStackRootIndex := self basicNew classTableRootSlots.
  	WeaklingStackRootIndex := MarkStackRootIndex + 1.
  	MournQueueRootIndex := MarkStackRootIndex + 2.
  	RememberedSetRootIndex := MarkStackRootIndex + 3.
  
  	MarkObjectsForEnumerationPrimitives := false.
  
  	"The remap buffer support is for compatibility; Spur doesn't GC during allocation.
  	 Eventually this should die."
  	RemapBufferSize := 25.
  
  	"Extra roots are for plugin support."
+ 	ExtraRootsSize := 64. "max. # of external roots; used e.g. by the PyBridge plugin which uses three entries"
- 	ExtraRootsSize := 2048. "max. # of external roots"
  
  	"gcPhaseInProgress takes these values to identify phases as required."
  	ScavengeInProgress := 1.
  	SlidingCompactionInProgress := 2!

Item was changed:
  ----- Method: SpurPlanningCompactorTests class>>preenImage (in category 'utilities') -----
  preenImage
  	"Assume there's a Pharo bootstrap core32.image in ../oscogvm/image/core32.image.
  	 We should find out where the image directory is and write a download script to get it.
  	 But for now assume it's there.  See e.g.
  		https://bintray.com/pharo-project/pharo/Pharo/201701061402-32bit#files"
  	"[SpurPlanningCompactorTests preenImage] timeToRun"
+ 	SpurImagePreener new
- 	Spur32BitPreen new
  		writeDefaultHeader: true;
  		savedWindowSize: 640 at 480;
  		preenImage: '../oscogvm/image/core32'!

Item was added:
+ ----- Method: VMClass class>>theNonSimulatorClass (in category 'translation') -----
+ theNonSimulatorClass
+ 	| class |
+ 	class := self.
+ 	[class name includesSubstring: 'Simulator'] whileTrue:
+ 		[class := class superclass].
+ 	^class!

Item was changed:
  ----- Method: VMMaker>>buildCodeGeneratorForInterpreter:includeAPIMethods:initializeClasses: (in category 'generate sources') -----
  buildCodeGeneratorForInterpreter: interpreterClass includeAPIMethods: getAPIMethods initializeClasses: initializeClasses
  	"Answer the code generator for translating the interpreter."
  
+ 	| cg interpreterClasses addedClasses |
- 	| cg interpreterClasses |
  	initializeClasses ifTrue:
  		[interpreterClass initializeWithOptions: optionsDictionary.
  		 interpreterClass hasCogit ifTrue:
  			[interpreterClass cogitClass initializeWithOptions: optionsDictionary]].
  
  	(cg := self createCodeGenerator) vmClass: interpreterClass.
  
  	"Construct interpreterClasses as all classes from interpreterClass &
  	 objectMemoryClass up to VMClass in superclass to subclass order."
  	interpreterClasses := OrderedCollection new.
  	{interpreterClass. interpreterClass objectMemoryClass} do:
  		[:vmClass| | theClass |
+ 		 theClass := vmClass theNonSimulatorClass.
- 		 theClass := vmClass.
  		 [theClass ~~ VMClass] whileTrue:
  			[interpreterClasses addFirst: theClass.
  			 theClass := theClass superclass]].
  	interpreterClasses
  		addFirst: VMClass;
+ 		addAllLast: ((cg nonStructClassesForTranslationClasses: interpreterClasses) collect: [:vmClass| vmClass theNonSimulatorClass]).
- 		addAllLast: (cg nonStructClassesForTranslationClasses: interpreterClasses).
  
  	initializeClasses ifTrue:
  		[interpreterClasses do:
  			[:ic|
  			(ic respondsTo: #initializeWithOptions:)
  				ifTrue: [ic initializeWithOptions: interpreterClass initializationOptions]
  				ifFalse: [ic initialize]].
  		 (cg structClassesForTranslationClasses: interpreterClasses) do:
  			[:structClass| structClass initialize]].
  
  	cg addStructClasses: (cg structClassesForTranslationClasses: interpreterClasses).
  
+ 	addedClasses := IdentitySet new.
+ 	interpreterClasses do:
+ 		[:ic| (addedClasses ifAbsentAdd: ic) ifTrue: [cg addClass: ic]].
- 	interpreterClasses do: [:ic| cg addClass: ic].
  
  	getAPIMethods ifTrue:
  		[interpreterClass cogitClass ifNotNil:
  			[:cogitClass|
  			 cg includeAPIFrom: (self
  									buildCodeGeneratorForCogit: cogitClass
  									includeAPIMethods: false
  									initializeClasses: false)]].
  
  	^cg!



More information about the Vm-dev mailing list