<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Optimize typed array access with a masked index"
   href="https://bugs.webkit.org/show_bug.cgi?id=142966#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Optimize typed array access with a masked index"
   href="https://bugs.webkit.org/show_bug.cgi?id=142966">bug 142966</a>
              from <span class="vcard"><a class="email" href="mailto:fpizlo&#64;apple.com" title="Filip Pizlo &lt;fpizlo&#64;apple.com&gt;"> <span class="fn">Filip Pizlo</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=249236&amp;action=diff" name="attach_249236" title="Optimize away bounds checks when given masked typed array indexes">attachment 249236</a> <a href="attachment.cgi?id=249236&amp;action=edit" title="Optimize away bounds checks when given masked typed array indexes">[details]</a></span>
Optimize away bounds checks when given masked typed array indexes

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

<span class="quote">&gt; Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp:57
&gt; +        JSValue shiftValue = indexNode-&gt;child2().node()-&gt;value.value();</span >

It is an antipattern to access the abstract value of a node directly.  You should use AbstractInterpreter::forNode(node).  Also, we usually access the inferred constant value using m_value, not value().

<span class="quote">&gt; Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp:68
&gt; +        JSValue offsetValue = indexNode-&gt;child2().node()-&gt;value.value();</span >

Ditto.

<span class="quote">&gt; Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp:93
&gt; +    JSValue maskValue = indexNode-&gt;child2().node()-&gt;value.value();</span >

Ditto.</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>