1. 19 Jul, 2021 1 commit
    • Clemens Backes's avatar
      [traphandler] Add simulator support · 431fff66
      Clemens Backes authored
      This prepares the trap handler to support being used from simulators.
      Modifications to the arm64 simulator will be done in a follow-up CL. For
      now, the trap handler will be registered but not used in Wasm (we emit
      explicit bounds checks instead, as before).
      
      The implementation uses inline assembly, so it is only available on x64
      POSIX systems for now. This is the main platform we use for testing and
      for fuzzing, so it should give us the test coverage we need. If needed,
      inline assembly for other platforms can be added later.
      The new code will be executed by the existing arm64 simulator bots, e.g.
      "V8 Linux - arm64 - sim".
      
      R=ahaas@chromium.org, mseaborn@chromium.org
      
      Bug: v8:11955
      Change-Id: Idc50291c704d9dea902ae0098e5309f19055816c
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3011160
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#75780}
      431fff66
  2. 07 Jul, 2021 1 commit
  3. 01 Jul, 2021 1 commit
  4. 30 Jun, 2021 4 commits
    • Manos Koukoutos's avatar
      Reland "[wasm] Refactor initializer expression handling" · 7981dc33
      Manos Koukoutos authored
      This is a reland of 071a1acf
      
      Changes compared to original:
      Expect SIMD test to fail if SIMD is not supported.
      
      Original change's description:
      > [wasm] Refactor initializer expression handling
      >
      > Design doc: https://bit.ly/3xPxWUe
      >
      > This CL introduces two main changes:
      > - Initializer expressions are now decoded by WasmFullDecoder. With
      >   wasm-gc, initializer expressions are no longer just constants, and
      >   require complex decoding (including stack tracking). This resulted in
      >   extensive code duplication.
      > - Initializer expressions are not stored explicitly by module-decoder as
      >   an AST (WasmInitExpr), but rather as a WireBytesRef, and are decoded
      >   again during module instantiation. This should reduce memory
      >   consumption for globals and other module elements with initializer
      >   expressions (which has been observed in the 40MB range in some
      >   real-world benchmarks.
      >
      > Summary of changes:
      > - Add a static parameter {kFunctionBody, kInitExpression} to the
      >   WasmDecoder. Use it to specialize validation to function bodies/init.
      >   expressions.
      > - Introduce a new Interface for the WasmFullDecoder for init.
      >   expressions.
      > - Differentiate between constant and non-constant opcodes in
      >   WasmFullDecoder.
      > - Change representation of init. expressions in WasmModule to
      >   WireBytesRef.
      > - Reimplement EvaluateInitExpression in module-instantiate to re-decode
      >   initializer expressions.
      > - Remove some now-invalid module decoder tests.
      >
      > Pending changes:
      > - Also refactor initializer expressions for element segment entries.
      > - Reintroduce deleted tests.
      >
      > Bug: v8:11895
      > Change-Id: I76512bfe1386c8338667d30fa6db93880a1e4b42
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2972910
      > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
      > Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#75476}
      
      Bug: v8:11895
      Change-Id: I2dface5ff28d5a2d439a65d3e5cb83135c061bb9
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2997722
      Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#75492}
      7981dc33
    • Clemens Backes's avatar
      Revert "[wasm] Refactor initializer expression handling" · 5756c40e
      Clemens Backes authored
      This reverts commit 071a1acf.
      
      Reason for revert: Breaks on nosse: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux/42795/overview
      
      Original change's description:
      > [wasm] Refactor initializer expression handling
      >
      > Design doc: https://bit.ly/3xPxWUe
      >
      > This CL introduces two main changes:
      > - Initializer expressions are now decoded by WasmFullDecoder. With
      >   wasm-gc, initializer expressions are no longer just constants, and
      >   require complex decoding (including stack tracking). This resulted in
      >   extensive code duplication.
      > - Initializer expressions are not stored explicitly by module-decoder as
      >   an AST (WasmInitExpr), but rather as a WireBytesRef, and are decoded
      >   again during module instantiation. This should reduce memory
      >   consumption for globals and other module elements with initializer
      >   expressions (which has been observed in the 40MB range in some
      >   real-world benchmarks.
      >
      > Summary of changes:
      > - Add a static parameter {kFunctionBody, kInitExpression} to the
      >   WasmDecoder. Use it to specialize validation to function bodies/init.
      >   expressions.
      > - Introduce a new Interface for the WasmFullDecoder for init.
      >   expressions.
      > - Differentiate between constant and non-constant opcodes in
      >   WasmFullDecoder.
      > - Change representation of init. expressions in WasmModule to
      >   WireBytesRef.
      > - Reimplement EvaluateInitExpression in module-instantiate to re-decode
      >   initializer expressions.
      > - Remove some now-invalid module decoder tests.
      >
      > Pending changes:
      > - Also refactor initializer expressions for element segment entries.
      > - Reintroduce deleted tests.
      >
      > Bug: v8:11895
      > Change-Id: I76512bfe1386c8338667d30fa6db93880a1e4b42
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2972910
      > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
      > Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#75476}
      
      Bug: v8:11895
      Change-Id: I9fcfdedad73ef21beb9632f50305b8e678a2dff6
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2997582
      Auto-Submit: Clemens Backes <clemensb@chromium.org>
      Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Cr-Commit-Position: refs/heads/master@{#75484}
      5756c40e
    • Manos Koukoutos's avatar
      [wasm] Refactor initializer expression handling · 071a1acf
      Manos Koukoutos authored
      Design doc: https://bit.ly/3xPxWUe
      
      This CL introduces two main changes:
      - Initializer expressions are now decoded by WasmFullDecoder. With
        wasm-gc, initializer expressions are no longer just constants, and
        require complex decoding (including stack tracking). This resulted in
        extensive code duplication.
      - Initializer expressions are not stored explicitly by module-decoder as
        an AST (WasmInitExpr), but rather as a WireBytesRef, and are decoded
        again during module instantiation. This should reduce memory
        consumption for globals and other module elements with initializer
        expressions (which has been observed in the 40MB range in some
        real-world benchmarks.
      
      Summary of changes:
      - Add a static parameter {kFunctionBody, kInitExpression} to the
        WasmDecoder. Use it to specialize validation to function bodies/init.
        expressions.
      - Introduce a new Interface for the WasmFullDecoder for init.
        expressions.
      - Differentiate between constant and non-constant opcodes in
        WasmFullDecoder.
      - Change representation of init. expressions in WasmModule to
        WireBytesRef.
      - Reimplement EvaluateInitExpression in module-instantiate to re-decode
        initializer expressions.
      - Remove some now-invalid module decoder tests.
      
      Pending changes:
      - Also refactor initializer expressions for element segment entries.
      - Reintroduce deleted tests.
      
      Bug: v8:11895
      Change-Id: I76512bfe1386c8338667d30fa6db93880a1e4b42
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2972910Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#75476}
      071a1acf
    • Clemens Backes's avatar
      [wasm] Make --wasm-trap-handler a d8-only flag · 9ca10d84
      Clemens Backes authored
      This flag only controls whether d8 installs the signal handler for wasm
      traps. Hence it should be a d8-only flag, to avoid confusion if used in
      other embeddings.
      We just introduced --wasm-enforce-bounds-checks to do what you might
      think --no-wasm-trap-handler would do.
      
      R=ahaas@chromium.org
      
      Bug: v8:11926
      Change-Id: Ic1f33af36236a2981cf060f450bbfd02e51d9793
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2989130
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#75459}
      9ca10d84
  5. 22 Jun, 2021 2 commits
  6. 21 Jun, 2021 1 commit
  7. 18 Jun, 2021 1 commit
  8. 16 Jun, 2021 1 commit
  9. 14 Jun, 2021 2 commits
  10. 11 Jun, 2021 1 commit
  11. 09 Jun, 2021 1 commit
  12. 08 Jun, 2021 2 commits
  13. 04 Jun, 2021 1 commit
  14. 02 Jun, 2021 2 commits
  15. 25 May, 2021 1 commit
  16. 21 May, 2021 1 commit
  17. 20 May, 2021 1 commit
  18. 19 May, 2021 3 commits
  19. 14 May, 2021 2 commits
  20. 05 May, 2021 1 commit
    • Manos Koukoutos's avatar
      [wasm] Complete element segment features for reftypes/typed-funcref · 37579df7
      Manos Koukoutos authored
      Main changes:
      - Allow global.get in elements segments with expressions-as-elements.
      - Allow element segments with types other than funcref.
      
      Detailed changes:
      - Move WasmInitExpr to its own file. Add stream opearator << support.
      - Simplify type of PrintCollection.
      - Make WasmElemSegment use an array of WasmInitExpr's over the previous
        ad-hoc implementation. Move null_index to WasmModuleBuilder.
      - Refactor consume_element_segment_header. Make it return a
        WasmElemSegment.
      - Refactor consume_element_expr. Make it return a WasmInitExpr.
      - Refactor DecodeElementSection. Make it invoke
        consume_element_segment_header, then populate its element array.
      - Update module-instantiate.cc to handle global.get elements.
      - Fix bug in wasm-objects.cc where the wrong type index was passed into
        module()->has_signature()
      - Adapt and add tests.
      
      Change-Id: I5abfbe424dbb750ee2dca59f91c451ffcb79f95f
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2857959
      Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#74374}
      37579df7
  21. 30 Apr, 2021 1 commit
  22. 23 Apr, 2021 1 commit
  23. 21 Apr, 2021 1 commit
    • Manos Koukoutos's avatar
      [wasm][refactor] Simplify/unify parts of the function decoder · c4113c47
      Manos Koukoutos authored
      Changes:
      - Remove TypeCheckBranchResult. Change TypeCheckBranch() to return bool.
        Refactor call sites to reflect this (decouple current code
        reachability check from type check).
      - Unify TypeCheckBranch(), TypeCheckFallthrough(), and the type-checking
        part of Return() into TypeCheckStackAgainstMerge().
      - Make sure all TypeCheck* functions are only called within VALIDATE.
      - In graph-builder-interface, rename end_env -> merge_env to reflect
        its function for loops.
      - Change expected error messages in some tests.
      
      Change-Id: I857edc18db9c2454ad12d539ffe7a10e96367710
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2839560Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#74100}
      c4113c47
  24. 15 Apr, 2021 2 commits
  25. 13 Apr, 2021 1 commit
  26. 30 Mar, 2021 1 commit
  27. 22 Mar, 2021 1 commit
  28. 19 Mar, 2021 2 commits