[Vm-dev] VM Maker: VMMaker.oscog-eem.3234.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Aug 2 17:26:26 UTC 2022
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.3234.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.3234
Author: eem
Time: 2 August 2022, 10:26:11.98735 am
UUID: 32fdb3bb-ea3a-4a14-9755-2ad589a8d3c2
Ancestors: VMMaker.oscog-eem.3233
Slang:
Fix an inlining regression in VMMaker.oscog-eem.3233. We still want to inline methods marked as macros for inlining across the cointerp/cogit boundary (e.g. shiftForWord). So distinguish between cmacro: methods (no inlining) and cmacro methods (inlining is fine).
=============== Diff against VMMaker.oscog-eem.3233 ===============
Item was changed:
----- Method: CCodeGenerator>>isConstantNode:valueInto: (in category 'utilities') -----
isConstantNode: aNode valueInto: aBlock
"Answer if aNode evaluates to a constant, and if so, evaluate aBlock with the value of that constant."
aNode isConstant ifTrue:
[(aNode isDefine
and: [self defineAtCompileTime: aNode name]) ifTrue:
[^false].
aBlock value: aNode value.
^true].
(aNode isVariable
and: [aNode name = #nil]) ifTrue:
[aBlock value: nil.
^true].
aNode isSend ifTrue:
[(self anyMethodNamed: aNode selector)
ifNil:
[(VMBasicConstants valueOfBasicSelector: aNode selector) ifNotNil:
[:value|
aBlock value: value.
^true].
aNode constantNumbericValueOrNil ifNotNil:
[:value|
aBlock value: value.
^true]]
ifNotNil:
[:m|
+ (m isMacroWithDefinition not
- (m definedAsMacro not
and: [m statements size = 1
and: [m statements last isReturn]]) ifTrue:
[^self isConstantNode: m statements last expression valueInto: aBlock]]].
^false!
Item was changed:
----- Method: CCodeGenerator>>isMacroSelector: (in category 'utilities') -----
isMacroSelector: sel
+ "Answer if the given selector is one of the selectors implemented as a macro in platform header files."
- "Answer if the given selector is one of the selectors implemented as a macro in platform header fiels."
^(self isKernelSelector: sel)
or: [(VMBasicConstants mostBasicConstantSelectors includes: sel)
or: [(self methodNamed: sel)
ifNil: [false]
ifNotNil: [:m| m definedAsMacro]]]!
Item was added:
+ ----- Method: TMethod>>isMacroWithDefinition (in category 'testing') -----
+ isMacroWithDefinition
+ "Answer if the method has a macro that has a definition, rather than being defined as a macro.
+ c.f. definedAsMacro.
+ Certain api methods are defined as cmacro (isMacroWithDefinition is false) so that their value can be defined,
+ e.g. shiftForWord. Many others are defined as macros proper, with a defintiion. The former is simply for
+ optimization and does not imply we want to disable inlining based on them. But we *do* want to disable
+ inlining of methods that are isMacroWithDefinition. hence the distinction."
+ ^properties notNil
+ and: [(properties includesKey: #cmacro:)]!
More information about the Vm-dev
mailing list