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

commits at source.squeak.org commits at source.squeak.org
Mon Jun 27 20:09:42 UTC 2022


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

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

Name: VMMaker.oscog.seperateMarking-eem.3204
Author: eem
Time: 27 June 2022, 1:09:28.571717 pm
UUID: 84801843-2af7-4a77-83eb-4f973addf6bc
Ancestors: VMMaker.oscog.seperateMarking-eem.3203

Add the means to alter the method order when generating a source file. sourceSortingKey on the class side allows a custom sort order.  Have SpurMarker sort with SpurMemoryManager so that during refactoring we can see what the effects are more easily.

=============== Diff against VMMaker.oscog.seperateMarking-eem.3203 ===============

Item was changed:
  ----- Method: CCodeGenerator>>sortMethods: (in category 'utilities') -----
  sortMethods: aTMethodCollection
  	"We need to define this since different Squeak versions answer different results
  	 for asSortedCollection and if sort order changes, generated code changes too.
  	 When generating VM code, use class name as major sort index as this groups
  	 some methods by functionality (e.g. SpurGenerationScavenger) and that makes
  	 the VMProfiler more useful."
  	^aTMethodCollection asSortedCollection:
  		(self isGeneratingPluginCode
  			ifTrue:
  				[[:a :b| a selector caseSensitiveLessOrEqual: b selector]]
  			ifFalse:
  				[[:a :b|
+ 				  a definingClass sourceSortingKey = b definingClass sourceSortingKey
- 				  a definingClass = b definingClass
  					ifTrue: [a selector caseSensitiveLessOrEqual: b selector]
+ 					ifFalse: [a definingClass sourceSortingKey caseSensitiveLessOrEqual: b definingClass sourceSortingKey]]])!
- 					ifFalse: [a definingClass name caseSensitiveLessOrEqual: b definingClass name]]])!

Item was changed:
+ ----- Method: SpurMarker class>>simulatorClass (in category 'simulation') -----
- ----- Method: SpurMarker class>>simulatorClass (in category 'as yet unclassified') -----
  simulatorClass
  	^SpurMarkerSimulator!

Item was added:
+ ----- Method: SpurMarker class>>sourceSortingKey (in category 'translation') -----
+ sourceSortingKey
+ 	"To keep methods in the same order while refactoring..."
+ 	^SpurMemoryManager name!

Item was added:
+ ----- Method: VMClass class>>sourceSortingKey (in category 'translation') -----
+ sourceSortingKey
+ 	"Answer the key used to sort methods when generating a source file. By
+ 	 default this is the name of the class, but can be overridden to alter the
+ 	 source order, for example to ensure that methods are emitted in the same
+ 	 order during a refactoring where methods are moved to different classes."
+ 	^self name!



More information about the Vm-dev mailing list