<div dir="ltr">Hi Clement,<div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.800000190734863px">Something is fishy in debugStackPointers in the SistaVM. It fails multiple assertion. I believe it's related tobranchIfInstanceOf bytecodes</span></blockquote><div>I think that the problem is in  stackDeltaForPrimitive:in:. An unary inline primitive has a stack delta of zero (Consumes one value and produce another value: -1 + 1 = 0). A binary inline primitive has a stack delta of -1 (Consumes 2 value, produce one value: -2 + 1 = -1) . A ternary inline primitive has a stack delta of -2. (Consume three values, produce one value: -3 + 1 = -2).</div><div><br></div><div>I think that this is the correct definition for the method:</div><div><br></div><div><div>stackDeltaForPrimitive: primitiveIndex in: method</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>"Answer the stack delta for the callPrimitive: bytecode (see my class comment).</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span> There is no delta for non-inlined primitives (its implicitly 0 - method numArgs).</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">     </span> Inlined primitives are grouped by the thousand by argument count, 32 args max ;-)."</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>| prim primSet |</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">       </span>^primitiveIndex < 32678</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">             </span>ifTrue: [0]</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">            </span>ifFalse: [</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                     </span>primSet := (primitiveIndex - 32768) >> 13 bitAnd: 3.</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                     </span>prim := (primitiveIndex - 32768) bitAnd: 8191.</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                 </span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">               </span>1 - (prim // 1000)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">     </span>]</div></div></div><div><br></div><div>Best regards,</div><div>Ronie</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-19 8:19 GMT-03:00  <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span>:<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.2105.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/<wbr>VMMaker/VMMaker.oscog-cb.2105.<wbr>mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: VMMaker.oscog-cb.2105<br>
Author: cb<br>
Time: 19 January 2017, 12:19:42.246677 pm<br>
UUID: 1f5ef635-cb7b-48c2-be74-<wbr>4345d39c620f<br>
Ancestors: VMMaker.oscog-cb.2104<br>
<br>
Set deadCode to true in trap bytecode to avoid generating merge machne code that is never reached.<br>
<br>
Something is fishy in debugStackPointers in the SistaVM. It fails multiple assertion. I believe it's related tobranchIfInstanceOf bytecodes<br>
<br>
=============== Diff against VMMaker.oscog-cb.2104 ===============<br>
<br>
Item was changed:<br>
  ----- Method: SistaCogit>><wbr>genUnconditionalTrapBytecode (in category 'bytecode generators') -----<br>
  genUnconditionalTrapBytecode<br>
        "SistaV1: *     217             Trap"<br>
        self ssFlushTo: simStackPtr.<br>
        self CallRT: ceTrapTrampoline.<br>
        self annotateBytecode: self Label.<br>
+       deadCode := true.<br>
        ^0!<br>
<br>
</blockquote></div><br></div>