<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:msaboff&#64;apple.com" title="Michael Saboff &lt;msaboff&#64;apple.com&gt;"> <span class="fn">Michael Saboff</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Strict Equality on objects should only check that one of the two sides is an object."
   href="https://bugs.webkit.org/show_bug.cgi?id=145992">bug 145992</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #254990 Flags</td>
           <td>review?
           </td>
           <td>review-
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Strict Equality on objects should only check that one of the two sides is an object."
   href="https://bugs.webkit.org/show_bug.cgi?id=145992#c15">Comment # 15</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Strict Equality on objects should only check that one of the two sides is an object."
   href="https://bugs.webkit.org/show_bug.cgi?id=145992">bug 145992</a>
              from <span class="vcard"><a class="email" href="mailto:msaboff&#64;apple.com" title="Michael Saboff &lt;msaboff&#64;apple.com&gt;"> <span class="fn">Michael Saboff</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=254990&amp;action=diff" name="attach_254990" title="Patch Expected File">attachment 254990</a> <a href="attachment.cgi?id=254990&amp;action=edit" title="Patch Expected File">[details]</a></span>
Patch Expected File

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=254990&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=254990&amp;action=review</a>

Almost there.

<span class="quote">&gt; LayoutTests/ChangeLog:7
&gt; +</span >

Explain that you added this test for the new optimization.

<span class="quote">&gt; LayoutTests/js/dom/script-tests/document-all-strict-eq.js:5
&gt; +        return 0;</span >

It is clearer to return true or false.

<span class="quote">&gt; LayoutTests/js/dom/script-tests/document-all-strict-eq.js:7
&gt; +    return 1;</span >

It is clearer to return true or false.

<span class="quote">&gt; LayoutTests/js/dom/script-tests/document-all-strict-eq.js:13
&gt; +for (var i = 1; i &lt; 1000; i++) {</span >

This executes 999 times.  Start with i = 0.

<span class="quote">&gt; LayoutTests/js/dom/script-tests/document-all-strict-eq.js:14
&gt; +    shouldBe(&quot;f(test, test)&quot;, &quot;0&quot;);</span >

Construct this so that you keep track of the the result and provide one shouldBeXXX() or test{Passed,Failed} at the end of the loop.  For example, as long as f(test, test) == 0, you continue the loop.

var result = true;
for (var i = 0; i &lt; 1000; ++i) {
    if (f(test, test) != 0) {
        result = false;
        break;
    }
}

if (result)
    testPassed(&quot;f(test, test) compared correctly&quot;);
else
    testFailed(&quot;f(test, test) did not compare correctly&quot;);

<span class="quote">&gt; LayoutTests/js/dom/script-tests/document-all-strict-eq.js:25
&gt; +    for (var i = 1; i &lt; 1000; i++) {
&gt; +        shouldBe(&quot;f(test, test)&quot;, &quot;0&quot;);
&gt; +    }</span >

Same comments as above.

<span class="quote">&gt; Source/JavaScriptCore/ChangeLog:9
&gt; +        to hoist type checks out of a loop we can be cleverer about how we choose</span >

Is cleverer a word?

<span class="quote">&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:1175
&gt; +        BasicBlock* tmp = taken;
&gt; +        taken = notTaken;
&gt; +        notTaken = tmp;</span >

Use std::swap()

<span class="quote">&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:3950
&gt; +            ASSERT(false);</span >

Is this debug code?  It needs to be removed.

<span class="quote">&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:1206
&gt; +    MacroAssembler::Jump falseCase = m_jit.branchPtr(MacroAssembler::NotEqual, op1GPR, op2GPR);
&gt; +    m_jit.move(TrustedImm32(1), resultPayloadGPR);
&gt; +    MacroAssembler::Jump done = m_jit.jump();
&gt; +    falseCase.link(&amp;m_jit);
&gt; +    m_jit.move(TrustedImm32(0), resultPayloadGPR);
&gt; +    done.link(&amp;m_jit);</span >

You could replace this with:
    m_jit.compare32(JITCompiler::Equal, op1GPR, op2GPR, resultPayloadGPR);

<span class="quote">&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:1319
&gt; +    MacroAssembler::Jump falseCase = m_jit.branch64(MacroAssembler::NotEqual, op1GPR, op2GPR);
&gt; +    m_jit.move(TrustedImm32(ValueTrue), resultGPR);
&gt; +    MacroAssembler::Jump done = m_jit.jump();
&gt; +    falseCase.link(&amp;m_jit);
&gt; +    m_jit.move(TrustedImm32(ValueFalse), resultGPR);
&gt; +    done.link(&amp;m_jit);</span >

You can replace this with:
    m_jit.compare64(JITCompiler::Equal, op1GPR, op2GPR, resultGPR);
    m_jit.or32(TrustedImm32(ValueFalse), resultGPR);</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>