[Vm-dev] VM Maker: VMMaker.oscog-eem.3225.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Jul 27 18:29:24 UTC 2022
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.3225.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.3225
Author: eem
Time: 27 July 2022, 11:29:08.077197 am
UUID: c63b47df-0c18-4c5d-8931-4c41d7baa28d
Ancestors: VMMaker.oscog-eem.3224
#firstIndexableField: is a "same-level" accessor as far as the accessor depth calculation goes. So it does not add to the depth. Hence collapse its case into the cCoerce*: one.
=============== Diff against VMMaker.oscog-eem.3224 ===============
Item was changed:
----- Method: CCodeGenerator>>depthOfAccessor:for: (in category 'spur primitive compilation') -----
depthOfAccessor: accessor for: chainVariableOrNil
"Compute the accessor depth for a send. This is potentially greater than one for a nested access
such as self fetchPointer: i ofObject: (self fetchPointer: j ofObject: (self fetchPointer: k ofObject: var)).
If chainVariableOrNil is not nil then an access is only meaningful if it is an access of chainVariableOrNil."
| keywords accessIndex objectAccessed |
accessor isSend ifFalse:
[^0].
(StackInterpreter isStackAccessor: accessor selector) ifTrue:
[^1].
+ (#(#firstIndexableField: cCoerceSimple:to: cCoerce:to:) includes: accessor selector) ifTrue:
- #firstIndexableField: == accessor selector ifTrue:
- [^1 + (self depthOfAccessor: accessor args first for: chainVariableOrNil)].
- (#(cCoerceSimple:to: cCoerce:to:) includes: accessor selector) ifTrue:
[^self depthOfAccessor: accessor args first for: chainVariableOrNil].
keywords := accessor selector keywords.
accessIndex := keywords
indexOf: 'ofObject:'
ifAbsent:
[^(accessor args
inject: ((StackInterpreter isObjectAccessor: accessor selector)
ifTrue: [1]
ifFalse: [0])
into:
[:best :node|
node isSend
ifTrue: [best max: (self depthOfAccessor: node for: chainVariableOrNil)]
ifFalse: [best]])].
objectAccessed := accessor args at: accessIndex.
chainVariableOrNil ifNil:
[^1 + (self depthOfAccessor: objectAccessed for: chainVariableOrNil)].
objectAccessed isSend ifFalse:
[^(objectAccessed isSameAs: chainVariableOrNil)
ifTrue: [1]
ifFalse: [0]].
(objectAccessed anySatisfy: [:node| node isSameAs: chainVariableOrNil]) ifFalse:
[^0].
^1 + (self depthOfAccessor: objectAccessed for: chainVariableOrNil)!
More information about the Vm-dev
mailing list