1. 11 Jun, 2021 1 commit
  2. 16 Mar, 2021 1 commit
  3. 12 Feb, 2021 1 commit
  4. 02 Dec, 2020 1 commit
    • Manos Koukoutos's avatar
      [wasm-gc] read_heap_type should check if index is in module bounds · 0396b732
      Manos Koukoutos authored
      read_heap_type did not have knowledge of the module for which the heap
      type was being decoded. As a result, callers of read_heap_type (or
      read_value_type, which in turn calls read_heap_type) had to check after
      the fact that a decoded indexed type (ref, ref null, or rtt) references
      a type index within the module's bounds. This was not done consistently,
      and was missing (at least) in DecodeLocals.
      To avoid such problems in the future, this CL refactors read_heap_type
      to accept a module and check the decoded index against it.
      
      Changes:
      - Add WasmModule argument to read_heap_type. Do so accordingly to all
        its transitive callers (read_value_type, immediate arguments,
        DecodeLocalDecls, DecodeValue/HeapType in unittests).
      - Add index check to read_heap_type and emit an error for an
        out-of-bounds index.
      - Remove all other now-redundant index validations. Replace them with
        decoder->ok() if needed (since read_heap_type will now emit an error).
      - Fix error message in Validate for BlockTypeImmediate.
      - In DecodeLocalDecls in unittests, pass an empty module to
        DecodeLocalDecls in the main code.
      - Add a unit test with an invalid index in local type declarations.
      
      Bug: v8:9495
      Change-Id: I4ed1204847db80f78b6ae85fa40d300cd2456295
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569757Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#71572}
      0396b732
  5. 20 Nov, 2020 1 commit
  6. 30 Sep, 2020 1 commit
  7. 21 Jul, 2020 1 commit
  8. 23 Jun, 2020 1 commit
  9. 20 May, 2020 1 commit
    • Ng Zhi An's avatar
      Reland "[wasm-simd][liftoff][x64][ia32] Implement load extend" · 6b228044
      Ng Zhi An authored
      This is a reland of dd19a400
      
      Original change's description:
      > [wasm-simd][liftoff][x64][ia32] Implement load extend
      > 
      > The operations are implemented:
      > 
      > - i16x8.load8x8_s
      > - i16x8.load8x8_u
      > - i32x4.load16x4_s
      > - i32x4.load16x4_u
      > - i64x2.load32x2_s
      > - i64x2.load32x2_u
      > 
      > on x64 and i32. The rest of the arch currently bail out, and will be
      > implemented in subsequent patches.
      > 
      > The liftoff-compiler.cc code looks very similar to the one for LoadMem,
      > the only difference is special handling of kSplat v.s. kExtend. kExtend
      > always loads 8 bytes, so the bounds check and tracing is different.
      > Compared to LoadMem there is less need for pinning, since the result is
      > always going to be in a SIMD/FP register, which is different from the
      > index/addr register.
      > 
      > The enum LoadTransformationKind was moved from
      > function-body-decoder-impl.h to function-body-decoder.h so that no
      > unncessary header file inclusions were needed to liftoff, and also it's
      > a better place for it to live.
      > 
      > Bug: v8:9909
      > Change-Id: I926bcc01c0c3c860223e8c08f91bc4ab3b75c399
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2203730
      > Commit-Queue: Zhi An Ng <zhin@chromium.org>
      > Reviewed-by: Clemens Backes <clemensb@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#67914}
      
      Bug: v8:9909
      Change-Id: Ic1d8dcc00d9c5af0d51100a947161eaa315b7659
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2209268Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Commit-Queue: Zhi An Ng <zhin@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67930}
      6b228044
  10. 19 May, 2020 2 commits
    • Zhi An Ng's avatar
      Revert "[wasm-simd][liftoff][x64][ia32] Implement load extend" · 7bd682c9
      Zhi An Ng authored
      This reverts commit dd19a400.
      
      Reason for revert: https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20debug/30448?
      
      Original change's description:
      > [wasm-simd][liftoff][x64][ia32] Implement load extend
      > 
      > The operations are implemented:
      > 
      > - i16x8.load8x8_s
      > - i16x8.load8x8_u
      > - i32x4.load16x4_s
      > - i32x4.load16x4_u
      > - i64x2.load32x2_s
      > - i64x2.load32x2_u
      > 
      > on x64 and i32. The rest of the arch currently bail out, and will be
      > implemented in subsequent patches.
      > 
      > The liftoff-compiler.cc code looks very similar to the one for LoadMem,
      > the only difference is special handling of kSplat v.s. kExtend. kExtend
      > always loads 8 bytes, so the bounds check and tracing is different.
      > Compared to LoadMem there is less need for pinning, since the result is
      > always going to be in a SIMD/FP register, which is different from the
      > index/addr register.
      > 
      > The enum LoadTransformationKind was moved from
      > function-body-decoder-impl.h to function-body-decoder.h so that no
      > unncessary header file inclusions were needed to liftoff, and also it's
      > a better place for it to live.
      > 
      > Bug: v8:9909
      > Change-Id: I926bcc01c0c3c860223e8c08f91bc4ab3b75c399
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2203730
      > Commit-Queue: Zhi An Ng <zhin@chromium.org>
      > Reviewed-by: Clemens Backes <clemensb@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#67914}
      
      TBR=clemensb@chromium.org,zhin@chromium.org
      
      Change-Id: I2af6dfe6cd163d0dbc9f3a5ad4bfc5e622e76b63
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:9909
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2207665Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
      Commit-Queue: Zhi An Ng <zhin@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67915}
      7bd682c9
    • Ng Zhi An's avatar
      [wasm-simd][liftoff][x64][ia32] Implement load extend · dd19a400
      Ng Zhi An authored
      The operations are implemented:
      
      - i16x8.load8x8_s
      - i16x8.load8x8_u
      - i32x4.load16x4_s
      - i32x4.load16x4_u
      - i64x2.load32x2_s
      - i64x2.load32x2_u
      
      on x64 and i32. The rest of the arch currently bail out, and will be
      implemented in subsequent patches.
      
      The liftoff-compiler.cc code looks very similar to the one for LoadMem,
      the only difference is special handling of kSplat v.s. kExtend. kExtend
      always loads 8 bytes, so the bounds check and tracing is different.
      Compared to LoadMem there is less need for pinning, since the result is
      always going to be in a SIMD/FP register, which is different from the
      index/addr register.
      
      The enum LoadTransformationKind was moved from
      function-body-decoder-impl.h to function-body-decoder.h so that no
      unncessary header file inclusions were needed to liftoff, and also it's
      a better place for it to live.
      
      Bug: v8:9909
      Change-Id: I926bcc01c0c3c860223e8c08f91bc4ab3b75c399
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2203730
      Commit-Queue: Zhi An Ng <zhin@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67914}
      dd19a400
  11. 16 Apr, 2020 1 commit
    • Ng Zhi An's avatar
      [wasm] Fix wasm decoder for multi-byte opcodes · b48b82e7
      Ng Zhi An authored
      SIMD opcodes consist of the prefix byte, then an LEB128 encoded int. We
      were decoding this incorrectly as a fixed uint8. This fixes the decoder
      to properly handle multi bytes.
      
      In some cases, the multi byte logic is applied to all prefixed opcodes.
      This is not a problem, since for values < 0x80, the LEB encoding is a
      single byte, and decodes to the same int. If the prefix opcode has
      instructions with index >= 0x80, it would be required to be LEB128
      encoded anyway.
      
      There are a bunch of trivial changes to test-run-wasm-simd, to change
      the macro from BUILD to BUILD_V, the former only works for single byte
      opcodes, the latter is a new template-based macro that correct handles
      multi-byte opcodes. The only unchanged test is the shuffle fuzzer test,
      which builds its own sequence of bytes without using the BUILD macro.
      
      Bug: v8:10258
      Change-Id: Ie7377e899a7eab97ecf28176fd908babc08d0f19
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2118476
      Commit-Queue: Zhi An Ng <zhin@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67186}
      b48b82e7
  12. 27 Feb, 2020 1 commit
  13. 26 Nov, 2019 1 commit
  14. 08 Jul, 2019 2 commits
  15. 24 May, 2019 1 commit
  16. 12 Oct, 2018 1 commit
  17. 11 Oct, 2018 1 commit
  18. 09 Aug, 2018 1 commit
    • Ben L. Titzer's avatar
      [wasm] Add WasmFeatures to enable/detect features · 6aa2a253
      Ben L. Titzer authored
      This CL introduces a set of configuration options implemented as
      a struct of booleans that together comprise the set of enabled
      or detected features. The configuration options replace command-line
      flags that were checked deep in the implementation. As such, it is
      necessary to plumb them through multiple levels of abstraction.
      
      R=ahaas@chromium.org
      CC=mstarzinger@chromium.org
      BUG=chromium:868844
      
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      Change-Id: I1b82f5826e4fd263f68e8cafcd923bac5818a637
      Reviewed-on: https://chromium-review.googlesource.com/1163670Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Ben Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55018}
      6aa2a253
  19. 01 Aug, 2018 1 commit
  20. 04 Jun, 2018 1 commit
  21. 25 May, 2018 1 commit
  22. 24 May, 2018 1 commit
  23. 07 May, 2018 1 commit
  24. 08 Jan, 2018 2 commits
  25. 16 Oct, 2017 1 commit
  26. 05 Oct, 2017 1 commit
  27. 15 Sep, 2017 1 commit
    • Andreas Haas's avatar
      [wasm] Streaming compilation for WebAssembly. · 549692cb
      Andreas Haas authored
      In this CL I implement streaming compilation for WebAssembly,
      as described in the design doc I have sent out already.
      
      In this implementation the decoding of sections other than the
      code section is done immediately on the foreground thread.
      Eventually all decoding should happen in the background. I
      think it is acceptable to do the decoding on the foreground
      thread for now because I have finished it already, and
      decoding in the background would add even more complexity to
      this CL.
      
      Bug:v8:6785
      
      Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      Change-Id: I285e1e5e1a5a243113c92571b25ee9bae551d0ed
      Reviewed-on: https://chromium-review.googlesource.com/631721Reviewed-by: 's avatarMircea Trofin <mtrofin@chromium.org>
      Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#48022}
      549692cb
  28. 03 Aug, 2017 1 commit
  29. 23 Jun, 2017 1 commit
    • Andreas Haas's avatar
      [wasm] In the FunctionBody, replace {base} by {offset} · 54e9f3e6
      Andreas Haas authored
      For correct error positions, the FunctionBody struct stored a {base}
      pointer to the beginning of the wasm module bytes, in addition to the
      {start} and {end} pointer of the function body within the module bytes.
      For streaming compilation, we do not have all module bytes in a single
      chunk of memory. Therefore this CL changes the FunctionBody such that it
      does not store the base pointer but the offset of the function body
      within the module. I did the same change already some time ago for the
      {Decoder}.
      
      R=clemensh@chromium.org, mtrofin@chromium.org
      
      Change-Id: I5138fbe270d0f5166a7dcc5cb8f3fe78a298bff6
      Reviewed-on: https://chromium-review.googlesource.com/544863Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#46170}
      54e9f3e6
  30. 19 Jun, 2017 1 commit
  31. 22 May, 2017 1 commit
    • Clemens Hammacher's avatar
      [wasm] [cleanup] Remove unused DecodeStruct type · c30cbb17
      Clemens Hammacher authored
      It was used before as a placeholder in Result<DecodeStruct*> to
      communicate that no value was returned. We actually only created a
      Results holding {nullptr} when returning such values. Thus, the whole
      struct is not needed, and we return Result<nullptr_t> instead, which
      clearly communicates that this result does not hold any value.
      
      An alternative would be to use Result<void>, but this would require
      partial specialization of the Result template, which would be overkill
      here.
      
      R=ahaas@chromium.org
      
      Change-Id: Ib07d2c4fe716c735839675d11146c47f97997d40
      Reviewed-on: https://chromium-review.googlesource.com/509551Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#45464}
      c30cbb17
  32. 25 Apr, 2017 1 commit
    • Clemens Hammacher's avatar
      [wasm] [interpreter] Precompute side table for breaks · 92bf8327
      Clemens Hammacher authored
      Instead of dynamically tracking the block nesting, precompute the
      information statically.
      The interpreter was already using a side table to store the pc diff for
      each break, conditional break and others. The information needed to
      adjust the stack was tracked dynamically, however. This CL also
      precomputes this information, as it is statically known.
      Instead of just storing the pc diff in the side table, we now store the
      pc diff, the stack height diff and the arity of the target block.
      
      Local measurements show speedups of 5-6% on average, sometimes >10%.
      
      R=ahaas@chromium.org
      BUG=v8:5822
      
      Change-Id: I986cfa989aabe1488f2ff79ddbfbb28aeffe1452
      Reviewed-on: https://chromium-review.googlesource.com/485482Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#44837}
      92bf8327
  33. 05 Apr, 2017 2 commits
    • Clemens Hammacher's avatar
      [wasm] [decoder] Templatize decode function for unchecked decoding · eeaceccb
      Clemens Hammacher authored
      In the C++ wasm interpreter, we decode LEB encoded immediates each time
      we execute the respective instruction. The whole instruction sequence
      was validated before, thus we know that all integers are valid.
      This CL refactors several Decoder methods to allow for either checked
      or unchecked decoding. In the checked case, an error is set if a check
      fails, in the unchecked case, a DCHECK will fail.
      
      This improves performance of the interpreter by 20.5%.
      
      R=ahaas@chromium.org
      BUG=v8:5822
      
      Change-Id: If69efd4f6fbe19d84bfc2f4aa000f429a8e22bf5
      Reviewed-on: https://chromium-review.googlesource.com/468786
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#44406}
      eeaceccb
    • Clemens Hammacher's avatar
      [wasm] [decoder] Merge checked_read_leb and consume_leb · 02b4d0e6
      Clemens Hammacher authored
      Both methods decoded a LEB128 encoded integer, but only consume_leb
      incremented the pc pointer accordingly.
      This CL implements consume_leb by using checked_read_leb.
      
      It also refactors a few things:
      1) It removes error_pt, which was only avaible in checked_read_leb.
      2) It renames the error method to errorf, since it receives a format
         string. This also avoids a name clash.
      3) It implements sign extension directly in checked_read_leb instead of
         doing this in the caller.
      
      R=ahaas@chromium.org
      BUG=v8:5822
      
      Change-Id: I8058f57418493861e5df26d4949041f6766d5138
      Reviewed-on: https://chromium-review.googlesource.com/467150
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#44405}
      02b4d0e6
  34. 10 Feb, 2017 1 commit
  35. 25 Jan, 2017 1 commit
  36. 20 Jan, 2017 1 commit