<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - B3 should efficiently emit great code for WebAssembly property accesses and bounds checks"
   href="https://bugs.webkit.org/show_bug.cgi?id=163171#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - B3 should efficiently emit great code for WebAssembly property accesses and bounds checks"
   href="https://bugs.webkit.org/show_bug.cgi?id=163171">bug 163171</a>
              from <span class="vcard"><a class="email" href="mailto:keith_miller&#64;apple.com" title="Keith Miller &lt;keith_miller&#64;apple.com&gt;"> <span class="fn">Keith Miller</span></a>
</span></b>
        <pre>I think your strategy does not work with the design of wasm. You cannot sink WasmBoundsCheck(Add(ptr, const), gpr, offset) to WasmBoundsCheck(ptr, gpr, offset - const) because that would change the trapping semantics of the language. For example if the user wrote the following wasm:

ptr = i32.Add(p, 2024)
i32.Load(ptr)

if p = 0 - 1024 then this code should not trap but if we sunk that addition into the guard page size we would trap since the pointer would appear to be out of bounds.</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>