[Vm-dev] VM Maker: VMMaker.oscog-eem.3288.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Jan 12 18:36:23 UTC 2023
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.3288.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.3288
Author: eem
Time: 12 January 2023, 10:36:05.690572 am
UUID: f51f1ed0-2a67-4403-a874-8b1ba1700ff5
Ancestors: VMMaker.oscog-eem.3287
Merge VMMaker.oscog.seperateMarking-WoC.3298 & VMMaker.oscog.seperateMarking-WoC.3299.
=============== Diff against VMMaker.oscog-eem.3287 ===============
Item was added:
+ ----- Method: StackInterpreter>>checkForRequiredInlinability (in category 'stack bytecodes') -----
+ checkForRequiredInlinability
+ "This is used in methods answering inlinability.
+ Always answer false. But if the receiver is marked as something that must be inlined (inline == #always) raise an error."
+ (inline == #always and: [complete]) ifTrue:
+ [self error: 'cannot inline method ', selector, ' marked as <inline: #always>'].
+ ^false!!TMethod methodsFor: #testing stamp: 'WoC 1/12/2023 12:48'!
Item was added:
+ ----- Method: StackInterpreter>>checkForRequiredInlinabilityIn: (in category 'stack bytecodes') -----
+ checkForRequiredInlinabilityIn: aMethod
+ "This is used in methods answering inlinability.
+ Always answer false. But if the receiver is marked as something that must be inlined (inline == #always) raise an error."
+ (inline == #always and: [complete]) ifTrue:
+ [self error: 'cannot inline method ', selector, ' marked as <inline: #always> into: ', aMethod asString].
+ ^false!!TMethod methodsFor: #inlining stamp: 'WoC 1/12/2023 12:47'!
Item was changed:
----- Method: StackInterpreter>>extPushFullClosureBytecode (in category 'stack bytecodes') -----
extPushFullClosureBytecode
"255 11111111 xxxxxxxx siyyyyyy
push Closure Compiled block literal index xxxxxxxx (+ Extend A * 256)
numCopied yyyyyy
receiverOnStack: s = 1
ignoreOuterContext: i = 1
The compiler has pushed the values to be copied, if any. The receiver has been pushed on stack before if specified.
Create a Closure with space for the copiedValues and pop numCopied values off the stack into the closure.
Sets outerContext, compiledBlock, numArgs and receiver as specified.."
| compiledBlockLiteralIndex compiledBlock byte numArgs numCopied receiverIsOnStack ignoreContext |
compiledBlockLiteralIndex := self fetchByte + (extA << 8).
extA := 0.
+ compiledBlock := objectMemory followMaybeForwarded: (self literal: compiledBlockLiteralIndex).
- compiledBlock := self literal: compiledBlockLiteralIndex.
self assert: (objectMemory isOopCompiledMethod: compiledBlock).
numArgs := self argumentCountOf: compiledBlock.
byte := self fetchByte.
numCopied := byte bitAnd: 1<< 6 - 1.
receiverIsOnStack := byte anyMask: 1 << 7.
ignoreContext := byte anyMask: 1 << 6.
+ self pushFullClosureNumArgs: numArgs copiedValues: numCopied compiledBlock: compiledBlock receiverIsOnStack: receiverIsOnStack ignoreContext: ignoreContext!!TMethod methodsFor: #testing stamp: 'eem 12/15/2016 09:32'!
- self pushFullClosureNumArgs: numArgs copiedValues: numCopied compiledBlock: compiledBlock receiverIsOnStack: receiverIsOnStack ignoreContext: ignoreContext!
Item was added:
+ ----- Method: StackInterpreter>>inlineableFunctionCall:in: (in category 'stack bytecodes') -----
+ inlineableFunctionCall: aNode in: aCodeGen
+ "Answer if the given send node is a call to a 'functional' method--a method whose body is a single return statement of some expression and whose actual parameters can all be directly substituted."
+
+ aCodeGen maybeBreakForTestToInline: aNode in: self.
+ aNode isSend ifFalse:
+ [^false].
+ ((aCodeGen shouldGenerateAsInterpreterProxySend: aNode)
+ or: [aCodeGen isStructSend: aNode]) ifTrue:
+ [^false].
+ ^(aCodeGen methodNamed: aNode selector)
+ ifNil:
+ [aNode asTransformedConstantPerform
+ ifNil: [self isInlineableConditional: aNode in: aCodeGen]
+ ifNotNil: [:n| self inlineableFunctionCall: n in: aCodeGen]]
+ ifNotNil:
+ [:m|
+ (m ~~ self
+ and: [((m isFunctionalIn: aCodeGen) or: [m mustBeInlined and: [m isComplete]])
+ and: [m mayBeInlined
+ and: [(aCodeGen mayInline: m selector)
+ and: [aNode args allSatisfy: [:a| self isSubstitutableNode: a intoMethod: m in: aCodeGen]]]]])
+ or: [m checkForRequiredInlinabilityIn: self]]!!TMethod methodsFor: #inlining stamp: 'WoC 1/12/2023 12:48'!
Item was added:
+ ----- Method: StackInterpreter>>inlineableSend:in: (in category 'stack bytecodes') -----
+ inlineableSend: aNode in: aCodeGen
+ "Answer if the given send node is a call to a method that can be inlined."
+
+ | m |
+ aCodeGen maybeBreakForTestToInline: aNode in: self.
+ aNode isSend ifFalse: [^false].
+ m := aCodeGen methodNamed: aNode selector. "nil if builtin or external function"
+
+ ^m ~= nil
+ and: [m ~~ self
+ and: [m unmodifiedSelector ~= self unmodifiedSelector
+ and: [m mayBeInlined
+ and: [(m isComplete and: [aCodeGen mayInline: m selector])
+ or: [m checkForRequiredInlinabilityIn: self]]]]]!
More information about the Vm-dev
mailing list