1. 18 Jul, 2022 1 commit
  2. 06 Jul, 2022 1 commit
    • Leszek Swirski's avatar
      [maglev] Add a maglev-specific safepoint mechanism · 76356780
      Leszek Swirski authored
      Maglev groups all its tagged spill slots together, and the number of
      them doesn't change. This means that the generality of the existing
      safepoint mechanism is massive overkill for maglev code.
      
      This patch adds a maglev-specific safepoint table, which is the
      safepoint of a code object if-and-only-if that code object has maglev
      code. This safepoint stores the number of tagged and untagged slots
      once, globally, and individual entries are just used for deopts and for
      storing the state of pushed registers (this is currently unused, but
      will be used in the future for pushing registers in deferred calls).
      
      Bug: v8:7700
      Change-Id: I15f84a6e957357825e84e33238f8a36f2e0b3012
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3747858
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#81564}
      76356780
  3. 09 Jun, 2022 1 commit
    • Georgia Kouveli's avatar
      [arm64] Fix CFI issue with short builtin calls · fb235844
      Georgia Kouveli authored
      The allowlist used for `Deoptimizer::IsValidReturnAddress` depends on
      fixed embedded builtin addresses. Pass a pointer to the isolate to
      this method, so that it can discover the actual builtin code start
      (which may have been remapped) and calculate the offset from the start
      of the builtins' code in order to check if the return address is
      allowed.
      
      After this change, do not disable short builtin calls when CFI is
      enabled.
      
      There's an important TODO for this change:
      Since the builtin code pointer that's used to check whether a return
      address is allowed is now writable, we should use pointer authentication
      to protect it.
      
      Bug: v8:10026
      Change-Id: Iafd31d3ad7e10cb17faf33e76e78d3df36edeefd
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3667506Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Commit-Queue: Georgia Kouveli <georgia.kouveli@arm.com>
      Cr-Commit-Position: refs/heads/main@{#81049}
      fb235844
  4. 03 Jun, 2022 1 commit
  5. 17 May, 2022 1 commit
  6. 14 May, 2022 1 commit
    • Simon Zünd's avatar
      Reland "[inspector] Re-enable Debugger#restartFrame" · 9ca7491b
      Simon Zünd authored
      This is a reland of commit 8278cb50
      
      The reland adds the RestartFrameTrampoline to the list of
      builtins that the deoptimizer is allowed to return from for
      control flow integrity.
      
      Original change's description:
      > [inspector] Re-enable Debugger#restartFrame
      >
      > Doc: https://bit.ly/revive-restart-frame
      >
      > This CL "undeprecates" Debugger#restartFrame and adds a new optional
      > "mode" parameter for back-wards compatibility. Moreover, the return
      > values are all deprecated. They were never actually used in the
      > DevTools frontend and the same information is available from the
      > Debugger#paused event that fires once execution stops at the
      > beginning of the restarted function.
      >
      > The CL also re-baselines all the restart-frame inspector tests that
      > now run successfully.
      >
      > R=bmeurer@chromium.org, kimanh@chromium.org
      >
      > Bug: chromium:1303521
      > Change-Id: I34bddeb1f2f4ff3dee58dd82e779c111495566f3
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3616505
      > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
      > Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
      > Commit-Queue: Simon Zünd <szuend@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#80491}
      
      Bug: chromium:1303521
      Change-Id: I13e2f8b5011795a38e541310622b8333a3d08049
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3644624Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
      Commit-Queue: Simon Zünd <szuend@chromium.org>
      Reviewed-by: 's avatarKim-Anh Tran <kimanh@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#80534}
      9ca7491b
  7. 13 May, 2022 2 commits
  8. 11 May, 2022 1 commit
  9. 10 May, 2022 1 commit
  10. 05 May, 2022 1 commit
  11. 04 May, 2022 1 commit
    • Dominik Inführ's avatar
      Revert "Reland^2: [heap] Store size with invalidated object" · 7840320f
      Dominik Inführ authored
      This reverts commit 2b79eefe.
      
      Reason for revert: Speculative revert because of https://crbug.com/1322305
      
      Original change's description:
      > Reland^2: [heap] Store size with invalidated object
      >
      > This is a reland of commit 23b2d571
      >
      > When updating pointers during a full GC, a page might not be swept
      > already. In such cases there might be invalid objects and slots
      > recorded in free memory. Updating tagged slots in free memory is fine
      > even though not strictly necessary.
      >
      > However, the GC also needs to calculate the size of potentially dead
      > invalid objects in order to be able to check whether a slot is within
      > that object. But since that object is dead, its map might be dead as
      > well which makes size calculation impossible on such objects. The CL
      > changes this to cache the size of invalid objects. A follow-up CL will
      > also check the marking bit of invalid objects.
      >
      > Reason for reverts:
      >
      > Revert #2: In-object slack tracking on JSObjects doesn't update the
      > cached size of invalidated objects. The fix here was to stop
      > invalidating recorded slots on JSObjects at all and avoid that problem
      > completely (see https://crrev.com/c/3620274).
      >
      > Revert #1: Not all size changes go through NotifyObjectLayoutChange, so
      > https://crrev.com/c/3607992 introduced NotifyObjectSizeChange as a
      > bottleneck for object size changes/right-trimming. This method is
      > now used to update the size of invalidated objects.
      >
      > Bug: v8:12578, chromium:1316289
      > Change-Id: I0478d04601c0270ddb39419ca6cf98719951eb4d
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3623542
      > Reviewed-by: Jakob Linke <jgruber@chromium.org>
      > Reviewed-by: Patrick Thier <pthier@chromium.org>
      > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#80344}
      
      Bug: v8:12578, chromium:1316289
      Change-Id: I6dd2dd13583123b9cb7933b15e2113fddc0c0b0b
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3627511
      Owners-Override: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Auto-Submit: Dominik Inführ <dinfuehr@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#80357}
      7840320f
  12. 03 May, 2022 1 commit
    • Dominik Inführ's avatar
      Reland^2: [heap] Store size with invalidated object · 2b79eefe
      Dominik Inführ authored
      This is a reland of commit 23b2d571
      
      When updating pointers during a full GC, a page might not be swept
      already. In such cases there might be invalid objects and slots
      recorded in free memory. Updating tagged slots in free memory is fine
      even though not strictly necessary.
      
      However, the GC also needs to calculate the size of potentially dead
      invalid objects in order to be able to check whether a slot is within
      that object. But since that object is dead, its map might be dead as
      well which makes size calculation impossible on such objects. The CL
      changes this to cache the size of invalid objects. A follow-up CL will
      also check the marking bit of invalid objects.
      
      Reason for reverts:
      
      Revert #2: In-object slack tracking on JSObjects doesn't update the
      cached size of invalidated objects. The fix here was to stop
      invalidating recorded slots on JSObjects at all and avoid that problem
      completely (see https://crrev.com/c/3620274).
      
      Revert #1: Not all size changes go through NotifyObjectLayoutChange, so
      https://crrev.com/c/3607992 introduced NotifyObjectSizeChange as a
      bottleneck for object size changes/right-trimming. This method is
      now used to update the size of invalidated objects.
      
      Bug: v8:12578, chromium:1316289
      Change-Id: I0478d04601c0270ddb39419ca6cf98719951eb4d
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3623542Reviewed-by: 's avatarJakob Linke <jgruber@chromium.org>
      Reviewed-by: 's avatarPatrick Thier <pthier@chromium.org>
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#80344}
      2b79eefe
  13. 02 May, 2022 2 commits
    • Jakob Linke's avatar
      Reland "Reland "[osr] Use the new OSR cache"" · 0e9a55d2
      Jakob Linke authored
      This is a reland of commit 91453880
      
      Fixed: properly reference the ClearedValue in CSA (i.e. without
      the cage_base upper 32 bits).
      
      Original change's description:
      > Reland "[osr] Use the new OSR cache"
      >
      > This is a reland of commit 91da3883
      >
      > Fixed: Use an X register for JumpIfCodeTIsMarkedForDeoptimization
      > on arm64.
      >
      > Original change's description:
      > > [osr] Use the new OSR cache
      > >
      > > This CL switches over our OSR system to be based on the feedback
      > > vector osr caches.
      > >
      > > - OSRing to Sparkplug is fully separated from OSR urgency. If
      > >   SP code exists, we simply jump to it, no need to maintain an
      > >   installation request.
      > > - Each JumpLoop checks its dedicated FeedbackVector cache slot.
      > >   If a valid target code object exists, we enter it *without*
      > >   calling into runtime to fetch the code object.
      > > - Finally, OSR urgency still remains as the heuristic for
      > >   requesting Turbofan OSR compile jobs. Note it no longer has a
      > >   double purpose of being a generic untargeted installation
      > >   request.
      > >
      > > With the new system in place, we can remove now-unnecessary
      > > hacks:
      > >
      > > - Early OSR tierup is replaced by the standard OSR system. Any
      > >   present OSR code is automatically entered.
      > > - The synchronous OSR compilation fallback is removed. With
      > >   precise installation (= per-JumpLoop-bytecode) we no longer
      > >   have the problem of 'getting unlucky' with JumpLoop/cache entry
      > >   mismatches. Execution has moved on while compiling? Simply spawn
      > >   a new concurrent compile job.
      > > - Remove the synchronous (non-OSR) Turbofan compile request now
      > >   that we always enter available OSR code as early as possible.
      > > - Tiering into Sparkplug no longer messes with OSR state.
      > >
      > > Bug: v8:12161
      > > Change-Id: I0a85e53d363504b7dac174dbaf69c03c35e66700
      > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3596167
      > > Commit-Queue: Jakob Linke <jgruber@chromium.org>
      > > Auto-Submit: Jakob Linke <jgruber@chromium.org>
      > > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > > Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      > > Cr-Commit-Position: refs/heads/main@{#80147}
      >
      > Bug: v8:12161
      > Change-Id: Ib3597cf1d99cdb5d0f2c5ac18e311914f376231d
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3606232
      > Auto-Submit: Jakob Linke <jgruber@chromium.org>
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#80167}
      
      Bug: v8:12161,chromium:1320189
      Change-Id: Ibd9a2ab61f51ebb32a3f5a66f7c602faead71c3e
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3620273Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Jakob Linke <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#80306}
      0e9a55d2
    • Igor Sheludko's avatar
      Revert "Reland "[heap] Store size with invalidated object"" · 1a80bfc1
      Igor Sheludko authored
      This reverts commit 23b2d571.
      
      Reason for revert: Breaks the V8 roll https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/1000394/
      
      Original change's description:
      > Reland "[heap] Store size with invalidated object"
      >
      > This is a reland of commit 5d235def
      >
      > The previous version of this CL got reverted because the cached
      > size of an invalidated object wasn't up-to-date when performing a GC.
      >
      > Not all size changes go through NotifyObjectLayoutChange, so
      > https://crrev.com/c/3607992 introduced NotifyObjectSizeChange as a
      > bottleneck for object size changes/right-trimming. This method is
      > now used to update the size of invalidated objects.
      >
      > Original change's description:
      > > [heap] Store size with invalidated object
      > >
      > > When updating pointers during a full GC, a page might not be swept
      > > already. In such cases there might be invalid objects and slots recorded
      > > in free memory. Updating tagged slots in free memory is fine even though
      > > it is superfluous work.
      > >
      > > However, the GC also needs to calculate the size of potentially dead
      > > invalid objects in order to be able to check whether a slot is within
      > > that object. But since that object is dead, its map might be dead as
      > > well which makes size calculation impossible on such objects. The CL
      > > changes this to cache the size of invalid objects. A follow-up CL will
      > > also check the marking bit of invalid objects.
      > >
      > > Bug: v8:12578, chromium:1316289
      > > Change-Id: Ie773d0862a565982957e0dc409630d76552d1a32
      > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3599482
      > > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
      > > Reviewed-by: Jakob Linke <jgruber@chromium.org>
      > > Reviewed-by: Patrick Thier <pthier@chromium.org>
      > > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      > > Cr-Commit-Position: refs/heads/main@{#80169}
      >
      > Bug: v8:12578, chromium:1316289
      > Change-Id: I1f7c6070b8e7d116aeb1a8d03d4f87927ab40872
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3608632
      > Reviewed-by: Jakob Linke <jgruber@chromium.org>
      > Reviewed-by: Patrick Thier <pthier@chromium.org>
      > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#80262}
      
      Bug: v8:12578, chromium:1316289
      Change-Id: I88b73ebe09bb923ba4ac57b0dbdceb08a1badd99
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3616730
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
      Auto-Submit: Igor Sheludko <ishell@chromium.org>
      Owners-Override: Michael Achenbach <machenbach@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Commit-Queue: Michael Achenbach <machenbach@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#80291}
      1a80bfc1
  14. 29 Apr, 2022 1 commit
    • Rohan Pavone's avatar
      Revert "Reland "[osr] Use the new OSR cache"" · 896f6e74
      Rohan Pavone authored
      This reverts commit 91453880.
      
      Reason for revert: Breaking the Fuchsia Deterministic Builder
      
      Original change's description:
      > Reland "[osr] Use the new OSR cache"
      >
      > This is a reland of commit 91da3883
      >
      > Fixed: Use an X register for JumpIfCodeTIsMarkedForDeoptimization
      > on arm64.
      >
      > Original change's description:
      > > [osr] Use the new OSR cache
      > >
      > > This CL switches over our OSR system to be based on the feedback
      > > vector osr caches.
      > >
      > > - OSRing to Sparkplug is fully separated from OSR urgency. If
      > >   SP code exists, we simply jump to it, no need to maintain an
      > >   installation request.
      > > - Each JumpLoop checks its dedicated FeedbackVector cache slot.
      > >   If a valid target code object exists, we enter it *without*
      > >   calling into runtime to fetch the code object.
      > > - Finally, OSR urgency still remains as the heuristic for
      > >   requesting Turbofan OSR compile jobs. Note it no longer has a
      > >   double purpose of being a generic untargeted installation
      > >   request.
      > >
      > > With the new system in place, we can remove now-unnecessary
      > > hacks:
      > >
      > > - Early OSR tierup is replaced by the standard OSR system. Any
      > >   present OSR code is automatically entered.
      > > - The synchronous OSR compilation fallback is removed. With
      > >   precise installation (= per-JumpLoop-bytecode) we no longer
      > >   have the problem of 'getting unlucky' with JumpLoop/cache entry
      > >   mismatches. Execution has moved on while compiling? Simply spawn
      > >   a new concurrent compile job.
      > > - Remove the synchronous (non-OSR) Turbofan compile request now
      > >   that we always enter available OSR code as early as possible.
      > > - Tiering into Sparkplug no longer messes with OSR state.
      > >
      > > Bug: v8:12161
      > > Change-Id: I0a85e53d363504b7dac174dbaf69c03c35e66700
      > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3596167
      > > Commit-Queue: Jakob Linke <jgruber@chromium.org>
      > > Auto-Submit: Jakob Linke <jgruber@chromium.org>
      > > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > > Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      > > Cr-Commit-Position: refs/heads/main@{#80147}
      >
      > Bug: v8:12161
      > Change-Id: Ib3597cf1d99cdb5d0f2c5ac18e311914f376231d
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3606232
      > Auto-Submit: Jakob Linke <jgruber@chromium.org>
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#80167}
      
      Bug: v8:12161
      Change-Id: I73e2d98660e9edfbe07a152a14402380ea9227de
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3615219Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
      Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
      Owners-Override: Deepti Gandluri <gdeepti@chromium.org>
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Cr-Commit-Position: refs/heads/main@{#80287}
      896f6e74
  15. 28 Apr, 2022 3 commits
    • Dominik Inführ's avatar
      Reland "[heap] Store size with invalidated object" · 23b2d571
      Dominik Inführ authored
      This is a reland of commit 5d235def
      
      The previous version of this CL got reverted because the cached
      size of an invalidated object wasn't up-to-date when performing a GC.
      
      Not all size changes go through NotifyObjectLayoutChange, so
      https://crrev.com/c/3607992 introduced NotifyObjectSizeChange as a
      bottleneck for object size changes/right-trimming. This method is
      now used to update the size of invalidated objects.
      
      Original change's description:
      > [heap] Store size with invalidated object
      >
      > When updating pointers during a full GC, a page might not be swept
      > already. In such cases there might be invalid objects and slots recorded
      > in free memory. Updating tagged slots in free memory is fine even though
      > it is superfluous work.
      >
      > However, the GC also needs to calculate the size of potentially dead
      > invalid objects in order to be able to check whether a slot is within
      > that object. But since that object is dead, its map might be dead as
      > well which makes size calculation impossible on such objects. The CL
      > changes this to cache the size of invalid objects. A follow-up CL will
      > also check the marking bit of invalid objects.
      >
      > Bug: v8:12578, chromium:1316289
      > Change-Id: Ie773d0862a565982957e0dc409630d76552d1a32
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3599482
      > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
      > Reviewed-by: Jakob Linke <jgruber@chromium.org>
      > Reviewed-by: Patrick Thier <pthier@chromium.org>
      > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#80169}
      
      Bug: v8:12578, chromium:1316289
      Change-Id: I1f7c6070b8e7d116aeb1a8d03d4f87927ab40872
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3608632Reviewed-by: 's avatarJakob Linke <jgruber@chromium.org>
      Reviewed-by: 's avatarPatrick Thier <pthier@chromium.org>
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#80262}
      23b2d571
    • Igor Sheludko's avatar
      Reland "[rwx][mac] Support fast W^X permission switching on Apple Silicon (M1)" · 449ece38
      Igor Sheludko authored
      This is a reland of commit 9d31f866
      There were issues with --future flag implications on M1.
      
      Original change's description:
      > [rwx][mac] Support fast W^X permission switching on Apple Silicon (M1)
      >
      > ... for V8 code space. The feature is currently disabled.
      >
      > In order to use fast W^X permission switching we must allocate
      > executable pages with readable writable executable permissions (RWX).
      > However, MacOS on ARM64 ("Apple M1"/Apple Silicon) prohibits further
      > permission changing of RWX memory pages. This means that the code page
      > headers must be allocated with RWX permissions too because otherwise
      > it wouldn't be possible to allocate a large code page over the freed
      > regular code page and vice versa.
      >
      > When enabled, the new machinery works as follows:
      >
      > 1) when memory region is reserved for allocating executable pages, the
      >    whole region is committed with RWX permissions and then decommitted,
      > 2) since reconfiguration of RWX page permissions is not allowed on
      >    MacOS on ARM64 ("Apple M1"/Apple Silicon), there must be no attempts
      >    to change them,
      > 3) the request to set RWX permissions in the executable page region
      >    just recommits the pages without changing permissions (see (1), they
      >    were already allocated as RWX and then discarded),
      > 4) in order to make executable pages inaccessible one must use
      >    OS::DiscardSystemPages() instead of OS::DecommitPages() or
      >    setting permissions to kNoAccess because the latter two are not
      >    allowed by the MacOS (see (2)).
      > 5) since code space page headers are allocated as RWX pages it's also
      >    necessary to switch between W^X modes when updating the data in the
      >    page headers (i.e. when marking, updating stats, wiring pages in
      >    lists, etc.). The new CodePageHeaderModificationScope class is used
      >    in the respective places. On unrelated configurations it's a no-op.
      >
      > The fast permission switching can't be used for V8 configuration with
      > enabled pointer compression and disabled external code space because
      > a) the pointer compression cage has to be reserved with MAP_JIT flag
      >    which is too expensive,
      > b) in case of shared pointer compression cage if the code range will
      >    be deleted while the cage is still alive then attempt to configure
      >    permissions of pages that were previously set to RWX will fail.
      >
      > This also CL extends the unmapper unit tests with permissions tracking
      > for discarded pages.
      >
      > Bug: v8:12797
      > Change-Id: Idb28cbc481306477589eee9962d2e75167d87c61
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3579303
      > Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
      > Reviewed-by: Clemens Backes <clemensb@chromium.org>
      > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
      > Commit-Queue: Igor Sheludko <ishell@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#80238}
      
      Bug: v8:12797
      Change-Id: I0fe86666f31bad37d7074e217555c95900d2afba
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3610433Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Commit-Queue: Igor Sheludko <ishell@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#80259}
      449ece38
    • Victor Gomes's avatar
      [cleanup] Rename TranslatedFrame with inlined arguments · 4b419c06
      Victor Gomes authored
      ... from ArgumentsAdaptorFrame to InlinedExtraArguments.
      
      Change-Id: I772e0546dd50282a4cd14723625fd5bf774f424c
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3609968Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Commit-Queue: Victor Gomes <victorgomes@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#80250}
      4b419c06
  16. 27 Apr, 2022 3 commits
    • Adam Klein's avatar
      Revert "[rwx][mac] Support fast W^X permission switching on Apple Silicon (M1)" · 10807c9f
      Adam Klein authored
      This reverts commit 9d31f866.
      
      Reason for revert: crashes on Mac/arm64 bots:
      https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Mac%20-%20arm64%20-%20debug/5923/overview
      
      Original change's description:
      > [rwx][mac] Support fast W^X permission switching on Apple Silicon (M1)
      >
      > ... for V8 code space. The feature is currently disabled.
      >
      > In order to use fast W^X permission switching we must allocate
      > executable pages with readable writable executable permissions (RWX).
      > However, MacOS on ARM64 ("Apple M1"/Apple Silicon) prohibits further
      > permission changing of RWX memory pages. This means that the code page
      > headers must be allocated with RWX permissions too because otherwise
      > it wouldn't be possible to allocate a large code page over the freed
      > regular code page and vice versa.
      >
      > When enabled, the new machinery works as follows:
      >
      > 1) when memory region is reserved for allocating executable pages, the
      >    whole region is committed with RWX permissions and then decommitted,
      > 2) since reconfiguration of RWX page permissions is not allowed on
      >    MacOS on ARM64 ("Apple M1"/Apple Silicon), there must be no attempts
      >    to change them,
      > 3) the request to set RWX permissions in the executable page region
      >    just recommits the pages without changing permissions (see (1), they
      >    were already allocated as RWX and then discarded),
      > 4) in order to make executable pages inaccessible one must use
      >    OS::DiscardSystemPages() instead of OS::DecommitPages() or
      >    setting permissions to kNoAccess because the latter two are not
      >    allowed by the MacOS (see (2)).
      > 5) since code space page headers are allocated as RWX pages it's also
      >    necessary to switch between W^X modes when updating the data in the
      >    page headers (i.e. when marking, updating stats, wiring pages in
      >    lists, etc.). The new CodePageHeaderModificationScope class is used
      >    in the respective places. On unrelated configurations it's a no-op.
      >
      > The fast permission switching can't be used for V8 configuration with
      > enabled pointer compression and disabled external code space because
      > a) the pointer compression cage has to be reserved with MAP_JIT flag
      >    which is too expensive,
      > b) in case of shared pointer compression cage if the code range will
      >    be deleted while the cage is still alive then attempt to configure
      >    permissions of pages that were previously set to RWX will fail.
      >
      > This also CL extends the unmapper unit tests with permissions tracking
      > for discarded pages.
      >
      > Bug: v8:12797
      > Change-Id: Idb28cbc481306477589eee9962d2e75167d87c61
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3579303
      > Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
      > Reviewed-by: Clemens Backes <clemensb@chromium.org>
      > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
      > Commit-Queue: Igor Sheludko <ishell@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#80238}
      
      Bug: v8:12797
      Change-Id: Ic07948e036db36326d464a2a901d052aa060a406
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3611665
      Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Auto-Submit: Adam Klein <adamk@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#80239}
      10807c9f
    • Igor Sheludko's avatar
      [rwx][mac] Support fast W^X permission switching on Apple Silicon (M1) · 9d31f866
      Igor Sheludko authored
      ... for V8 code space. The feature is currently disabled.
      
      In order to use fast W^X permission switching we must allocate
      executable pages with readable writable executable permissions (RWX).
      However, MacOS on ARM64 ("Apple M1"/Apple Silicon) prohibits further
      permission changing of RWX memory pages. This means that the code page
      headers must be allocated with RWX permissions too because otherwise
      it wouldn't be possible to allocate a large code page over the freed
      regular code page and vice versa.
      
      When enabled, the new machinery works as follows:
      
      1) when memory region is reserved for allocating executable pages, the
         whole region is committed with RWX permissions and then decommitted,
      2) since reconfiguration of RWX page permissions is not allowed on
         MacOS on ARM64 ("Apple M1"/Apple Silicon), there must be no attempts
         to change them,
      3) the request to set RWX permissions in the executable page region
         just recommits the pages without changing permissions (see (1), they
         were already allocated as RWX and then discarded),
      4) in order to make executable pages inaccessible one must use
         OS::DiscardSystemPages() instead of OS::DecommitPages() or
         setting permissions to kNoAccess because the latter two are not
         allowed by the MacOS (see (2)).
      5) since code space page headers are allocated as RWX pages it's also
         necessary to switch between W^X modes when updating the data in the
         page headers (i.e. when marking, updating stats, wiring pages in
         lists, etc.). The new CodePageHeaderModificationScope class is used
         in the respective places. On unrelated configurations it's a no-op.
      
      The fast permission switching can't be used for V8 configuration with
      enabled pointer compression and disabled external code space because
      a) the pointer compression cage has to be reserved with MAP_JIT flag
         which is too expensive,
      b) in case of shared pointer compression cage if the code range will
         be deleted while the cage is still alive then attempt to configure
         permissions of pages that were previously set to RWX will fail.
      
      This also CL extends the unmapper unit tests with permissions tracking
      for discarded pages.
      
      Bug: v8:12797
      Change-Id: Idb28cbc481306477589eee9962d2e75167d87c61
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3579303Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Commit-Queue: Igor Sheludko <ishell@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#80238}
      9d31f866
    • Jakob Gruber's avatar
      [osr] Fix DeoptExitIsInsideOsrLoop in presence of inlining · 4ac65c1b
      Jakob Gruber authored
      This logic was confused in the presence of inlined frames; the
      deopt exit offset would point inside the innermost inlined frame
      while we incorrectly assumed it points at the outermost frame.
      
      Fix this by always referring to the bytecode offset of the outermost
      frame.
      
      Bug: v8:12161
      Fixed: chromium:1320094
      Change-Id: I2eb28498639432c5344859f64a9388d93ee23bde
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3608630
      Auto-Submit: Jakob Linke <jgruber@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Commit-Queue: Jakob Linke <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#80212}
      4ac65c1b
  17. 26 Apr, 2022 4 commits
    • Jakob Gruber's avatar
      [osr] Opportunistically keep deoptimized OSR code in the cache · 12284536
      Jakob Gruber authored
      .. when deoptimization occurs after the outermost loop containing the
      loop that triggered OSR compilation. The reasoning is that the main
      benefit of OSR'd code is speeding up the OSR'd loop; the speedup of
      the OSR'd loop is assumed to be higher than deoptimization overhead.
      
      This is a slightly modified version of crrev.com/c/3521361, credit
      goes to tao.pan@intel.com for most of the investigation and
      implementation work.
      
      Bug: v8:12161
      Change-Id: Ie729dd5d1df9c7f529a1cf1b9471bb60ce76c41a
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3607988Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Jakob Linke <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#80177}
      12284536
    • Nico Hartmann's avatar
      Revert "[heap] Store size with invalidated object" · 95dab014
      Nico Hartmann authored
      This reverts commit 5d235def.
      
      Reason for revert: Speculative revert because of https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux%20-%20gc%20stress/38153/overview
      
      Original change's description:
      > [heap] Store size with invalidated object
      >
      > When updating pointers during a full GC, a page might not be swept
      > already. In such cases there might be invalid objects and slots recorded
      > in free memory. Updating tagged slots in free memory is fine even though
      > it is superfluous work.
      >
      > However, the GC also needs to calculate the size of potentially dead
      > invalid objects in order to be able to check whether a slot is within
      > that object. But since that object is dead, its map might be dead as
      > well which makes size calculation impossible on such objects. The CL
      > changes this to cache the size of invalid objects. A follow-up CL will
      > also check the marking bit of invalid objects.
      >
      > Bug: v8:12578, chromium:1316289
      > Change-Id: Ie773d0862a565982957e0dc409630d76552d1a32
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3599482
      > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
      > Reviewed-by: Jakob Linke <jgruber@chromium.org>
      > Reviewed-by: Patrick Thier <pthier@chromium.org>
      > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#80169}
      
      Bug: v8:12578, chromium:1316289
      Change-Id: I6949412c5d6e1aa15718d027043d9528137a60a0
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3605812
      Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
      Owners-Override: Nico Hartmann <nicohartmann@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/main@{#80173}
      95dab014
    • Dominik Inführ's avatar
      [heap] Store size with invalidated object · 5d235def
      Dominik Inführ authored
      When updating pointers during a full GC, a page might not be swept
      already. In such cases there might be invalid objects and slots recorded
      in free memory. Updating tagged slots in free memory is fine even though
      it is superfluous work.
      
      However, the GC also needs to calculate the size of potentially dead
      invalid objects in order to be able to check whether a slot is within
      that object. But since that object is dead, its map might be dead as
      well which makes size calculation impossible on such objects. The CL
      changes this to cache the size of invalid objects. A follow-up CL will
      also check the marking bit of invalid objects.
      
      Bug: v8:12578, chromium:1316289
      Change-Id: Ie773d0862a565982957e0dc409630d76552d1a32
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3599482Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Reviewed-by: 's avatarJakob Linke <jgruber@chromium.org>
      Reviewed-by: 's avatarPatrick Thier <pthier@chromium.org>
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#80169}
      5d235def
    • Jakob Gruber's avatar
      Reland "[osr] Use the new OSR cache" · 91453880
      Jakob Gruber authored
      This is a reland of commit 91da3883
      
      Fixed: Use an X register for JumpIfCodeTIsMarkedForDeoptimization
      on arm64.
      
      Original change's description:
      > [osr] Use the new OSR cache
      >
      > This CL switches over our OSR system to be based on the feedback
      > vector osr caches.
      >
      > - OSRing to Sparkplug is fully separated from OSR urgency. If
      >   SP code exists, we simply jump to it, no need to maintain an
      >   installation request.
      > - Each JumpLoop checks its dedicated FeedbackVector cache slot.
      >   If a valid target code object exists, we enter it *without*
      >   calling into runtime to fetch the code object.
      > - Finally, OSR urgency still remains as the heuristic for
      >   requesting Turbofan OSR compile jobs. Note it no longer has a
      >   double purpose of being a generic untargeted installation
      >   request.
      >
      > With the new system in place, we can remove now-unnecessary
      > hacks:
      >
      > - Early OSR tierup is replaced by the standard OSR system. Any
      >   present OSR code is automatically entered.
      > - The synchronous OSR compilation fallback is removed. With
      >   precise installation (= per-JumpLoop-bytecode) we no longer
      >   have the problem of 'getting unlucky' with JumpLoop/cache entry
      >   mismatches. Execution has moved on while compiling? Simply spawn
      >   a new concurrent compile job.
      > - Remove the synchronous (non-OSR) Turbofan compile request now
      >   that we always enter available OSR code as early as possible.
      > - Tiering into Sparkplug no longer messes with OSR state.
      >
      > Bug: v8:12161
      > Change-Id: I0a85e53d363504b7dac174dbaf69c03c35e66700
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3596167
      > Commit-Queue: Jakob Linke <jgruber@chromium.org>
      > Auto-Submit: Jakob Linke <jgruber@chromium.org>
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#80147}
      
      Bug: v8:12161
      Change-Id: Ib3597cf1d99cdb5d0f2c5ac18e311914f376231d
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3606232
      Auto-Submit: Jakob Linke <jgruber@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#80167}
      91453880
  18. 25 Apr, 2022 2 commits
    • Nico Hartmann's avatar
      Revert "[osr] Use the new OSR cache" · c34b7b41
      Nico Hartmann authored
      This reverts commit 91da3883.
      
      Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20-%20arm64%20-%20sim%20-%20pointer%20compression%20-%20builder/21150/overview
      
      Original change's description:
      > [osr] Use the new OSR cache
      >
      > This CL switches over our OSR system to be based on the feedback
      > vector osr caches.
      >
      > - OSRing to Sparkplug is fully separated from OSR urgency. If
      >   SP code exists, we simply jump to it, no need to maintain an
      >   installation request.
      > - Each JumpLoop checks its dedicated FeedbackVector cache slot.
      >   If a valid target code object exists, we enter it *without*
      >   calling into runtime to fetch the code object.
      > - Finally, OSR urgency still remains as the heuristic for
      >   requesting Turbofan OSR compile jobs. Note it no longer has a
      >   double purpose of being a generic untargeted installation
      >   request.
      >
      > With the new system in place, we can remove now-unnecessary
      > hacks:
      >
      > - Early OSR tierup is replaced by the standard OSR system. Any
      >   present OSR code is automatically entered.
      > - The synchronous OSR compilation fallback is removed. With
      >   precise installation (= per-JumpLoop-bytecode) we no longer
      >   have the problem of 'getting unlucky' with JumpLoop/cache entry
      >   mismatches. Execution has moved on while compiling? Simply spawn
      >   a new concurrent compile job.
      > - Remove the synchronous (non-OSR) Turbofan compile request now
      >   that we always enter available OSR code as early as possible.
      > - Tiering into Sparkplug no longer messes with OSR state.
      >
      > Bug: v8:12161
      > Change-Id: I0a85e53d363504b7dac174dbaf69c03c35e66700
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3596167
      > Commit-Queue: Jakob Linke <jgruber@chromium.org>
      > Auto-Submit: Jakob Linke <jgruber@chromium.org>
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#80147}
      
      Bug: v8:12161
      Change-Id: I4a6955f4f20b6f3b13e98d5600c7c6a5205915bc
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3605608
      Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
      Owners-Override: Nico Hartmann <nicohartmann@chromium.org>
      Reviewed-by: 's avatarNico Hartmann <nicohartmann@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/main@{#80148}
      c34b7b41
    • Jakob Gruber's avatar
      [osr] Use the new OSR cache · 91da3883
      Jakob Gruber authored
      This CL switches over our OSR system to be based on the feedback
      vector osr caches.
      
      - OSRing to Sparkplug is fully separated from OSR urgency. If
        SP code exists, we simply jump to it, no need to maintain an
        installation request.
      - Each JumpLoop checks its dedicated FeedbackVector cache slot.
        If a valid target code object exists, we enter it *without*
        calling into runtime to fetch the code object.
      - Finally, OSR urgency still remains as the heuristic for
        requesting Turbofan OSR compile jobs. Note it no longer has a
        double purpose of being a generic untargeted installation
        request.
      
      With the new system in place, we can remove now-unnecessary
      hacks:
      
      - Early OSR tierup is replaced by the standard OSR system. Any
        present OSR code is automatically entered.
      - The synchronous OSR compilation fallback is removed. With
        precise installation (= per-JumpLoop-bytecode) we no longer
        have the problem of 'getting unlucky' with JumpLoop/cache entry
        mismatches. Execution has moved on while compiling? Simply spawn
        a new concurrent compile job.
      - Remove the synchronous (non-OSR) Turbofan compile request now
        that we always enter available OSR code as early as possible.
      - Tiering into Sparkplug no longer messes with OSR state.
      
      Bug: v8:12161
      Change-Id: I0a85e53d363504b7dac174dbaf69c03c35e66700
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3596167
      Commit-Queue: Jakob Linke <jgruber@chromium.org>
      Auto-Submit: Jakob Linke <jgruber@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#80147}
      91da3883
  19. 04 Apr, 2022 3 commits
  20. 01 Apr, 2022 1 commit
    • Adam Klein's avatar
      Revert "Refactor OSROptimizedCodeCache" · b591fccb
      Adam Klein authored
      This reverts commit d368dcf4.
      
      Reason for revert: https://crbug.com/1312188
      
      Original change's description:
      > Refactor OSROptimizedCodeCache
      >
      > Tweak a few names, remove a few GetIsolate calls, other minor
      > usability refactors.
      >
      > It may be worth taking a closer look at the impl in the future,
      > currently the design choices don't seem ideal (see the added TODO
      > on top of the class).
      >
      > Bug: v8:12161
      > Change-Id: Ib34e372aa58a30c68c9c5cdd0d1da0ec3e86717c
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3560447
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Commit-Queue: Jakob Linke <jgruber@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#79687}
      
      Bug: v8:12161, chromium:1312188
      Change-Id: Ieb3a91682845a23536fdfdf3208af74b3c6585f8
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3564989
      Auto-Submit: Adam Klein <adamk@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/main@{#79700}
      b591fccb
  21. 31 Mar, 2022 1 commit
  22. 30 Mar, 2022 1 commit
  23. 29 Mar, 2022 1 commit
  24. 24 Mar, 2022 1 commit
  25. 23 Mar, 2022 1 commit
  26. 22 Mar, 2022 1 commit
  27. 21 Mar, 2022 2 commits