<div dir="ltr">With that commit the VM is stable again. </div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 17, 2016 at 4:11 PM, <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
ClementBera uploaded a new version of VMMaker to project VM Maker:<br>
<a href="http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1919.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/<wbr>VMMaker/VMMaker.oscog-cb.1919.<wbr>mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: VMMaker.oscog-cb.1919<br>
Author: cb<br>
Time: 17 August 2016, 4:10:53.445475 pm<br>
UUID: 00a8dd2a-bc8d-4552-b400-<wbr>be781c8aabec<br>
Ancestors: VMMaker.oscog-cb.1918<br>
<br>
fixed bug in scanner related to twoPath methods<br>
<br>
=============== Diff against VMMaker.oscog-cb.1918 ===============<br>
<br>
Item was changed:<br>
----- Method: StackToRegisterMappingCogit>><wbr>compileFrameBuild (in category 'compile abstract instructions') -----<br>
compileFrameBuild<br>
"Build a frame for a CogMethod activation. See CoInterpreter class>>initializeFrameIndices.<br>
Override to push the register receiver and register arguments, if any."<br>
self cppIf: IMMUTABILITY ifTrue:<br>
[useTwoPaths ifTrue:<br>
[self compileTwoPathFrameBuild.<br>
^self]].<br>
needsFrame ifFalse:<br>
[useTwoPaths ifTrue:<br>
[self compileTwoPathFramelessInit].<br>
self initSimStackForFramelessMethod<wbr>: initialPC.<br>
^self].<br>
+ self deny: useTwoPaths.<br>
self genPushRegisterArgs.<br>
super compileFrameBuild.<br>
self initSimStackForFramefulMethod: initialPC!<br>
<br>
Item was changed:<br>
----- Method: StackToRegisterMappingCogit>><wbr>scanMethod (in category 'compile abstract instructions') -----<br>
scanMethod<br>
"Scan the method (and all embedded blocks) to determine<br>
- what the last bytecode is; extra bytes at the end of a method are used to encode things like source pointers or temp names<br>
- if the method needs a frame or not<br>
- what are the targets of any backward branches.<br>
- how many blocks it creates<br>
Answer the block count or on error a negative error code"<br>
| latestContinuation nExts descriptor pc numBlocks distance targetPC framelessStackDelta seenInstVarStore |<br>
<var: #descriptor type: #'BytecodeDescriptor *'><br>
needsFrame := useTwoPaths := seenInstVarStore := false.<br>
self maybeInitNumFixups.<br>
self maybeInitNumCounters.<br>
prevBCDescriptor := nil.<br>
NewspeakVM ifTrue:<br>
[numIRCs := 0].<br>
(primitiveIndex > 0<br>
and: [coInterpreter isQuickPrimitiveIndex: primitiveIndex]) ifTrue:<br>
[^0].<br>
pc := latestContinuation := initialPC.<br>
numBlocks := framelessStackDelta := nExts := extA := extB := 0.<br>
[pc <= endPC] whileTrue:<br>
[byte0 := (objectMemory fetchByte: pc ofObject: methodObj) + bytecodeSetOffset.<br>
descriptor := self generatorAt: byte0.<br>
descriptor isExtension ifTrue:<br>
[descriptor opcode = Nop ifTrue: "unknown bytecode tag; see Cogit class>>#generatorTableFrom:"<br>
[^EncounteredUnknownBytecode].<br>
self loadSubsequentBytesForDescript<wbr>or: descriptor at: pc.<br>
self perform: descriptor generator].<br>
(descriptor isReturn<br>
and: [pc >= latestContinuation]) ifTrue:<br>
[endPC := pc].<br>
<br>
needsFrame ifFalse:<br>
[(descriptor needsFrameFunction isNil<br>
or: [self perform: descriptor needsFrameFunction with: framelessStackDelta])<br>
ifTrue:<br>
["With immutability we win simply by avoiding a frame build if the receiver is young and not immutable."<br>
self cppIf: IMMUTABILITY<br>
ifTrue: [descriptor is1ByteInstVarStore<br>
ifTrue: [useTwoPaths := true]<br>
ifFalse: [needsFrame := true. useTwoPaths := false]]<br>
+ ifFalse: [needsFrame := true. useTwoPaths := false]]<br>
- ifFalse: [needsFrame := true]]<br>
ifFalse:<br>
[framelessStackDelta := framelessStackDelta + descriptor stackDelta.<br>
"Without immutability we win if there are two or more stores and the receiver is new."<br>
self cppIf: IMMUTABILITY<br>
ifTrue: []<br>
ifFalse:<br>
[descriptor is1ByteInstVarStore ifTrue:<br>
[seenInstVarStore<br>
ifTrue: [useTwoPaths := true]<br>
ifFalse: [seenInstVarStore := true]]]]].<br>
<br>
descriptor isBranch ifTrue:<br>
[distance := self spanFor: descriptor at: pc exts: nExts in: methodObj.<br>
targetPC := pc + descriptor numBytes + distance.<br>
(self isBackwardBranch: descriptor at: pc exts: nExts in: methodObj)<br>
ifTrue: [self initializeFixupAt: targetPC - initialPC]<br>
ifFalse:<br>
[latestContinuation := latestContinuation max: targetPC.<br>
self maybeCountFixup.<br>
self maybeCountCounter]].<br>
descriptor isBlockCreation ifTrue:<br>
[numBlocks := numBlocks + 1.<br>
distance := self spanFor: descriptor at: pc exts: nExts in: methodObj.<br>
targetPC := pc + descriptor numBytes + distance.<br>
latestContinuation := latestContinuation max: targetPC.<br>
self maybeCountFixup].<br>
<br>
NewspeakVM ifTrue:<br>
[descriptor hasIRC ifTrue:<br>
[numIRCs := numIRCs + 1]].<br>
pc := pc + descriptor numBytes.<br>
descriptor isExtension<br>
ifTrue: [nExts := nExts + 1]<br>
ifFalse: [nExts := extA := extB := 0].<br>
prevBCDescriptor := descriptor].<br>
^numBlocks!<br>
<br>
</blockquote></div><br></div>