1. 03 Aug, 2022 1 commit
  2. 28 Jul, 2022 1 commit
  3. 27 Jul, 2022 1 commit
  4. 22 Jul, 2022 2 commits
  5. 21 Jul, 2022 1 commit
  6. 19 Jul, 2022 1 commit
  7. 11 Jul, 2022 2 commits
    • Thibaud Michaud's avatar
      [wasm] Move Suspender functions to WebAssembly · ff440126
      Thibaud Michaud authored
      Suspender.{returnPromiseOnSuspend,suspendOnReturnedPromise}
      are not tied to a specific suspender anymore, so move them to
      WebAssembly.{returnPRomiseOnSuspend,suspendOnReturnedPromise}.
      
      With this change, the suspender property is not needed anymore on the
      function data. Convert it to a boolean flag that just indicates whether
      a function uses the JS Promise Integration API.
      
      R=ahaas@chromium.org
      
      Bug: v8:12191
      Change-Id: I1b6d8e3190ebf5049dbc7eedee448999cf077509
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3748660Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#81639}
      ff440126
    • Thibaud Michaud's avatar
      [wasm] Take suspender as parameter for stack-switching · 00282d7d
      Thibaud Michaud authored
      This CL is the first step towards the 'static API':
      https://github.com/WebAssembly/js-promise-integration/pull/1/files
      
      The limitation of the previous API is that the stack-switching wrappers
      are tied to a particular suspender. Since a suspender cannot be
      re-entered until the corresponding computation has completed, this
      prevents creating multiple concurrent instances of the same export.
      
      Multiple APIs have been proposed and are still under discussion to
      solve that, but the core idea is the same: the suspender should become a
      runtime argument of the export and the import. This CL implements that.
      
      For now, the suspender is still explicit everywhere: it is created in JS
      and passed to the export, and forwarded to the JS import. Eventually,
      the suspender may be completely hidden from JS: it would be materialized
      by the export wrapper, and "swallowed" by the import wrapper, as
      proposed in the PR above.
      
      R=ahaas@chromium.org
      
      Bug: v8:12191
      Change-Id: Ic425a3fd920c7ad03874c636cd835d31c0e04994
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3748655Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#81633}
      00282d7d
  8. 08 Jul, 2022 1 commit
  9. 06 Jul, 2022 1 commit
  10. 28 Jun, 2022 1 commit
  11. 23 Jun, 2022 2 commits
  12. 16 Jun, 2022 1 commit
  13. 27 Apr, 2022 1 commit
  14. 17 Feb, 2022 1 commit
    • Thibaud Michaud's avatar
      [wasm] Handle arguments in stack-switching export wrapper · 921135c7
      Thibaud Michaud authored
      Use the existing generic js-to-wasm wrapper to handle arguments in
      the stack-switching export wrapper, by combining them into a single
      helper function parameterized by a boolean.
      
      If the stack_switch parameter is false, the generated js-to-wasm wrapper
      is the same as before.
      
      If the stack_switch parameter is true, we allocate and switch to the new
      stack before starting to process the parameters. To load the parameters,
      we also keep a pointer to the old stack.
      After the call, we convert the return value according to the return type
      as usual, and then switch back to the parent stack (which may be
      different than the original stack, but has a compatible stack frame
      layout).
      If the stack suspends during the call, control-flow jumps right before
      we deconstruct and leave the frame, and returns the Promise as an
      externref in the return register.
      
      R=ahaas@chromium.org,jkummerow@chromium.org
      CC=fgm@chromium.org
      
      Bug: v8:12191
      Change-Id: If3f8eaba8edebe6e98d4738f79f895fdb5322adc
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3460410Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#79148}
      921135c7
  15. 15 Feb, 2022 1 commit
  16. 07 Feb, 2022 2 commits
    • Thibaud Michaud's avatar
      [wasm] Only suspend on promise for stack-switching · 7b19d05b
      Thibaud Michaud authored
      Currently, the stack-switching import wrapper always suspends. Only
      suspend if the returned value is a promise, otherwise just convert and
      return the value back to wasm.
      
      R=ahaas@chromium.org
      CC=fgm@chromium.org
      
      Bug: v8:12191
      Change-Id: I26e7a3921aeae30fcce7f0ccc98d790a1a6f8c35
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3440655Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78980}
      7b19d05b
    • Thibaud Michaud's avatar
      [wasm] Fix typing of stack-switching wrappers · 08b3da7f
      Thibaud Michaud authored
      - Suspender.suspendOnReturnedPromise expects a function with type
      [ti*]->[externref] and returns a function with the same type.
      - Suspender.returnPromiseOnSuspend expects a function with type
      [ti*]->[to] and returns a function with type [ti*]->[externref].
      
      Changes:
      - Check the wrapped function's return types
      - Skip type checking of return types when importing a wrapper (and
      assert that the return type is externref)
      - Add special case for WebAssembly.Function.type of a
      WasmExportedFunction: it currently returns the signature declared by
      the module. Change the return type to externref if this is a
      stack-switching export.
      
      Bug: v8:12191
      Change-Id: I6619c306e9613825ad1b021cb3400d73cd684656
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3435190Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78973}
      08b3da7f
  17. 03 Feb, 2022 1 commit
    • Thibaud Michaud's avatar
      Reland "Reland "[wasm] Resume suspender on resolved promise"" · dfbe5028
      Thibaud Michaud authored
      This is a reland of f942f656
      
      Changes: Change the order of initialization for wasm continuations to
      ensure object integrity if a GC happens during allocation. Also add
      missing handles.
      
      Original change's description:
      > Reland "[wasm] Resume suspender on resolved promise"
      >
      > This is a reland of a865d16b
      >
      > Changes:
      > - Make the next ID atomic
      > - Leave more space for runtime calls in debug mode
      >
      > Original change's description:
      > > [wasm] Resume suspender on resolved promise
      > >
      > > Implement the WasmResume builtin, which resumes a wasm suspender
      > > when the corresponding JS promise resolves.
      > >
      > > Drive-by 1: Fix detection of empty stacks in the stack frame iterator.
      > > Drive-by 2: Add a stack ID for better tracing.
      > >
      > > R=ahaas@chromium.org
      > > CC=​fgm@chromium.org
      > >
      > > Bug: v8:12191
      > > Change-Id: Ifa3f00c4259f802292b04d426c739e9b551f87b9
      > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3420827
      > > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
      > > Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      > > Cr-Commit-Position: refs/heads/main@{#78842}
      >
      > Bug: v8:12191
      > Change-Id: I3c231690b27be79a0c00e13043342bb4a3628886
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3427203
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
      > Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#78890}
      
      Bug: v8:12191
      Change-Id: I0e1362d3a9da1fd8c0d600ad9776ce2fd26c6a52
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3434145Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78922}
      dfbe5028
  18. 01 Feb, 2022 2 commits
    • Thibaud Michaud's avatar
      Revert "Reland "[wasm] Resume suspender on resolved promise"" · cb12a3e4
      Thibaud Michaud authored
      This reverts commit f942f656.
      
      Reason for revert: Breaks gc-stress
      
      Original change's description:
      > Reland "[wasm] Resume suspender on resolved promise"
      >
      > This is a reland of a865d16b
      >
      > Changes:
      > - Make the next ID atomic
      > - Leave more space for runtime calls in debug mode
      >
      > Original change's description:
      > > [wasm] Resume suspender on resolved promise
      > >
      > > Implement the WasmResume builtin, which resumes a wasm suspender
      > > when the corresponding JS promise resolves.
      > >
      > > Drive-by 1: Fix detection of empty stacks in the stack frame iterator.
      > > Drive-by 2: Add a stack ID for better tracing.
      > >
      > > R=ahaas@chromium.org
      > > CC=​fgm@chromium.org
      > >
      > > Bug: v8:12191
      > > Change-Id: Ifa3f00c4259f802292b04d426c739e9b551f87b9
      > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3420827
      > > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
      > > Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      > > Cr-Commit-Position: refs/heads/main@{#78842}
      >
      > Bug: v8:12191
      > Change-Id: I3c231690b27be79a0c00e13043342bb4a3628886
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3427203
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
      > Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#78890}
      
      Bug: v8:12191
      Change-Id: I5037419b6cee7a3bb49c1649e5a5d11a935a9b28
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Auto-submit: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3429500
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Auto-Submit: Thibaud Michaud <thibaudm@chromium.org>
      Owners-Override: Maya Lekova <mslekova@chromium.org>
      Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78893}
      cb12a3e4
    • Thibaud Michaud's avatar
      Reland "[wasm] Resume suspender on resolved promise" · f942f656
      Thibaud Michaud authored
      This is a reland of a865d16b
      
      Changes:
      - Make the next ID atomic
      - Leave more space for runtime calls in debug mode
      
      Original change's description:
      > [wasm] Resume suspender on resolved promise
      >
      > Implement the WasmResume builtin, which resumes a wasm suspender
      > when the corresponding JS promise resolves.
      >
      > Drive-by 1: Fix detection of empty stacks in the stack frame iterator.
      > Drive-by 2: Add a stack ID for better tracing.
      >
      > R=ahaas@chromium.org
      > CC=​fgm@chromium.org
      >
      > Bug: v8:12191
      > Change-Id: Ifa3f00c4259f802292b04d426c739e9b551f87b9
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3420827
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
      > Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#78842}
      
      Bug: v8:12191
      Change-Id: I3c231690b27be79a0c00e13043342bb4a3628886
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3427203Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78890}
      f942f656
  19. 28 Jan, 2022 2 commits
    • Thibaud Michaud's avatar
      Revert "[wasm] Resume suspender on resolved promise" · 98db248d
      Thibaud Michaud authored
      This reverts commit a865d16b.
      
      Reason for revert: breaks tsan and gc-stress
      
      Original change's description:
      > [wasm] Resume suspender on resolved promise
      >
      > Implement the WasmResume builtin, which resumes a wasm suspender
      > when the corresponding JS promise resolves.
      >
      > Drive-by 1: Fix detection of empty stacks in the stack frame iterator.
      > Drive-by 2: Add a stack ID for better tracing.
      >
      > R=​ahaas@chromium.org
      > CC=​​fgm@chromium.org
      >
      > Bug: v8:12191
      > Change-Id: Ifa3f00c4259f802292b04d426c739e9b551f87b9
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3420827
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
      > Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#78842}
      
      Bug: v8:12191
      Change-Id: I3352c8b1dcc8d99e1bd782a09276add219a3ecda
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3424489
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Owners-Override: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78845}
      98db248d
    • Thibaud Michaud's avatar
      [wasm] Resume suspender on resolved promise · a865d16b
      Thibaud Michaud authored
      Implement the WasmResume builtin, which resumes a wasm suspender
      when the corresponding JS promise resolves.
      
      Drive-by 1: Fix detection of empty stacks in the stack frame iterator.
      Drive-by 2: Add a stack ID for better tracing.
      
      R=ahaas@chromium.org
      CC=​fgm@chromium.org
      
      Bug: v8:12191
      Change-Id: Ifa3f00c4259f802292b04d426c739e9b551f87b9
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3420827Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78842}
      a865d16b
  20. 26 Jan, 2022 1 commit
  21. 21 Jan, 2022 1 commit
  22. 11 Jan, 2022 1 commit
  23. 08 Dec, 2021 1 commit
  24. 05 Nov, 2021 2 commits
  25. 26 Oct, 2021 1 commit