1. 07 Sep, 2021 1 commit
  2. 06 Sep, 2021 1 commit
  3. 19 Aug, 2021 1 commit
    • Patrick Thier's avatar
      [masm] Create helpers to manipulate arguments on the stack. · 89933af6
      Patrick Thier authored
      - Introduce helper to push arguments onto the stack (Standalone this
      change doesn't make a lot of sense, but is in preparation for including
      the receiver in argc).
      - Introduce helper to shift arguments already on the stack to make room
      for new arguments (Varargs).
      - arm64 is not included because a) there was already a helper similar
      to ShiftArguments and b) PushArguments is not similar enough to make
      sense for arm64 because of small differences (e.g. also pushing the
      function) in conjunction with stack alignment.
      
      Drive-by: Use masm DropArguments in Sparkplug EmitReturn
      
      Bug: v8:11112
      Change-Id: Id7a3a5f025abb19e2a52dae27b3b484fe87e9faf
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3097275Reviewed-by: 's avatarVictor Gomes <victorgomes@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Patrick Thier <pthier@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#76392}
      89933af6
  4. 04 Aug, 2021 1 commit
  5. 29 Jul, 2021 1 commit
    • Leszek Swirski's avatar
      [sparkplug] Fix invalid stack on baseline install · b4e62f2d
      Leszek Swirski authored
      InterpreterOnStackReplacement_ToBaseline spills the accumulator register
      without a frame, but can then call kInstallBaselineCode. If that
      function then allocates, then the GC will see an invalid stack.
      
      Fix this by making sure that the accumulator register is spilled inside
      the internal frame of the kInstallBaselineCode, and either don't spill
      it at all outside that frame, or at least make sure that we pop/re-push
      the spilled value so that it moves inside the frame.
      
      Bug: v8:11420
      Change-Id: Iad2aa718b0477ff960544d881fecae9efcbeef54
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059072
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Auto-Submit: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
      Reviewed-by: 's avatarVictor Gomes <victorgomes@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#75978}
      b4e62f2d
  6. 21 Jul, 2021 1 commit
  7. 20 Jul, 2021 1 commit
  8. 19 Jul, 2021 2 commits
  9. 30 Jun, 2021 1 commit
  10. 24 Jun, 2021 4 commits
  11. 22 Jun, 2021 1 commit
  12. 21 Jun, 2021 2 commits
  13. 18 Jun, 2021 1 commit
  14. 14 Jun, 2021 2 commits
  15. 10 Jun, 2021 1 commit
  16. 07 Jun, 2021 2 commits
  17. 02 Jun, 2021 1 commit
  18. 01 Jun, 2021 1 commit
  19. 11 May, 2021 2 commits
  20. 10 May, 2021 1 commit
  21. 06 May, 2021 1 commit
  22. 27 Apr, 2021 1 commit
  23. 26 Apr, 2021 1 commit
  24. 21 Apr, 2021 1 commit
  25. 19 Apr, 2021 1 commit
  26. 16 Apr, 2021 3 commits
    • Leszek Swirski's avatar
      Reland "[codegen] Add static interface descriptors" · 2871e05c
      Leszek Swirski authored
      This is a reland of ae0752df
      
      Reland fixes:
      
        * Remove UNREACHABLE() from constexpr switch, since we don't have a
          CONSTEXPR_UNREACHABLE() (it's ok, the switch is exhaustive for the
          enum anyway).
        * Fix IsRegisterArray trait to use public inheritance and size_t for
          std::array size.
      
      Original change's description:
      > [codegen] Add static interface descriptors
      >
      > Add a new CRTP StaticCallInterfaceDescriptor class, which provides
      > static constexpr getters for a descriptor's registers, parameter counts,
      > and so on. Each CallInterfaceDescriptor subclass is changed to extend
      > StaticCallInterfaceDescriptor, with StaticCallInterfaceDescriptor itself
      > extending CallInterfaceDescriptor to still provide a dynamic lookup
      > where needed.
      >
      > StaticCallInterfaceDescriptor provides a couple of customisation points,
      > where it reads its CRTP derived descriptor's static fields and
      > functions, with default fallbacks where appropriate. With these
      > customisation points, the definition of CallInterfaceDescriptor
      > subclasses is simplified to:
      >
      >     a) Providing parameter names (as before)
      >     b) Providing parameter types (as before)
      >     c) Optionally setting flags (like kNoContext or kAllowVarArgs) as
      >        static booleans on the class.
      >     d) Optionally providing a `registers()` method that returns a
      >        std::array<Register, N> of registers that may be used for
      >        parameters (if not provided, this defaults to the implementation
      >        specific default register set).
      >
      > Parameter registers (and register count) are automagically set based on
      > the number of parameters and number of given registers, with extra magic
      > to ignore no_reg registers (to reduce ia32 special casing). The
      > CallInterfaceDescriptorData is initialized based on these static
      > functions, rather than manual per-descriptor initializers.
      >
      > This allows us to skip loading descriptors dynamically for CallBuiltin
      > in Sparkplug, and instead lets us use a bit of template magic to
      > statically set up arguments for the calls. Any other users of statically
      > known descriptors will also benefit, thanks to C++ picking the static
      > methods over the dynamic methods on the base class when available.
      >
      > Because we can remove various virtual functions and trigger heavier
      > inlining of constantly known values, binary size slightly decreases with
      > this change.
      >
      > Note that torque-generated descriptors are changed to use the same magic,
      > rather than having Torque-specific magic, for consistency.
      >
      > Bug: v8:11420
      > Change-Id: Icc5e238b6313a08734feb564204a13226b450c22
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2814518
      > Auto-Submit: Leszek Swirski <leszeks@chromium.org>
      > Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
      > Reviewed-by: Clemens Backes <clemensb@chromium.org>
      > Reviewed-by: Igor Sheludko <ishell@chromium.org>
      > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
      > Commit-Queue: Clemens Backes <clemensb@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#73996}
      
      TBR=nicohartmann@chromium.org,clemensb@chromium.org,ishell@chromium.org,clemensb@chromium.org
      
      Bug: v8:11420
      Change-Id: Icd1f6cdb3c178e74460044b1e9623139929ceba8
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2831872Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#74010}
      2871e05c
    • Leszek Swirski's avatar
      Revert "[codegen] Add static interface descriptors" · 5dea60d6
      Leszek Swirski authored
      This reverts commit ae0752df.
      
      Reason for revert: Predictably, constexpr issues on non-clang compilers.
      
      Original change's description:
      > [codegen] Add static interface descriptors
      >
      > Add a new CRTP StaticCallInterfaceDescriptor class, which provides
      > static constexpr getters for a descriptor's registers, parameter counts,
      > and so on. Each CallInterfaceDescriptor subclass is changed to extend
      > StaticCallInterfaceDescriptor, with StaticCallInterfaceDescriptor itself
      > extending CallInterfaceDescriptor to still provide a dynamic lookup
      > where needed.
      >
      > StaticCallInterfaceDescriptor provides a couple of customisation points,
      > where it reads its CRTP derived descriptor's static fields and
      > functions, with default fallbacks where appropriate. With these
      > customisation points, the definition of CallInterfaceDescriptor
      > subclasses is simplified to:
      >
      >     a) Providing parameter names (as before)
      >     b) Providing parameter types (as before)
      >     c) Optionally setting flags (like kNoContext or kAllowVarArgs) as
      >        static booleans on the class.
      >     d) Optionally providing a `registers()` method that returns a
      >        std::array<Register, N> of registers that may be used for
      >        parameters (if not provided, this defaults to the implementation
      >        specific default register set).
      >
      > Parameter registers (and register count) are automagically set based on
      > the number of parameters and number of given registers, with extra magic
      > to ignore no_reg registers (to reduce ia32 special casing). The
      > CallInterfaceDescriptorData is initialized based on these static
      > functions, rather than manual per-descriptor initializers.
      >
      > This allows us to skip loading descriptors dynamically for CallBuiltin
      > in Sparkplug, and instead lets us use a bit of template magic to
      > statically set up arguments for the calls. Any other users of statically
      > known descriptors will also benefit, thanks to C++ picking the static
      > methods over the dynamic methods on the base class when available.
      >
      > Because we can remove various virtual functions and trigger heavier
      > inlining of constantly known values, binary size slightly decreases with
      > this change.
      >
      > Note that torque-generated descriptors are changed to use the same magic,
      > rather than having Torque-specific magic, for consistency.
      >
      > Bug: v8:11420
      > Change-Id: Icc5e238b6313a08734feb564204a13226b450c22
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2814518
      > Auto-Submit: Leszek Swirski <leszeks@chromium.org>
      > Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
      > Reviewed-by: Clemens Backes <clemensb@chromium.org>
      > Reviewed-by: Igor Sheludko <ishell@chromium.org>
      > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
      > Commit-Queue: Clemens Backes <clemensb@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#73996}
      
      Bug: v8:11420
      Change-Id: Ie5469c9253fc140590ac30b72db6eb1d93f86806
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2831485
      Auto-Submit: Leszek Swirski <leszeks@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@{#74000}
      5dea60d6
    • Leszek Swirski's avatar
      [codegen] Add static interface descriptors · ae0752df
      Leszek Swirski authored
      Add a new CRTP StaticCallInterfaceDescriptor class, which provides
      static constexpr getters for a descriptor's registers, parameter counts,
      and so on. Each CallInterfaceDescriptor subclass is changed to extend
      StaticCallInterfaceDescriptor, with StaticCallInterfaceDescriptor itself
      extending CallInterfaceDescriptor to still provide a dynamic lookup
      where needed.
      
      StaticCallInterfaceDescriptor provides a couple of customisation points,
      where it reads its CRTP derived descriptor's static fields and
      functions, with default fallbacks where appropriate. With these
      customisation points, the definition of CallInterfaceDescriptor
      subclasses is simplified to:
      
          a) Providing parameter names (as before)
          b) Providing parameter types (as before)
          c) Optionally setting flags (like kNoContext or kAllowVarArgs) as
             static booleans on the class.
          d) Optionally providing a `registers()` method that returns a
             std::array<Register, N> of registers that may be used for
             parameters (if not provided, this defaults to the implementation
             specific default register set).
      
      Parameter registers (and register count) are automagically set based on
      the number of parameters and number of given registers, with extra magic
      to ignore no_reg registers (to reduce ia32 special casing). The
      CallInterfaceDescriptorData is initialized based on these static
      functions, rather than manual per-descriptor initializers.
      
      This allows us to skip loading descriptors dynamically for CallBuiltin
      in Sparkplug, and instead lets us use a bit of template magic to
      statically set up arguments for the calls. Any other users of statically
      known descriptors will also benefit, thanks to C++ picking the static
      methods over the dynamic methods on the base class when available.
      
      Because we can remove various virtual functions and trigger heavier
      inlining of constantly known values, binary size slightly decreases with
      this change.
      
      Note that torque-generated descriptors are changed to use the same magic,
      rather than having Torque-specific magic, for consistency.
      
      Bug: v8:11420
      Change-Id: Icc5e238b6313a08734feb564204a13226b450c22
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2814518
      Auto-Submit: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#73996}
      ae0752df
  27. 15 Apr, 2021 1 commit
    • Thibaud Michaud's avatar
      [wasm][x64] Fix OSR shadow stack violation · 06a2c2e0
      Thibaud Michaud authored
      We currently allow OSR (On-Stack Replacement) of arbitrarily deep return
      addresses. This is in direct violation of Intel CET's shadow stack,
      which we plan to enable eventually.
      
      This change works around this by postponing OSR until after we return to
      the old code. The main changes are:
      - Reserve a slot in Liftoff frames to store the OSR target,
      - Skip the return address modification, and instead store the new code
      pointer in the dedicated slot,
      - Upon returning to the old code, check the slot and do an indirect jump
      to the new code if needed.
      
      CET also prevents indirect jumps to arbitrary locations, so the last
      point is also a CET violation. Valid indirect jump targets must be
      marked with the ENDBRANCH instruction, which I will do in a follow-up
      CL.
      
      Bug: v8:11654
      Change-Id: I6925005211aa95d60803b9409e3c07c7c226b25c
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2826127
      Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#73977}
      06a2c2e0
  28. 14 Apr, 2021 1 commit
  29. 06 Apr, 2021 1 commit
    • Patrick Thier's avatar
      Reland "[sparkplug] OSR Ignition -> Sparkplug" · 064ca18c
      Patrick Thier authored
      This is a reland of b9c521d0.
      
      Fixes crashes by calling kInstallBaselineCode from BaselineEntry if
      needed, i.e. when there is no feedback vector (required a bit of
      register rejiggling).
      This can happen with cross-realm calls. The OSR arming is stored as
      part of the BytecodeArray and therefore shared across realms.
      
      Original change's description:
      > [sparkplug] OSR Ignition -> Sparkplug
      >
      > Add support for OSR to baseline code.
      > We compile baseline and perform OSR immediately when the bytecode budget
      > interrupt hits.
      >
      > Drive-by: Clean-up deoptimizer special handling of JumpLoop by using
      > the newly introduced GetBaselinePCForNextExecutedBytecode instead of
      > GetBaselineEndPCForBytecodeOffset.
      >
      > Bug: v8:11420
      > Change-Id: Ifbea264d4a83a127dd2a11e28626bf2a5e8aca59
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2784687
      > Commit-Queue: Patrick Thier <pthier@chromium.org>
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#73677}
      
      Bug: v8:11420
      Change-Id: I67325450514ed5a1170b730b1dd59fa6acc6e1d8
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2800112Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Patrick Thier <pthier@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#73803}
      064ca18c
  30. 01 Apr, 2021 1 commit