<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <title></title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Thanks a lot Eliot!<br>
    <br>
    Cheers,<br>
    <br>
    On 12/12/2022 2:40 PM, Eliot Miranda wrote:
    <blockquote
cite="mid:CAC20JE1H9YDARn--HkTR457DXwweP9kZ9zQE2FurUAqPOQ2JDg@mail.gmail.com"
      type="cite">
      <pre wrap=""> </pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <div dir="ltr">
        <div class="gmail_default" style="font-size: small;">Thanks
          Juan., Thanks Boris,</div>
        <div class="gmail_default" style="font-size: small;"><br>
        </div>
        <div class="gmail_default" style="font-size: small;">    that
          was easy to fix. The JIT primitive simply forgot to check
          the the target method;'s argument count  a bad oversight on my
          part.  I think what you're seeing in your example is the JIT
          primitive falling back on the interpreter version the first
          time, because either GC has voided the method cache or the
          target method isn't yet jitted (cuz it's never been used). The
          interpreter version has always correctly checked the target
          method;'s argument count.  I'll generate new sources soon.</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Mon, Dec 12, 2022 at 5:32
          AM Juan Vuletich <<a moz-do-not-send="true"
            href="mailto:juan@cuis.st">juan@cuis.st</a>> wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin: 0px 0px 0px
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;"> <br>
          Hi Folks,<br>
          <br>
          There seems to be a problem in the validation of the number of
          arguments <br>
          passed to #perform: (primitive 83, presumably also 84 and
          100). I can <br>
          reproduce the problem consistently in Cuis using OpenSmalltalk
          Mac x64 <br>
          Cog Spur VMs. Tried releases from 2022-05 and 2022-06. Also
          tried build <br>
          from 2022-11-21. I observe the same behavior on a fresh
          Squeak6.0-22104 <br>
          Mac bundle from <a moz-do-not-send="true"
            href="http://squeak.org" rel="noreferrer" target="_blank">squeak.org</a>.<br>
          <br>
          To reproduce the problem, print the result of this snippet:<br>
          <br>
          results := Bag new.<br>
          n := 100.<br>
          c := 0.<br>
          n timesRepeat: [<br>
               "Smalltalk garbageCollect."<br>
               b := [ 7 perform: #isDivisibleBy: ] on: Error do: [
          #errorAsExpected ].<br>
               results add: b.<br>
               b = #errorAsExpected ifFalse: [ c := c + 1 ]].<br>
          {c. 'failures out of'. n}<br>
          <br>
          I get 98 or 99 failures out of 100. The results bag shows that
          the <br>
          answer of #isDivisibleBy: without any argument is false (when
          the Error <br>
          is not raised). Adding this line:<br>
          <br>
          true ifTrue: [ ^ {self. aNumber} ].<br>
          <br>
          to the the start of #isDivisibleBy: shows that the argument
          passed to <br>
          the method is the #isDivisibleBy: symbol itself, i.e. the
          argument to <br>
          #perform:.<br>
          <br>
          As a last experiment, if I activate the call to garbage
          collection, it <br>
          works as expected, the Error is always raised, and there are
          zero <br>
          failures. So, whatever got broken, GC fixes it.<br>
          <br>
          I don't know the related VM internals in enough detail to work
          this out. <br>
          Can you please take a look?<br>
          <br>
          Thanks!<br>
          <br>
          -- <br>
          Juan Vuletich<br>
          <a moz-do-not-send="true" href="http://cuis.st"
            rel="noreferrer" target="_blank">cuis.st</a><br>
          <a moz-do-not-send="true" href="http://github.com/jvuletich"
            rel="noreferrer" target="_blank">github.com/jvuletich</a><br>
          <a moz-do-not-send="true"
            href="http://researchgate.net/profile/Juan-Vuletich"
            rel="noreferrer" target="_blank">researchgate.net/profile/Juan-Vuletich</a><br>
          <a moz-do-not-send="true"
            href="http://independent.academia.edu/JuanVuletich"
            rel="noreferrer" target="_blank">independent.academia.edu/JuanVuletich</a><br>
          <a moz-do-not-send="true"
            href="http://patents.justia.com/inventor/juan-manuel-vuletich"
            rel="noreferrer" target="_blank">patents.justia.com/inventor/juan-manuel-vuletich</a><br>
          <a moz-do-not-send="true"
            href="http://linkedin.com/in/juan-vuletich-75611b3"
            rel="noreferrer" target="_blank">linkedin.com/in/juan-vuletich-75611b3</a><br>
          <a moz-do-not-send="true"
            href="http://twitter.com/JuanVuletich" rel="noreferrer"
            target="_blank">twitter.com/JuanVuletich</a><br>
          <br>
        </blockquote>
      </div>
      <br clear="all">
      <div><br>
      </div>
      -- <br>
      <div dir="ltr" class="gmail_signature">
        <div dir="ltr">
          <div><span style="font-size: small; border-collapse:
              separate;">
              <div>_,,,^..^,,,_<br>
              </div>
              <div>best, Eliot</div>
            </span></div>
        </div>
      </div>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich</pre>
  </body>
</html>