[Vm-dev] VM Maker: VMMaker.oscog-eem.1664.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat Jan 23 01:34:10 UTC 2016
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1664.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.1664
Author: eem
Time: 23 January 2016, 5:32:29.926128 pm
UUID: 9e676eea-f638-4da0-bd70-920a096bda28
Ancestors: VMMaker.oscog-eem.1663
And the type iferrence algorithm can't cope with mutual recursion, so break the log jam by explicitly typing findMethodWithPrimitive:FromContext:UpToContext: which is mutually recursive with findMethodWithPrimitive:FromFP:UpToContext:.
=============== Diff against VMMaker.oscog-eem.1663 ===============
Item was changed:
----- Method: StackInterpreter>>findMethodWithPrimitive:FromContext:UpToContext: (in category 'handler search') -----
findMethodWithPrimitive: primitive FromContext: senderContext UpToContext: homeContext
"See findUnwindThroughContext:. Alas this is mutually recursive with
findMethodWithPrimitive:FromFP:SP:ThroughContext: instead of iterative.
We're doing the simplest thing that could possibly work. Niceties can wait."
<inline: false>
+ <returnTypeC: #sqInt> "Being mutually-recursive with findMethodWithPrimitive:FromFP:UpToContext: gives the author's type inference algorithm headaches. Wimp out by declaring the return type."
| theContext theMethod |
self assert: (senderContext = objectMemory nilObject or: [objectMemory isContext: senderContext]).
self assert: (homeContext = objectMemory nilObject or: [objectMemory isContext: homeContext]).
theContext := senderContext.
[theContext = objectMemory nilObject ifTrue:
[^theContext].
self isMarriedOrWidowedContext: theContext] whileFalse:
[theContext = homeContext ifTrue: [^0].
(primitive = 0
or: [(objectMemory fetchPointer: ClosureIndex ofObject: theContext) ~= objectMemory nilObject]) ifFalse:
[theMethod := objectMemory fetchPointer: MethodIndex ofObject: theContext.
(self primitiveIndexOf: theMethod) = primitive ifTrue:
[^theContext]].
theContext := objectMemory fetchPointer: SenderIndex ofObject: theContext].
(self isWidowedContext: theContext) ifTrue:
[^objectMemory nilObject].
^self
findMethodWithPrimitive: primitive
FromFP: (self frameOfMarriedContext: theContext)
UpToContext: homeContext!
More information about the Vm-dev
mailing list