Commit Graph

71369 Commits

Author SHA1 Message Date
Georg Neis
3554c2ad52 Move DetachGlobal from Bootstrapper to Isolate
... as it has nothing to do with bootstrapping.

Change-Id: I364469b023b3f0811a674ea39aefd46313dd10fc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3164536
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76877}
2021-09-16 14:09:39 +00:00
Georg Neis
defedd0c26 [compiler] Fix data race between FindRootMap and DetachGlobal
... by adding atomic (relaxed) accessor's for a map's
constructor_or_backpointer field, and using them in the two functions.

Bug: chromium:1250216, v8:7790
Change-Id: I3416799cca73792ff5f8963685274ad9afdc6229
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162129
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76876}
2021-09-16 13:34:30 +00:00
Yoav Weiss
9bba68a4c6 Fix a comment typo
Change-Id: I528f43d6aaee068114fadb5a577ead0482eb425b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160350
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76875}
2021-09-16 13:33:27 +00:00
Jakob Gruber
d09fc5403a [isolate-data] Consistent field names
This is a refactor-only change in preparation for the upcoming
builtins table split.

- Define fields through a macro list to avoid some manual boilerplate
  code.
- Consistent names for builtin_entry_table_ and builtin_table_, and
  update names of related methods as well.
- Add Builtins::ToInt to replace manual static_casts.
- Move around IsolateData methods s.t. they're in the same order as
  the underlying fields.

Bug: v8:12203
Change-Id: I68cd036b8de1dd2708e2d4579d76bb3baaea5e1c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162128
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76874}
2021-09-16 13:21:37 +00:00
Andreas Haas
b01d2f456f Reland "[wasm][externref] Support default value for the table.set"
Reason for revert: There was an out-dated wpt test in blink that
failed after this CL. I adjusted the test expectations in https://chromium-review.googlesource.com/c/chromium/src/+/3162980 so that I can land this CL.

Original change's description:
> Revert "[wasm][externref] Support default value for the table.set"
>
> This reverts commit 6b57898062.
>
> Reason for revert: Fails layout tests: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Blink%20Linux/13751/overview
>
> Original change's description:
> > [wasm][externref] Support default value for the table.set
> >
> > WebAssembly.Table.set allows a default value instead of the second
> > parameter, which was not supported by V8 so far.
> >
> > R=​thibaudm@chromium.org
> >
> > Bug: v8:7581
> > Change-Id: I417790722b1cb4f854cd0056ecb8377c330c45fa
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3141574
> > Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
> > Commit-Queue: Andreas Haas <ahaas@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#76846}
>
> Bug: v8:7581
> Change-Id: I83d9be59c66ece3184b5708e5b8a3b401e4938ed
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3163257
> Auto-Submit: Clemens Backes <clemensb@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@{#76852}

Bug: v8:7581
Change-Id: I248f836ba4de2a4e3f3d80c00e6f1ac0b46a38d7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162608
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76873}
2021-09-16 13:03:41 +00:00
Omer Katz
ed0459770f cppgc: Add GetWriteBarrierType that ignores slots
GetWriteBarrierType used to consider the slot so that a barrier is not
triggered for on-stack slots. For strongifying weak collections we want
the write barrier to trigger even if the backing store is only reachable
from stack.

Blink counterpart: crrev.com/c/3162170

Bug: chromium:1244057
Change-Id: I75b1ca62ad5de7bae3d2f4c1a9acce839f3ccdc1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162127
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76872}
2021-09-16 12:53:21 +00:00
Andreas Haas
b2fa5f335d [wasm] Add shared field to memory type
R=thibaudm@chromium.org

Bug: v8:12227
Change-Id: If10683be63beb32c658d2dfaac0a07d858c472ba
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162038
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76871}
2021-09-16 12:43:21 +00:00
Milad Fa
ce29ee4405 [wasm-gc] skip test on ppc/s390 platforms
Liftoff needs to be fully implemented for running this test.

Change-Id: Ia229d478fa22d4ce9a715d13b3d2b09a2634ad1c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3163016
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#76870}
2021-09-16 12:08:54 +00:00
Andreas Haas
775cf013d6 [wasm] Update spec tests
Drive-by: Reorder the entries in wasm-js.status a bit.

R=thibaudm@chromium.org

Change-Id: I7c854c41a58f16f95a8909f4d7aa103ae440007d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162126
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76869}
2021-09-16 12:07:51 +00:00
Liu Yu
5833fb1165 [wasm-gc] skip test RefTrivialCastsStatic on no-simd platforms
This test is added in commit bc3b9332ac

Bug: v8:7748
Change-Id: I8bada39c6fc9ed22f7a25786697aed880738bc9e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3163286
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76868}
2021-09-16 11:57:53 +00:00
Dominik Inführ
d79e0c4f26 [heap] Add and remove allocation observers without using safepoints
Safepoints were used in Heap::AddAllocationObserversToAllSpaces and
Heap::RemoveAllocationObserversFromAllSpaces as a poor man's approach
to synchronization. This CL removes the safepoint and protects the
potential race on the free list with a mutex in
PagedSpace::DecreaseLimit.

The motivation for this CL is that SafepointScope might possibly park
the main thread in the future. However parking is only allowed if GCs
are also allowed. GCs are not allowed when running allocation observers,
so an allocation observer would not be able to add or remove additional
observers as is currently done in StressConcurrentAllocationObserver.

Also adding additional checks to the safepoint to ensure that we are
on the main thread.

Bug: v8:11708
Change-Id: I4e65a83ac4015d30b15d8c4eeaed4ea759b7c982
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160523
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76867}
2021-09-16 11:49:21 +00:00
Dan Elphick
d407af0de1 [include] Fix include guard to v8-forward.h
Change include guard to INCLUDE_V8_FORWARD_H_ from
INCLUDE_V8_LOCAL_HANDLES_H_.

Bug: v8:11965
Change-Id: I7a1a2fb3b5441b8f9cd733f89d19ccd5869c2287
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162051
Auto-Submit: Dan Elphick <delphick@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76866}
2021-09-16 10:59:01 +00:00
Michael Lippautz
0d50bda4a7 cppgc: Fix data race when replacing a LAB
ClusterFuzz reported a non-reproducible issue here:
  https://clusterfuzz.com/testcase-detail/4634185246244864

What happens here is that a LAB is replaced that is adjacent to a live
object that is concurrently being marked using the object start
bitmap.

Bug: chromium:1056170
Change-Id: Iebc0db6b85262f2f544a76bac9b3d1c662e41d6a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162603
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76865}
2021-09-16 10:12:14 +00:00
Jaroslav Sevcik
7994004493 [inspector] Use ephemeron table for exception metadata
EphemeronHashTable does not trigger interrupts when accessed
(as opposed to calling the WeakMapGet builtin), so it avoids
the use-after-free problem when reading exception metadata
triggers session disconnect while holding a reference
to the session.

Bug: chromium:1241860
Change-Id: I29264b04b8daf682e7c33a97faedf50e323d57c4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3158326
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76864}
2021-09-16 08:45:11 +00:00
Camillo Bruni
9c601fbff8 [api] Replace a few auto's
Change-Id: I4c2347e9b75ef36c37b46d527ad6c4338dc20819
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162047
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76863}
2021-09-16 08:36:32 +00:00
Lu Yahan
ac95e0243d [riscv64]delete check in F32X4MIN/MAX
Change-Id: I7419009e11d40416322abb0bec8bfacf9b5580d0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162721
Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#76862}
2021-09-16 07:33:31 +00:00
Lu Yahan
6f12d8b933 [riscv64] Add s10 into allocate reg
3103425 had delete s10 from scratch reg

Bug: v8:12124
Change-Id: I23b34c7ce28f129137683204f12a19a46325f91a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3156291
Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#76861}
2021-09-16 07:26:21 +00:00
Patrick Thier
1b88d4e93d Floods correctness fuzzers (e.g. https://crbug.com/1249941)
Revert "[x64][ia32] Activate Argument Count Consistency"

This reverts commit b73557685b.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [x64][ia32] Activate Argument Count Consistency
>
> Activate argument count consistency (receiver is always included in
> JS argument count) for x64 and ia32.
>
> Bug: v8:11112
> Change-Id: If60000b6566846c84f1042473d25d79bf5c86a9d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160198
> Auto-Submit: Patrick Thier <pthier@chromium.org>
> Reviewed-by: Victor Gomes <victorgomes@chromium.org>
> Commit-Queue: Victor Gomes <victorgomes@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#76838}

Bug: v8:11112
Change-Id: I98e4127dcedaf7e19751ac29175700817b1b2202
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162607
Reviewed-by: Patrick Thier <pthier@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76860}
2021-09-16 06:50:43 +00:00
Dominik Inführ
b8146576d6 Reland "[test] Avoid disabling of RCS during runtime"
This is a reland of 11045926ca

The first version of this CL uncovered a TSAN failure when not disabling
RCS anymore. The problem was that a background thread was still updating
RCS counters, while the main thread already dumped those values during
tear down. This CL fixes this by dumping counters only after all
background threads are stopped.

Original change's description:
> [test] Avoid disabling of RCS during runtime
>
> Test was flaky since disabling of RCS at runtime is unsafe. Some code
> (e.g. TRACE_GC) is run only in case RCS is enabled and such code paths
> might also DCHECK that RCS is enabled.
> A background thread (sweeping in this case) could've already
> entered such a code path right before RCS is disabled. In this case the
> guard at the entry still saw that RCS is enabled but subsequent DCHECKs
> that ensure that RCS is enabled might fail.
>
> We could fix this by completing the sweeper tasks before disabling RCS
> but there might be other similar tasks which might be run at that point
> in the future (e.g. memory unmapper).
>
> Disabling the flag doesn't even seem to be needed for the initial
> regression test, so it seems simpler to just not disable RCS anymore.
>
> Bug: v8:12026
> Change-Id: I878f7dd9a7a4abb6a501f7a7651a1240ef2082a6
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162043
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#76845}

Bug: v8:12026, v8:12234
Change-Id: I5cb577051d188d17b02ca7da79a3f1d9aa646cae
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162050
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76859}
2021-09-16 06:05:51 +00:00
v8-ci-autoroll-builder
0fe20577ed Update V8 DEPS.
Rolling v8/build: 1384630..590c648

Rolling v8/third_party/depot_tools: 287ed7c..5307522

Rolling v8/third_party/instrumented_libraries: cb29f9c..0faacf9

Rolling v8/tools/luci-go: git_revision:dc21267f89df3981e809fe9566591d6916ae758b..git_revision:028cd41e0f4b2bec99d94c780caf2f978e09b182

Rolling v8/tools/luci-go: git_revision:dc21267f89df3981e809fe9566591d6916ae758b..git_revision:028cd41e0f4b2bec99d94c780caf2f978e09b182

Rolling v8/tools/luci-go: git_revision:dc21267f89df3981e809fe9566591d6916ae758b..git_revision:028cd41e0f4b2bec99d94c780caf2f978e09b182

TBR=v8-waterfall-sheriff@grotations.appspotmail.com,mtv-sf-v8-sheriff@grotations.appspotmail.com

Change-Id: Ie1336651a1a87dfebd3d4597284a2c4c636de398
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162251
Reviewed-by: 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@{#76858}
2021-09-16 03:48:00 +00:00
Paolo Severini
e0974192cb Enable inlining of JS->Wasm calls by default
Bug: v8:11092
Change-Id: I8d0dc34b28f0f2627069b7e4cbaf3f2d0ba49869
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3163276
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Paolo Severini <paolosev@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#76857}
2021-09-15 22:13:31 +00:00
Brian Ryner
eb1d0ee711 Verify mac-arm64 wheels for v8/.vpython spec.
vpython's default verification does not yet include this platform,
so this allows us to ensure that v8 vpython specs stay mac-arm64
compatible.

Bug: chromium:1235841
Change-Id: I0cfe369f07a786a0606f7dac13b581820c060445
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3163003
Commit-Queue: Brian Ryner <bryner@google.com>
Auto-Submit: Brian Ryner <bryner@google.com>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76856}
2021-09-15 21:11:50 +00:00
Ng Zhi An
2d9dc54d93 [ia32][x64] Reorganize macro-assembler functions and move to shared
Group all the SIMD (SSE/AVX) functions in macro-assembler-x64 together,
and move Ucomisd/Ucomiss to shared-macro-assembler.

Bug: v8:11589
Change-Id: Ia2246e816615aa8e143e94a1064838b2c314d8f0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160698
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76855}
2021-09-15 18:18:40 +00:00
Ng Zhi An
f67ee467aa [disasm][x64] Remove unnecessary initialization code
These tests don't depend on initializing VM (for Context) or even an
isolate, so we can remove the setup code, and use UNINITIALIZED_TEST
(will not even set up an isolate).

Bug: v8:12207
Change-Id: I4b509b95cc8272db22892c32b53464678403dc7d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160748
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76854}
2021-09-15 17:38:00 +00:00
Leszek Swirski
be526b1eb1 [log] Fix off-thread use of string.Get
Fixed: v8:12233
Change-Id: If23330e2edd6f4e2352800c145fc3ad5a360be5a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162055
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76853}
2021-09-15 17:31:05 +00:00
Clemens Backes
46540df8fd Revert "[wasm][externref] Support default value for the table.set"
This reverts commit 6b57898062.

Reason for revert: Fails layout tests: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Blink%20Linux/13751/overview

Original change's description:
> [wasm][externref] Support default value for the table.set
>
> WebAssembly.Table.set allows a default value instead of the second
> parameter, which was not supported by V8 so far.
>
> R=​thibaudm@chromium.org
>
> Bug: v8:7581
> Change-Id: I417790722b1cb4f854cd0056ecb8377c330c45fa
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3141574
> Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
> Commit-Queue: Andreas Haas <ahaas@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#76846}

Bug: v8:7581
Change-Id: I83d9be59c66ece3184b5708e5b8a3b401e4938ed
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3163257
Auto-Submit: Clemens Backes <clemensb@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@{#76852}
2021-09-15 17:03:11 +00:00
Clemens Backes
9068522bc7 Revert "[arm64][wasm-simd] Use Cm(0) for integer comparison with 0"
This reverts commit 16df1dfa13.

Reason for revert: Multiple failures, e.g. https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux/43844/overview

Original change's description:
> [arm64][wasm-simd] Use Cm(0) for integer comparison with 0
>
> Use an immediate zero operand for integer comparison when possible. This
> gives ~1% runtime performance improvement in some benchmarks on Neoverse
> N1.
>
> Change-Id: I727a8104f8e6ca3d122d6b5b8b3d38d7bdd76c47
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3158327
> Reviewed-by: Zhi An Ng <zhin@chromium.org>
> Commit-Queue: Martyn Capewell <martyn.capewell@arm.com>
> Cr-Commit-Position: refs/heads/main@{#76847}

Tbr: zhin@chromium.org
Change-Id: I7039106d885c59aecad24dd8dda4d151b8e1f022
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162053
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Auto-Submit: Clemens Backes <clemensb@chromium.org>
Owners-Override: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76851}
2021-09-15 16:06:43 +00:00
Clemens Backes
e366c4b7d4 [wasm][test] CFI also prints UBSan errors
Instead of trying to detect which sanitizer we run on, just allow the
output that any sanitizer would produce.
Note that the regular expression syntax is pretty limited, so we cannot
express this as a single regex.

This removes the single use of {V8_USE_UNDEFINED_BEHAVIOR_SANITIZER}
again, but for completeness I leave it in {macros.h} for now.

TBR=jkummerow@chromium.org

Bug: v8:12226
Cq-Include-Trybots: luci.v8.try:v8_linux64_msan_rel_ng
Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng
Cq-Include-Trybots: luci.v8.try:v8_linux64_cfi_rel_ng
Change-Id: I37a6d15ebb9fdafbdbee0158ba6c540582c31301
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162046
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76850}
2021-09-15 15:48:50 +00:00
Andreas Haas
0af529a365 [wasm] Change type() for js-api objects
The type() function is now part of the js-api object and not part of the
constructor anymore, see
https://github.com/WebAssembly/js-types/blob/master/document/js-api/index.bs#L971

This fixes a failing spec test, but there is a bug in the test itself,
so it cannot be enabled yet.

R=thibaudm@chromium.org

Bug: v8:12227, v8:7742
Change-Id: I41e3752ad2e9af85c7197617f573dd0dc1a7a77f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162036
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76849}
2021-09-15 15:23:49 +00:00
Dominik Inführ
0feba98a5c Revert "[test] Avoid disabling of RCS during runtime"
This reverts commit 11045926ca.

Reason for revert: Uncovered TSAN failure

Original change's description:
> [test] Avoid disabling of RCS during runtime
>
> Test was flaky since disabling of RCS at runtime is unsafe. Some code
> (e.g. TRACE_GC) is run only in case RCS is enabled and such code paths
> might also DCHECK that RCS is enabled.
> A background thread (sweeping in this case) could've already
> entered such a code path right before RCS is disabled. In this case the
> guard at the entry still saw that RCS is enabled but subsequent DCHECKs
> that ensure that RCS is enabled might fail.
>
> We could fix this by completing the sweeper tasks before disabling RCS
> but there might be other similar tasks which might be run at that point
> in the future (e.g. memory unmapper).
>
> Disabling the flag doesn't even seem to be needed for the initial
> regression test, so it seems simpler to just not disable RCS anymore.
>
> Bug: v8:12026
> Change-Id: I878f7dd9a7a4abb6a501f7a7651a1240ef2082a6
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162043
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#76845}

Bug: v8:12026
Change-Id: I154817fc5ddeab68c69c745d08f3d77c48896dc4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162049
Auto-Submit: Dominik Inführ <dinfuehr@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@{#76848}
2021-09-15 15:02:20 +00:00
Ilja Iskovs
16df1dfa13 [arm64][wasm-simd] Use Cm(0) for integer comparison with 0
Use an immediate zero operand for integer comparison when possible. This
gives ~1% runtime performance improvement in some benchmarks on Neoverse
N1.

Change-Id: I727a8104f8e6ca3d122d6b5b8b3d38d7bdd76c47
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3158327
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Martyn Capewell <martyn.capewell@arm.com>
Cr-Commit-Position: refs/heads/main@{#76847}
2021-09-15 14:34:08 +00:00
Andreas Haas
6b57898062 [wasm][externref] Support default value for the table.set
WebAssembly.Table.set allows a default value instead of the second
parameter, which was not supported by V8 so far.

R=thibaudm@chromium.org

Bug: v8:7581
Change-Id: I417790722b1cb4f854cd0056ecb8377c330c45fa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3141574
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76846}
2021-09-15 14:12:18 +00:00
Dominik Inführ
11045926ca [test] Avoid disabling of RCS during runtime
Test was flaky since disabling of RCS at runtime is unsafe. Some code
(e.g. TRACE_GC) is run only in case RCS is enabled and such code paths
might also DCHECK that RCS is enabled.
A background thread (sweeping in this case) could've already
entered such a code path right before RCS is disabled. In this case the
guard at the entry still saw that RCS is enabled but subsequent DCHECKs
that ensure that RCS is enabled might fail.

We could fix this by completing the sweeper tasks before disabling RCS
but there might be other similar tasks which might be run at that point
in the future (e.g. memory unmapper).

Disabling the flag doesn't even seem to be needed for the initial
regression test, so it seems simpler to just not disable RCS anymore.

Bug: v8:12026
Change-Id: I878f7dd9a7a4abb6a501f7a7651a1240ef2082a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162043
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76845}
2021-09-15 13:49:08 +00:00
Jakob Kummerow
bc3b9332ac [wasm-gc] Implement nominal types
Per https://github.com/WebAssembly/gc/issues/234, this implements
"nominal" type definitions with explicit supertypes, and statically
typed RTT-less instructions for allocation and testing/casting.
This should be fully backwards compatible with existing Wasm modules.

Spec: https://bit.ly/3cWcm6Q ("version 4")

Bug: v8:7748
Change-Id: Id5a1399b368fdfad22036cfd66f1bef593e640f7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3144916
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76844}
2021-09-15 13:43:39 +00:00
Sathya Gunasekaran
62acef549e [system-analyzer] Fix zoom
Don't render if the timeline track doesn't have any data.

Change-Id: Ib0638ce18391f14212d3a5385d90877cf0392c5f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162042
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76843}
2021-09-15 13:28:38 +00:00
Jakob Kummerow
45fc148601 [bigint] Max parts when parsing: fix off-by-one
The very last part skipped the max_digits check, and earlier parts
forgot to account for that in their check. The reason why the last
part originally got special treatment no longer applies, so we can
fix this bug by removing the special case, simplifying the overall
logic.

Fixed: chromium:1248972
Change-Id: I1857dd8b63c00f9bdfb9237f2ea3621ecc1339e2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160522
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76842}
2021-09-15 13:20:28 +00:00
Clemens Backes
6599863141 Reland^2 "[wasm][test] Fix test expectation"
This is a reland of a55c82d46b, now also
fixed for UBSan.

Original change's description:
> Reland "[wasm][test] Fix test expectation"
>
> This is a reland of 6f9cde1ee6, with
> special handling for MSan as well.
>
> Original change's description:
> > [wasm][test] Fix test expectation
> >
> > In the mprotect case, there could be one or multiple succeeding writes
> > until we finally crash. Thus do not check that we never successfully
> > write, but just check that the last printed statement is *before* a
> > write.
> >
> > R=jkummerow@chromium.org
> >
> > Bug: v8:12226
> > Change-Id: I04209691a9320a9b29dd0ec364539e062ad2dc03
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160343
> > Commit-Queue: Clemens Backes <clemensb@chromium.org>
> > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#76829}
>
> Bug: v8:12226
> Cq-Include-Trybots: luci.v8.try:v8_linux64_msan_rel_ng
> Change-Id: I85ca98be43fc1d933d39a4602194e1771c33007c
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162037
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#76839}

Bug: v8:12226
Change-Id: I911295b73a385c899a993a729db3a499e58b7cb6
Cq-Include-Trybots: luci.v8.try:v8_linux64_msan_rel_ng
Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162041
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76841}
2021-09-15 13:04:08 +00:00
Clemens Backes
2872775fd9 Revert "Reland "[wasm][test] Fix test expectation""
This reverts commit a55c82d46b.

Reason for revert: Fails on UBSan: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20-%20cfi/31712/overview

Original change's description:
> Reland "[wasm][test] Fix test expectation"
>
> This is a reland of 6f9cde1ee6, with
> special handling for MSan as well.
>
> Original change's description:
> > [wasm][test] Fix test expectation
> >
> > In the mprotect case, there could be one or multiple succeeding writes
> > until we finally crash. Thus do not check that we never successfully
> > write, but just check that the last printed statement is *before* a
> > write.
> >
> > R=jkummerow@chromium.org
> >
> > Bug: v8:12226
> > Change-Id: I04209691a9320a9b29dd0ec364539e062ad2dc03
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160343
> > Commit-Queue: Clemens Backes <clemensb@chromium.org>
> > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#76829}
>
> Bug: v8:12226
> Cq-Include-Trybots: luci.v8.try:v8_linux64_msan_rel_ng
> Change-Id: I85ca98be43fc1d933d39a4602194e1771c33007c
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162037
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#76839}

Bug: v8:12226
Change-Id: Ifb0f4b7e87c9c54271f7f3de29b1f1fc6e867f3f
Cq-Include-Trybots: luci.v8.try:v8_linux64_msan_rel_ng
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162040
Auto-Submit: Clemens Backes <clemensb@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@{#76840}
2021-09-15 12:03:50 +00:00
Clemens Backes
a55c82d46b Reland "[wasm][test] Fix test expectation"
This is a reland of 6f9cde1ee6, with
special handling for MSan as well.

Original change's description:
> [wasm][test] Fix test expectation
>
> In the mprotect case, there could be one or multiple succeeding writes
> until we finally crash. Thus do not check that we never successfully
> write, but just check that the last printed statement is *before* a
> write.
>
> R=jkummerow@chromium.org
>
> Bug: v8:12226
> Change-Id: I04209691a9320a9b29dd0ec364539e062ad2dc03
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160343
> Commit-Queue: Clemens Backes <clemensb@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#76829}

Bug: v8:12226
Cq-Include-Trybots: luci.v8.try:v8_linux64_msan_rel_ng
Change-Id: I85ca98be43fc1d933d39a4602194e1771c33007c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162037
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76839}
2021-09-15 11:30:18 +00:00
Patrick Thier
b73557685b [x64][ia32] Activate Argument Count Consistency
Activate argument count consistency (receiver is always included in
JS argument count) for x64 and ia32.

Bug: v8:11112
Change-Id: If60000b6566846c84f1042473d25d79bf5c86a9d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160198
Auto-Submit: Patrick Thier <pthier@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76838}
2021-09-15 10:29:38 +00:00
Leszek Swirski
012af69b71 [string] Add PtrCage for ExternalString::GetChars
Change-Id: I14400c0efea88b4bbb40aa2fbe9527dc9c67d3fb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160340
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76837}
2021-09-15 09:29:38 +00:00
Patrick Thier
d345b25add [torque] Fix argument count consistency for cross-compilation
Don't evaluate the (currently) arch dependent constants
kJSArgcIncludesReceiver and kJSArgcReceiverSlots at Torque build time.

Bug: v8:11112
Change-Id: If955f7f2c02bfd88c791797a8ef3f94184d4a1fd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160519
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76836}
2021-09-15 08:35:28 +00:00
Lu Yahan
9d0b3cd8a3 [riscv64] Implement RVV float
Bug: v8:11976
Change-Id: I19e1ef43f073c8155dbc2890de0f331782eb7aac
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3156588
Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#76835}
2021-09-15 07:54:58 +00:00
Georg Neis
23b4cc8e62 [compiler] Avoid raw pointers in JSFunctionData::Cache
The function used raw pointers but also created Refs, which can cause
GC. Thus the code isn't safe (this has already lead to crashes in an
older version of the code).

Drive-by: Remove unnecessary native_context field (get the native
context from the context instead).

Bug: v8:12205, v8:7790
Change-Id: I4868323f48fc411e8462b7824fde3d8715b55abc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160520
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76834}
2021-09-15 07:21:19 +00:00
v8-ci-autoroll-builder
e0c280f352 Update V8 DEPS.
Rolling v8/build: f16814b..1384630

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/53aef64..6b072fa

Rolling v8/third_party/depot_tools: 984ce94..287ed7c

Rolling v8/third_party/googletest/src: 955c7f8..159c9ad

Rolling v8/tools/clang: e74330f..83b09bd

Rolling v8/tools/luci-go: git_revision:4a0f3da2840eaa5341470174b57047313e074ecd..git_revision:dc21267f89df3981e809fe9566591d6916ae758b

Rolling v8/tools/luci-go: git_revision:4a0f3da2840eaa5341470174b57047313e074ecd..git_revision:dc21267f89df3981e809fe9566591d6916ae758b

Rolling v8/tools/luci-go: git_revision:4a0f3da2840eaa5341470174b57047313e074ecd..git_revision:dc21267f89df3981e809fe9566591d6916ae758b

TBR=v8-waterfall-sheriff@grotations.appspotmail.com,mtv-sf-v8-sheriff@grotations.appspotmail.com

Change-Id: I1a08e93ba5d136d01a02754ddf98f6d21f50d014
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3159555
Reviewed-by: 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@{#76833}
2021-09-15 03:50:40 +00:00
Ng Zhi An
4773be80d9 [x64][ia32] Share pextrd code
Share the AVX and SSE4_1 code for Pextrd but delegate to base class for
the pre-SSE4.1 code (via CRTP).

Bug: v8:11589
Change-Id: Ic7709ccf7d9029829583c9287c1b0842ff11b799
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160332
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76832}
2021-09-14 22:39:58 +00:00
Zhi An Ng
99c17a8bd0 Revert "[wasm][test] Fix test expectation"
This reverts commit 6f9cde1ee6.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/40332/overview

Original change's description:
> [wasm][test] Fix test expectation
>
> In the mprotect case, there could be one or multiple succeeding writes
> until we finally crash. Thus do not check that we never successfully
> write, but just check that the last printed statement is *before* a
> write.
>
> R=​jkummerow@chromium.org
>
> Bug: v8:12226
> Change-Id: I04209691a9320a9b29dd0ec364539e062ad2dc03
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160343
> Commit-Queue: Clemens Backes <clemensb@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#76829}

Bug: v8:12226
Change-Id: I11ed00268db8dae5c773ed14fda9a343566f910a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3161333
Auto-Submit: Zhi An Ng <zhin@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@{#76831}
2021-09-14 22:07:22 +00:00
Milad Fa
bd9762dd01 PPC: Check if rb is valid when creating MemOperand
r0 is used to indicate a value of "0" in which case
only the ra() value gets used.

Change-Id: I5ea5c51c1a652d042137c2d940818b93dac52492
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3159668
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#76830}
2021-09-14 20:59:58 +00:00
Clemens Backes
6f9cde1ee6 [wasm][test] Fix test expectation
In the mprotect case, there could be one or multiple succeeding writes
until we finally crash. Thus do not check that we never successfully
write, but just check that the last printed statement is *before* a
write.

R=jkummerow@chromium.org

Bug: v8:12226
Change-Id: I04209691a9320a9b29dd0ec364539e062ad2dc03
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160343
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76829}
2021-09-14 20:53:18 +00:00
Ng Zhi An
ca817b0bb6 [x64] Add new disassembly tests that verifies output
Currently the main test for disassembly just checks that there is
disassembly support for a assembler function, it doesn't verify the
output is as expected.

Add a new test case that checks the disassembly output against an
expected string.

Right now we only check a single instruction, subsequent patches will
move more instructions into this test case.

Bug: v8:12207
Change-Id: Id183bb2fd625713d82239363ebce3f4c77155acd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3150145
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76828}
2021-09-14 20:41:29 +00:00