<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebAssembly: make code position independent"
   href="https://bugs.webkit.org/show_bug.cgi?id=168264">168264</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>WebAssembly: make code position independent
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>JavaScriptCore
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jfbastien&#64;apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>fpizlo&#64;apple.com, jfbastien&#64;apple.com, keith_miller&#64;apple.com, mark.lam&#64;apple.com, msaboff&#64;apple.com, sbarati&#64;apple.com
          </td>
        </tr>

        <tr>
          <th>Blocks</th>
          <td>166480, 166481
          </td>
        </tr></table>
      <p>
        <div>
        <pre>We'll want to be able to save a WebAssembly.Module's code in IndexDB (#166481) and postMessage (#166480) the WebAssembly.Module cheaply to other workers without having to patch pointers and duplicate physical pages used for code. This allows us to instantiate the same module waaayyy better.

Right now our implementation has some pointers baked in: &amp;VM.topInstance, and functions for back traces. We'll want to do away with this.

The easiest and fastest thing is probably to store the topInstance in a TLS slot, and then change it when entering js-&gt;wasm, doing wasm-&gt;wasm calls, and when in a worker (nothing to do here really, it's the same mechanism).</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>