1. 05 Dec, 2016 1 commit
  2. 23 Nov, 2016 3 commits
    • gdeepti's avatar
      [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. · e108f90d
      gdeepti authored
      Add support for WebAssembly.Memory objects to be simultaneously referenced by multiple Instance objects. GrowingMemory should maintain a consistent view of memory across instances.
       - Store a link to instances that share WebAssembly.Memory in the WasmMemoryObject, updated on instantiate.
       - Implement WasmInstanceWrapper as a wrapper around the instance object to keep track of previous/next instances, instance object is stored as a WeakCell that can be garbage collected.
       - MemoryInstanceFinalizer maintains a valid list of instances when an instance is garbage collected.
       - Refactor GrowInstanceMemory to GrowMemoryBuffer that allocates a new buffer, and UncheckedUpdateInstanceMemory that updates memory references for an instance.
      
       R=titzer@chromium.org, mtrofin@chromium.org, bradnelson@chromium.org
      
      Committed: https://crrev.com/30ef8e33f3a199a27ca8512bcee314c9522d03f6
      Committed: https://crrev.com/3c98e339599b068f1ed630afb7601ff942424d31
      Review-Url: https://codereview.chromium.org/2471883003
      Cr-Original-Original-Commit-Position: refs/heads/master@{#41121}
      Cr-Original-Commit-Position: refs/heads/master@{#41198}
      Cr-Commit-Position: refs/heads/master@{#41234}
      e108f90d
    • hablich's avatar
      Revert of [wasm] WebAssembly.Memory object can be referenced by multiple... · de330e13
      hablich authored
      Revert of [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. (patchset #13 id:240001 of https://codereview.chromium.org/2471883003/ )
      
      Reason for revert:
      Test crashes after an unrelated revert: https://chromegw.corp.google.com/i/client.v8/builders/V8%20Linux%20-%20gc%20stress/builds/7189
      
      Reverting because of recommendation from WASM team.
      
      Original issue's description:
      > [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects.
      >
      > Add support for WebAssembly.Memory objects to be simultaneously referenced by multiple Instance objects. GrowingMemory should maintain a consistent view of memory across instances.
      >  - Store a link to instances that share WebAssembly.Memory in the WasmMemoryObject, updated on instantiate.
      >  - Implement WasmInstanceWrapper as a wrapper around the instance object to keep track of previous/next instances, instance object is stored as a WeakCell that can be garbage collected.
      >  - MemoryInstanceFinalizer maintains a valid list of instances when an instance is garbage collected.
      >  - Refactor GrowInstanceMemory to GrowMemoryBuffer that allocates a new buffer, and UncheckedUpdateInstanceMemory that updates memory references for an instance.
      >
      >  R=titzer@chromium.org, mtrofin@chromium.org, bradnelson@chromium.org
      >
      > Committed: https://crrev.com/30ef8e33f3a199a27ca8512bcee314c9522d03f6
      > Committed: https://crrev.com/3c98e339599b068f1ed630afb7601ff942424d31
      > Cr-Original-Commit-Position: refs/heads/master@{#41121}
      > Cr-Commit-Position: refs/heads/master@{#41198}
      
      TBR=bradnelson@chromium.org,mtrofin@chromium.org,titzer@chromium.org,gdeepti@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      
      Review-Url: https://codereview.chromium.org/2529573002
      Cr-Commit-Position: refs/heads/master@{#41208}
      de330e13
    • gdeepti's avatar
      [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. · 3c98e339
      gdeepti authored
      Add support for WebAssembly.Memory objects to be simultaneously referenced by multiple Instance objects. GrowingMemory should maintain a consistent view of memory across instances.
       - Store a link to instances that share WebAssembly.Memory in the WasmMemoryObject, updated on instantiate.
       - Implement WasmInstanceWrapper as a wrapper around the instance object to keep track of previous/next instances, instance object is stored as a WeakCell that can be garbage collected.
       - MemoryInstanceFinalizer maintains a valid list of instances when an instance is garbage collected.
       - Refactor GrowInstanceMemory to GrowMemoryBuffer that allocates a new buffer, and UncheckedUpdateInstanceMemory that updates memory references for an instance.
      
       R=titzer@chromium.org, mtrofin@chromium.org, bradnelson@chromium.org
      
      Committed: https://crrev.com/30ef8e33f3a199a27ca8512bcee314c9522d03f6
      Review-Url: https://codereview.chromium.org/2471883003
      Cr-Original-Commit-Position: refs/heads/master@{#41121}
      Cr-Commit-Position: refs/heads/master@{#41198}
      3c98e339
  3. 21 Nov, 2016 1 commit
  4. 19 Nov, 2016 2 commits
    • machenbach's avatar
      Revert of [wasm] WebAssembly.Memory object can be referenced by multiple... · 682f6500
      machenbach authored
      Revert of [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. (patchset #10 id:180001 of https://codereview.chromium.org/2471883003/ )
      
      Reason for revert:
      Breaks gc stress:
      https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20gc%20stress/builds/7114
      
      Original issue's description:
      > [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects.
      >
      > Add support for WebAssembly.Memory objects to be simultaneously referenced by multiple Instance objects. GrowingMemory should maintain a consistent view of memory across instances.
      >  - Store a link to instances that share WebAssembly.Memory in the WasmMemoryObject, updated on instantiate.
      >  - Implement WasmInstanceWrapper as a wrapper around the instance object to keep track of previous/next instances, instance object is stored as a WeakCell that can be garbage collected.
      >  - MemoryInstanceFinalizer maintains a valid list of instances when an instance is garbage collected.
      >  - Refactor GrowInstanceMemory to GrowMemoryBuffer that allocates a new buffer, and UncheckedUpdateInstanceMemory that updates memory references for an instance.
      >
      >  R=titzer@chromium.org, mtrofin@chromium.org, bradnelson@chromium.org
      >
      > Committed: https://crrev.com/30ef8e33f3a199a27ca8512bcee314c9522d03f6
      > Cr-Commit-Position: refs/heads/master@{#41121}
      
      TBR=bradnelson@chromium.org,mtrofin@chromium.org,titzer@chromium.org,gdeepti@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      
      Review-Url: https://codereview.chromium.org/2512323004
      Cr-Commit-Position: refs/heads/master@{#41122}
      682f6500
    • gdeepti's avatar
      [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. · 30ef8e33
      gdeepti authored
      Add support for WebAssembly.Memory objects to be simultaneously referenced by multiple Instance objects. GrowingMemory should maintain a consistent view of memory across instances.
       - Store a link to instances that share WebAssembly.Memory in the WasmMemoryObject, updated on instantiate.
       - Implement WasmInstanceWrapper as a wrapper around the instance object to keep track of previous/next instances, instance object is stored as a WeakCell that can be garbage collected.
       - MemoryInstanceFinalizer maintains a valid list of instances when an instance is garbage collected.
       - Refactor GrowInstanceMemory to GrowMemoryBuffer that allocates a new buffer, and UncheckedUpdateInstanceMemory that updates memory references for an instance.
      
       R=titzer@chromium.org, mtrofin@chromium.org, bradnelson@chromium.org
      
      Review-Url: https://codereview.chromium.org/2471883003
      Cr-Commit-Position: refs/heads/master@{#41121}
      30ef8e33
  5. 17 Nov, 2016 1 commit
  6. 16 Nov, 2016 1 commit
  7. 11 Nov, 2016 1 commit
    • titzer's avatar
      [wasm] Move all heap-allocated WASM structures into wasm-objects.h. · fa9c25ce
      titzer authored
      This CL moves all heap-allocated WASM data structures, both ones
      that are bonafide JSObjects and ones that are FixedArrays only, into a
      consistent place with consistent layout. Note that not all accessors are complete, and I haven't fully spread the new static typing goodness
      to all places in the code.
      
      R=ahaas@chromium.org,rossberg@chromium.org
      CC=gdeepti@chromium.org,mtrofin@chromium.org,clemensh@chromium.org
      BUG=
      
      Review-Url: https://codereview.chromium.org/2490663002
      Cr-Commit-Position: refs/heads/master@{#40913}
      fa9c25ce
  8. 08 Nov, 2016 1 commit
  9. 29 Oct, 2016 1 commit
  10. 28 Oct, 2016 3 commits
  11. 26 Oct, 2016 1 commit
  12. 25 Oct, 2016 1 commit
  13. 21 Oct, 2016 1 commit
  14. 19 Oct, 2016 2 commits
    • titzer's avatar
      [wasm] Use a Managed<WasmModule> to hold metadata about modules. · 418b239f
      titzer authored
      This CL refactors the handling of metadata associated with WebAssembly
      modules to reduce the duplicate marshalling of data from the C++ world
      to the JavaScript world. It does this by wrapping the C++ WasmModule*
      object in a Foreign that is rooted from the on-heap WasmCompiledModule
      (which is itself just a FixedArray). Upon serialization, the C++ object
      is ignored and the original WASM wire bytes are serialized. Upon
      deserialization, the C++ object is reconstituted by reparsing the bytes.
      
      This is motivated by increasing complications in implementing the JS
      API, in particular WebAssembly.Table, which must perform signature
      canonicalization across instances.
      
      Additionally, this CL implements the proper base + offset initialization
      behavior for tables.
      
      R=rossberg@chromium.org,bradnelson@chromium.org,mtrofin@chromium.org,yangguo@chromium.org
      BUG=v8:5507, chromium:575167, chromium:657316
      
      Review-Url: https://chromiumcodereview.appspot.com/2424623002
      Cr-Commit-Position: refs/heads/master@{#40434}
      418b239f
    • titzer's avatar
      [wasm] Improve naming consistency for WASM instances. · acf99a89
      titzer authored
      R=clemensh@chromium.org,ahaas@chromium.org
      BUG=
      
      Review-Url: https://chromiumcodereview.appspot.com/2428343005
      Cr-Commit-Position: refs/heads/master@{#40426}
      acf99a89
  15. 18 Oct, 2016 1 commit
  16. 17 Oct, 2016 2 commits
  17. 13 Oct, 2016 2 commits
  18. 12 Oct, 2016 1 commit
    • clemensh's avatar
      [wasm] Provide better stack traces for asm.js code · 5d9fa102
      clemensh authored
      For the asm.js to WASM pipeline, the current stack traces only show
      low-level WASM information.
      This CL maps this back to asm.js source positions.
      It does so by attaching the asm.js source Script to the compiled WASM
      module, and emitting a delta-encoded table which maps from WASM byte
      offsets to positions within that Script. As asm.js code does not throw
      exceptions, we only store a mapping for call instructions.
      
      The new AsmJsWasmStackFrame implementation inherits from
      WasmStackFrame, but contains the logic to provide the source script and
      the position inside of it.
      What is still missing is the JSFunction object returned by
      CallSite.getFunction(). We currently return null.
      
      R=jgruber@chromium.org, titzer@chromium.org
      BUG=v8:4203
      
      Review-Url: https://codereview.chromium.org/2404253002
      Cr-Commit-Position: refs/heads/master@{#40205}
      5d9fa102
  19. 07 Oct, 2016 1 commit
  20. 29 Sep, 2016 2 commits
  21. 27 Sep, 2016 1 commit
    • titzer's avatar
      [wasm] Master CL for Binary 0xC changes. · 28392ab1
      titzer authored
      [0xC] Convert to stack machine semantics.
      [0xC] Use section codes instead of names.
      [0xC] Add elements section decoding.
      [0xC] Decoding of globals section.
      [0xC] Decoding of memory section.
      [0xC] Decoding of imports section.
      [0xC] Decoding of exports section.
      [0xC] Decoding of data section.
      [0xC] Remove CallImport bytecode.
      [0xC] Function bodies have an implicit block.
      [0xC] Remove the bottom label from loops.
      [0xC] Add signatures to blocks.
      [0xC] Remove arities from branches.
      Add tests for init expression decoding.
      Rework compilation of import wrappers and how they are patched.
      Rework function indices in debugging.
      Fix ASM->WASM builder for stack machine.
      Reorganize asm.js foreign functions due to import indices change.
      
      R=ahaas@chromium.org,rossberg@chromium.org,bradnelson@chromium.org
      BUG=chromium:575167
      LOG=Y
      
      Committed: https://crrev.com/76eb976a67273b8c03c744f64ad850b0432554b9
      Review-Url: https://codereview.chromium.org/2345593003
      Cr-Original-Commit-Position: refs/heads/master@{#39678}
      Cr-Commit-Position: refs/heads/master@{#39795}
      28392ab1
  22. 26 Sep, 2016 3 commits
  23. 23 Sep, 2016 2 commits
    • machenbach's avatar
      Revert of [wasm] Master CL for Binary 0xC changes. (patchset #26 id:490001 of... · e1eee748
      machenbach authored
      Revert of [wasm] Master CL for Binary 0xC changes. (patchset #26 id:490001 of https://codereview.chromium.org/2345593003/ )
      
      Reason for revert:
      Main suspect for tsan:
      https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20TSAN/builds/11893
      
      Also changes layout tests:
      https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/10036
      
      +mips builder:
      https://build.chromium.org/p/client.v8.ports/builders/V8%20Mips%20-%20builder/builds/4032
      
      Original issue's description:
      > [wasm] Master CL for Binary 0xC changes.
      >
      > [0xC] Convert to stack machine semantics.
      > [0xC] Use section codes instead of names.
      > [0xC] Add elements section decoding.
      > [0xC] Decoding of globals section.
      > [0xC] Decoding of memory section.
      > [0xC] Decoding of imports section.
      > [0xC] Decoding of exports section.
      > [0xC] Decoding of data section.
      > [0xC] Remove CallImport bytecode.
      > [0xC] Function bodies have an implicit block.
      > [0xC] Remove the bottom label from loops.
      > [0xC] Add signatures to blocks.
      > [0xC] Remove arities from branches.
      > Add tests for init expression decoding.
      > Rework compilation of import wrappers and how they are patched.
      > Rework function indices in debugging.
      > Fix ASM->WASM builder for stack machine.
      > Reorganize asm.js foreign functions due to import indices change.
      >
      > R=ahaas@chromium.org,rossberg@chromium.org,bradnelson@chromium.org
      > BUG=chromium:575167
      > LOG=Y
      >
      > Committed: https://crrev.com/76eb976a67273b8c03c744f64ad850b0432554b9
      > Cr-Commit-Position: refs/heads/master@{#39678}
      
      TBR=ahaas@chromium.org,bradnelson@chromium.org,mtrofin@chromium.org,rossberg@chromium.org,bradnelson@google.com,titzer@chromium.org
      # Skipping CQ checks because original CL landed less than 1 days ago.
      NOPRESUBMIT=true
      NOTREECHECKS=true
      NOTRY=true
      BUG=chromium:575167
      
      Review-Url: https://codereview.chromium.org/2361053004
      Cr-Commit-Position: refs/heads/master@{#39685}
      e1eee748
    • titzer's avatar
      [wasm] Master CL for Binary 0xC changes. · 76eb976a
      titzer authored
      [0xC] Convert to stack machine semantics.
      [0xC] Use section codes instead of names.
      [0xC] Add elements section decoding.
      [0xC] Decoding of globals section.
      [0xC] Decoding of memory section.
      [0xC] Decoding of imports section.
      [0xC] Decoding of exports section.
      [0xC] Decoding of data section.
      [0xC] Remove CallImport bytecode.
      [0xC] Function bodies have an implicit block.
      [0xC] Remove the bottom label from loops.
      [0xC] Add signatures to blocks.
      [0xC] Remove arities from branches.
      Add tests for init expression decoding.
      Rework compilation of import wrappers and how they are patched.
      Rework function indices in debugging.
      Fix ASM->WASM builder for stack machine.
      Reorganize asm.js foreign functions due to import indices change.
      
      R=ahaas@chromium.org,rossberg@chromium.org,bradnelson@chromium.org
      BUG=chromium:575167
      LOG=Y
      
      Review-Url: https://codereview.chromium.org/2345593003
      Cr-Commit-Position: refs/heads/master@{#39678}
      76eb976a
  24. 21 Sep, 2016 1 commit
  25. 17 Sep, 2016 1 commit
    • gdeepti's avatar
      [wasm] Fix test-run-wasm-module tests in debug mode. · dd3b14b7
      gdeepti authored
      test-run-wasm-module cctests broken in debug since recent refactoring changes for moving Compilation/Instantiation off the module object (https://codereview.chromium.org/2320723005). The problem here is that SetupIsolateForWasm tries to add the same property to a module_object multiple times and hits a DCHECK when this property is found on a lookup.
       - Fixed to use the setup method only once when CcTest::InitIsolateOnce is used.
       - Move setup method to test as this is only used for cctests/fuzzers. The install method should take care of this in the regular JS pipeline.
      
       R=mtrofin@chromium.org, ahaas@chromium.org
      
      Review-Url: https://codereview.chromium.org/2342263002
      Cr-Commit-Position: refs/heads/master@{#39484}
      dd3b14b7
  26. 12 Sep, 2016 1 commit
    • mtrofin's avatar
      [wasm] Compilation/Instantiation pipeline works off module object · 8e5ac62d
      mtrofin authored
      Moved the compilation/instantiation pipeline to work off the
      module object (JSObject), making the compiled module data (the
      FixedArray) an implementation detail. This:
      - simplifies the code by removing duplicate decode->compile->instantiate
      sequences
      - sets up the stage for "dressing up" the runtime model with
      stronger typed APIs
      - helps relanding this CL: https://codereview.chromium.org/2305903002/.
        It turns out that GCs during the cloning/instantiation events cause
      trouble, and centering the source of truth on the module object helps
      address this issue.
      
      In the process, clarified cctest setup for wasm-capable isolates,
      and changed signatures for consistency (using ModuleOrigin througout).
      
      BUG=
      
      Review-Url: https://codereview.chromium.org/2320723005
      Cr-Commit-Position: refs/heads/master@{#39360}
      8e5ac62d
  27. 01 Sep, 2016 1 commit
    • mtrofin's avatar
      [wasm] consolidate wasm and asm.js module compilation sequence · 5f8a6ec4
      mtrofin authored
      This unblocks avoiding the separate code template.
      In the upcoming CL doing away with code templates, We need to track instances
      through the module object, which needs to be separate from the compiled module
      data, which is then shared with the first instance.
      
      This CL ensures we have the object available in the asm.js scenario, too.
      
      Note that this CL also unifies the error messaging when module
      decoding fails.
      
      BUG=v8:5316
      
      Review-Url: https://codereview.chromium.org/2299873002
      Cr-Commit-Position: refs/heads/master@{#39097}
      5f8a6ec4
  28. 31 Aug, 2016 1 commit