1. 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
  2. 05 Mar, 2021 1 commit
    • Bill Budge's avatar
      Reland "Reland "Reland "[compiler][wasm] Align Frame slots to value size""" · e639eafe
      Bill Budge authored
      This is a reland of 352b9ecb
      
      The test/fix CL has been merged in, as the fixes to return slot
      accounting are needed to fix Arm64 issues turned up by the fuzzers:
      
      https://chromium-review.googlesource.com/c/v8/v8/+/2644139
      
      The reverted fix for Wasm return slot allocation is added in
      patchset #2, to avoid fuzzer issues that it fixed:
      
      https://chromium-review.googlesource.com/c/v8/v8/+/2683024
      
      TBR=neis@chromium.org
      
      Original change's description:
      > Reland "Reland "[compiler][wasm] Align Frame slots to value size""
      >
      > This is a reland of 1694925c
      >
      > Minor fix to linkage for constexpr.
      >
      > TBR=ahaas@chromium.org,neis@chromium.org
      >
      > Original change's description:
      > > Reland "[compiler][wasm] Align Frame slots to value size"
      > >
      > > This is a reland of cddaf66c
      > >
      > > Original change's description:
      > > > [compiler][wasm] Align Frame slots to value size
      > > >
      > > > - Adds an AlignedSlotAllocator class and tests, to unify slot
      > > >   allocation. This attempts to use alignment holes for smaller
      > > >   values.
      > > > - Reworks Frame to use the new allocator for stack slots.
      > > > - Reworks LinkageAllocator to use the new allocator for stack
      > > >   slots and for ARMv7 FP register aliasing.
      > > > - Fixes the RegisterAllocator to align spill slots.
      > > > - Fixes InstructionSelector to align spill slots.
      > > >
      > > > Bug: v8:9198
      > > >
      > > > Change-Id: Ida148db428be89ef95de748ec5fc0e7b0358f523
      > > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2512840
      > > > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > > > Reviewed-by: Georg Neis <neis@chromium.org>
      > > > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > > > Cr-Commit-Position: refs/heads/master@{#71644}
      > >
      > > Bug: v8:9198
      > > Change-Id: Ib91fa6746370c38496706341e12d05c7bf999389
      > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2633390
      > > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > > Reviewed-by: Georg Neis <neis@chromium.org>
      > > Cr-Commit-Position: refs/heads/master@{#72195}
      >
      > Bug: v8:9198
      > Change-Id: I91e02b823af8ec925dacf075388fb22e3eeb3384
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2640890
      > Reviewed-by: Bill Budge <bbudge@chromium.org>
      > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#72209}
      
      Bug: v8:9198
      Change-Id: Ia5cf63af4e5991bc7cf42da9972ffd044fc829f0
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2733177
      Commit-Queue: Bill Budge <bbudge@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#73238}
      e639eafe
  3. 03 Mar, 2021 1 commit
  4. 23 Feb, 2021 2 commits
    • Clemens Backes's avatar
      [backend] Fix source position annotations · 5c237388
      Clemens Backes authored
      If two call instructions were generated right after each other, the
      source position table could get populated with two entries for the same
      PC (triggered by the follow-up CL: https://crrev.com/c/2697359).
      This CL fixes that by slightly changing the carry-over of source
      positions from nodes to instructions.
      
      The call node which has a source position attached generates two
      instructions:
            18: gap () ([rax|R|tp] = v16(-); [rbx|R|t] = v17(-);)
                [rax|R|t] = ArchCallWasmFunction [immediate:4] #-1 [rax|R|tp] [rbx|R|t] [immediate:5]
            19: gap () ()
                ArchJmp [immediate:6]
      
      Those are then reversed, and the source position is attached to the first
      one (the ArchJmp). After reversing it again later, the source position
      will be set to the pc *after* the call instruction, which in the example
      happened to be just another call instruction which already had a source
      position, resulting in this code:
      
      [...]
      0x388ee467d426    66  e875feffff     call 0x388ee467d2a0     ;; wasm stub: WasmThrow
      0x388ee467d42b    6b  e850feffff     call 0x388ee467d280     ;; wasm stub: WasmStackGuard
      [...]
      Source positions:
       pc offset  position
              6b         5
              6b         0
      
      By attaching the source position to the *last* instruction (after
      reversing), we ensure that it will be generated for an instruction
      *before* the call, or the call itself if this is the first instruction
      emitted for that node.
      
      R=jgruber@chromium.org
      
      Bug: v8:11490, v8:11496
      Change-Id: Ie95c87d0d9daea56ca14a811abcd02ac07a4cf84
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2697358
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72951}
      5c237388
    • Bill Budge's avatar
      Revert "Reland "Reland "Reland "[compiler][wasm] Align Frame slots to value size"""" · 942af6c7
      Bill Budge authored
      This reverts commit 9da4e363.
      
      Reason for revert: Fuzzers revealed that Liftoff doesn't use the CallDescriptor when pushing arguments, breaking linkage.
      
      tbr=ahaas@chromium.org,neis@chromium.org,jgruber@chromium.org
      
      Original change's description:
      > Reland "Reland "Reland "[compiler][wasm] Align Frame slots to value size"""
      >
      > This is a reland of 352b9ecb
      >
      > The test/fix CL has been merged in, as the fixes to return slot
      > accounting are needed to fix Arm64 issues turned up by the fuzzers:
      >
      > https://chromium-review.googlesource.com/c/v8/v8/+/2644139
      >
      > Original change's description:
      > > Reland "Reland "[compiler][wasm] Align Frame slots to value size""
      > >
      > > This is a reland of 1694925c
      > >
      > > Minor fix to linkage for constexpr.
      > >
      > > TBR=ahaas@chromium.org,neis@chromium.org
      > >
      > > Original change's description:
      > > > Reland "[compiler][wasm] Align Frame slots to value size"
      > > >
      > > > This is a reland of cddaf66c
      > > >
      > > > Original change's description:
      > > > > [compiler][wasm] Align Frame slots to value size
      > > > >
      > > > > - Adds an AlignedSlotAllocator class and tests, to unify slot
      > > > >   allocation. This attempts to use alignment holes for smaller
      > > > >   values.
      > > > > - Reworks Frame to use the new allocator for stack slots.
      > > > > - Reworks LinkageAllocator to use the new allocator for stack
      > > > >   slots and for ARMv7 FP register aliasing.
      > > > > - Fixes the RegisterAllocator to align spill slots.
      > > > > - Fixes InstructionSelector to align spill slots.
      > > > >
      > > > > Bug: v8:9198
      > > > >
      > > > > Change-Id: Ida148db428be89ef95de748ec5fc0e7b0358f523
      > > > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2512840
      > > > > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > > > > Reviewed-by: Georg Neis <neis@chromium.org>
      > > > > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > > > > Cr-Commit-Position: refs/heads/master@{#71644}
      > > >
      > > > Bug: v8:9198
      > > > Change-Id: Ib91fa6746370c38496706341e12d05c7bf999389
      > > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2633390
      > > > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > > > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > > > Reviewed-by: Georg Neis <neis@chromium.org>
      > > > Cr-Commit-Position: refs/heads/master@{#72195}
      > >
      > > Bug: v8:9198
      > > Change-Id: I91e02b823af8ec925dacf075388fb22e3eeb3384
      > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2640890
      > > Reviewed-by: Bill Budge <bbudge@chromium.org>
      > > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > > Cr-Commit-Position: refs/heads/master@{#72209}
      >
      > Bug: v8:9198
      > Change-Id: I8258f87463f66417c7028b9a1fed4b9b6d82a3be
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2669892
      > Reviewed-by: Georg Neis <neis@chromium.org>
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#72506}
      
      Bug: v8:9198
      Change-Id: I7f344e4d018ce3c02333b0b08efeecdd8cddf082
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2713207Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
      Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
      Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
      Commit-Queue: Bill Budge <bbudge@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72937}
      942af6c7
  5. 03 Feb, 2021 1 commit
    • Bill Budge's avatar
      Reland "Reland "Reland "[compiler][wasm] Align Frame slots to value size""" · 9da4e363
      Bill Budge authored
      This is a reland of 352b9ecb
      
      The test/fix CL has been merged in, as the fixes to return slot
      accounting are needed to fix Arm64 issues turned up by the fuzzers:
      
      https://chromium-review.googlesource.com/c/v8/v8/+/2644139
      
      Original change's description:
      > Reland "Reland "[compiler][wasm] Align Frame slots to value size""
      >
      > This is a reland of 1694925c
      >
      > Minor fix to linkage for constexpr.
      >
      > TBR=ahaas@chromium.org,neis@chromium.org
      >
      > Original change's description:
      > > Reland "[compiler][wasm] Align Frame slots to value size"
      > >
      > > This is a reland of cddaf66c
      > >
      > > Original change's description:
      > > > [compiler][wasm] Align Frame slots to value size
      > > >
      > > > - Adds an AlignedSlotAllocator class and tests, to unify slot
      > > >   allocation. This attempts to use alignment holes for smaller
      > > >   values.
      > > > - Reworks Frame to use the new allocator for stack slots.
      > > > - Reworks LinkageAllocator to use the new allocator for stack
      > > >   slots and for ARMv7 FP register aliasing.
      > > > - Fixes the RegisterAllocator to align spill slots.
      > > > - Fixes InstructionSelector to align spill slots.
      > > >
      > > > Bug: v8:9198
      > > >
      > > > Change-Id: Ida148db428be89ef95de748ec5fc0e7b0358f523
      > > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2512840
      > > > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > > > Reviewed-by: Georg Neis <neis@chromium.org>
      > > > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > > > Cr-Commit-Position: refs/heads/master@{#71644}
      > >
      > > Bug: v8:9198
      > > Change-Id: Ib91fa6746370c38496706341e12d05c7bf999389
      > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2633390
      > > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > > Reviewed-by: Georg Neis <neis@chromium.org>
      > > Cr-Commit-Position: refs/heads/master@{#72195}
      >
      > Bug: v8:9198
      > Change-Id: I91e02b823af8ec925dacf075388fb22e3eeb3384
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2640890
      > Reviewed-by: Bill Budge <bbudge@chromium.org>
      > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#72209}
      
      Bug: v8:9198
      Change-Id: I8258f87463f66417c7028b9a1fed4b9b6d82a3be
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2669892Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Bill Budge <bbudge@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72506}
      9da4e363
  6. 30 Jan, 2021 1 commit
    • Bill Budge's avatar
      Revert "Reland "Reland "[compiler][wasm] Align Frame slots to value size""" · 797c1e3b
      Bill Budge authored
      This reverts commit 352b9ecb.
      
      Reason for revert: fuzzers turned up more problems:
      https://bugs.chromium.org/p/chromium/issues/detail?id=1171759
      https://bugs.chromium.org/p/chromium/issues/detail?id=1171846
      
      tbr=ahaas@chromium.org,neis@chromium.org
      
      Original change's description:
      > Reland "Reland "[compiler][wasm] Align Frame slots to value size""
      >
      > This is a reland of 1694925c
      >
      > Minor fix to linkage for constexpr.
      >
      > TBR=ahaas@chromium.org,neis@chromium.org
      >
      > Original change's description:
      > > Reland "[compiler][wasm] Align Frame slots to value size"
      > >
      > > This is a reland of cddaf66c
      > >
      > > Original change's description:
      > > > [compiler][wasm] Align Frame slots to value size
      > > >
      > > > - Adds an AlignedSlotAllocator class and tests, to unify slot
      > > >   allocation. This attempts to use alignment holes for smaller
      > > >   values.
      > > > - Reworks Frame to use the new allocator for stack slots.
      > > > - Reworks LinkageAllocator to use the new allocator for stack
      > > >   slots and for ARMv7 FP register aliasing.
      > > > - Fixes the RegisterAllocator to align spill slots.
      > > > - Fixes InstructionSelector to align spill slots.
      > > >
      > > > Bug: v8:9198
      > > >
      > > > Change-Id: Ida148db428be89ef95de748ec5fc0e7b0358f523
      > > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2512840
      > > > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > > > Reviewed-by: Georg Neis <neis@chromium.org>
      > > > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > > > Cr-Commit-Position: refs/heads/master@{#71644}
      > >
      > > Bug: v8:9198
      > > Change-Id: Ib91fa6746370c38496706341e12d05c7bf999389
      > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2633390
      > > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > > Reviewed-by: Georg Neis <neis@chromium.org>
      > > Cr-Commit-Position: refs/heads/master@{#72195}
      >
      > Bug: v8:9198
      > Change-Id: I91e02b823af8ec925dacf075388fb22e3eeb3384
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2640890
      > Reviewed-by: Bill Budge <bbudge@chromium.org>
      > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#72209}
      
      TBR=bbudge@chromium.org,neis@chromium.org,ahaas@chromium.org
      
      # Not skipping CQ checks because original CL landed > 1 day ago.
      
      Bug: v8:9198
      Change-Id: Ifee566e3e82f2e774525996b038ce135190d0be1
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2660378
      Commit-Queue: Bill Budge <bbudge@chromium.org>
      Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72447}
      797c1e3b
  7. 21 Jan, 2021 1 commit
    • Bill Budge's avatar
      Reland "Reland "[compiler][wasm] Align Frame slots to value size"" · 352b9ecb
      Bill Budge authored
      This is a reland of 1694925c
      
      Minor fix to linkage for constexpr.
      
      TBR=ahaas@chromium.org,neis@chromium.org
      
      Original change's description:
      > Reland "[compiler][wasm] Align Frame slots to value size"
      >
      > This is a reland of cddaf66c
      >
      > Original change's description:
      > > [compiler][wasm] Align Frame slots to value size
      > >
      > > - Adds an AlignedSlotAllocator class and tests, to unify slot
      > >   allocation. This attempts to use alignment holes for smaller
      > >   values.
      > > - Reworks Frame to use the new allocator for stack slots.
      > > - Reworks LinkageAllocator to use the new allocator for stack
      > >   slots and for ARMv7 FP register aliasing.
      > > - Fixes the RegisterAllocator to align spill slots.
      > > - Fixes InstructionSelector to align spill slots.
      > >
      > > Bug: v8:9198
      > >
      > > Change-Id: Ida148db428be89ef95de748ec5fc0e7b0358f523
      > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2512840
      > > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > > Reviewed-by: Georg Neis <neis@chromium.org>
      > > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > > Cr-Commit-Position: refs/heads/master@{#71644}
      >
      > Bug: v8:9198
      > Change-Id: Ib91fa6746370c38496706341e12d05c7bf999389
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2633390
      > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Reviewed-by: Georg Neis <neis@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#72195}
      
      Bug: v8:9198
      Change-Id: I91e02b823af8ec925dacf075388fb22e3eeb3384
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2640890Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
      Commit-Queue: Bill Budge <bbudge@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72209}
      352b9ecb
  8. 20 Jan, 2021 2 commits
    • Clemens Backes's avatar
      Revert "Reland "[compiler][wasm] Align Frame slots to value size"" · f1730ded
      Clemens Backes authored
      This reverts commit 1694925c.
      
      Reason for revert: Link error in CFI release build: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Clusterfuzz%20Linux64%20CFI%20-%20release%20builder/19756/overview
      
      Original change's description:
      > Reland "[compiler][wasm] Align Frame slots to value size"
      >
      > This is a reland of cddaf66c
      >
      > Original change's description:
      > > [compiler][wasm] Align Frame slots to value size
      > >
      > > - Adds an AlignedSlotAllocator class and tests, to unify slot
      > >   allocation. This attempts to use alignment holes for smaller
      > >   values.
      > > - Reworks Frame to use the new allocator for stack slots.
      > > - Reworks LinkageAllocator to use the new allocator for stack
      > >   slots and for ARMv7 FP register aliasing.
      > > - Fixes the RegisterAllocator to align spill slots.
      > > - Fixes InstructionSelector to align spill slots.
      > >
      > > Bug: v8:9198
      > >
      > > Change-Id: Ida148db428be89ef95de748ec5fc0e7b0358f523
      > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2512840
      > > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > > Reviewed-by: Georg Neis <neis@chromium.org>
      > > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > > Cr-Commit-Position: refs/heads/master@{#71644}
      >
      > Bug: v8:9198
      > Change-Id: Ib91fa6746370c38496706341e12d05c7bf999389
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2633390
      > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Reviewed-by: Georg Neis <neis@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#72195}
      
      TBR=bbudge@chromium.org,neis@chromium.org,ahaas@chromium.org
      
      Change-Id: Ic94763925195c3a3552930e61a0eb0b7f0c0c756
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:9198
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2640474Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72197}
      f1730ded
    • Bill Budge's avatar
      Reland "[compiler][wasm] Align Frame slots to value size" · 1694925c
      Bill Budge authored
      This is a reland of cddaf66c
      
      Original change's description:
      > [compiler][wasm] Align Frame slots to value size
      >
      > - Adds an AlignedSlotAllocator class and tests, to unify slot
      >   allocation. This attempts to use alignment holes for smaller
      >   values.
      > - Reworks Frame to use the new allocator for stack slots.
      > - Reworks LinkageAllocator to use the new allocator for stack
      >   slots and for ARMv7 FP register aliasing.
      > - Fixes the RegisterAllocator to align spill slots.
      > - Fixes InstructionSelector to align spill slots.
      >
      > Bug: v8:9198
      >
      > Change-Id: Ida148db428be89ef95de748ec5fc0e7b0358f523
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2512840
      > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > Reviewed-by: Georg Neis <neis@chromium.org>
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#71644}
      
      Bug: v8:9198
      Change-Id: Ib91fa6746370c38496706341e12d05c7bf999389
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2633390
      Commit-Queue: Bill Budge <bbudge@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72195}
      1694925c
  9. 10 Dec, 2020 1 commit
    • Bill Budge's avatar
      Revert "[compiler][wasm] Align Frame slots to value size" · ba4c08a9
      Bill Budge authored
      This reverts commit cddaf66c.
      
      Reason for revert: Multiple fuzzer failures
      
      TBR=neis@chromium.org,ahaas@chromium.org
      
      Original change's description:
      > [compiler][wasm] Align Frame slots to value size
      >
      > - Adds an AlignedSlotAllocator class and tests, to unify slot
      >   allocation. This attempts to use alignment holes for smaller
      >   values.
      > - Reworks Frame to use the new allocator for stack slots.
      > - Reworks LinkageAllocator to use the new allocator for stack
      >   slots and for ARMv7 FP register aliasing.
      > - Fixes the RegisterAllocator to align spill slots.
      > - Fixes InstructionSelector to align spill slots.
      >
      > Bug: v8:9198
      >
      > Change-Id: Ida148db428be89ef95de748ec5fc0e7b0358f523
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2512840
      > Commit-Queue: Bill Budge <bbudge@chromium.org>
      > Reviewed-by: Georg Neis <neis@chromium.org>
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#71644}
      
      TBR=bbudge@chromium.org,neis@chromium.org,ahaas@chromium.org
      
      # Not skipping CQ checks because original CL landed > 1 day ago.
      
      Bug: v8:9198
      Change-Id: Ib26d016df6f30f333d30b5ac14eed9630bba8252
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2584200
      Commit-Queue: Bill Budge <bbudge@chromium.org>
      Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#71703}
      ba4c08a9
  10. 07 Dec, 2020 1 commit
  11. 21 Oct, 2020 1 commit
    • Jakob Gruber's avatar
      Reland "Reland "[deoptimizer] Change deopt entries into builtins"" · c7cb9bec
      Jakob Gruber authored
      This is a reland of fbfa9bf4
      
      The arm64 was missing proper codegen for CFI, thus sizes were off.
      
      Original change's description:
      > Reland "[deoptimizer] Change deopt entries into builtins"
      >
      > This is a reland of 7f58ced7
      >
      > It fixes the different exit size emitted on x64/Atom CPUs due to
      > performance tuning in TurboAssembler::Call. Additionally, add
      > cctests to verify the fixed size exits.
      >
      > Original change's description:
      > > [deoptimizer] Change deopt entries into builtins
      > >
      > > While the overall goal of this commit is to change deoptimization
      > > entries into builtins, there are multiple related things happening:
      > >
      > > - Deoptimization entries, formerly stubs (i.e. Code objects generated
      > >   at runtime, guaranteed to be immovable), have been converted into
      > >   builtins. The major restriction is that we now need to preserve the
      > >   kRootRegister, which was formerly used on most architectures to pass
      > >   the deoptimization id. The solution differs based on platform.
      > > - Renamed DEOPT_ENTRIES_OR_FOR_TESTING code kind to FOR_TESTING.
      > > - Removed heap/ support for immovable Code generation.
      > > - Removed the DeserializerData class (no longer needed).
      > > - arm64: to preserve 4-byte deopt exits, introduced a new optimization
      > >   in which the final jump to the deoptimization entry is generated
      > >   once per Code object, and deopt exits can continue to emit a
      > >   near-call.
      > > - arm,ia32,x64: change to fixed-size deopt exits. This reduces exit
      > >   sizes by 4/8, 5, and 5 bytes, respectively.
      > >
      > > On arm the deopt exit size is reduced from 12 (or 16) bytes to 8 bytes
      > > by using the same strategy as on arm64 (recalc deopt id from return
      > > address). Before:
      > >
      > >  e300a002       movw r10, <id>
      > >  e59fc024       ldr ip, [pc, <entry offset>]
      > >  e12fff3c       blx ip
      > >
      > > After:
      > >
      > >  e59acb35       ldr ip, [r10, <entry offset>]
      > >  e12fff3c       blx ip
      > >
      > > On arm64 the deopt exit size remains 4 bytes (or 8 bytes in same cases
      > > with CFI). Additionally, up to 4 builtin jumps are emitted per Code
      > > object (max 32 bytes added overhead per Code object). Before:
      > >
      > >  9401cdae       bl <entry offset>
      > >
      > > After:
      > >
      > >  # eager deoptimization entry jump.
      > >  f95b1f50       ldr x16, [x26, <eager entry offset>]
      > >  d61f0200       br x16
      > >  # lazy deoptimization entry jump.
      > >  f95b2b50       ldr x16, [x26, <lazy entry offset>]
      > >  d61f0200       br x16
      > >  # the deopt exit.
      > >  97fffffc       bl <eager deoptimization entry jump offset>
      > >
      > > On ia32 the deopt exit size is reduced from 10 to 5 bytes. Before:
      > >
      > >  bb00000000     mov ebx,<id>
      > >  e825f5372b     call <entry>
      > >
      > > After:
      > >
      > >  e8ea2256ba     call <entry>
      > >
      > > On x64 the deopt exit size is reduced from 12 to 7 bytes. Before:
      > >
      > >  49c7c511000000 REX.W movq r13,<id>
      > >  e8ea2f0700     call <entry>
      > >
      > > After:
      > >
      > >  41ff9560360000 call [r13+<entry offset>]
      > >
      > > Bug: v8:8661,v8:8768
      > > Change-Id: I13e30aedc360474dc818fecc528ce87c3bfeed42
      > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2465834
      > > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > > Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
      > > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
      > > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > > Cr-Commit-Position: refs/heads/master@{#70597}
      >
      > Tbr: ulan@chromium.org, tebbi@chromium.org, rmcilroy@chromium.org
      > Bug: v8:8661,v8:8768,chromium:1140165
      > Change-Id: Ibcd5c39c58a70bf2b2ac221aa375fc68d495e144
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2485506
      > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
      > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#70655}
      
      Tbr: ulan@chromium.org, tebbi@chromium.org, rmcilroy@chromium.org
      Bug: v8:8661
      Bug: v8:8768
      Bug: chromium:1140165
      Change-Id: I471cc94fc085e527dc9bfb5a84b96bd907c2333f
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2488682Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70672}
      c7cb9bec
  12. 20 Oct, 2020 3 commits
    • Maya Lekova's avatar
      Revert "Reland "[deoptimizer] Change deopt entries into builtins"" · 7c7aa4fa
      Maya Lekova authored
      This reverts commit fbfa9bf4.
      
      Reason for revert: Seems to break arm64 sim CFI build (please see DeoptExitSizeIfFixed) - https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20arm64%20-%20sim%20-%20CFI/2808
      
      Original change's description:
      > Reland "[deoptimizer] Change deopt entries into builtins"
      >
      > This is a reland of 7f58ced7
      >
      > It fixes the different exit size emitted on x64/Atom CPUs due to
      > performance tuning in TurboAssembler::Call. Additionally, add
      > cctests to verify the fixed size exits.
      >
      > Original change's description:
      > > [deoptimizer] Change deopt entries into builtins
      > >
      > > While the overall goal of this commit is to change deoptimization
      > > entries into builtins, there are multiple related things happening:
      > >
      > > - Deoptimization entries, formerly stubs (i.e. Code objects generated
      > >   at runtime, guaranteed to be immovable), have been converted into
      > >   builtins. The major restriction is that we now need to preserve the
      > >   kRootRegister, which was formerly used on most architectures to pass
      > >   the deoptimization id. The solution differs based on platform.
      > > - Renamed DEOPT_ENTRIES_OR_FOR_TESTING code kind to FOR_TESTING.
      > > - Removed heap/ support for immovable Code generation.
      > > - Removed the DeserializerData class (no longer needed).
      > > - arm64: to preserve 4-byte deopt exits, introduced a new optimization
      > >   in which the final jump to the deoptimization entry is generated
      > >   once per Code object, and deopt exits can continue to emit a
      > >   near-call.
      > > - arm,ia32,x64: change to fixed-size deopt exits. This reduces exit
      > >   sizes by 4/8, 5, and 5 bytes, respectively.
      > >
      > > On arm the deopt exit size is reduced from 12 (or 16) bytes to 8 bytes
      > > by using the same strategy as on arm64 (recalc deopt id from return
      > > address). Before:
      > >
      > >  e300a002       movw r10, <id>
      > >  e59fc024       ldr ip, [pc, <entry offset>]
      > >  e12fff3c       blx ip
      > >
      > > After:
      > >
      > >  e59acb35       ldr ip, [r10, <entry offset>]
      > >  e12fff3c       blx ip
      > >
      > > On arm64 the deopt exit size remains 4 bytes (or 8 bytes in same cases
      > > with CFI). Additionally, up to 4 builtin jumps are emitted per Code
      > > object (max 32 bytes added overhead per Code object). Before:
      > >
      > >  9401cdae       bl <entry offset>
      > >
      > > After:
      > >
      > >  # eager deoptimization entry jump.
      > >  f95b1f50       ldr x16, [x26, <eager entry offset>]
      > >  d61f0200       br x16
      > >  # lazy deoptimization entry jump.
      > >  f95b2b50       ldr x16, [x26, <lazy entry offset>]
      > >  d61f0200       br x16
      > >  # the deopt exit.
      > >  97fffffc       bl <eager deoptimization entry jump offset>
      > >
      > > On ia32 the deopt exit size is reduced from 10 to 5 bytes. Before:
      > >
      > >  bb00000000     mov ebx,<id>
      > >  e825f5372b     call <entry>
      > >
      > > After:
      > >
      > >  e8ea2256ba     call <entry>
      > >
      > > On x64 the deopt exit size is reduced from 12 to 7 bytes. Before:
      > >
      > >  49c7c511000000 REX.W movq r13,<id>
      > >  e8ea2f0700     call <entry>
      > >
      > > After:
      > >
      > >  41ff9560360000 call [r13+<entry offset>]
      > >
      > > Bug: v8:8661,v8:8768
      > > Change-Id: I13e30aedc360474dc818fecc528ce87c3bfeed42
      > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2465834
      > > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > > Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
      > > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
      > > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > > Cr-Commit-Position: refs/heads/master@{#70597}
      >
      > Tbr: ulan@chromium.org, tebbi@chromium.org, rmcilroy@chromium.org
      > Bug: v8:8661,v8:8768,chromium:1140165
      > Change-Id: Ibcd5c39c58a70bf2b2ac221aa375fc68d495e144
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2485506
      > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
      > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#70655}
      
      TBR=ulan@chromium.org,rmcilroy@chromium.org,jgruber@chromium.org,tebbi@chromium.org
      
      Change-Id: I4739a3475bfd8ee0cfbe4b9a20382f91a6ef1bf0
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:8661
      Bug: v8:8768
      Bug: chromium:1140165
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2485223Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
      Commit-Queue: Maya Lekova <mslekova@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70658}
      7c7aa4fa
    • Jakob Gruber's avatar
      Reland "[deoptimizer] Change deopt entries into builtins" · fbfa9bf4
      Jakob Gruber authored
      This is a reland of 7f58ced7
      
      It fixes the different exit size emitted on x64/Atom CPUs due to
      performance tuning in TurboAssembler::Call. Additionally, add
      cctests to verify the fixed size exits.
      
      Original change's description:
      > [deoptimizer] Change deopt entries into builtins
      >
      > While the overall goal of this commit is to change deoptimization
      > entries into builtins, there are multiple related things happening:
      >
      > - Deoptimization entries, formerly stubs (i.e. Code objects generated
      >   at runtime, guaranteed to be immovable), have been converted into
      >   builtins. The major restriction is that we now need to preserve the
      >   kRootRegister, which was formerly used on most architectures to pass
      >   the deoptimization id. The solution differs based on platform.
      > - Renamed DEOPT_ENTRIES_OR_FOR_TESTING code kind to FOR_TESTING.
      > - Removed heap/ support for immovable Code generation.
      > - Removed the DeserializerData class (no longer needed).
      > - arm64: to preserve 4-byte deopt exits, introduced a new optimization
      >   in which the final jump to the deoptimization entry is generated
      >   once per Code object, and deopt exits can continue to emit a
      >   near-call.
      > - arm,ia32,x64: change to fixed-size deopt exits. This reduces exit
      >   sizes by 4/8, 5, and 5 bytes, respectively.
      >
      > On arm the deopt exit size is reduced from 12 (or 16) bytes to 8 bytes
      > by using the same strategy as on arm64 (recalc deopt id from return
      > address). Before:
      >
      >  e300a002       movw r10, <id>
      >  e59fc024       ldr ip, [pc, <entry offset>]
      >  e12fff3c       blx ip
      >
      > After:
      >
      >  e59acb35       ldr ip, [r10, <entry offset>]
      >  e12fff3c       blx ip
      >
      > On arm64 the deopt exit size remains 4 bytes (or 8 bytes in same cases
      > with CFI). Additionally, up to 4 builtin jumps are emitted per Code
      > object (max 32 bytes added overhead per Code object). Before:
      >
      >  9401cdae       bl <entry offset>
      >
      > After:
      >
      >  # eager deoptimization entry jump.
      >  f95b1f50       ldr x16, [x26, <eager entry offset>]
      >  d61f0200       br x16
      >  # lazy deoptimization entry jump.
      >  f95b2b50       ldr x16, [x26, <lazy entry offset>]
      >  d61f0200       br x16
      >  # the deopt exit.
      >  97fffffc       bl <eager deoptimization entry jump offset>
      >
      > On ia32 the deopt exit size is reduced from 10 to 5 bytes. Before:
      >
      >  bb00000000     mov ebx,<id>
      >  e825f5372b     call <entry>
      >
      > After:
      >
      >  e8ea2256ba     call <entry>
      >
      > On x64 the deopt exit size is reduced from 12 to 7 bytes. Before:
      >
      >  49c7c511000000 REX.W movq r13,<id>
      >  e8ea2f0700     call <entry>
      >
      > After:
      >
      >  41ff9560360000 call [r13+<entry offset>]
      >
      > Bug: v8:8661,v8:8768
      > Change-Id: I13e30aedc360474dc818fecc528ce87c3bfeed42
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2465834
      > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
      > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#70597}
      
      Tbr: ulan@chromium.org, tebbi@chromium.org, rmcilroy@chromium.org
      Bug: v8:8661,v8:8768,chromium:1140165
      Change-Id: Ibcd5c39c58a70bf2b2ac221aa375fc68d495e144
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2485506Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70655}
      fbfa9bf4
    • Jakob Gruber's avatar
      Revert "[deoptimizer] Change deopt entries into builtins" · 8bc9a794
      Jakob Gruber authored
      This reverts commit 7f58ced7.
      
      Reason for revert: Segfaults on Atom_x64 https://ci.chromium.org/p/v8-internal/builders/ci/v8_linux64_atom_perf/5686?
      
      Original change's description:
      > [deoptimizer] Change deopt entries into builtins
      >
      > While the overall goal of this commit is to change deoptimization
      > entries into builtins, there are multiple related things happening:
      >
      > - Deoptimization entries, formerly stubs (i.e. Code objects generated
      >   at runtime, guaranteed to be immovable), have been converted into
      >   builtins. The major restriction is that we now need to preserve the
      >   kRootRegister, which was formerly used on most architectures to pass
      >   the deoptimization id. The solution differs based on platform.
      > - Renamed DEOPT_ENTRIES_OR_FOR_TESTING code kind to FOR_TESTING.
      > - Removed heap/ support for immovable Code generation.
      > - Removed the DeserializerData class (no longer needed).
      > - arm64: to preserve 4-byte deopt exits, introduced a new optimization
      >   in which the final jump to the deoptimization entry is generated
      >   once per Code object, and deopt exits can continue to emit a
      >   near-call.
      > - arm,ia32,x64: change to fixed-size deopt exits. This reduces exit
      >   sizes by 4/8, 5, and 5 bytes, respectively.
      >
      > On arm the deopt exit size is reduced from 12 (or 16) bytes to 8 bytes
      > by using the same strategy as on arm64 (recalc deopt id from return
      > address). Before:
      >
      >  e300a002       movw r10, <id>
      >  e59fc024       ldr ip, [pc, <entry offset>]
      >  e12fff3c       blx ip
      >
      > After:
      >
      >  e59acb35       ldr ip, [r10, <entry offset>]
      >  e12fff3c       blx ip
      >
      > On arm64 the deopt exit size remains 4 bytes (or 8 bytes in same cases
      > with CFI). Additionally, up to 4 builtin jumps are emitted per Code
      > object (max 32 bytes added overhead per Code object). Before:
      >
      >  9401cdae       bl <entry offset>
      >
      > After:
      >
      >  # eager deoptimization entry jump.
      >  f95b1f50       ldr x16, [x26, <eager entry offset>]
      >  d61f0200       br x16
      >  # lazy deoptimization entry jump.
      >  f95b2b50       ldr x16, [x26, <lazy entry offset>]
      >  d61f0200       br x16
      >  # the deopt exit.
      >  97fffffc       bl <eager deoptimization entry jump offset>
      >
      > On ia32 the deopt exit size is reduced from 10 to 5 bytes. Before:
      >
      >  bb00000000     mov ebx,<id>
      >  e825f5372b     call <entry>
      >
      > After:
      >
      >  e8ea2256ba     call <entry>
      >
      > On x64 the deopt exit size is reduced from 12 to 7 bytes. Before:
      >
      >  49c7c511000000 REX.W movq r13,<id>
      >  e8ea2f0700     call <entry>
      >
      > After:
      >
      >  41ff9560360000 call [r13+<entry offset>]
      >
      > Bug: v8:8661,v8:8768
      > Change-Id: I13e30aedc360474dc818fecc528ce87c3bfeed42
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2465834
      > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
      > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#70597}
      
      TBR=ulan@chromium.org,rmcilroy@chromium.org,jgruber@chromium.org,tebbi@chromium.org
      
      # Not skipping CQ checks because original CL landed > 1 day ago.
      
      Bug: v8:8661,v8:8768,chromium:1140165
      Change-Id: I3df02ab42f6e02233d9f6fb80e8bb18f76870d91
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2485504Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70649}
      8bc9a794
  13. 19 Oct, 2020 1 commit
    • Jakob Gruber's avatar
      [deoptimizer] Change deopt entries into builtins · 7f58ced7
      Jakob Gruber authored
      While the overall goal of this commit is to change deoptimization
      entries into builtins, there are multiple related things happening:
      
      - Deoptimization entries, formerly stubs (i.e. Code objects generated
        at runtime, guaranteed to be immovable), have been converted into
        builtins. The major restriction is that we now need to preserve the
        kRootRegister, which was formerly used on most architectures to pass
        the deoptimization id. The solution differs based on platform.
      - Renamed DEOPT_ENTRIES_OR_FOR_TESTING code kind to FOR_TESTING.
      - Removed heap/ support for immovable Code generation.
      - Removed the DeserializerData class (no longer needed).
      - arm64: to preserve 4-byte deopt exits, introduced a new optimization
        in which the final jump to the deoptimization entry is generated
        once per Code object, and deopt exits can continue to emit a
        near-call.
      - arm,ia32,x64: change to fixed-size deopt exits. This reduces exit
        sizes by 4/8, 5, and 5 bytes, respectively.
      
      On arm the deopt exit size is reduced from 12 (or 16) bytes to 8 bytes
      by using the same strategy as on arm64 (recalc deopt id from return
      address). Before:
      
       e300a002       movw r10, <id>
       e59fc024       ldr ip, [pc, <entry offset>]
       e12fff3c       blx ip
      
      After:
      
       e59acb35       ldr ip, [r10, <entry offset>]
       e12fff3c       blx ip
      
      On arm64 the deopt exit size remains 4 bytes (or 8 bytes in same cases
      with CFI). Additionally, up to 4 builtin jumps are emitted per Code
      object (max 32 bytes added overhead per Code object). Before:
      
       9401cdae       bl <entry offset>
      
      After:
      
       # eager deoptimization entry jump.
       f95b1f50       ldr x16, [x26, <eager entry offset>]
       d61f0200       br x16
       # lazy deoptimization entry jump.
       f95b2b50       ldr x16, [x26, <lazy entry offset>]
       d61f0200       br x16
       # the deopt exit.
       97fffffc       bl <eager deoptimization entry jump offset>
      
      On ia32 the deopt exit size is reduced from 10 to 5 bytes. Before:
      
       bb00000000     mov ebx,<id>
       e825f5372b     call <entry>
      
      After:
      
       e8ea2256ba     call <entry>
      
      On x64 the deopt exit size is reduced from 12 to 7 bytes. Before:
      
       49c7c511000000 REX.W movq r13,<id>
       e8ea2f0700     call <entry>
      
      After:
      
       41ff9560360000 call [r13+<entry offset>]
      
      Bug: v8:8661,v8:8768
      Change-Id: I13e30aedc360474dc818fecc528ce87c3bfeed42
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2465834
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70597}
      7f58ced7
  14. 30 Sep, 2020 1 commit
    • Jakob Gruber's avatar
      Rename legacy code kinds · 29bcdaad
      Jakob Gruber authored
      CodeKind::OPTIMIZED_CODE -> TURBOFAN
      
      Kinds are now more fine-grained and distinguish between TF, TP, NCI.
      
      CodeKind::STUB -> DEOPT_ENTRIES_OR_FOR_TESTING
      
      Code stubs (like builtins, but generated at runtime) were removed from
      the codebase years ago, this is the last remnant. This kind is used
      only for deopt entries (which should be converted into builtins) and
      for tests.
      
      Change-Id: I67beb15377cb60f395e9b051b25f3e5764982e93
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2440335
      Auto-Submit: Jakob Gruber <jgruber@chromium.org>
      Commit-Queue: Mythri Alle <mythria@chromium.org>
      Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70234}
      29bcdaad
  15. 05 Aug, 2020 1 commit
    • Jakob Gruber's avatar
      [nci] Replace CompilationTarget with a new Code::Kind value · c51041f4
      Jakob Gruber authored
      With the new Turbofan variants (NCI and Turboprop), we need a way to
      distinguish between them both during and after compilation. We
      initially introduced CompilationTarget to track the variant during
      compilation, but decided to reuse the code kind as the canonical spot to
      store this information instead.
      
      Why? Because it is an established mechanism, already available in most
      of the necessary spots (inside the pipeline, on Code objects, in
      profiling traces).
      
      This CL removes CompilationTarget and adds a new
      NATIVE_CONTEXT_INDEPENDENT kind, plus helper functions to determine
      various things about a given code kind (e.g.: does this code kind
      deopt?).
      
      As a (very large) drive-by, refactor both Code::Kind and
      AbstractCode::Kind into a new CodeKind enum class.
      
      Bug: v8:8888
      Change-Id: Ie858b9a53311b0731630be35cf5cd108dee95b39
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2336793
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69244}
      c51041f4
  16. 31 Jul, 2020 3 commits
  17. 24 Jul, 2020 1 commit
  18. 02 Jun, 2020 1 commit
  19. 12 Sep, 2019 1 commit
  20. 22 Aug, 2019 1 commit
  21. 27 May, 2019 1 commit