Commit Graph

78463 Commits

Author SHA1 Message Date
Dominik Inführ
ee6a0dafaf [heap] Allow shared space pointers to evacuation candidates
With --shared-space incremental marking might happen even on pages
in the shared heap. This means that scavengers during incremental
marking might be able to discover shared space pointers that point
to an evacuation candidate.

This isn't possible with the shared isolate where no incremental
marking was supported.

Bug: v8:13267
Change-Id: I68d09fda6d3ec44a488f12f454db4a29b481e266
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3990563
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83971}
2022-10-28 08:46:49 +00:00
Leszek Swirski
da04b88f69 Revert "[ic] Remove SameValue optimisation for constant fields"
This reverts commit e7f6d34cfe.

Reason for revert: Regressions and clusterfuzz bugs

Original change's description:
> [ic] Remove SameValue optimisation for constant fields
>
> We would previously try to preserve field constness if field assignment
> was assigning the same value. It's unexpected that real-life code would
> be assigning the same value multiple times to an intentionally constant
> field, so this was additional bookkeeping with unclear value.
>
> Replace this with not doing it, and considering any write to a constant
> field to convert it to mutable. In particular, this means that stores to
> existing constant fields in TurboFan become unconditional deopts, rather
> than emitting additional code to check whether the value is the same.
>
> Locally, this deopt doesn't fire on our peak-performance benchmarks.
>
> Bug: v8:5495
> Change-Id: I12216c5f10a00f42be32c64ca3afe7cf59b4e7f3
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3976516
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#83955}

Bug: v8:5495
Change-Id: Ifeeceb773af04e9dd5e069821cd128a1cdbedcf5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3990683
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Owners-Override: 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/main@{#83970}
2022-10-28 08:23:09 +00:00
Shu-yu Guo
ec4680f79c [Promise.allSettled] Mark values array as COW
Bug: chromium:1377790
Change-Id: I36bb9e35ca7ecaaa7ed4605f1a19293bc662f341
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3988925
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83969}
2022-10-28 08:12:59 +00:00
Shu-yu Guo
e08fa94bbc [Promise.any] Fix errors allocation
Bug: chromium:1379054
Change-Id: Ibfcdd4ddc3c9a26471094074c8e7810d93abc898
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3988924
Commit-Queue: Marja Hölttä <marja@chromium.org>
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83968}
2022-10-28 07:45:09 +00:00
Michael Achenbach
dc2933e61b [build] Remove configs of removed bots
The following bots were removed or renamed:
v8_fuchsia_compile_rel
v8_linux64_gcc_compile_rel
v8_win_compile_dbg
v8_win64_msvc_compile_rel
v8_mac_arm64_compile_rel
v8_mac_arm64_compile_dbg
v8_mac_arm64_sim_compile_rel
v8_mac_arm64_sim_compile_dbg
v8_mac64_asan_compile_rel

They are all auto-generated as compilators.

Bug: chromium:890222
Change-Id: I893eb06497084976ed0b162ea2e252419c0884b8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3988264
Auto-Submit: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Alexander Schulze <alexschulze@chromium.org>
Commit-Queue: Alexander Schulze <alexschulze@chromium.org>
Reviewed-by: Liviu Rau <liviurau@google.com>
Cr-Commit-Position: refs/heads/main@{#83967}
2022-10-28 06:38:48 +00:00
Tobias Tebbi
bfda81d1a1 [turboshaft] introduce SnapshotTable
Bug: v8:12783

Change-Id: Ie8e578105065ed5ad833fbf2a525b149e39d3424
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3971368
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83966}
2022-10-28 06:36:55 +00:00
v8-ci-autoroll-builder
f018f2a146 Update V8 DEPS (trusted)
Rolling v8/build: 4e03165..9ce69a9

Rolling v8/buildtools: ddc9513..c50c0de

Rolling v8/buildtools/linux64: git_revision:3e98c606ed0dff59fa461fbba4892c0b6de1966e..git_revision:11dc0b1f438bd26380774e9d50fd4c63f346d41a

Rolling v8/buildtools/third_party/libc++/trunk: baa43f8..47b3117

Rolling v8/buildtools/third_party/libc++abi/trunk: 519e9ef..c7b6fcf

Rolling v8/buildtools/third_party/libunwind/trunk: 1f633d4..aabcd87

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/2f63d55..d2c6581

Rolling v8/third_party/fuchsia-sdk/sdk: version:10.20221026.0.1..version:10.20221027.2.1

Rolling v8/third_party/instrumented_libraries: f764ffc..03ce9f0

Rolling v8/tools/clang: 87d0b8c..38497db

Change-Id: I2b6f402b468a5607b3cbb347f015ac7634a5492f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3990203
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@{#83965}
2022-10-28 04:25:36 +00:00
Shu-yu Guo
4cb4c0723d [test262] Support the 'raw' flag
Tests flagged as 'raw' need to run without the harness. The language/module-code/eval-gtbndng-indirect-faux-assertion test was failing only because it was running with the harness.

Bug: v8:10958
Change-Id: If00f3ec8abc697d9b3727691e12ae0da7ce8c785
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3984052
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83964}
2022-10-27 20:08:39 +00:00
Andreu Botella
9df5ef70ff Add an v8::ArrayBuffer::WasDetached method to the C++ API
V8's C++ API does not give a way to tell whether an ArrayBuffer has
been detached from the `v8::ArrayBuffer` class. In fact, as far as can
be told from the C++ API without running JS code, detached
ArrayBuffers behave the same as zero-sized ArrayBuffers and there is
no way to observe the difference. However, this difference can be
observed in JS because constructing a TypedArray from a detached
ArrayBuffer will throw.

This change adds a `WasDetached` method to the `v8::ArrayBuffer` class
to give embedders access to this information without having to run JS
code.

Bug: v8:13159
Change-Id: I2bb1e380cee1cecd31f6d48ec3d9f28c03a8a673
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3810345
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83963}
2022-10-27 20:04:25 +00:00
Dominik Inführ
b799750f0a [heap] Allow Heap::ClearRecordedSlotRange in SHARED_SPACE
During String::MakeThin, Heap::ClearRecordedSlotRange might be
invoked on a string in SHARED_SPACE. This can also happen outside
GCs.

Bug: v8:13267
Change-Id: I10d4d7f0b47589127e4a080ce49d69ca7486fc67
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3985911
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Auto-Submit: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83962}
2022-10-27 16:26:35 +00:00
Darius M
b35d549082 [turboshaft] Change Reducer stack architecture
Bug: v8:12783
Change-Id: If30dea88ce237c04261dc942ee9f1547a1c45252
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3982114
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83961}
2022-10-27 16:08:45 +00:00
Nikolaos Papaspyrou
dbda17a58e [heap] Fix tests for OSB and CSS
Since crrev.com/c/3973310 which renamed the isolate scopes, the unit and
cctests for the object-start bitmap and the conservative stack visitor
have broken.

Bug: v8:13257
Change-Id: If8a498827f2085108cf0740a9c5c994145424fc3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3980255
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83960}
2022-10-27 15:52:05 +00:00
Thibaud Michaud
f517e518af [wasm] Reload cached instance fields in catch handler
The memory start and size are reloaded after a call in case the call
grows the memory. We should also reload them when the call throws.

We don't need to reload in the 'delegate' case since this will be
handled by the catch handler that it delegates to.

R=jkummerow@chromium.org

Bug: chromium:1377816
Change-Id: Ied1cdb6ed83c1de6a5992df21d776aca9ccf02e6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3982115
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83959}
2022-10-27 13:56:16 +00:00
Michael Achenbach
648958bab5 [build] Prepare renaming msvc compile trybot
No-Try: true
Bug: chromium:890222
Change-Id: Id18d1631a54ce792669e428f2d3ea8edfca49f44
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3985912
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Liviu Rau <liviurau@google.com>
Reviewed-by: Liviu Rau <liviurau@google.com>
Auto-Submit: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83958}
2022-10-27 13:44:45 +00:00
Thibaud Michaud
caaaec8451 [wasm-relaxed-simd] Fix Liftoff FMA dst register
R=clemensb@chromium.org

Change-Id: Ib65dc59d3c68fd563953a1ee8ec50d9c54310747
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3985845
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83957}
2022-10-27 13:38:35 +00:00
Nico Hartmann
cfc4a2d16e Reland^2 "[turbofan] Optimize rab/gsab-backed TypedArrays and DataViews"
This reverts commit 57db447bf2.

This reland adds handling for Oddballs in Int64Add and Int64Sub in the
SLVerifier and updates the Verifier to check that Int32Constant and
Int64Constant are correctly typed with Type::Machine().

Original change's description:
> [turbofan] Optimize rab/gsab-backed TypedArrays and DataViews
>
> This CL adds TurboFan optimizations for length and element access
> of TypedArrays and DataViews that are rab/gsab-backed.
>
> To enable this optimization, this CL builds the necessary machinery
> required to allow machine operators at the front of the pipeline
> (before simplified lowering). Some key changes to allow this are:
>  - Introduce Type::Machine() to allow the typer and the verifier to
>    provide a type to those machine operators in parts of the pipeline
>    that require nodes to be typed.
>  - Add EnterMachineGraph and ExitMachineGraph operators that define
>    the boundary between early machine graphs and the normal graph with
>    JS semantics.
>  - Give Branch operators a BranchSemantics parameter to distinguish
>    between machine branches (condition is a machine level value) and
>    JS branches (condition is a JS boolean value) and have phases that
>    handle branches decide on the branch's semantics based on this
>    parameter instead of the position in the pipeline.
>  - Extend SimplifiedLowering and SimplifiedLoweringVerifier to handle
>    machine graphs. In particular, constants required special handling,
>    because they are cached in the graph but they may have uses in both
>    a machine and the JS graph, which prevents consistent typing of
>    them.
>  - Moved lots of logic from JSCallReducerAssembler into
>    [JS]GraphAssembler such that functionality can be shared between
>    different phases (e.g. JSNativeContextSpecialization and
>    JSCallReducer need to generate logic to compute a TypedArray's
>    byte length). Extended assembler interface in general with
>    additional TNode<> overloads.
>
>
> Bug: v8:11111, chromium:1358505
> Change-Id: Ife006b8c38a83045cd3b8558acbfdcb66408891f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3898690
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#83881}

Bug: v8:11111, chromium:1358505, v8:13412, chromium:1378439, chromium:1378162
Change-Id: I89702c4be05e0e71cd6836dc50d2e26736a55429
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3980759
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83956}
2022-10-27 13:06:06 +00:00
Leszek Swirski
e7f6d34cfe [ic] Remove SameValue optimisation for constant fields
We would previously try to preserve field constness if field assignment
was assigning the same value. It's unexpected that real-life code would
be assigning the same value multiple times to an intentionally constant
field, so this was additional bookkeeping with unclear value.

Replace this with not doing it, and considering any write to a constant
field to convert it to mutable. In particular, this means that stores to
existing constant fields in TurboFan become unconditional deopts, rather
than emitting additional code to check whether the value is the same.

Locally, this deopt doesn't fire on our peak-performance benchmarks.

Bug: v8:5495
Change-Id: I12216c5f10a00f42be32c64ca3afe7cf59b4e7f3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3976516
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83955}
2022-10-27 13:05:03 +00:00
Dominik Inführ
60f29614e3 Revert "Reland^3 "[heap] Enable --shared-space flag by default""
This reverts commit 0b251add9b.

Reason for revert: Causes crashes in https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux%20-%20debug/41507/overview

Original change's description:
> Reland^3 "[heap] Enable --shared-space flag by default"
>
> This is a reland of commit 1352f2969a
>
> Original change's description:
> > Reland^2 "[heap] Enable --shared-space flag by default"
> >
> > This is a reland of commit 3df866d67d
> >
> > Original change's description:
> > > Reland "[heap] Enable --shared-space flag by default"
> > >
> > > This is a reland of commit 934afdf0d1
> > >
> > > After landing https://crrev.com/c/3959774 try to re-enable
> > > --shared-space again.
> > >
> > > Original change's description:
> > > > [heap] Enable --shared-space flag by default
> > > >
> > > > This switches V8 to the shared space isolate approach for the shared
> > > > heap by default.
> > > >
> > > > Bug: v8:13267
> > > > Change-Id: I06d36468a3a6b098475ec2bbfa998cb1934afe81
> > > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3925754
> > > > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> > > > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> > > > Cr-Commit-Position: refs/heads/main@{#83701}
> > >
> > > Bug: v8:13267
> > > Change-Id: Icb3cfd7c1da2d2420741057c26d32893a6edc80c
> > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3959695
> > > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> > > Auto-Submit: Dominik Inführ <dinfuehr@chromium.org>
> > > Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> > > Cr-Commit-Position: refs/heads/main@{#83742}
> >
> > Bug: v8:13267
> > Change-Id: I8d44788d05fd7aaf04ac528db5bb7ae98ee980ec
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3961511
> > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#83816}
>
> Bug: v8:13267
> Change-Id: I212b47c9c8aa5d818c2875f10cc18b7b16233a0b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3971118
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#83947}

Bug: v8:13267
Change-Id: I51cc3071c2e0ff6c9e75d92ab606b348da317502
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3986724
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#83954}
2022-10-27 13:03:04 +00:00
Leszek Swirski
4d8055d41e [maglev] Use accessors for DeoptInfo fields
... so that we can add logic to them later for builtin continuation
deopts.

Bug: v8:7700
Change-Id: I03a616243efecb5d637d6ab7d078392a0c51abf4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3985907
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83953}
2022-10-27 11:27:24 +00:00
Matthias Liedtke
8852999115 [fuzzer][wasm] Allow struct.new_default for structs with immutable fields
This is a follow-up to commit d1a11dd15a.
This reverts commit 9182c028c1.

Change-Id: I4555f329314955e6a4a40dd40e22dc12a570c89e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3986086
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83952}
2022-10-27 11:23:42 +00:00
Victor Gomes
212028f4eb [cleanup] Dead code in InvokePrologue stub
kDontAdaptArgumentsSentinel is now always equal to zero.

Change-Id: I8f0a930b22cdc88279de66324c23800dd3a93bb4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3985725
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83951}
2022-10-27 11:17:32 +00:00
Matthias Liedtke
f1d16aebe4 [wasm-gc] Skip null-check for casts of any to non-nullable type
We can skip explicit null check for casts from any to a non-nullable
type as they have to perform an instance type check afterwards as part
of the cast and trap if they encounter a non-wasm object (null is not
a wasm object).
The same is true for type checks which fail on null.

Bug: v8:7748
Change-Id: I41ec225618a400feec5dab210fbf7c1bc2718c8f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3981859
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83950}
2022-10-27 10:34:14 +00:00
Michael Achenbach
53e69521f4 [build] Equally compile on mac_arm64 sim trybots
Bug: chromium:890222
Change-Id: I85cd713da582c42efb83417850493f3b0f7b8c29
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3986027
Auto-Submit: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Alexander Schulze <alexschulze@chromium.org>
Commit-Queue: Alexander Schulze <alexschulze@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83949}
2022-10-27 10:33:11 +00:00
Manos Koukoutos
1717a1c1b8 [wasm-gc] Fix type union bug
Bug: v8:13422, v8:7748
Change-Id: I0eef5ec4bf7699d374e32d6af566babde3d97aa9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3985866
Reviewed-by: Matthias Liedtke <mliedtke@chromium.org>
Auto-Submit: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83948}
2022-10-27 10:23:41 +00:00
Dominik Inführ
0b251add9b Reland^3 "[heap] Enable --shared-space flag by default"
This is a reland of commit 1352f2969a

Original change's description:
> Reland^2 "[heap] Enable --shared-space flag by default"
>
> This is a reland of commit 3df866d67d
>
> Original change's description:
> > Reland "[heap] Enable --shared-space flag by default"
> >
> > This is a reland of commit 934afdf0d1
> >
> > After landing https://crrev.com/c/3959774 try to re-enable
> > --shared-space again.
> >
> > Original change's description:
> > > [heap] Enable --shared-space flag by default
> > >
> > > This switches V8 to the shared space isolate approach for the shared
> > > heap by default.
> > >
> > > Bug: v8:13267
> > > Change-Id: I06d36468a3a6b098475ec2bbfa998cb1934afe81
> > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3925754
> > > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> > > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> > > Cr-Commit-Position: refs/heads/main@{#83701}
> >
> > Bug: v8:13267
> > Change-Id: Icb3cfd7c1da2d2420741057c26d32893a6edc80c
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3959695
> > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> > Auto-Submit: Dominik Inführ <dinfuehr@chromium.org>
> > Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#83742}
>
> Bug: v8:13267
> Change-Id: I8d44788d05fd7aaf04ac528db5bb7ae98ee980ec
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3961511
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#83816}

Bug: v8:13267
Change-Id: I212b47c9c8aa5d818c2875f10cc18b7b16233a0b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3971118
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83947}
2022-10-27 10:16:31 +00:00
Darius M
0ce2731067 [compiler] fix bug in inlining of Array.At
The inlined version of Array.At was only checking the kind of the
maps, rather than the maps themselves. When the feedback was
containing an array map that "supports_fast_array_iteration", then its
kind was added to the list of supported kinds. If this Array.at was
later called with a non-array map with the same kind, then the object
would be wrongly treated as an array.

This is now fixed: inlining Array.at checks the maps directly rather
than only their kinds.

Fixed: chromium:1377775
Change-Id: I6669ffdc04df04a7c9d00d6b9f8bac82dc9cd235
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3981554
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83946}
2022-10-27 09:54:51 +00:00
Matthias Liedtke
f257ed51ad [wasm-gc] Fix missing instance type check for concrete casts from any
The newly added cast instructions can cast from {any} type, resulting
in the cast instructions with a concrete type having to also check if
an object actually is a wasm object (and not e.g. a JS object) before
loading the WasmTypeInfo from its map.

Bug: v8:7748
Change-Id: Ia9c1d35fb9de016af4984883f1374fd5238ce6ea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3981858
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83945}
2022-10-27 09:37:02 +00:00
Pan, Tao
35c0931420 [tiering] Reset profiler ticks after OSR compilation
After concurrent OSR was enabled, JS execution may stop not at OSR entry
when concurrent OSR compilation finish. If no more feedback change,
without reset profiler ticks, OSR urgency is increased from 0 by 1 per
profiler tick after concurrent OSR compilation finish, it makes new
OSR compilation can be quickly triggered, reset profiler ticks after OSR
compilation for triggering the later OSR compilation under the same
condition with the first OSR compilation. For example:
for (;;) {
  for (;;) {
  } // OSR entry
  for (;;) {
    <- Executing JS code here when the OSR compilation finish
  }
}
1. We start executing the nesting loop.
2. We reset profiler ticks once feedback change.
3. If the first inner loop happens to be executing after accumulating
enough no feedback change profiler ticks, we start concurrent OSR whose
entry belongs to the first inner loop.
4. We continue executing the nesting loop, if no new feedback change,
increasing profiler ticks again.
5. Concurrent OSR whose entry belongs to the first inner loop completes.
6. If the second inner loop happens to be executing, without reset
profiler ticks, we immediately start concurrent OSR whose entry belongs
to the second inner loop.
The second OSR code is almost same quality with the first OSR code.
This CL can reduce OSR compilation amount by ~3.9% (2311 -> 2224) when
running JetStream2.1.

Change-Id: I4d64cd8963fd2b99d88a3c218841fe5d7c4dc34f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3819421
Commit-Queue: Tao Pan <tao.pan@intel.com>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83944}
2022-10-27 09:31:41 +00:00
Michael Lippautz
18e31a8e38 Reland "[heap] Update young nodes of traced handles"
This is a reland of commit 31edec6406

Original change's description:
> [heap] Update young nodes of traced handles
>
> Fix regressions caused by
>   https://crrev.com/c/3966952
>
> Update and clear the list of young nodes which would otherwise be
> repeatedly processed during Scavenge and full GCs.
>
> Bug: v8:13372, chromium:1378097
> Change-Id: I1b302f75f970385e9e0259fa4b1719d9262c1f2a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3981273
> Reviewed-by: Omer Katz <omerkatz@chromium.org>
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#83922}

Bug: v8:13372, chromium:1378097
Change-Id: I254e1c5c40b5c1cfa06ddd435d5a6610d84e36bc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3984605
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83943}
2022-10-27 09:21:43 +00:00
Marja Hölttä
4bef10308f [rab/gsab] Fix RAB/GSABness in %TypedArray%.of
Bug: v8:11111,chromium:1377840
Change-Id: I0a3d86b9f160c0daf28f45b9ec7a37f0a88be614
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3976511
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Auto-Submit: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83942}
2022-10-27 08:33:01 +00:00
Marja Hölttä
fb6b3f7373 [compiler] Fix depending on the prototype chain w/ --omit-default-ctors
Bug: v8:13091,chromium:1374746
Change-Id: If36d80f956db000d02faa155cf6b302d53b52e53
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3976517
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Marja Hölttä <marja@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83941}
2022-10-27 08:21:42 +00:00
v8-ci-autoroll-builder
0ccd75e47c Update V8 DEPS (trusted)
Rolling v8/build: adcb306..4e03165

Rolling v8/buildtools: 4c4e17b..ddc9513

Rolling v8/buildtools/linux64: git_revision:7a6231e3e43845d9aa298bb040f11dd1953e966f..git_revision:3e98c606ed0dff59fa461fbba4892c0b6de1966e

Rolling v8/buildtools/third_party/libc++/trunk: 0487904..baa43f8

Rolling v8/third_party/depot_tools: 1f51102..6f2321d

Rolling v8/third_party/fuchsia-sdk/sdk: version:10.20221025.2.1..version:10.20221026.0.1

Rolling v8/tools/clang: 863e4bb..87d0b8c

Change-Id: Ieeb9465bd17974caba7cd8f6d1448b5bd7f2b402
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3982514
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@{#83940}
2022-10-27 03:53:41 +00:00
Dominik Inführ
dca313554b [heap] Make shared space iterable in Heap::MakeHeapIterable
In order to be able to iterate all objects in the heap (including
SHARED_SPACE), all LABs in the shared space need to be iterable. For this reason the HeapObjectIterator needs to perform a global safepoint for the shared heap isolate.

Bug: v8:13267
Change-Id: I2b7583fac0564f8b98b74607404be851fde1281f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3978091
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83939}
2022-10-26 19:09:27 +00:00
Juan José Arboleda
b45f353ccd test: use v8-json.h in the HeapSnapshotJSONSerialization test
Change-Id: Id2633b4268f6dbd2944dc1659c217d035943195b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3978348
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83938}
2022-10-26 18:42:21 +00:00
Dave Tapuska
b6969920f4 [execution] Add ability to set the microtask queue for the context.
It is important that the Context's microtask queue matches what the
embedder thinks it is. Android WebView has some interop functionality
where the Agent changes but the context must not be cleared. Ensuring the microtask queue for the context matches the Agent by adding a
setter that the embedder can call.

BUG=chromium:961186

Change-Id: Id99644fbfc84b8a1676162261444c02d07b238a1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3976350
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83937}
2022-10-26 16:40:21 +00:00
Toon Verwaest
0bc2afb1b5 [maglev] Only fold constant field loads if constant
Bug: v8:7700
Change-Id: Id04cf43d92946654982930ef529c23797e460ba9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3982235
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83936}
2022-10-26 16:37:01 +00:00
Toon Verwaest
4b06193f9a [maglev] Initialize map info for loads with field_map
Bug: v8:7700
Change-Id: If8ed9f7fe4fb0549e3d4ebe059d85a5a592da78c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3981555
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83935}
2022-10-26 15:53:10 +00:00
Matthias Liedtke
1688cad47f [wasm-gc] Add new ref.cast null taking any reference
This extends crrev.com/c/3948663 (ref.cast) by adding the new
"ref.cast null" which only behaves different for null for which
it doesn't trap but instead casts the null value to the target
(null)type.

Bug: v8:7748
Change-Id: I3ac85d83cc06c95af8830c1c60ae2f28414e2570
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3960329
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83934}
2022-10-26 15:06:50 +00:00
Victor Gomes
c9e8be7cd3 [maglev] Remove overzealous DCHECK
It looks like a map can become a migration target between
graph building and codegen.

Bug: v8:7700
Change-Id: I88562d69ae62ce5e6c168c73d8ad5eb19099c03b
Fixes: v8:13419
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3982113
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83933}
2022-10-26 13:47:16 +00:00
Victor Gomes
5e99228909 [maglev] Add an InternalizedString known type
Bug: v8:7700
Change-Id: Iea926696fec0a0289322e5c9bc72b86225c57b23
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3980256
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83932}
2022-10-26 13:22:20 +00:00
Samuel Groß
5571f9973c Fix incorrect DCHECK in ExternalPointerTable::Mark
The DCHECK is not correct: if we're marking a not-fully-initialized
object, then the handle can change from its uninitialized value (zero)
to a valid handle prior to this DCHECK, therefore causing it to fail.
This scenario is fine though, since the new entry will already be marked
as alive as it has just been allocated.
To fix that, the DCHECK now allows the two values to mismatch iff the
handle is zero.

Bug: v8:13297
Change-Id: If640d457da1d78a3d1666ffa930c27116a6080c5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3981553
Commit-Queue: Samuel Groß <saelo@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83931}
2022-10-26 12:43:09 +00:00
Victor Gomes
77da3d0dcd [maglev] Fix negative char code in StringFromChar
In the constant branch, we need to check if char code is
bigger than zero.
In the generic branch, we do the `andl` before the
comparison.

This also fixes issues with aliasing the code char with
the result register.

Bug: v8:7700
Change-Id: I41a8a22a1acf3feabdee34a61d77c53bcda6892b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3981276
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83930}
2022-10-26 12:23:59 +00:00
Toon Verwaest
f51fa7ddd8 [maglev] Insert and keep track of empty unstable map sets
They do have a meaning as well: there are no unstable maps. When we need
to clear unstable maps (and drop related stable maps), we can avoid
doing this for empty unstable map sets since no unstable maps can have
transitioned to new stable maps.

Bug: v8:7700
Change-Id: Ie74f62b6bff81dff8118a46e22a2ea81550d09c4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3981278
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83929}
2022-10-26 11:51:54 +00:00
Michael Lippautz
b835d86cd4 Revert "[heap] Update young nodes of traced handles"
This reverts commit 31edec6406.

Reason for revert: Crashes on GPU bots

Original change's description:
> [heap] Update young nodes of traced handles
>
> Fix regressions caused by
>   https://crrev.com/c/3966952
>
> Update and clear the list of young nodes which would otherwise be
> repeatedly processed during Scavenge and full GCs.
>
> Bug: v8:13372, chromium:1378097
> Change-Id: I1b302f75f970385e9e0259fa4b1719d9262c1f2a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3981273
> Reviewed-by: Omer Katz <omerkatz@chromium.org>
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#83922}

Bug: v8:13372, chromium:1378097
Change-Id: Id2b4f565e2a92d01a54942630627cb8aebec06d8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3981493
Auto-Submit: Michael Lippautz <mlippautz@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@{#83928}
2022-10-26 11:01:11 +00:00
Omer Katz
20b395a8ef Reland "[heap] Fix racy OOM in new space concurrent sweeping"
This is a reland of commit 95eece3068

Original change's description:
> [heap] Fix racy OOM in new space concurrent sweeping
>
> Some tests are flakily failing due to a timing issue between new space
> concurrent sweeping and allocations.
> When new spaces and other spaces are also swept, each concurrent thread
> will take one new space page. If a young allocation happens right after
> the atomic pause finished, it's possible that all new space pages are
> held by concurrent threads. The main thread will try to contribute to
> sweeping but get no pages, and fail to allocate.
>
> Fix by restoring the round robin order of sweeping, such that not all
> threads start with new space.
>
> Bug: v8:12612, v8:13413
> Change-Id: I3b448199b4678c339f9e59f7ca31d9e1e0e76011
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3976043
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Omer Katz <omerkatz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#83918}

Bug: v8:12612, v8:13413
Change-Id: Idbd5cbb53c9f43290e02d10d85ee4199ea9a4136
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3980756
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83927}
2022-10-26 10:26:23 +00:00
Toon Verwaest
199304b26b [maglev] Fix typecheck in load from constant folding
Bug: v8:7700
Change-Id: I3de3245502340283c323d98191623c1fcaf646a3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3980758
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83926}
2022-10-26 10:25:19 +00:00
Tobias Tebbi
db83e72034 [turbofan] do not optimize any stores for field type None
Fixed: chromium:1378239
Change-Id: If9d05ed391175a7a3923ab2108231759e649bb44
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3981277
Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83925}
2022-10-26 09:57:43 +00:00
Kim-Anh Tran
1e029c0694 [inspector] Remove left-over definition used for instrumentation breaks
Bug: none
Change-Id: Ia25afe2251088dfa59a8b6b03496c444c82dc74d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3981274
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83924}
2022-10-26 09:47:50 +00:00
Victor Gomes
539d2b7dc3 [maglev] Stable maps can become stale after a side effect
Unstable maps can transition to stable ones after a side effect,
therefore we cannot trust the set of stable maps. The CL nukes
from the set from stable_maps, equivalent of setting it to
the universal set.

Bug: v8:7700
Change-Id: I457f76efd48ec7eec747233ec063ebe265d3085a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3978169
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83923}
2022-10-26 09:39:59 +00:00
Michael Lippautz
31edec6406 [heap] Update young nodes of traced handles
Fix regressions caused by
  https://crrev.com/c/3966952

Update and clear the list of young nodes which would otherwise be
repeatedly processed during Scavenge and full GCs.

Bug: v8:13372, chromium:1378097
Change-Id: I1b302f75f970385e9e0259fa4b1719d9262c1f2a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3981273
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83922}
2022-10-26 09:17:56 +00:00