Commit Graph

71679 Commits

Author SHA1 Message Date
Maria Tîmbur
749e41d468 [fuzzer] ref.func should look up functions by signature
When we generate identical signatures in the fuzzer,
we generate one function for each of the copies.
However, when these functions are added to WasmModulBuilder,
all will be assigned the same signature index.
Therefore, when ref.func tries to find a function corresponding
to a signature index, it will fail, despite a matching signature
existing in the module.
This CL fixes this issue by looking up functions by signature
over signature index.

Bug: v8:11954, chromium:1254387
Change-Id: Iac8d5444d4914d993da63d0630ca4d95e671630c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3197711
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Maria Tîmbur <mtimbur@google.com>
Cr-Commit-Position: refs/heads/main@{#77187}
2021-10-01 10:30:04 +00:00
Benedikt Meurer
6d25f20f35 [debug] Set breakpoints correctly right after function literals.
The logic to locate the correct function to set a breakpoint in based
on script position was treating SharedFunctionInfo::EndPosition() as
inclusive rather than exclusive. There are various assumptions all over
the Debugger that seem to demand this treatment for the toplevel script.
But it's definitely wrong for function literals.

Fixed: chromium:1253277
Change-Id: I3421703673f4d78aee28e923e03e2fca24bc06ac
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3197715
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77186}
2021-10-01 10:11:45 +00:00
Victor Gomes
b65e72c68e [TurboFan] Change representation of NumberConstant in 32-bit arch
Smi constants in 32 bit machines are guaranteed to be 31 bits.

Bug: chromium:1254189
Change-Id: I4ea296a7212c5e6ea14119fbd71cfb5789762b55
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3195874
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77185}
2021-10-01 09:39:57 +00:00
Maya Lekova
582f8021d4 [fastcall] Enhance FastApiTypedArray with aligned data getter
This CL adds a getStorageIfAligned method to obtaining a typed pointer
to the underlying TypedArray data, if the pointer to it is properly
aligned.

Bug: chromium:1052746
Change-Id: Ie8cb3438135b0da060e2b42ec71bba0e72ae4f5e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3195875
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77184}
2021-10-01 09:19:56 +00:00
Benedikt Meurer
0195a5eb49 [inspector] Consistently treat promise rejections as side-effecting.
Previously we'd treat %_AsyncFunctionReject (and %AsyncFunctionReject)
as side-effect free (in async functions), but that's not correct, since
promise rejections have side-effects (at the very least triggering the
unhandled promise rejection machinery in the browser).

This required a minor refactoring as previously we'd classify functions
as side-effecting or not depending on whether they contain any calls to
side-effecting intrinsics, no matter whether this call is actually
executed or not. That would break REPL mode however if we'd generally
treat all async functions with %_AsyncFunctionReject intrinsic calls as
side-effecting, so instead of performing the intrinsic checks ahead of
time, we now perform the test at execution time.

Before: https://imgur.com/5BvJP9d.png
After: https://imgur.com/10FanNr.png
Fixed: chromium:1249275
Change-Id: Ib06f945ba21f1e06ee9b13a1363fad342464fd9a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3197712
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77183}
2021-10-01 07:10:34 +00:00
Benedikt Meurer
0ea62c94f0 [inspector] Mark Intl builtins as side-effect free.
Fixed: chromium:1073804
Change-Id: Idb8b4b5558bb243eb1cbe70b2de1c22d8dd07f9d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3198152
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77182}
2021-10-01 05:31:16 +00:00
Manos Koukoutos
29afe1e585 [turbofan] Optimize traps after Merge/IfTrue/IfFalse
We implement two optimizations for trap conditionals for patterns that
come up in wasm-gc.
In case of a Merge followed by a trap, where the path conditions of all
branches of the Merge contain the trap condition, we lift the trap into
the branches of the Merge.
In case of a Branch whose IfTrue branch is followed by a TrapIf with the
same condition, we replace it with the trap followed by the IfFalse
branch. Symmetrically for IfFalse and TrapUnless.

Bug: v8:7748
Change-Id: I43040aebe60eab7b2230fc3130e3b8250e8b2f45
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3190109
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77181}
2021-10-01 05:05:15 +00:00
Milad Fa
9227a8da33 PPC/s390: [regexp] Fix stack growth for global regexps
Port 3e3a027da1

Original Commit Message:

    Irregexp reentrancy (crrev.com/c/3162604) introduced a bug for global
    regexp execution in which each iteration would use a new stack region
    (i.e. we forgot to pop the regexp stack pointer when starting a new
    iteration).

    This CL fixes that by popping the stack pointer on the loop backedge.

    At a high level:

    - Initialize the backtrack_stackpointer earlier and avoid clobbering
      it by setup code.
    - Pop it on the loop backedge.
    - Slightly refactor Push/Pop operations to avoid unneeded memory
      accesses.

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

Change-Id: Iafe6814d3695e83fced6a46209accf5e712d56f6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3198391
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77180}
2021-09-30 18:40:23 +00:00
Milad Fa
3cfb9308b1 PPC/s390: [masm] Improve Instance Type Checks in Builtins::Call/Construct
Port b9a6301ef5

Original Commit Message:

    Load instance type into a register instead of using memory operands for
    several checks on ia32 and x64.

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

Change-Id: I05ea2bd32ea2a2053b601323813c580d55094e46
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3198130
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77179}
2021-09-30 18:38:54 +00:00
Seth Brenith
25f0e32915 [torque] Make return types required
Currently, it is possible to declare macros, builtins, etc., without
specifying a return type, in which case the return type is treated as
void. This is confusing; the code is more clear if we require the return
type to be specified.

Aside from src/torque, this change is almost entirely just adding
`: void` until the compiler is happy. However, two intrinsics in
src/builtins/torque-internal.tq have been corrected to declare an
appropriate return type. Those two intrinsics were only used in code
generated within the compiler after the type-checking phase, so we never
noticed that their return types were declared incorrectly.

Bug: v8:7793
Change-Id: Ib7df88678c25393a9e3eba389a6a1c4d9233dcbb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3176502
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77178}
2021-09-30 15:54:17 +00:00
Nico Hartmann
c9f69db900 [turbofan] No speculative BigInt operations on 32 bit architectures
Bug: chromium:1254191, v8:9407
Change-Id: Ieb22063dad1ea8dfde359662d0330e689b6b2e05
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3193547
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77177}
2021-09-30 15:49:17 +00:00
Junliang Yan
420228e439 ppc: [liftoff] fix rounding issue
Change-Id: Iec020471bd8268043961c62207cc03ca8a315d33
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3197290
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77176}
2021-09-30 15:44:10 +00:00
Manos Koukoutos
c1e26cc722 [wasm] Do not emit loop exits in inlined functions
Loop exits are only used during loop unrolling and are then removed, as
they cannot be handled by later optimization stages. Since unrolling
comes before inlining in the compilation pipeline, we should not emit
loop exits in inlined functions.

Bug: v8:12166
Change-Id: I28b3ebaf67c9e15b127eeb1a63906c4ecfd77480
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3195871
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77175}
2021-09-30 15:16:20 +00:00
Austin Eng
6247f98df5 [fastcall] Match template arguments to TryCopyAndConvertArrayToCppBuffer
Bug: chromium:1052746
Change-Id: I368ef855f711ca09c1a34b2be6e9bf72e6a7310c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3193873
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77174}
2021-09-30 15:05:17 +00:00
Maya Lekova
ea64150b8a Revert "[inspector] Mark Intl builtins as side-effect free."
This reverts commit f40998322f.

Reason for revert: The new test is failing on noi18n, see https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux%20-%20noi18n%20-%20debug/39705/blamelist

Original change's description:
> [inspector] Mark `Intl` builtins as side-effect free.
>
> Fixed: chromium:1073804
> Change-Id: Ia8cd29323e2b1c4faa0f115b5f60bc216b7813f1
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3196175
> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Simon Zünd <szuend@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#77171}

Change-Id: Ibb11ba2e835992e8b2fdd374bb38e245d32a1047
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3197192
Auto-Submit: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77173}
2021-09-30 14:54:19 +00:00
Jakob Kummerow
a80b722862 [wasm-gc] Fix initialization of ref-type fields
The NewWasmStruct/NewWasmArray factory functions didn't take pointer
compression into account; this patch fixes that.

Bug: v8:7748
Change-Id: I7a77d867971aad1df6660a3b7279ca3b2819b86a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3195873
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77172}
2021-09-30 14:33:12 +00:00
Benedikt Meurer
f40998322f [inspector] Mark Intl builtins as side-effect free.
Fixed: chromium:1073804
Change-Id: Ia8cd29323e2b1c4faa0f115b5f60bc216b7813f1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3196175
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77171}
2021-09-30 14:25:31 +00:00
Michael Lippautz
46088a2838 heap: Fix --minor-mc ephemeron processing
Minor MC does not support processing the specialized remembered set
for ephemeron tables.

Temporarily delegate to the regular write barrier for correctness
until the other barrier is supported.

Bug: v8:12262
Change-Id: Iad74b27f8738237dcc1e146b2df3aa6ed8c9a505
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3195895
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77170}
2021-09-30 13:50:51 +00:00
Manos Koukoutos
2ae6cda1ee [wasm-gc] Skip array.copy if length == 0
Bug: v8:7748
Change-Id: Id6adc39af6818f5a37307f26cfe40de11a0ce3c2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3195872
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77169}
2021-09-30 13:23:11 +00:00
Seth Brenith
07d82db1eb Reland "[torque] Get rid of @noVerifier annotation"
This is a reland of 9495817296

Original change's description:
> [torque] Get rid of @noVerifier annotation
>
> As one small step toward reducing annotations, I propose that all
> classes get generated verifiers unless they've opted out of C++ class
> generation via @doNotGenerateCppClass, and that generated verifiers
> always verify every Torque-defined field. If a generated verifier is
> incorrect, such as for JSFunction or DataHandler, we can just avoid
> calling it and hand-code the verification.
>
> Bug: v8:7793
> Change-Id: I7c0edb660574d0c688a59c7e90c41ee7ad464b42
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3171758
> Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
> Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#77145}

Bug: v8:7793
Change-Id: I3da34705bf9fc2b1886161f8f59c7275583f7fc4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3194812
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77168}
2021-09-30 12:59:21 +00:00
Clemens Backes
68ab78e24d [wasm] Fix error message for missing stack arguments
We currently could produce the error message 'not enough arguments on
the stack for block, expected 0 more'. This CL fixes this by printing
the available number of arguments and the needed number, and adds
DCHECKs to catch similar miscomputations in the future.

It also adds a new test that produced the broken error before, and
includes the expected failure message in a few more tests for
robustness.

R=manoskouk@chromium.org

Change-Id: Ia08863889ae36ae0a05d96d36e92295b7159a01e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3194264
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77167}
2021-09-30 12:29:01 +00:00
Marja Hölttä
8b0bfea3f8 [cleanup] Make interpreter/ Wshadow compatible
Bug: v8:12244, v8:12245
Change-Id: I46cc6fca7d4dda82c825ac15c97bba41ec61378a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3183347
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77166}
2021-09-30 12:23:31 +00:00
Al Muthanna Athamina
76f50dff09 Return flags directly in the numfuzz runner
Bug: v8:11826
Change-Id: I5b7f64df8bf067d85cf89bc6c5e6a6804e6b2bc1
Cq-Include-Trybots: luci.v8.try:v8_numfuzz_dbg_ng,v8_numfuzz_ng,v8_numfuzz_tsan_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3196130
Auto-Submit: Almothana Athamneh <almuthanna@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77165}
2021-09-30 12:11:21 +00:00
Clemens Backes
0cb6323bf1 [wasm] Skip slow test
The test allocates a lot of wasm memories. This got a low slower after
https://crrev.com/c/3190476, because we can now allocate more than 102
memories, and do not explicitly trigger a GC any more to get rid of
unused memories.
We should figure out how to tell the GC about the external memory such
that the memories get collected earlier.

R=ahaas@chromium.org

Bug: v8:12076, v8:12278
Change-Id: I9b8795a9999a806380d86f22e751de2727942648
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3196131
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77164}
2021-09-30 11:06:52 +00:00
Omer Katz
6040caf5da cppgc: Check same thread accesses to PersistentRegion
Bug: chromium:1056170
Change-Id: I355187177d062bf7117bcbd402821f2b9dd739de
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3194267
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77163}
2021-09-30 09:55:10 +00:00
Omer Katz
ea2723c9ec cppgc: Add same thread check for Members and Persistents
Bug: chromium:1056170
Change-Id: I0876d1977694c50995a7b97145748bdb365289ad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3194266
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77162}
2021-09-30 09:50:59 +00:00
Clemens Backes
2cbcf6e089 [wasm] Remove process-wide address space limit
The address space limit puts an arbitrary cap on the total reservation
size, thus limiting the total number of Wasm memories to around 100 on
64-bit systems.
Since the usable address space on 64 bit is much larger than the
1TB+4GB limit, this makes us reject code that we could otherwise just
execute.

This CL thus removes that limit completely.

See the linked issue for more discussion, including security
considerations.

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

Bug: v8:12076
Change-Id: I1f61511d68efdab1f8cef4e09c0a39fc1d6fed60
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3190476
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77161}
2021-09-30 09:07:59 +00:00
Marja Hölttä
db50b49128 [csa, torque, cleanup] Rename CSA_ASSERT to CSA_DCHECK
It's confusing that we have CSA_CHECK and CSA_ASSERT and it's not
clear from the names that the former works in release mode and the
latter only in debug mode.

Renaming CSA_ASSERT to CSA_DCHECK makes it clear what it does. So now
we have CSA_CHECK and CSA_DCHECK and they're not confusing.

This also renames assert() in Torque to dcheck().

Bug: v8:12244
Change-Id: I6f25d431ebc6eec7ebe326b6b8ad3a0ac5e9a108
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3190104
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77160}
2021-09-30 08:41:23 +00:00
Maya Lekova
a2fa2efe35 Revert "Update V8 DEPS."
This reverts commit 6e6385a06a.

Reason for revert: Breaks MSAN, see https://bugs.chromium.org/p/v8/issues/detail?id=12277

Original change's description:
> Update V8 DEPS.
>
> Rolling v8/build: ecb990f..28fa03f
>
> Rolling v8/buildtools/third_party/libc++abi/trunk: 50e90b8..31a3660
>
> Rolling v8/third_party/aemu-linux-x64: e_KiIcYNB7sHa2eqRBhqVoR_Mmg2Q7nqmzRCXzegWQAC..pE8RqfOzLp5AXCDDOSrlKJ4MZInfuyxWzRSwdXBe1doC
>
> Rolling v8/third_party/android_platform: 6e5dc9a..7a11b79
>
> Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/5afc365..01df326
>
> Rolling v8/third_party/depot_tools: 764c927..9c24aed
>
> Rolling v8/third_party/instrumented_libraries: eb740e9..0aa3fcf
>
> TBR=v8-waterfall-sheriff@grotations.appspotmail.com,mtv-sf-v8-sheriff@grotations.appspotmail.com
>
> Change-Id: If86099561baf7a927d6c5109790dad7b958208d0
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3194881
> 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@{#77153}

Change-Id: I40135e9ed7adfcbfca054969c729aba5d8c9c91e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3195713
Auto-Submit: Maya Lekova <mslekova@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Owners-Override: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77159}
2021-09-30 08:40:11 +00:00
Jakob Gruber
3e3a027da1 [regexp] Fix stack growth for global regexps
Irregexp reentrancy (crrev.com/c/3162604) introduced a bug for global
regexp execution in which each iteration would use a new stack region
(i.e. we forgot to pop the regexp stack pointer when starting a new
iteration).

This CL fixes that by popping the stack pointer on the loop backedge.

At a high level:

- Initialize the backtrack_stackpointer earlier and avoid clobbering
  it by setup code.
- Pop it on the loop backedge.
- Slightly refactor Push/Pop operations to avoid unneeded memory
  accesses.

Bug: v8:11382
Change-Id: Ibad6235767e110089a2b346034f923590b286a05
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3194251
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77158}
2021-09-30 07:57:17 +00:00
Benedikt Meurer
d6c01059a5 [inspector] Align async task frame reporting for await.
The V8 Inspector was sending an additional frame as part of async stack
traces for async functions, which pointed to the first executed `await`
in the async function. This is leaking an implementation detail of how
(and more precisely when) the inspector decides to collect this stack
trace. From the users perspective the async part of the stack trace is
supposed to capture what happened _prior to the task_ - meaning in case
of async functions: What lead to the execution of the async function.
This is reflected by the fact that the DevTools front-end (and the V8
Inspector itself) performs post-processing on these async call stacks,
removing the misleading top frame from it. But this post-processing is
not applied consistently to all async stack traces (i.e. the Console
message stack traces don't get this), and potentially also not applied
consistently across consumers of the Chromium debugger backend.

Instead the V8 Inspector now removes the top frame itself and thus
reports `await` consistently with how other async tasks are reported to
debugger front-ends.

Note: This preserves backwards compatibility with old versions of
devtools-frontend, which do post-processing (for the Call Stack) only on
async stack traces marked with "async function", while we now mark these
async stack traces with "await" instead (aligned with what the front-end
is using as user visibile string anyways in the Call Stack section, and
this matching will be updated in a separate follow up CL to look for
"await" instead of "async function").

Before: https://imgur.com/kIrWcIc.png
After: https://imgur.com/HvZGqiP
Fixed: chromium:1254259
Bug: chromium:1229662
Change-Id: I57ce051a28892177b6b96221f083ae957f967e52
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3193535
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77157}
2021-09-30 07:56:15 +00:00
Patrick Thier
b9a6301ef5 [masm] Improve Instance Type Checks in Builtins::Call/Construct
Load instance type into a register instead of using memory operands for
several checks on ia32 and x64.

Drive-by: Name used registers in Generate_Call/Generate_Construct

Change-Id: I289c5e420fa03ca639c9b78266560cafb166f6f7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3190099
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77156}
2021-09-30 07:55:12 +00:00
Victor Gomes
c5c60391e4 [tools] Use absolute imports in testrunner
It also updates the scripts to support Python3

Bug: chromium:1245634
Change-Id: Iffe29bacfd788575b35da6449d5830fc665da7a8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3194259
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77155}
2021-09-30 07:54:10 +00:00
Zhao Jiazhong
129ef0a16b [mips64][loong64][codegen] Sign-extend uint32 values to 64-bit
Due to MIPS64 ISA feature, 32-bit values should be sign-extended
in 64-bit registers, no matter it's signed or unsigned.

Besides, LoongArch64 also has this feature, and a similar change
has been made before loong64 port's land in V8. This CL also make
a small fix for loong64.

Change-Id: Ib284662931082365f727925af61781e3653debc8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3193595
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Liu yu <liuyu@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#77154}
2021-09-30 07:53:06 +00:00
v8-ci-autoroll-builder
6e6385a06a Update V8 DEPS.
Rolling v8/build: ecb990f..28fa03f

Rolling v8/buildtools/third_party/libc++abi/trunk: 50e90b8..31a3660

Rolling v8/third_party/aemu-linux-x64: e_KiIcYNB7sHa2eqRBhqVoR_Mmg2Q7nqmzRCXzegWQAC..pE8RqfOzLp5AXCDDOSrlKJ4MZInfuyxWzRSwdXBe1doC

Rolling v8/third_party/android_platform: 6e5dc9a..7a11b79

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/5afc365..01df326

Rolling v8/third_party/depot_tools: 764c927..9c24aed

Rolling v8/third_party/instrumented_libraries: eb740e9..0aa3fcf

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

Change-Id: If86099561baf7a927d6c5109790dad7b958208d0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3194881
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@{#77153}
2021-09-30 03:53:19 +00:00
Seth Brenith
267b067bad [torque] Get rid of @generatePrint annotation
I'm trying to remove annotations and make behavior more consistent. For
@generatePrint, there are two options: either generate printers for
every extern class, or never generate printers for extern classes. This
change implements the option of always generating printers. Classes that
require custom printing can easily hide the generated printer by using
DECL_PRINTER. This causes the generated file
gen/torque-generated/objects-printer.cc to grow to 1600 lines, including
many functions that are never used, but I think the consistency benefit
outweighs a little more compilation time on one file. This change also
removes custom printers in cases where the generated printer includes
all of the same content.

If folks would prefer the option to never generate printers, I'm open to
doing that instead. I like the notion that generating more code could
reduce the friction of adding new classes and thereby encourage people
to define precise types rather than using FixedArrays, but the current
implementation of generated printers is limited, and many printers have
been customized to show the data that matters the most. Unlike verifiers
and body descriptors, there are no correctness or safety concerns with
hand-written printers.

Some bugs showed up once we start generating printers for everything,
and this change fixes them:
- Printers incorrectly included ungettable fields like padding
- Printers called getters which might be hidden by hand-written classes
- The generated getter for Map::instance_type used
  ReadField<InstanceType>, which is not an arithmetic type since it's an
  enum

One more tiny drive-by fix: added a missing newline in the printers for
JSMap and JSSet.

Bug: v8:7793
Change-Id: Ib9e9575fbcb57879935ff18bf4db49fe276d2966
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3172190
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#77152}
2021-09-29 23:02:31 +00:00
Seth Brenith
d5625e3572 [torque] Remove unused field offset macros
Nobody uses the generated *_FIELDS macros anymore, so we can remove
them. I also renamed the generated file to represent its content better.

Bug: v8:7793
Change-Id: I49ab39e363d6961e7210cd67018b6fb83b65a162
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3192191
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#77151}
2021-09-29 22:27:35 +00:00
Junliang Yan
5a505fc0bf ppc/s390: [liftoff][arm] Add explicit stack check for large frames
Port edc349dbf5

Bug: v8:11235
Change-Id: I53538b1a18d778c4580683d300bc380ee1041c40
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3194874
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77150}
2021-09-29 21:00:20 +00:00
Clemens Backes
4b6ee11532 [asm] Fix importing monkey-patched objects
This fixes a long-standing TODO to disallow importing receivers that
have "toString" or "valueOf" patched. Calling those methods could have
observable side effects, so allowing that would require bigger
refactorings to ensure that we only call each such function exactly once
per import, and in the right order.
Since this use case is rare, we just forbid importing such receivers.

R=jkummerow@chromium.org

Bug: chromium:1248677
Change-Id: I99bbd7db950ec3c7ac9cc1f59e8c476688e7d7b6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3190475
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77149}
2021-09-29 18:19:30 +00:00
Junliang Yan
3600aabf73 ppc: [liftoff] implement AtomicExch and AtomicCmpExch
Change-Id: Ida66b9c42cfb9bd5b59a83188a2dfa0d602d4036
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3192427
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77148}
2021-09-29 18:11:30 +00:00
Milad Fa
7245d2c1fa PPC/s390: Create Instance Type for Class Constructors
Port: 1cd7a58223

Original Commit Message:

Class Constructors are special, because they are callable but [[Call]]
raises an exception. Instead of checking if a JS function is a class
constructor for every JS function call, this CL adds a new instance
type for class constructors.
This way we can use a fast instance type range check for the common
case, and only check for class constructors in the uncommon case were
a class constructor is called and when we need to raise an exception.

Change-Id: I578fde90d00d1e80cf36ba28205ce9bfe6830afb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3192422
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77147}
2021-09-29 18:08:57 +00:00
Maya Lekova
8679a4e1a2 Revert "[torque] Get rid of @noVerifier annotation"
This reverts commit 9495817296.

Reason for revert: Breaks arm/arm64 ports, e.g. https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux%20-%20arm64%20-%20sim/30120/blamelist

Original change's description:
> [torque] Get rid of @noVerifier annotation
>
> As one small step toward reducing annotations, I propose that all
> classes get generated verifiers unless they've opted out of C++ class
> generation via @doNotGenerateCppClass, and that generated verifiers
> always verify every Torque-defined field. If a generated verifier is
> incorrect, such as for JSFunction or DataHandler, we can just avoid
> calling it and hand-code the verification.
>
> Bug: v8:7793
> Change-Id: I7c0edb660574d0c688a59c7e90c41ee7ad464b42
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3171758
> Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
> Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#77145}

Bug: v8:7793
Change-Id: I56da8a9726d23470e927be1be5e7bcede1399861
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3194262
Auto-Submit: Maya Lekova <mslekova@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Owners-Override: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#77146}
2021-09-29 17:09:42 +00:00
Seth Brenith
9495817296 [torque] Get rid of @noVerifier annotation
As one small step toward reducing annotations, I propose that all
classes get generated verifiers unless they've opted out of C++ class
generation via @doNotGenerateCppClass, and that generated verifiers
always verify every Torque-defined field. If a generated verifier is
incorrect, such as for JSFunction or DataHandler, we can just avoid
calling it and hand-code the verification.

Bug: v8:7793
Change-Id: I7c0edb660574d0c688a59c7e90c41ee7ad464b42
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3171758
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#77145}
2021-09-29 16:59:00 +00:00
Omer Katz
a43fe7ffd0 Reland "cppgc: Inline allocation fast path across api boundary"
This is a reland of e47f920071

Relanding for clang only.
GCC and MSVC will not inline.

Original change's description:
> cppgc: Inline allocation fast path across api boundary
>
> Bug: chromium:1239030, chromium:1056170
> Change-Id: I4a559027e63ebbd99e51344aa659d4fb284df88f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3190094
> Commit-Queue: Omer Katz <omerkatz@chromium.org>
> Reviewed-by: Anton Bikineev <bikineev@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#77124}

Bug: chromium:1239030, chromium:1056170
Change-Id: Iaa52118ea0e6ccd78f5e7818fa30ed163906da83
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3191211
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77144}
2021-09-29 16:05:07 +00:00
Omer Katz
f001bfd787 Reland "Reland "Reland "cppgc: Enable checks for assignments in prefinalizers"""
This is a reland of 2db5067031

crrev.com/c/3182223 resolves all known issues (and should prevent
additional issues in the future).

Original change's description:
> Reland "Reland "cppgc: Enable checks for assignments in prefinalizers""
>
> This is a reland of adb6276f4a
>
> Causes for previous revert was addressed by crbug.com/3140387 and
> crbug.com/3163579.
>
> Original change's description:
> > Reland "cppgc: Enable checks for assignments in prefinalizers"
> >
> > This is a reland of edcc8ff5b5
> >
> > Cause for previous revert was addressed by crbug.com/1241773.
> >
> > Original change's description:
> > > cppgc: Enable checks for assignments in prefinalizers
> > >
> > > Bug: v8:11749
> > > Change-Id: Ic027f732030fb6a2befeffeca9db2eacfd0830a5
> > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3099953
> > > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> > > Commit-Queue: Omer Katz <omerkatz@chromium.org>
> > > Cr-Commit-Position: refs/heads/main@{#76370}
> >
> > Bug: v8:11749
> > Change-Id: I57fc138ace002d41e54f7f70250e4d19bc9262b0
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3122153
> > Auto-Submit: Omer Katz <omerkatz@chromium.org>
> > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> > Commit-Queue: Omer Katz <omerkatz@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#76553}
>
> Bug: v8:11749
> Change-Id: I138ca374314108f0f23e234a8fd90d15d912120d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3168280
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Omer Katz <omerkatz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#76971}

Bug: v8:11749
Change-Id: I8bf48cecde910e74f40cf0cd6aa8a5ed19de1584
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3182224
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77143}
2021-09-29 16:02:17 +00:00
Al Muthanna Athamina
010d43d2de [infra] Make no-fail the default for numfuzz builders
Remove infra-staging from numfuzz builders and add
no-fail instead. Also remove the staging builders.

Bug: v8:11826
Cq-Include-Trybots: luci.v8.try:v8_numfuzz_dbg_ng,v8_numfuzz_ng,v8_numfuzz_tsan_ng
Change-Id: Icd7bc6275b5c78e38f0e75b5d133b3b7056f333e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3182233
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77142}
2021-09-29 15:23:56 +00:00
Junliang Yan
51ebc66349 ppc: [liftoff] implement atomic ops
Change-Id: I23f5a67a347c586fb26b99fd71fca8ea03cd83a4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3194258
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77141}
2021-09-29 14:43:01 +00:00
Patrick Thier
1cd7a58223 Create Instance Type for Class Constructors
Class Constructors are special, because they are callable but [[Call]]
raises an exception. Instead of checking if a JS function is a class
constructor for every JS function call, this CL adds a new instance
type for class constructors.
This way we can use a fast instance type range check for the common
case, and only check for class constructors in the uncommon case were
a class constructor is called and when we need to raise an exception.

Change-Id: Ic6fdd9829722d05559fdfd01f6100c61873a0872
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3186434
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77140}
2021-09-29 13:49:05 +00:00
Michael Lippautz
e57ec7aef3 cppgc: Delay CrossThreadPersistent processing
During a final atomic pause CrossThreadPersistent handles need to be
frozen after they have been marked to avoid any
WeakCrossThreadPersistent handles creating new strong references
(through their Lock() call) that would retain objects.

Handles are frozen by acquiring a lock. Since this lock is also taking
by other threads on WCTP::Lock() this can introduce jank.

This CL improves the situation by delaying processing of CTP
references until absolutely necessary, i.e., when we have otherwise no
more objects to mark.

Bug: chromium:1252743
Change-Id: I872f38c6d24d7955bea74fd59685abd3019b385e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3194253
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77139}
2021-09-29 12:11:15 +00:00
Jakob Gruber
77906a700c [regexp] Hide the generic JSRegExp::DataAt/SetDataAt accessors
.. and refactor js-regexp.h.

- Hide the generic DataAt/SetDataAt accessors and replace them by
  dedicated accessors. Use the common lower_case naming scheme for
  these.
- Shuffle around definitions in js-regexp.h s.t. they are in a
  meaningful order.
- Dedupe the source/flags accessors - these fields are stored both
  on the instance and on the data array. We keep only accessors for
  the instance. Previously, these were disambiguated through naming
  oddities (e.g. Pattern() returned data->source).

Change-Id: I3d53c8b095f0d59621ff779608438f7fa5e8c92a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3193534
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77138}
2021-09-29 11:37:41 +00:00