v8/v8
0
Commit Graph

86267 Commits

Author SHA1 Message Date
95b9f93234 Add unit tests to importer
+ small refactorings and 2 bug fixes

Bug: v8:14002
Change-Id: I52fa159e84690d6e5d5340e8331e2766a15fa1a4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5185494
Commit-Queue: Liviu Rau <liviurau@google.com>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91775}
2024-01-11 08:57:35 +00:00
85616782bb [wasm-gc][liftoff] Trapping null check for array.fill
This is a follow-up to crrev.com/c/v8/v8/+/5173423.

Bug: v8:14034
Change-Id: Ib43ccf715e0ee9f6b06e0dc0e693ab7b7df5dbb8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5184214
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91774}
2024-01-11 08:50:11 +00:00
0322f56398 [turboshaft] Remove the experimental status of some flags
LoopUnrolling and LoopPeeling are already used for Wasm, so they it
makes not sense to keep the flags experimental for JS.

As for turboshaft-machine-lowering-opt, it should soon be enabled by
default, so remove the experimental status also makes sense.

Bug: v8:12783
Change-Id: I6ac8b58c0aa395859ad7a29fb387e9daaf1db66b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5185037
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Auto-Submit: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91773}
2024-01-11 08:00:08 +00:00
e621e88ed0 Update V8 DEPS (trusted)
Rolling build: 05ae923..eba30cc

Rolling buildtools: 71983d6..a656fc7

Rolling third_party/catapult: https://chromium.googlesource.com/catapult/+log/f582f5b..73730a0

Rolling third_party/depot_tools: 095b349..ad697e3

Rolling third_party/libc++/src: f18cfa9..e4aac3a

Rolling third_party/libunwind/src: 29eb3a5..e09e0d4

Rolling tools/luci-go: git_revision:d740e2026f68271ad436672df5a4c763d244451d..git_revision:0d11be367258bfe14a13ff1afcf43a0bc6aedb45

Rolling tools/luci-go: git_revision:d740e2026f68271ad436672df5a4c763d244451d..git_revision:0d11be367258bfe14a13ff1afcf43a0bc6aedb45

Roll created at https://cr-buildbucket.appspot.com/build/8759228672407191505

Change-Id: I90351f0f5129f5ded119c33a760c8aafa47b08db
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5185479
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#91772}
2024-01-11 04:53:55 +00:00
052e632c99 [interpreter] Add missing HoleElisionScope for derived ctor body
Fixed: chromium:1516861
Change-Id: I1d4b438cee759b729a15405df72b6d3dcf70785d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5181847
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91771}
2024-01-10 19:30:14 +00:00
292cd5bf8c [turboshaft][wasm] Run MachineOptimizationReducer in WasmLowering phase
Running the MachineOptimizationReducer helps the late load elimination
to eliminate redundant loads.

Bug: chromium:1511364
Change-Id: If251591d08e27da09bfdda065ae4a017cd37119c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5185038
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91770}
2024-01-10 19:07:13 +00:00
4a1cff3497 Update V8 DEPS (trusted)
Rolling third_party/abseil-cpp: d556a0f..5fe3232

Rolling third_party/depot_tools: cd076ba..095b349

Rolling tools/clang: 9eb7931..7fb9c81

Rolling tools/luci-go: git_revision:a7b7f319032d68f1cf0e710e695a84957d3b11dc..git_revision:d740e2026f68271ad436672df5a4c763d244451d

Rolling tools/luci-go: git_revision:a7b7f319032d68f1cf0e710e695a84957d3b11dc..git_revision:d740e2026f68271ad436672df5a4c763d244451d

Roll created at https://cr-buildbucket.appspot.com/build/8759273969212489953

Change-Id: I510c97e431fe102eed68e46496ce32d33f646d4f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5186154
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#91769}
2024-01-10 17:07:09 +00:00
3db6fcb66d Reland "[sandbox] Assert no trusted space objects are passed into CompareRoots"
This is a reland of commit b4ad5c2eff

The failing DCHECK on non-ptr-compr builds has been turned into an
if condition to correctly handle this situation. This is simpler than
the alternative of moving these checks into all callers.

Original change's description:
> [sandbox] Assert no trusted space objects are passed into CompareRoots
>
> As we're moving more objects into trusted space, we need to be careful
> when comparing such objects against objects inside the main cage, in
> particular to roots (which happens frequently). This is because by
> default, such comparisons would be 32-bit comparisons of just the lower
> 32-bits of the address, which is no longer correct once the objects live
> in different pointer compression cages. In C++ we have DCHECKs to catch
> these cases. This CL adds a similar debug assertion into generated code.
>
> Bug: chromium:1473677
> Change-Id: Iaae496b6ed20d7bec88923e8d70e27cb41b9e336
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5181094
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Samuel Groß <saelo@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#91763}

Bug: chromium:1473677
Change-Id: I4e0c8da75cf1172dbfe0a12850772ff9bcb768e5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5185495
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91768}
2024-01-10 16:41:23 +00:00
3a34091edd [interpreter] Save accumulator for derived ctor return value check
Fixed: chromium:1516321
Change-Id: I585b36158b4f297e2e30182279dca262854848f8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5179151
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91767}
2024-01-10 16:26:27 +00:00
8859593594 [api] Add use counters for shipped Wasm features
This adds use counters for six Wasm proposals where we tracked usage but
never populated use counters with that data.
In order to avoid the same mistake in the future we also add static
asserts to check that any staged or shipped feature has a corresponding
use counter.

The chromium-side wiring will be done in a follow-up.

R=jkummerow@chromium.org, mlippautz@chromium.org

Change-Id: Id44911a80e61ec85b0cd700cd3eba4e229f310d5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5180775
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91766}
2024-01-10 15:59:39 +00:00
79d85c3df8 [tagged-ptr] Introduce FLEXIBLE_ARRAY_MEMBER macro
Because of compiler limitations with the flexible array member
extension, in particular around subclassing, introduce a new macro which
defines the flexible array members. This also requires accessing
flexible array members using a macro, rather than with offsetof.

Bug: v8:12710
Change-Id: Ibf8ae9b20bb1a83be7374e439bff484914d7bad1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5148173
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91765}
2024-01-10 15:47:59 +00:00
ad7450ad27 Revert "[sandbox] Assert no trusted space objects are passed into CompareRoots"
This reverts commit b4ad5c2eff.

Reason for revert: Breaks some builds: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Mac%20-%20arm64%20-%20no%20pointer%20compression%20debug%20builder/8710/overview

Original change's description:
> [sandbox] Assert no trusted space objects are passed into CompareRoots
>
> As we're moving more objects into trusted space, we need to be careful
> when comparing such objects against objects inside the main cage, in
> particular to roots (which happens frequently). This is because by
> default, such comparisons would be 32-bit comparisons of just the lower
> 32-bits of the address, which is no longer correct once the objects live
> in different pointer compression cages. In C++ we have DCHECKs to catch
> these cases. This CL adds a similar debug assertion into generated code.
>
> Bug: chromium:1473677
> Change-Id: Iaae496b6ed20d7bec88923e8d70e27cb41b9e336
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5181094
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Samuel Groß <saelo@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#91763}

Bug: chromium:1473677
Change-Id: I6f56bbb2402a263ec4e8449f76e4145708b57377
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5185036
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Owners-Override: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91764}
2024-01-10 15:41:59 +00:00
b4ad5c2eff [sandbox] Assert no trusted space objects are passed into CompareRoots
As we're moving more objects into trusted space, we need to be careful
when comparing such objects against objects inside the main cage, in
particular to roots (which happens frequently). This is because by
default, such comparisons would be 32-bit comparisons of just the lower
32-bits of the address, which is no longer correct once the objects live
in different pointer compression cages. In C++ we have DCHECKs to catch
these cases. This CL adds a similar debug assertion into generated code.

Bug: chromium:1473677
Change-Id: Iaae496b6ed20d7bec88923e8d70e27cb41b9e336
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5181094
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91763}
2024-01-10 15:18:30 +00:00
beeb6c8982 [wasm] Remove feature flags for shipping features
This removes three feature flags for features that are shipping (enabled
by default) since at least v11.4.

We keep an enum value for them in `WasmFeature` so we can still track
their usage.

R=thibaudm@chromium.org
CC=manoskouk@chromium.org

Change-Id: I522fcfae3ceba05457924c3136996e8ca45eda4f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5180737
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91762}
2024-01-10 14:50:12 +00:00
6b4d53e840 [wasm][jspi] Simplify JS frames detection
The wasm-to-js counter was introduced to detect and prevent the
accidental capture of JS frames. This was needed before, when JS frames
could be pushed alongside wasm frames in a secondary stack.

But this can be simplified now by relying on the central-stack switch:
the suspender contains JS frames if and only if it has switched to the
central stack and has not returned yet.

Rename the counter to "has_js_frames", make it a boolean, and update
this boolean when switching to/from the central stack.

R=jkummerow@chromium.org

Bug: v8:12191
Change-Id: Ic541afcefecf3776323701aec64f935988b2e38e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5180774
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91761}
2024-01-10 14:47:37 +00:00
66253e1b99 [build] Use a new google_benchmark location to avoid conflicts
Using the same path for DEPS'ed and previously checked-in files
causes conflicts when going back and forth between new and old
revisions. Since all references here are v8 stand-alone, the
exact location shouldn't be important. Therefore we use some
new name to avoid conflicts when locally running `gclient sync`.

Bug: chromium:1513046
Change-Id: Icf1ecc4d9b1f9c7e67b5a542c2be08ff9738d045
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5184217
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Liviu Rau <liviurau@google.com>
Cr-Commit-Position: refs/heads/main@{#91760}
2024-01-10 14:37:11 +00:00
6f7a8df651 [wasm] atomics: Consistent order of errors for oob and misaligned
When the trap handler is used, out of bounds checks are implicit and
happen during the access, the alignment runtime check is explicit.
However, without the trap handler we first checked for oob and then
for the alignment causing a different error message for atomic
operations that trap both for oob and unaligned access causing
inconsistencies / observable behavior differences between liftoff and
Turbofan / Turboshaft.

This CL fixes these inconsistencies for all atomic operations by
always first executing the alignment check and then the (implicit or
explicit) bounds check.

Change-Id: I98fc37a334fbf70500b0c8b7a768561db3c1b977
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5180367
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91759}
2024-01-10 14:23:13 +00:00
fd49c47079 [turboshaft][wasm] Add inline implementation of table.get
This allows load elimination to eliminate repeated loads of the table
in case of accessing multiple values or multiple tables.
Note that this is for non-funcref tables only (for now).

Bug: v8:14034
Change-Id: I492062567526e1c2e5a001fa0643632b54884a1e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5180776
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91758}
2024-01-10 13:57:30 +00:00
cb47d844cd [torque] Allow aliasing enum entries with @sameEnumValueAs
Bug: v8:7793
Change-Id: I40412543dbf22f8001898c82bbf2ba770df5f2e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5184219
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91757}
2024-01-10 13:30:05 +00:00
4c8c3e23d8 [maglev] Fix TypedArray length load to return IntPtr
TypedArray lengths can be larger than Uint32 on 64-bit arch, so we need
the value representation to be IntPtr rather than Uint32. Change Maglev
to have an IntPtr representation instead of a Word64 one, and use this
for TypedArray length checks.

Bug: v8:7700
Change-Id: I8c1fa227f4568aa98e32516f0bbf2dc9561404ec
Fixed: chromium:1516871
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5184218
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91756}
2024-01-10 13:29:02 +00:00
bd9ce10aff [turboshaft][wasm] Only add phi inputs from reachable inlined blocks
Bug: chromium:1514304
Change-Id: Iec30d3139d2def0c4b0f5c14adda6c6caaa126cd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5184134
Reviewed-by: Matthias Liedtke <mliedtke@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91755}
2024-01-10 13:08:27 +00:00
9a54182913 [heap] Move incremental marking counters to GCTracer::Event
Counters for incremental marking (start time, duration, bytes) used to
reside in GCTracer. This was fine as long as only full GCs used
incremental marking.

MinorMS also uses concurrent marking and may update these counters.
Specifically, due to interleaved sweeping, a concurrent MinorMS may
override the incremental marking time of a previous full GC, which will
result in negative incremental marking duration when finalizing the full
GC (i.e. after sweeping).

This CL fixes such issues by moving the cycle specific counters to
GCTracer::Event.

Bug: v8:13012
Change-Id: I055831fb831dfd3c06a3d3897d902afbfd59b3b2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5184216
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91754}
2024-01-10 12:29:24 +00:00
3089157cce [turboshaft] Framework for unit tests in Turboshaft
Bug: v8:12783
Change-Id: Id69c63594260e9e00994fa8d58a4edf1908a6f50
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5136535
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91753}
2024-01-10 12:04:29 +00:00
ee35421186 [heap] Improve trace-gc output
1) Delay crash due to ineffective full GCs until after trace-gc output
   for the current cycle.
2) Mark interleaved GCs in trace-gc output (to make it easier to
   identify them in the future).

Change-Id: I6d30bd83581d1ec037e90c926adab72a25024799
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5184215
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91752}
2024-01-10 11:12:11 +00:00
be27fc2222 Revert "[cleanup] Clean up extra inlined arguments frame"
This reverts commit e5ba85174f.

Reason for revert: Fails on blink bots: https://luci-milo.appspot.com/ui/inv/build-8759300068921273953/test-results?q=fast%2Fjs%2Fregress%2Ftear-off-arguments.html&sortby=&groupby=

Original change's description:
> [cleanup] Clean up extra inlined arguments frame
>
> Every time we inline a function with argument count different than
> the parameter count, we retain all arguments (up to the parameter
> count) twice in the deopt translated state.
>
> In the CL, we remove the duplication.
>
> Change-Id: I3de637dfeecad759328183ed369ac96e7c89ea98
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4714609
> Commit-Queue: Victor Gomes <victorgomes@chromium.org>
> Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#91749}

Change-Id: Ia5fe1498958fa8fa99235e68960ad38f9882e073
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5184178
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#91751}
2024-01-10 11:02:14 +00:00
ae1d91913b Reland "[heap] Fix OOM in new space allocations"
This is a *partial* reland of commit 2e671bb003

This CL contains only the fix for 1) below.

Original change's description:
> [heap] Fix OOM in new space allocations
>
> This CL fixes 2 issues:
> 1) OOM when new space is empty because old space is full. Old space size
>    should only be considered for allocating pages beyond capacity. As
>    long as new space capacity is below the limit, allocation should
>    succeed.
> 2) OOM crash before trace-gc output. This makes it appear as if the OOM
>    comes from a minor gc when it is actually a full gc.
>
> Bug: v8:12612
> Change-Id: I9f072e1e3cdc1d8ffbf52d1153f6dfc5bc1dd4c8
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5176936
> Commit-Queue: Omer Katz <omerkatz@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#91734}

Bug: v8:12612
Change-Id: I98f8539e7faee4dd263e54fde1d6efd428fad039
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5184135
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91750}
2024-01-10 09:05:59 +00:00
e5ba85174f [cleanup] Clean up extra inlined arguments frame
Every time we inline a function with argument count different than
the parameter count, we retain all arguments (up to the parameter
count) twice in the deopt translated state.

In the CL, we remove the duplication.

Change-Id: I3de637dfeecad759328183ed369ac96e7c89ea98
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4714609
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91749}
2024-01-10 09:04:53 +00:00
89318585e2 [riscv][liftoff] Use trapping null
Port commit 58b43c4a74

Change-Id: I8952e72bcc51433717c22cbc2870a5768400bbb0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5181852
Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#91748}
2024-01-10 05:45:00 +00:00
7161638e5e Update V8 DEPS (trusted)
Rolling build: e920e5b..05ae923

Rolling buildtools: f5d99b3..71983d6

Rolling buildtools/reclient: re_client_version:0.125.0.f3883c2-gomaip..re_client_version:0.126.0.4aaef37-gomaip

Rolling third_party/depot_tools: 6953ebe..cd076ba

Rolling third_party/libc++/src: 8c2468e..f18cfa9

Rolling third_party/libunwind/src: 42293b9..29eb3a5

Roll created at https://cr-buildbucket.appspot.com/build/8759319271203028193

Change-Id: I4df0e6c437c696560c40a5930092fffdb9f51572
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5181477
Bot-Commit: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#91747}
2024-01-10 04:43:28 +00:00
f05f0efb59 [turboshaft] Fix StructuralOptimizationReducer
Bug: v8:14528
Change-Id: I80e5c65cee56b1e43646dc33bc52208d5aff6edc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5152469
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Jianxiao Lu <jianxiao.lu@intel.com>
Cr-Commit-Position: refs/heads/main@{#91746}
2024-01-10 01:52:31 +00:00
c82365ef60 [riscv][wasm] Introduce WasmTrustedInstanceData
Port commit 59acab802a

Port commit 8cf17a14a7
[sandbox] Reference Code from FeedbackVector via code pointer

Port commit 4fa7784b10
[sandbox] Reference Code from OSR feedback vector slots via its wrapper


Change-Id: I88cd9b5f27a856aaf7ad319d55c9bed98eb24e45
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5179912
Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#91745}
2024-01-10 00:43:43 +00:00
e22a4ea457 PPC/s390: [wasm-gc][liftoff] Use trapping null
Port 58b43c4a74

Original Commit Message:

    We extend the use of trapping null to the Liftoff compiler. The
    following operations now use trapping instructions instead of explicit
    null checks when possible:
    struct.get/set, array.get/set/len, ref.as_non_null.

    liftoff assembler on arm64.

R=manoskouk@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N

Change-Id: I86ca5f5027f022e582603402f5705e5ef5242054
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5178655
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#91744}
2024-01-09 19:49:11 +00:00
5c93717955 PPC: fix reverse atomic load operations
When checking for an atomic load reverse op we need to use the
input node rather than the parent node.

Change-Id: I5f687298c613b1a34769768c3eead110d5af2434
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5173657
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#91743}
2024-01-09 19:47:10 +00:00
e0cd4a2642 [build] Use gm.py in gen-static-roots.py
Instead of copying the build logic from gm.py call it.

This should now make gen-static-roots.py use reclient when available.

Fixed: v8:14538
Change-Id: I309e5255bb76253f2f22551a3455a00fd377469e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5180370
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91742}
2024-01-09 17:28:49 +00:00
fb49d000e2 Update V8 DEPS (trusted)
Rolling build: b4cce16..e920e5b

Roll created at https://cr-buildbucket.appspot.com/build/8759364568387990993

Change-Id: I5f165d82c0e295b09db5b81e3c49d5f8c3d84d8b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5178654
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#91741}
2024-01-09 16:55:59 +00:00
f469cd0b52 Fix missing return in CompareRoot in x64 MacroAssembler
Bug: v8:7700
Change-Id: Ib90645f19747ebdf175c5966ae47c214d652b9ac
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5177660
Commit-Queue: Samuel Groß <saelo@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91740}
2024-01-09 15:19:20 +00:00
d7e78e0a08 PPC/s390: fix behaviour of immediate_crash
__builtin_trap() could potentially emit `cite` on s390x which
crashes with SIGFPE instead of a breakpoint trap.
This CL fixes the issue on both ppc64 and s390x by emitting
the `bkpt` instructions.

Change-Id: I31d7881da1b50ee193b942e3ec2b4960991352f2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5176785
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#91739}
2024-01-09 14:26:31 +00:00
904e75f350 Revert "[heap] Fix OOM in new space allocations"
This reverts commit 2e671bb003.

Reason for revert: flakes on multiple bots

Original change's description:
> [heap] Fix OOM in new space allocations
>
> This CL fixes 2 issues:
> 1) OOM when new space is empty because old space is full. Old space size
>    should only be considered for allocating pages beyond capacity. As
>    long as new space capacity is below the limit, allocation should
>    succeed.
> 2) OOM crash before trace-gc output. This makes it appear as if the OOM
>    comes from a minor gc when it is actually a full gc.
>
> Bug: v8:12612
> Change-Id: I9f072e1e3cdc1d8ffbf52d1153f6dfc5bc1dd4c8
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5176936
> Commit-Queue: Omer Katz <omerkatz@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#91734}

Bug: v8:12612
Change-Id: I052913a6e124b45363edc25dd0da302952e36626
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5180738
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#91738}
2024-01-09 13:42:12 +00:00
8bedb95f32 [wasm] Skip alignment check for single-byte accesses
The alignment check is redundant if the access size is 1. Turboshaft and
TurboFan optimize out the code later, but Liftoff emits this useless
sequence:

                  [ alignment check
0x2b9e02b5a8a6    a6  8bfb                 movl rdi,rbx
0x2b9e02b5a8a8    a8  83e700               andl rdi,0x0
0x2b9e02b5a8ab    ab  85ff                 testl rdi,rdi
0x2b9e02b5a8ad    ad  0f8574000000         jnz 0x2b9e02b5a927  <+0x127>
                  ]

This CL avoid emitting the alignment check for single-byte accesses
in all compilers. This will save memory and compile time also for the
optimizing compilers.

R=dlehmann@chromium.org

Change-Id: I8ca9719248113cf57fd3a34dc0c70180613d4872
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5177987
Reviewed-by: Daniel Lehmann <dlehmann@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91737}
2024-01-09 13:24:05 +00:00
4a31b44913 [turboshaft] Use a single operation for Smi->Word32 bitcast
Bug: v8:12783
Change-Id: I2e0a989fee59442a1edc0f4e881b43d69dbc7438
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5083021
Auto-Submit: Darius Mercadier <dmercadier@chromium.org>
Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
Reviewed-by: Matthias Liedtke <mliedtke@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91736}
2024-01-09 12:27:20 +00:00
60b2956fe0 [maglev] Hoist detached check out of Load/StoreTypedArrayElement
Unify the deopting and non-deopting Load/StoreTypedArrayElement by
making the detached check a separate node. This allows us to

  a) Potentially eliminate the check if we've already checked earlier
     and there have been no side effects,
  b) Check for detached _before_ loading the length, in case some future
     code using that no-longet-valid length could have caused trouble.

Bug: v8:7700
Change-Id: I12d390d12fbd3215f781077cc23ca4c8fc783323
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5176948
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91735}
2024-01-09 12:14:39 +00:00
2e671bb003 [heap] Fix OOM in new space allocations
This CL fixes 2 issues:
1) OOM when new space is empty because old space is full. Old space size
   should only be considered for allocating pages beyond capacity. As
   long as new space capacity is below the limit, allocation should
   succeed.
2) OOM crash before trace-gc output. This makes it appear as if the OOM
   comes from a minor gc when it is actually a full gc.

Bug: v8:12612
Change-Id: I9f072e1e3cdc1d8ffbf52d1153f6dfc5bc1dd4c8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5176936
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91734}
2024-01-09 12:03:35 +00:00
da0a9c45ac heap: Introduce page pool in V8
The CL replaces the current way of handling free pages - concurrent
unmapper - with a page pool. The latter is very similar to what
Oilpan already uses. The pages are kept alive until a memory-reducing
GC kicks in, after which they get released.

The downside of removing the offloading logic is that the large,
executable and trusted pages are now sequentially freed, which may
in theory introduce regressions in rare scenarios.

Benchmarking:
- Jetstream2:
  - M1: +0.3%
  - Windows: +2%
- Speedometer2:
  - M1: +0.3%
  - Windows: +0.2%

Bug: v8:14390
Change-Id: I520ae79a5942cf9411667089bfaf3b4df9973270
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5033402
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91733}
2024-01-09 11:14:42 +00:00
962b5fef01 Add lldb visualizer support
Tested with lldb-vscode. It is currently incomplete and slow, but
it allows expansion of V8 objects, and then expanding their children.
Also adds a stack trace visualization to the isolate, from which
you can expand frame summary objects or the expression stack.

Bug: None
Change-Id: I9473383e00f69f57c1e1bc7a7348e96ae4257724
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4952335
Commit-Queue: Eric Leese <leese@chromium.org>
Reviewed-by: Nikolaos Papaspyrou <nikolaos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91732}
2024-01-09 10:24:37 +00:00
58b43c4a74 [wasm-gc][liftoff] Use trapping null
We extend the use of trapping null to the Liftoff compiler. The
following operations now use trapping instructions instead of explicit
null checks when possible:
struct.get/set, array.get/set/len, ref.as_non_null.

Drive-by: Fix the protected-instruction offsets returned by the
liftoff assembler on arm64.

Bug: v8:14034
Change-Id: Ie090feb5fdf12e69c2ce670b408d9d023f3a274d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5173423
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91731}
2024-01-09 09:48:32 +00:00
2d257c4053 [torque] Emit layout asserts in cc file
Instead of emitting layout asserts in generated *-tq.h and *-tq-inl.h
files, which might get forgotten and get pulled in for every use of
those headers, emit them in *-tq.cc files. This has two advantages:

  1. They are no longer opt-in, so _all_ types with both torque and C++
     layouts get asserted (this caught a bug in BytecodeArray!)
  2. They no longer need to be templated, because they're not being
     defined before the object definition. This will surely make the
     compiler happier.

Bug: v8:12710
Change-Id: I630495739c422e1ba89ce78cb218379d858f54cd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5163948
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91730}
2024-01-09 09:47:28 +00:00
c95bcad353 [loong64][mips64][wasm] Introduce WasmTrustedInstanceData
Port commit 59acab802a

Change-Id: I7d5a8c610a950d0f9342c39a520bcf91eb222229
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5179772
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Auto-Submit: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91729}
2024-01-09 09:34:12 +00:00
443adf1aa9 [wasm] Unsandboxify memory start address
The memory start stored in WasmTrustedInstanceData can be a raw pointer
now that the object lives in trusted space.
This saves some code and performance in every function that accesses
memory 0.

R=thibaudm@chromium.org
CC=saelo@chromium.org

Bug: v8:14499, chromium:1516319
Change-Id: I40aa7fe1b489f0bcfd11aa280cbd00e08271c23b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5177007
Reviewed-by: Samuel Groß <saelo@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91728}
2024-01-09 09:33:08 +00:00
2f230ab688 cppgc: Clarify and check prefinalizer invariant
Improve comment around CHECKs in non-allocating prefinalizers and add an
additional CHECK for the same invariant.

This does not fix any issue but would merely introduce a well-defined
crash in case we get no-allocation scopes wrong.

Bug: chromium:1516773
Change-Id: I753d16361f83f47256433eef4b8e79412bf78a62
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5180366
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#91727}
2024-01-09 09:27:30 +00:00
bf358800a4 Update V8 DEPS (trusted)
Rolling build: 2c36118..b4cce16

Rolling buildtools: 9b82414..f5d99b3

Rolling third_party/catapult: https://chromium.googlesource.com/catapult/+log/5c4205e..f582f5b

Rolling third_party/depot_tools: 35a5306..6953ebe

Rolling third_party/jinja2: 515dd10..e2d0243

Rolling third_party/libc++/src: 34685c3..8c2468e

Rolling third_party/libc++abi/src: 1ec0821..f80f02a

Rolling third_party/markupsafe: 006709b..0bad08b

Roll created at https://cr-buildbucket.appspot.com/build/8759409868870552433

Change-Id: Ib6b96857be51e41ca7c01f2d47f592574f325fe7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5176781
Bot-Commit: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#91726}
2024-01-09 04:44:16 +00:00