<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Refactor MathIC compilation process in Baseline and DFG to turn temporary registers usage more flexible"
   href="https://bugs.webkit.org/show_bug.cgi?id=160588#c34">Comment # 34</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Refactor MathIC compilation process in Baseline and DFG to turn temporary registers usage more flexible"
   href="https://bugs.webkit.org/show_bug.cgi?id=160588">bug 160588</a>
              from <span class="vcard"><a class="email" href="mailto:sbarati&#64;apple.com" title="Saam Barati &lt;sbarati&#64;apple.com&gt;"> <span class="fn">Saam Barati</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=160588#c33">comment #33</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=294030&amp;action=diff" name="attach_294030" title="Patch">attachment 294030</a> <a href="attachment.cgi?id=294030&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=294030&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=294030&amp;action=review</a>
&gt; 
&gt; &gt;&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:3563
&gt; &gt;&gt; +    FPRReg scratchFPR[Generator::scratchFPRRegCount];
&gt; &gt; 
&gt; &gt; I'm more of a fan of using Vector&lt;&gt; with an inline capacity for this API. You'll still get the same property where you don't end up mallocing any memory.
&gt; 
&gt; Sorry for my ignorance here. I used Vector with inline capacity in another
&gt; Patch this weekend, however I didn't totally understand it .Do you mind
&gt; explain me what is the difference of use a Vector&lt;int&gt;, for example?</span >
Using a Vector with an inline capacity as a stack allocated variable will prevent it from mallocing a backing store until you've exceeded InlineCapacity number of elements. You should read the entire vector class to get a better idea of what I'm saying, but at a high level, it has a field like this:

template &lt;typename T, size_t InlineCapacity&gt;
class Vector {
     T m_inlineVector[InlineCapacity];
}

<span class="quote">&gt; 
&gt; &gt;&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:3600
&gt; &gt;&gt; +    for (size_t i = 0; i &lt; std::min&lt;unsigned&gt;(availableGPRs, scratchGPRRegCount); i++) {
&gt; &gt; 
&gt; &gt; It seems wrong if the min() expression ever returns availableGPRs instead of scratchGPRRegCount. I would just turn this into an assert that we have enough registers.
&gt; 
&gt; hum...We can reproduce it on x86_32, for sure, because old implementation
&gt; uses result.tagGPR as scratchGPR because of limited registers. I am going to
&gt; double check it.</span ></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>