<div dir="ltr">Hi Tim,<div><br></div><div>   is there a reason why you cannot put this in a subclass, e.g. RSqueakInterpreterProxy, rather than in the default?  Seems to me that would provide better documentation than the current method.  Also you could at least comment the method to explain that this is for RSqueak, and try and explain what happens in the RSqueakVM.  It looks opaque to me.  I like to know what primitives do.  For example, the comment in BlockClosure&gt;&gt;ensure: is explicit:</div><div><br></div><div><div>ensure: aBlock</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&quot;Evaluate a termination block after evaluating the receiver, regardless of</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> whether the receiver&#39;s evaluation completes.  N.B.  This method is *not*</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> implemented as a primitive.  Primitive 198 always fails.  The VM uses prim</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> 198 in a context&#39;s method as the mark for an ensure:/ifCurtailed: activation.&quot;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>| complete returnValue |</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;primitive: 198&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>returnValue := self valueNoContextSwitch.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>complete ifNil:[</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>complete := true.</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>aBlock value.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>].</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>^ returnValue</div></div><div><br></div><div>What you have is mysterious (at least to me):</div><div><br></div><div><div>primitiveFailFor: reasonCode</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&quot;Set specific primitive failure.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>N.B. primitiveFailFor: PrimNoErr is expected to clear the primFailCode.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>Primitive 255 is called to indicate that we are currently simulating a primitive that should fail and the VM should handle that case appropriately (if supported by the VM).&quot;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;primitive: 255&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>^ primFailCode := reasonCode</div></div><div><br></div><div>Surely, &quot;Primitive 255 is called to inform the VM that we are failing a primitive we are simulating.  Specific VMs, e.g. the RSqueakVM, choose not to implement certain primitives and prefer to simulate the code.  In this case the VM needs the primitive execution to catch, and handle, failure of the simulated code.&quot;</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 29, 2015 at 10:59 PM,  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Tim Felgentreff uploaded a new version of VMMaker to project VM Maker:<br>
<a href="http://source.squeak.org/VMMaker/VMMaker.oscog-tfel.1274.mcz" target="_blank">http://source.squeak.org/VMMaker/VMMaker.oscog-tfel.1274.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: VMMaker.oscog-tfel.1274<br>
Author: tfel<br>
Time: 30 April 2015, 7:59:26.741 am<br>
UUID: 11ab491c-b25b-4a4b-bbee-864f39e9d3e7<br>
Ancestors: VMMaker.oscog-rmacnak.1273<br>
<br>
Merge from VMMaker-tfel.363. Add primitive 255 as marker to InterpreterProxy&gt;&gt;primitiveFailFor: for RSqueakVM to notice that the simulation is about to fail<br>
<br>
=============== Diff against VMMaker.oscog-rmacnak.1273 ===============<br>
<br>
Item was changed:<br>
  ----- Method: InterpreterProxy&gt;&gt;primitiveFailFor: (in category &#39;other&#39;) -----<br>
  primitiveFailFor: reasonCode<br>
        &quot;Set specific primitive failure.<br>
+       N.B. primitiveFailFor: PrimNoErr is expected to clear the primFailCode.<br>
+       Primitive 255 is called to indicate that we are currently simulating a primitive that should fail and the VM should handle that case appropriately (if supported by the VM).&quot;<br>
+       &lt;primitive: 255&gt;<br>
+       ^ primFailCode := reasonCode!<br>
-        N.B. primitiveFailFor: PrimNoErr is expected to clear the primFailCode.&quot;<br>
-       (self confirm:&#39;A primitive is failing -- Stop simulation?&#39;) ifTrue:[self halt].<br>
-       ^primFailCode := reasonCode!<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">best,<div>Eliot</div></div>
</div>