<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>168264</bug_id>
          
          <creation_ts>2017-02-13 16:14:09 -0800</creation_ts>
          <short_desc>WebAssembly: make code position independent</short_desc>
          <delta_ts>2017-04-13 19:12:02 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>169611</dependson>
    
    <dependson>169773</dependson>
    
    <dependson>170207</dependson>
    
    <dependson>170210</dependson>
    
    <dependson>170261</dependson>
    
    <dependson>170312</dependson>
    
    <dependson>170488</dependson>
    
    <dependson>170573</dependson>
    
    <dependson>170632</dependson>
          <blocked>166480</blocked>
    
    <blocked>166481</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="JF Bastien">jfbastien</reporter>
          <assigned_to name="Saam Barati">saam</assigned_to>
          <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>jfbastien</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>msaboff</cc>
    
    <cc>saam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1276424</commentid>
    <comment_count>0</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2017-02-13 16:14:09 -0800</bug_when>
    <thetext>We&apos;ll want to be able to save a WebAssembly.Module&apos;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&apos;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&apos;s the same mechanism).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1287325</commentid>
    <comment_count>1</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2017-03-13 13:59:17 -0700</bug_when>
    <thetext>There&apos;s also code in the trap handling which needs to be updated. It has ([codebegin, codeend) + VM) structures, and the signal handlers have thunks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1292644</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-03-29 17:23:38 -0700</bug_when>
    <thetext>&lt;rdar://problem/31335594&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1297272</commentid>
    <comment_count>3</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-04-13 19:12:02 -0700</bug_when>
    <thetext>This is done as of:
https://trac.webkit.org/changeset/215353/webkit</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>