1. 24 Nov, 2021 1 commit
    • Manos Koukoutos's avatar
      [wasm] Internal representation for function references · f60132e9
      Manos Koukoutos authored
      Design doc: bit.ly/3jEVgzz
      
      We separate the internal representation of function references in Wasm
      from their JSFunction-based (external) representation. This improves
      performance of call_ref by requiring less indirections to load the
      context and call target from a function reference. In the boundary
      between wasm and JS/the C API, we add transformations between the two
      representations.
      
      Detailed changes:
      - Introduce WasmInternalFunction, containing fields required by
        call_ref, as well as a reference to the corresponding
        WasmExternalFunction. Add a reference to the WasmInternalFunction in
        WasmFunctionData. The {WasmInternalFunction::FromExternal} helper
        extracts the internal out of an external function.
      - Change {WasmInstanceObject::external_functions()} to internal
        functions.
      - Change wasm function tables to contain internal functions.
      - Change the following code to use internal functions:
        - call_ref in liftoff and Turbofan
        - function type checks in liftoff and Turbofan
        - CallRefIC and GenericJSToWasmWrapper builtins
        - {InitExprInterface::RefFunc}
        - module-compiler.cc in {ProcessTypeFeedback}
        - In module-instantiate.cc, in function-rtt creation.
      - Add transformations between internal and external functions in:
        - WasmWrapperGraphBuilder::{ToJS, BuildUnpackObjectWrapper, FromJS,
          BuildJSToJSWrapper}.
        - debug-wasm-objects.cc in {FunctionProxy::Get},
          {WasmValueObject::New} and {AddWasmTableObjectInternalProperties}.
        - runtime-wasm.cc in ReplaceWrapper
        - the C and JS APIs
        - module-instantiate.cc, in import and export processing, as well as
          {InitializeIndirectFunctionTables}
        - WasmTableObject::{IsValidElement, SetFunctionTableEntry}
        - {WasmGlobalObject::SetFuncRef}
      - Simplify body descriptors of WasmExternalFunction variants.
      - Adjust tests.
      
      Bug: v8:11510
      
      Change-Id: I8377f46f55c3771391ae1c5c8201a83854ee7878
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3277878Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78068}
      f60132e9
  2. 16 Nov, 2021 1 commit
  3. 08 Nov, 2021 1 commit
  4. 28 Oct, 2021 1 commit
  5. 21 Oct, 2021 1 commit
    • Ng Zhi An's avatar
      [wasm-relaxed-simd][x64] Prototype relaxed min and max · c3f346b7
      Ng Zhi An authored
      Relaxed f32x4 and f64x2 min and max.
      
      These instructions only guarantee results when the inputs are non nans,
      and when the inputs are not 0s of opposite signs.
      
      Reuse existing float binop testing harnesses and add special checks for
      such constants when relaxed operations are being tested.
      
      Drive-by rename of x64 instruction codes to be Minps/Maxps/Minpd/Maxpd
      since they map down exactly to a single instruction.
      
      Bug: v8:12284
      Change-Id: I1449dbfa87935a96d7d260db22667ab7b9e86601
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3218196Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
      Commit-Queue: Zhi An Ng <zhin@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#77484}
      c3f346b7
  6. 14 Oct, 2021 1 commit
  7. 11 Oct, 2021 1 commit
  8. 07 Oct, 2021 1 commit
  9. 28 Sep, 2021 1 commit
  10. 27 Sep, 2021 1 commit
  11. 24 Sep, 2021 1 commit
    • Clemens Backes's avatar
      [wasm][test] Cleanup macros · 156b2409
      Clemens Backes authored
      Some macros are redundant or unused.
      - WASM_RETURN1 is identical to WASM_RETURN.
      - WASM_RETURNN has an unused {count} parameter, and is otherwise
        identical to WASM_RETURN.
      - WASM_IFB is identical to WASM_IF.
      - WASM_CASE and WASM_CASE_BR are unused.
      - WASM_BR_TABLEV is unused.
      
      R=thibaudm@chromium.org
      
      Bug: v8:12244
      Change-Id: Ie7be00351f2dfe38d6e84d80e157a85df37233a9
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3178860Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#77056}
      156b2409
  12. 20 Sep, 2021 1 commit
  13. 17 Sep, 2021 1 commit
    • Thibaud Michaud's avatar
      [wasm][eh] Fix interpreter delegate in catch block · 159e440d
      Thibaud Michaud authored
      The recent change in the delegate semantics was incorrectly implemented
      in the interpreter. It only checked that the first opcode of the target
      block is a 'try': we also need to skip try blocks when we are already in
      their 'catch' or 'catch_all' sub-block.
      Use the exception_stack instead, since it already only contains indices
      of try blocks that haven't reached their handlers yet.
      
      R=clemensb@chromium.org
      
      Bug: chromium:1249306
      Change-Id: I15746b4bfabf3dcf04cfe0f2ad438c573cce65e7
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3168622
      Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#76919}
      159e440d
  14. 15 Sep, 2021 1 commit
  15. 13 Sep, 2021 1 commit
  16. 08 Sep, 2021 1 commit
  17. 17 Aug, 2021 1 commit
  18. 13 Aug, 2021 2 commits
    • Clemens Backes's avatar
      Revert "[arm64][wasm] Use NEON S/Usra for Wasm SIMD add(shr(x, imm), y)" · 55e6a51f
      Clemens Backes authored
      This reverts commit 2261e053.
      
      Reason for revert: No issues with the CL, but it is taking the
      last two available opcodes on arm64 (we use 9 bits to encode it,
      so we are limited to 512 opcodes). We need to land a security fix
      which includes the addition of two opcodes. Before relanding this,
      we need to figure out a strategy to either reduce opcodes, or use
      one more bit to encode them.
      
      Original change's description:
      > [arm64][wasm] Use NEON S/Usra for Wasm SIMD add(shr(x, imm), y)
      >
      > A single AArch64 SIMD signed/unsigned Shift Right and Accumulate can be
      > used to implement Wasm SIMD add(shr(x, imm), y). This gives a 1-1.5%
      > improvement on some compute intensive Wasm benchmarks on Neoverse-N1.
      >
      > Mla and Adalp optimisations were refactored to match the style of the
      > added code.
      >
      > Change-Id: Id5959a31ca267e02b7d60e7ff6f942adb029b41e
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3089157
      > Reviewed-by: Zhi An Ng <zhin@chromium.org>
      > Commit-Queue: Martyn Capewell <martyn.capewell@arm.com>
      > Cr-Commit-Position: refs/heads/master@{#76280}
      
      Change-Id: Ifad0625ed8a6b66e7a7a74da11ad7d60941207e5
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3094014
      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@{#76282}
      55e6a51f
    • Ilja Iskovs's avatar
      [arm64][wasm] Use NEON S/Usra for Wasm SIMD add(shr(x, imm), y) · 2261e053
      Ilja Iskovs authored
      A single AArch64 SIMD signed/unsigned Shift Right and Accumulate can be
      used to implement Wasm SIMD add(shr(x, imm), y). This gives a 1-1.5%
      improvement on some compute intensive Wasm benchmarks on Neoverse-N1.
      
      Mla and Adalp optimisations were refactored to match the style of the
      added code.
      
      Change-Id: Id5959a31ca267e02b7d60e7ff6f942adb029b41e
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3089157Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
      Commit-Queue: Martyn Capewell <martyn.capewell@arm.com>
      Cr-Commit-Position: refs/heads/master@{#76280}
      2261e053
  19. 12 Aug, 2021 1 commit
  20. 03 Aug, 2021 1 commit
  21. 29 Jul, 2021 1 commit
  22. 27 Jul, 2021 1 commit
  23. 26 Jul, 2021 1 commit
  24. 07 Jul, 2021 2 commits
  25. 01 Jul, 2021 1 commit
  26. 24 Jun, 2021 1 commit
  27. 21 Jun, 2021 1 commit
  28. 18 Jun, 2021 1 commit
  29. 14 Jun, 2021 3 commits
  30. 10 Jun, 2021 1 commit
  31. 04 Jun, 2021 1 commit
    • Manos Koukoutos's avatar
      [wasm] Simplify Immediates in decoder · f9db82ab
      Manos Koukoutos authored
      Changes:
      - Merge all immediates which read a u32_v index into IndexImmediate.
        Refactor overloaded Validate(const byte*, [Type]Immediate) functions
        to Validate[Type](const byte*, IndexImmediate).
      - Move MemoryIndexImmediate/MemoryAccessImmediate validation into their
        own Validate functions. Remove CheckHasMemory(), move its
        functionality into these Validate() functions.
      - Refactor MemoryInitImmediate, TableInitImmediate and
        CallIndirectImmediate as composite immediates.
      - Change field initializations for some Immediates to constructor
        initializers. This helps us drop some useless default constructors.
      - Use the correct pc in StackEffect for struct.new_default.
      
      Bug: v8:11831
      Change-Id: I878f69a33f8473dc275184995b3b7b88fe0dfc8a
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2928498Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#74948}
      f9db82ab
  32. 02 Jun, 2021 1 commit
  33. 31 May, 2021 1 commit
  34. 27 May, 2021 1 commit
    • Manos Koukoutos's avatar
      [wasm-gc] Implement array.copy (experimental) · dfdc8f68
      Manos Koukoutos authored
      Changes:
      - Add --experimental-wasm-gc-experiments flag.
      - Add array.copy opcode. Implement it in decoding and code generation
        behind the new flag.
      - Add WasmCodeBuilder::BoundsCheckArrayCopy. Move BoundsCheckArray to
        the private section.
      - Add WasmArrayCopy and WasmArrayCopyWithChecks builtin.
      - Add WasmArrayCopy runtime function.
      - Add WasmArray::ElementSlot.
      - Always print two hex digits in CHECK_PROTOTYPE_OPCODE.
      - In test-gc, print the thrown-error message if the function should not
        throw.
      - In test-gc, add GetResultObject with one argument.
      
      Bug: v8:7748
      Change-Id: I58f4d37e254154596cdef5e78482b55260dd3782
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2912729
      Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#74806}
      dfdc8f68
  35. 21 May, 2021 1 commit
  36. 20 May, 2021 1 commit