1. 16 Nov, 2016 1 commit
  2. 11 Nov, 2016 2 commits
    • ahaas's avatar
      [wasm] Check data segments for zero-sized memory. · e3c7324a
      ahaas authored
      According to the spec data segments are allowed even if the memory size
      is zero. However, if one of the data segments has a length greater than
      0, then module instantiation should fail.
      
      I also changed the exception type in LoadDataSegments to TypeError,
      because that's the exception type for all exceptions which can happen
      during instantiation.
      
      R=titzer@chromium.org, rossberg@chromium.org
      TEST=cctest/test-run-wasm-module/EmptyMemoryEmptyDataSegment, cctest/test-run-wasm-module/EmptyMemoryNonEmptyDataSegment
      
      Review-Url: https://codereview.chromium.org/2483053005
      Cr-Commit-Position: refs/heads/master@{#40922}
      e3c7324a
    • 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
  3. 10 Nov, 2016 1 commit
  4. 09 Nov, 2016 2 commits
    • ahaas's avatar
      [wasm] Only immutable imported globals are valid initializer expressions · d91bed67
      ahaas authored
      R=titzer@chromium.org
      TEST=unittests/WasmModuleVerifyTest.DataSegmentWithImmutableGlobal, unittests/WasmModuleVerifyTest.DataSegmentWithMutableImportedGlobal, unittests/WasmModuleVerifyTest.DataSegmentWithImmutableImportedGlobal
      
      Review-Url: https://codereview.chromium.org/2493433002
      Cr-Commit-Position: refs/heads/master@{#40865}
      d91bed67
    • ahaas's avatar
      [wasm] Fix bounds check in LoadDataSegments. · ac183d49
      ahaas authored
      The bounds check in LoadDataSegment was off by one. I also improved the
      error message, and fixed an issue where data was initialized even if
      the bounds check failed.
      
      In InstantiateModuleForTesting I allow instantiation of modules without
      exports. This check was legacy code from the time where instantiation
      and execution was still combined in a single function.
      
      R=titzer@chromium.org, rossberg@chromium.org
      TEST=cctest/test-run-wasm-module/InitDataAtTheUpperLimit
      
      Review-Url: https://codereview.chromium.org/2486183002
      Cr-Commit-Position: refs/heads/master@{#40856}
      ac183d49
  5. 08 Nov, 2016 1 commit
  6. 07 Nov, 2016 1 commit
  7. 31 Oct, 2016 1 commit
  8. 19 Oct, 2016 1 commit
    • 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
  9. 18 Oct, 2016 1 commit
  10. 17 Oct, 2016 1 commit
  11. 14 Oct, 2016 1 commit
  12. 13 Oct, 2016 1 commit
  13. 12 Oct, 2016 1 commit
    • mtrofin's avatar
      [wasm] API renames for wasm serialization/deserialization · 38ac7fe6
      mtrofin authored
      This incorporates recent feedback:
      - simpler deserialization API by dropping the std::unique_ptr.
      The only purpose there was communicating to the caller that they
      own the buffer, and that the deserializer won't delete it. The new
      design communicates that through a naming choice.
      - renamed *UncompiledBytes to *WasmWireBytes
      
      BUG=
      
      Review-Url: https://codereview.chromium.org/2411263004
      Cr-Commit-Position: refs/heads/master@{#40238}
      38ac7fe6
  14. 11 Oct, 2016 2 commits
  15. 10 Oct, 2016 1 commit
  16. 06 Oct, 2016 5 commits
  17. 05 Oct, 2016 4 commits
  18. 29 Sep, 2016 2 commits
  19. 28 Sep, 2016 1 commit
  20. 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
  21. 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
  22. 20 Sep, 2016 1 commit
  23. 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
  24. 15 Sep, 2016 1 commit
  25. 14 Sep, 2016 1 commit
  26. 12 Sep, 2016 2 commits
    • 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
    • ahaas's avatar
      [wasm] Call the wasm interpreter from the wasm-code-fuzzer. · 1521fe9c
      ahaas authored
      With this CL the wasm-code-fuzzer first decodes and interprets the test
      case generated by the fuzzer. It then compiles the test case, but only
      executes the compiled instance if the interpretation of the test case
      was successful. If the compiled instance is executed, then the result of
      the execution is compared with the result of the interpretation.
      
      Additionally this CL refactors the CompileAndRunWasmModule function in
      wasm-module.cc to resuse code in the call to the interpreter.
      
      R=titzer@chromium.org
      
      Review-Url: https://codereview.chromium.org/2321443002
      Cr-Commit-Position: refs/heads/master@{#39351}
      1521fe9c
  27. 02 Sep, 2016 1 commit