Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.3340.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.3340 Author: eem Time: 25 October 2023, 7:26:14.908882 pm UUID: a4e72b77-5223-444e-a9f0-1672fbd720f1 Ancestors: VMMaker.oscog-eem.3339
Slang: fix an inlining bug where inlined struct sends would have their receiver renamed to a parameter, causing the receivers to no longer be elided as required.
VMMaker: for convenience, allow classes as the keys and values of initializationOptions as well as symbols
=============== Diff against VMMaker.oscog-eem.3339 ===============
Item was added: + ----- Method: TMethod>>protectToBeExcludedReceiversForInlining (in category 'inlining support') ----- + protectToBeExcludedReceiversForInlining + "Any struct sends whose receivers will be elided must not be renamed on inlining, as this could prevent their elision when code is generated. Instead, these receivers are renamed to 'self_in_inlined_method' to ensure they persist to be elided when code is generated." + + parseTree nodesWithParentsDo: + [ :node :parent| + (node isVariable + and: [(node name beginsWith: 'self_in_') + and: [parent notNil + and: [parent isSend + and: [parent receiver == node]]]]) ifTrue: + [parent receiver: (TVariableNode new setName: #'self_in_inlined_method')]]!
Item was changed: ----- Method: TMethod>>renameVarsForInliningInto:except:in: (in category 'inlining support') ----- renameVarsForInliningInto: destMethod except: doNotRename in: aCodeGen "Rename any variables that would clash with those of the destination method."
| destVars usedVars varMap newVarName | destVars := aCodeGen globalsAsSet copy. destVars addAll: destMethod locals. destVars addAll: destMethod args. usedVars := destVars copy. "keeps track of names in use" usedVars addAll: args; addAll: locals. varMap := Dictionary new: 100. locals, args do: [ :v | ((doNotRename includes: v) not and: [destVars includes: v]) ifTrue: [newVarName := self unusedNamePrefixedBy: v avoiding: usedVars. varMap at: v put: newVarName]]. + self protectToBeExcludedReceiversForInlining. self renameVariablesUsing: varMap!
Item was added: + ----- Method: TSendNode>>nodeIsThisSendsStructReceiver: (in category 'inlining support') ----- + nodeIsThisSendsStructReceiver: aTParseNode + selector == #'atomic_store:_:' ifTrue: [self halt]. + ^aTParseNode == receiver + and: [receiver name beginsWith: 'self_in_']!
Item was changed: ----- Method: VMMaker>>options: (in category 'initialize') ----- options: anArrayOfPairs self assert: anArrayOfPairs size even. 1 to: anArrayOfPairs size by: 2 do: + [:i| + [:key :value| optionsDictionary at: key put: value] + valueWithArguments: + ((i to: i + 1) collect: + [:j| | value | + value := anArrayOfPairs at: j. + self assert: (value isSymbol or: [value isBehavior and: [value isMeta not]]). + value isSymbol ifTrue: [value] ifFalse: [value name]])]. - [:i| | key | - key := anArrayOfPairs at: i. - self assert: key isSymbol. - optionsDictionary at: key put: (anArrayOfPairs at: i + 1)]. "Now clear any stale/broken options in the actual InitializationOptions variable..." VMClass initializeWithOptions: optionsDictionary!
vm-dev@lists.squeakfoundation.org