<?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>166480</bug_id>
          
          <creation_ts>2016-12-26 09:35:43 -0800</creation_ts>
          <short_desc>WebAssembly: test compile / instantiate in a Worker</short_desc>
          <delta_ts>2017-05-03 10:17:25 -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>CONFIGURATION CHANGED</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>166481</dependson>
    
    <dependson>168264</dependson>
          <blocked>161709</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="JF Bastien">jfbastien</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>jfbastien</cc>
    
    <cc>keith_miller</cc>
    
    <cc>saam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1262749</commentid>
    <comment_count>0</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2016-12-26 09:35:43 -0800</bug_when>
    <thetext>I&apos;ve heard from someone trying out WebAssembly that they current use compile / instantiate in a worker because some implementations aren&apos;t asynchronous. They want to do work on the main thread while compiling, so a Worker makes sense. They then transfer the Module / Instance back to the main thread.

We should have a test that this works well.

Related:
 - WebAssembly: Make WebAssembly.compile truly asynchronous https://bugs.webkit.org/show_bug.cgi?id=166016
 - WebAssembly: Implement the WebAssembly.instantiate API https://bugs.webkit.org/show_bug.cgi?id=165982</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262763</commentid>
    <comment_count>1</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-12-26 11:34:36 -0800</bug_when>
    <thetext>(In reply to comment #0)
&gt; I&apos;ve heard from someone trying out WebAssembly that they current use compile
&gt; / instantiate in a worker because some implementations aren&apos;t asynchronous.
&gt; They want to do work on the main thread while compiling, so a Worker makes
&gt; sense. They then transfer the Module / Instance back to the main thread.
&gt; 
&gt; We should have a test that this works well.
&gt; 
&gt; Related:
&gt;  - WebAssembly: Make WebAssembly.compile truly asynchronous
&gt; https://bugs.webkit.org/show_bug.cgi?id=166016
&gt;  - WebAssembly: Implement the WebAssembly.instantiate API
&gt; https://bugs.webkit.org/show_bug.cgi?id=165982

I think this should work as expected regardless of the compile API being asynchronous internally.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262764</commentid>
    <comment_count>2</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-12-26 11:35:09 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; (In reply to comment #0)
&gt; &gt; I&apos;ve heard from someone trying out WebAssembly that they current use compile
&gt; &gt; / instantiate in a worker because some implementations aren&apos;t asynchronous.
&gt; &gt; They want to do work on the main thread while compiling, so a Worker makes
&gt; &gt; sense. They then transfer the Module / Instance back to the main thread.
&gt; &gt; 
&gt; &gt; We should have a test that this works well.
&gt; &gt; 
&gt; &gt; Related:
&gt; &gt;  - WebAssembly: Make WebAssembly.compile truly asynchronous
&gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=166016
&gt; &gt;  - WebAssembly: Implement the WebAssembly.instantiate API
&gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=165982
&gt; 
&gt; I think this should work as expected regardless of the compile API being
&gt; asynchronous internally.

Also, I agree we should have a test for this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262765</commentid>
    <comment_count>3</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2016-12-26 11:40:55 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; (In reply to comment #1)
&gt; &gt; (In reply to comment #0)
&gt; &gt; &gt; I&apos;ve heard from someone trying out WebAssembly that they current use compile
&gt; &gt; &gt; / instantiate in a worker because some implementations aren&apos;t asynchronous.
&gt; &gt; &gt; They want to do work on the main thread while compiling, so a Worker makes
&gt; &gt; &gt; sense. They then transfer the Module / Instance back to the main thread.
&gt; &gt; &gt; 
&gt; &gt; &gt; We should have a test that this works well.
&gt; &gt; &gt; 
&gt; &gt; &gt; Related:
&gt; &gt; &gt;  - WebAssembly: Make WebAssembly.compile truly asynchronous
&gt; &gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=166016
&gt; &gt; &gt;  - WebAssembly: Implement the WebAssembly.instantiate API
&gt; &gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=165982
&gt; &gt; 
&gt; &gt; I think this should work as expected regardless of the compile API being
&gt; &gt; asynchronous internally.
&gt; 
&gt; Also, I agree we should have a test for this.

Right, I want to make sure postMessage-ing Module / Instance / Memory / Table all work as expected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262769</commentid>
    <comment_count>4</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-12-26 12:08:21 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; (In reply to comment #1)
&gt; &gt; &gt; (In reply to comment #0)
&gt; &gt; &gt; &gt; I&apos;ve heard from someone trying out WebAssembly that they current use compile
&gt; &gt; &gt; &gt; / instantiate in a worker because some implementations aren&apos;t asynchronous.
&gt; &gt; &gt; &gt; They want to do work on the main thread while compiling, so a Worker makes
&gt; &gt; &gt; &gt; sense. They then transfer the Module / Instance back to the main thread.
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; We should have a test that this works well.
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; Related:
&gt; &gt; &gt; &gt;  - WebAssembly: Make WebAssembly.compile truly asynchronous
&gt; &gt; &gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=166016
&gt; &gt; &gt; &gt;  - WebAssembly: Implement the WebAssembly.instantiate API
&gt; &gt; &gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=165982
&gt; &gt; &gt; 
&gt; &gt; &gt; I think this should work as expected regardless of the compile API being
&gt; &gt; &gt; asynchronous internally.
&gt; &gt; 
&gt; &gt; Also, I agree we should have a test for this.
&gt; 
&gt; Right, I want to make sure postMessage-ing Module / Instance / Memory /
&gt; Table all work as expected.

Interesting. Is that the expected behavior? This is unlike anything we do elsewhere. We don&apos;t postMessage heap cells since each worker is in a different VM</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262770</commentid>
    <comment_count>5</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2016-12-26 12:09:32 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; (In reply to comment #1)
&gt; &gt; &gt; &gt; (In reply to comment #0)
&gt; &gt; &gt; &gt; &gt; I&apos;ve heard from someone trying out WebAssembly that they current use compile
&gt; &gt; &gt; &gt; &gt; / instantiate in a worker because some implementations aren&apos;t asynchronous.
&gt; &gt; &gt; &gt; &gt; They want to do work on the main thread while compiling, so a Worker makes
&gt; &gt; &gt; &gt; &gt; sense. They then transfer the Module / Instance back to the main thread.
&gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; We should have a test that this works well.
&gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; Related:
&gt; &gt; &gt; &gt; &gt;  - WebAssembly: Make WebAssembly.compile truly asynchronous
&gt; &gt; &gt; &gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=166016
&gt; &gt; &gt; &gt; &gt;  - WebAssembly: Implement the WebAssembly.instantiate API
&gt; &gt; &gt; &gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=165982
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; I think this should work as expected regardless of the compile API being
&gt; &gt; &gt; &gt; asynchronous internally.
&gt; &gt; &gt; 
&gt; &gt; &gt; Also, I agree we should have a test for this.
&gt; &gt; 
&gt; &gt; Right, I want to make sure postMessage-ing Module / Instance / Memory /
&gt; &gt; Table all work as expected.
&gt; 
&gt; Interesting. Is that the expected behavior? This is unlike anything we do
&gt; elsewhere. We don&apos;t postMessage heap cells since each worker is in a
&gt; different VM

I don&apos;t know what&apos;s expected :-D</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262771</commentid>
    <comment_count>6</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-12-26 12:21:19 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; (In reply to comment #3)
&gt; &gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; &gt; (In reply to comment #1)
&gt; &gt; &gt; &gt; &gt; (In reply to comment #0)
&gt; &gt; &gt; &gt; &gt; &gt; I&apos;ve heard from someone trying out WebAssembly that they current use compile
&gt; &gt; &gt; &gt; &gt; &gt; / instantiate in a worker because some implementations aren&apos;t asynchronous.
&gt; &gt; &gt; &gt; &gt; &gt; They want to do work on the main thread while compiling, so a Worker makes
&gt; &gt; &gt; &gt; &gt; &gt; sense. They then transfer the Module / Instance back to the main thread.
&gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; We should have a test that this works well.
&gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; Related:
&gt; &gt; &gt; &gt; &gt; &gt;  - WebAssembly: Make WebAssembly.compile truly asynchronous
&gt; &gt; &gt; &gt; &gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=166016
&gt; &gt; &gt; &gt; &gt; &gt;  - WebAssembly: Implement the WebAssembly.instantiate API
&gt; &gt; &gt; &gt; &gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=165982
&gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; I think this should work as expected regardless of the compile API being
&gt; &gt; &gt; &gt; &gt; asynchronous internally.
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; Also, I agree we should have a test for this.
&gt; &gt; &gt; 
&gt; &gt; &gt; Right, I want to make sure postMessage-ing Module / Instance / Memory /
&gt; &gt; &gt; Table all work as expected.
&gt; &gt; 
&gt; &gt; Interesting. Is that the expected behavior? This is unlike anything we do
&gt; &gt; elsewhere. We don&apos;t postMessage heap cells since each worker is in a
&gt; &gt; different VM
&gt; 
&gt; I don&apos;t know what&apos;s expected :-D

We won&apos;t be able to compile a Module then ship over the module across workers. We will be able to have workers that have their own Modules/Instances/etc that can run independently. We need to think about what happens when we try to ship over an ArrayBuffer for Memory. This should probably not be allowed since it&apos;s backed by Wasm::Memory mmaped memory.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262772</commentid>
    <comment_count>7</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2016-12-26 12:23:51 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #5)
&gt; &gt; (In reply to comment #4)
&gt; &gt; &gt; (In reply to comment #3)
&gt; &gt; &gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; &gt; &gt; (In reply to comment #1)
&gt; &gt; &gt; &gt; &gt; &gt; (In reply to comment #0)
&gt; &gt; &gt; &gt; &gt; &gt; &gt; I&apos;ve heard from someone trying out WebAssembly that they current use compile
&gt; &gt; &gt; &gt; &gt; &gt; &gt; / instantiate in a worker because some implementations aren&apos;t asynchronous.
&gt; &gt; &gt; &gt; &gt; &gt; &gt; They want to do work on the main thread while compiling, so a Worker makes
&gt; &gt; &gt; &gt; &gt; &gt; &gt; sense. They then transfer the Module / Instance back to the main thread.
&gt; &gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; &gt; We should have a test that this works well.
&gt; &gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; &gt; Related:
&gt; &gt; &gt; &gt; &gt; &gt; &gt;  - WebAssembly: Make WebAssembly.compile truly asynchronous
&gt; &gt; &gt; &gt; &gt; &gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=166016
&gt; &gt; &gt; &gt; &gt; &gt; &gt;  - WebAssembly: Implement the WebAssembly.instantiate API
&gt; &gt; &gt; &gt; &gt; &gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=165982
&gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; I think this should work as expected regardless of the compile API being
&gt; &gt; &gt; &gt; &gt; &gt; asynchronous internally.
&gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; Also, I agree we should have a test for this.
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; Right, I want to make sure postMessage-ing Module / Instance / Memory /
&gt; &gt; &gt; &gt; Table all work as expected.
&gt; &gt; &gt; 
&gt; &gt; &gt; Interesting. Is that the expected behavior? This is unlike anything we do
&gt; &gt; &gt; elsewhere. We don&apos;t postMessage heap cells since each worker is in a
&gt; &gt; &gt; different VM
&gt; &gt; 
&gt; &gt; I don&apos;t know what&apos;s expected :-D
&gt; 
&gt; We won&apos;t be able to compile a Module then ship over the module across
&gt; workers. We will be able to have workers that have their own
&gt; Modules/Instances/etc that can run independently. We need to think about
&gt; what happens when we try to ship over an ArrayBuffer for Memory. This should
&gt; probably not be allowed since it&apos;s backed by Wasm::Memory mmaped memory.

IIUC they serialize WebAssembly.Module, and transfer it from Worker to main thread. Apparently this works in Chrome / FF. Should we file an issue on this in the design repo?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262773</commentid>
    <comment_count>8</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-12-26 12:27:27 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #6)
&gt; &gt; (In reply to comment #5)
&gt; &gt; &gt; (In reply to comment #4)
&gt; &gt; &gt; &gt; (In reply to comment #3)
&gt; &gt; &gt; &gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; &gt; &gt; &gt; (In reply to comment #1)
&gt; &gt; &gt; &gt; &gt; &gt; &gt; (In reply to comment #0)
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; I&apos;ve heard from someone trying out WebAssembly that they current use compile
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; / instantiate in a worker because some implementations aren&apos;t asynchronous.
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; They want to do work on the main thread while compiling, so a Worker makes
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; sense. They then transfer the Module / Instance back to the main thread.
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; We should have a test that this works well.
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Related:
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;  - WebAssembly: Make WebAssembly.compile truly asynchronous
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=166016
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;  - WebAssembly: Implement the WebAssembly.instantiate API
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=165982
&gt; &gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; &gt; I think this should work as expected regardless of the compile API being
&gt; &gt; &gt; &gt; &gt; &gt; &gt; asynchronous internally.
&gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; Also, I agree we should have a test for this.
&gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; Right, I want to make sure postMessage-ing Module / Instance / Memory /
&gt; &gt; &gt; &gt; &gt; Table all work as expected.
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; Interesting. Is that the expected behavior? This is unlike anything we do
&gt; &gt; &gt; &gt; elsewhere. We don&apos;t postMessage heap cells since each worker is in a
&gt; &gt; &gt; &gt; different VM
&gt; &gt; &gt; 
&gt; &gt; &gt; I don&apos;t know what&apos;s expected :-D
&gt; &gt; 
&gt; &gt; We won&apos;t be able to compile a Module then ship over the module across
&gt; &gt; workers. We will be able to have workers that have their own
&gt; &gt; Modules/Instances/etc that can run independently. We need to think about
&gt; &gt; what happens when we try to ship over an ArrayBuffer for Memory. This should
&gt; &gt; probably not be allowed since it&apos;s backed by Wasm::Memory mmaped memory.
&gt; 
&gt; IIUC they serialize WebAssembly.Module, and transfer it from Worker to main
&gt; thread. Apparently this works in Chrome / FF. Should we file an issue on
&gt; this in the design repo?
We should probably support the same serialization. I&apos;m interested to know what happens to the underlying Memory/etc in the worker that created them after they&apos;re transferred. Also, what happens to the underlying memory? Is there a spec for this serialization? A better API than using workers would be we should just make the asynchronous APIs truly asynchronous. I don&apos;t think that should be too difficult</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262775</commentid>
    <comment_count>9</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2016-12-26 13:02:03 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; (In reply to comment #6)
&gt; &gt; &gt; (In reply to comment #5)
&gt; &gt; &gt; &gt; (In reply to comment #4)
&gt; &gt; &gt; &gt; &gt; (In reply to comment #3)
&gt; &gt; &gt; &gt; &gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; &gt; &gt; &gt; &gt; (In reply to comment #1)
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; (In reply to comment #0)
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; I&apos;ve heard from someone trying out WebAssembly that they current use compile
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; / instantiate in a worker because some implementations aren&apos;t asynchronous.
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; They want to do work on the main thread while compiling, so a Worker makes
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; sense. They then transfer the Module / Instance back to the main thread.
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; We should have a test that this works well.
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Related:
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;  - WebAssembly: Make WebAssembly.compile truly asynchronous
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=166016
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;  - WebAssembly: Implement the WebAssembly.instantiate API
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; https://bugs.webkit.org/show_bug.cgi?id=165982
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; I think this should work as expected regardless of the compile API being
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; asynchronous internally.
&gt; &gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; &gt; Also, I agree we should have a test for this.
&gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; Right, I want to make sure postMessage-ing Module / Instance / Memory /
&gt; &gt; &gt; &gt; &gt; &gt; Table all work as expected.
&gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; Interesting. Is that the expected behavior? This is unlike anything we do
&gt; &gt; &gt; &gt; &gt; elsewhere. We don&apos;t postMessage heap cells since each worker is in a
&gt; &gt; &gt; &gt; &gt; different VM
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; I don&apos;t know what&apos;s expected :-D
&gt; &gt; &gt; 
&gt; &gt; &gt; We won&apos;t be able to compile a Module then ship over the module across
&gt; &gt; &gt; workers. We will be able to have workers that have their own
&gt; &gt; &gt; Modules/Instances/etc that can run independently. We need to think about
&gt; &gt; &gt; what happens when we try to ship over an ArrayBuffer for Memory. This should
&gt; &gt; &gt; probably not be allowed since it&apos;s backed by Wasm::Memory mmaped memory.
&gt; &gt; 
&gt; &gt; IIUC they serialize WebAssembly.Module, and transfer it from Worker to main
&gt; &gt; thread. Apparently this works in Chrome / FF. Should we file an issue on
&gt; &gt; this in the design repo?
&gt; We should probably support the same serialization. I&apos;m interested to know
&gt; what happens to the underlying Memory/etc in the worker that created them
&gt; after they&apos;re transferred. Also, what happens to the underlying memory? Is
&gt; there a spec for this serialization? A better API than using workers would
&gt; be we should just make the asynchronous APIs truly asynchronous. I don&apos;t
&gt; think that should be too difficult

I believe that only Module is expected to be postMessage-able correctly, and that the details are tied to IndexDB support:
  https://bugs.webkit.org/show_bug.cgi?id=166481</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262776</commentid>
    <comment_count>10</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2016-12-26 13:04:26 -0800</bug_when>
    <thetext>At a minimum we&apos;ll have to be able to patch vm.topJSWebAssemblyInstance (I&apos;m removing the other wasm things from VM).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1304079</commentid>
    <comment_count>11</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-05-03 09:56:41 -0700</bug_when>
    <thetext>&lt;rdar://problem/31965359&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1304094</commentid>
    <comment_count>12</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-05-03 10:17:25 -0700</bug_when>
    <thetext>This is already done.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>