Commit Graph

78920 Commits

Author SHA1 Message Date
Marja Hölttä
993d2ea282 [rab/gsab] Fix length reloading in TA.p.fill
Bug: v8:11111,chromium:1392577
Change-Id: I28c0559fdccdc97eefedbbcbffeefa895cddb9c4
Fixed: chromium:1392577
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4047206
Commit-Queue: Marja Hölttä <marja@chromium.org>
Auto-Submit: Marja Hölttä <marja@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84428}
2022-11-23 08:32:27 +00:00
v8-ci-autoroll-builder
6004eb86ae Update V8 DEPS (trusted)
Rolling v8/build: 81415f1..7df66e5

Rolling v8/buildtools: 09154d6..3c8fef0

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/c996ebb..cce68bc

Rolling v8/third_party/depot_tools: 30e3ce8..2fc7e1f

Rolling v8/third_party/fuchsia-sdk/sdk: version:10.20221121.3.1..version:10.20221122.0.1

Rolling v8/tools/clang: 77843ad..4f8bb52

Change-Id: I5c333ae5943fc238e61160381ae9f11bfa0fb1f9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4048421
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@{#84427}
2022-11-23 03:56:48 +00:00
sunhao
e6dd3058cc [loong64][mips64][regalloc] Resolve tail-call gap moves
Port commit 2f4397d652

Bug: chromium:1269989
Change-Id: I035fe0c5e09d30656fb45521bdbe62b53b70007c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4046381
Auto-Submit: 孙昊 <sunhao01@loongson.cn>
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#84426}
2022-11-23 02:58:28 +00:00
JialuZhang-intel
f3e6f4a63e Improve BranchElimination reducer for CSA code.
This CL checks the pattern that one branch node's condition comes from
a phi node with two constants inputs and try to eliminate the branch
and the phi nodes.

Bug: v8:13501
Change-Id: I657fc827172110414da64a9b457a6a6b9943fc78
Design-doc: https://docs.google.com/document/d/1XUxmV84BJ4ttx8Y0c3IQMQ373SfZDuiBtJtfi4iu5X8/edit?usp=sharing
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4032059
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Jialu Zhang <jialu.zhang@intel.com>
Cr-Commit-Position: refs/heads/main@{#84425}
2022-11-23 01:33:07 +00:00
pthier
733c76b95c Reland "[heap] Transition/Shortcut strings only during GCs without stack"
This is a reland of commit 7bf94d0336

Changes since revert:
- Update string forwarding table with evacuated objects in mark compact.
- Always mark forward objects in string forwarding table.

Original change's description:
> [heap] Transition/Shortcut strings only during GCs without stack
>
> By limiting transitions of (shared) strings and shortcutting of
> Thin/Cons strings to GC withouts stacks, optimizing compilers can rely on
> the invariant that string maps do not change during a GC, allowing them
> to eliminate map checks and enable more aggressive optimizations.
>
> Change-Id: Ic9c9ed7b04b2ceed369484bf048965c083a9a693
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4030578
> Commit-Queue: Patrick Thier <pthier@chromium.org>
> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#84347}

Change-Id: I1ab0965ff421635457a66fbe7f178d951afe4402
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4035240
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84424}
2022-11-22 16:37:57 +00:00
Samuel Groß
f7260c5e14 Reland "Reland "[sandbox] Improve the default ArrayBufferAllocator for the sandbox""
This is a reland of commit dc91addeef

https://crrev.com/c/4042290 has fixed an issue with the sandbox
initialization on Windows which would lead to less available address
space in the sandbox. This reland further allows for a smaller backing
memory region for the ArrayBufferAllocator. Together, this should
guarantee that backing memory can always be allocated.

Original change's description:
> Reland "[sandbox] Improve the default ArrayBufferAllocator for the sandbox"
>
> This is a reland of commit f08547afd4
>
> All ArrayBufferAllocators now share a backend allocator which owns the
> backing memory. This fixes the address space exchaustion issues.
>
> Original change's description:
> > [sandbox] Improve the default ArrayBufferAllocator for the sandbox
> >
> > Rather than using a page allocator and rounding all allocation request
> > sizes up to the next multiple of the OS page size, we now use a
> > base::RegionAllocator with a "page size" of 128 as a compromise between
> > the number of regions it needs to manage and the amount of wasted memory
> > due to allocations being rounded up to a multiple of that page size.
> > While this is still not as performant as a "real" allocator, it does
> > noticeably improve performance when allocating lots of ArrayBuffers.
> >
> > Bug: chromium:1340224
> > Change-Id: I56d1ab066ba55710864bdad048fb620078b2d8c2
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913346
> > Commit-Queue: Samuel Groß <saelo@chromium.org>
> > Reviewed-by: Igor Sheludko <ishell@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#83396}
>
> Bug: chromium:1340224
> Change-Id: Ia52eeb695ad89cc6146807fda040281ac5fdaf59
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3916640
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Commit-Queue: Samuel Groß <saelo@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#83502}

Bug: chromium:1340224
Change-Id: I196c66012e1c8418797d46c01fb7a3be4bcf7c0e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4038262
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84423}
2022-11-22 16:14:47 +00:00
Samuel Groß
160684a0c3 [sandbox] Reserve the last page in the sandbox
We now reserve the last page of the sandbox address space and make it
inaccessible. This ensures that any accidental access to e.g. the
EmptyBackingStoreBuffer constant will crash with an access violation.
Further, it also fixes an edge case scenario where the construction of
e.g. a DataView could lead to an invalid SandboxedPointer: if an
ArrayBuffer is located right at then end of the sandbox, constructing a
view onto it with offset=buffer.byteLength will lead to a pointer that
points just outside of the sandbox, causing a CHECK failure.

Bug: v8:1385733
Change-Id: I3fa68c0779d2c02511ff1dbbb07b79451b6cb206
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4034205
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84422}
2022-11-22 16:10:18 +00:00
Camillo Bruni
ea6a160753 [compiler] Expose more detailed script types with --log-function-events
Expose more detailed script event types:
- streaming vs non-streaming
- background vs foreground

Change-Id: Iebbe891f5526cbf6ae8eaad4fbafe07fcf5a6e3a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4031053
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84421}
2022-11-22 12:05:35 +00:00
Andreas Haas
80981c27ee [wasm] Update spec tests
R=mliedtke@chromium.org

Change-Id: I45cb5a15e3efadb7ee9afa879590e89b5e275a49
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042244
Reviewed-by: Matthias Liedtke <mliedtke@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84420}
2022-11-22 12:00:15 +00:00
Manos Koukoutos
dbe5434a36 [wasm] Use size over capacity for types OOB checks
This fixes a bug where the {types} vector automatically reserved
additional space, and by comparing with its capacity we failed to
register an out-of-bounds error.
Using capacity over size has led to bugs before, and using it correctly
(reserving as much space as needed manually) prevents vectors from
reserving space exponentially. Therefore we are switching to using size
for bounds checks instead.

Bug: v8:7748, chromium:1388942
Change-Id: I3cb8de4f113aaa6d70e45557161fd4c268861f1f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4046221
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84419}
2022-11-22 11:47:27 +00:00
Al Muthanna Athamina
858e87894a [infra] Removing redundant sandbox setting since it is on by default
Bug: v8:13058
Change-Id: Ifb7e9621b59dfae0f34857f944abd3881fe9fad2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042541
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84418}
2022-11-22 10:35:40 +00:00
Andreas Haas
4c3e4e1109 [wasm] Add flag to allow more functions in a module
There exists a limit in the WebAssembly specification on the maximum
number of functions allowed in a module. For release builds the limit
seems high enough for now, but we got developer feedback that their
debug builds exceed this limit. To support these developers without
violating the specification this CL introduces a V8 flag that allows
to specify a custom limit. Developers can then increase this limit
locally for their debugging sessions.

R=clemensb@chromium.org

Bug: chromium:1380561
Change-Id: Ie65a47d49e9ca1d8b05617df0f46c187afef06e6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4027963
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84417}
2022-11-22 10:34:35 +00:00
Victor Gomes
5007e30e96 [bazel] Add hide symbols from release build
This is a reland of https://chromium-review.googlesource.com/c/v8/v8/+/3925698

Change-Id: Ic3f2084f29088fc2154931181da2b027b8ad7eff
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042292
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84416}
2022-11-22 10:00:46 +00:00
Lu Yahan
8757293d7e [riscv] Optimize ComputeCodeStartAddress func
We can only use auipc + add instr to get pc address.

Change-Id: I44d7dd1798c94d672bf506658c82c80de601a4af
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4039240
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@{#84415}
2022-11-22 08:13:25 +00:00
Dominik Inführ
f76262d87a [heap] Allow shared objects in global/traced handles
Global/traced handles are only ever used with two callbacks:
 * MarkCompactCollector::IsUnmarkedHeapObject
 * IsUnscavengedHeapObjectSlot

IsUnscavengedHeapObjectSlot already works with shared heap objects
because it only applies to objects in the young generation.

This CL fixes MarkCompactCollector::IsUnmarkedHeapObject with shared
heap objects. E.g. a local GC isn't allowed to load markbits for
shared objects.

Bug: v8:13267
Change-Id: Id0fb9ed73409e384eed4c7168100a1bf40a06f94
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4044362
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84414}
2022-11-22 08:06:45 +00:00
Igor Sheludko
00c7e383a8 [ptr-compr] Store cage bases in globals when cage sharing is enabled
... instead of computing them on the fly. This approach seems to
perform slightly better because it requires less code.

Bug: v8:7703, v8:11460
Change-Id: If31a06fbc748251c491c011e9e3f118665e20159
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4020456
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84413}
2022-11-22 08:00:16 +00:00
Dominik Inführ
5e07bb70e5 [heap] Enable shared heap flags on more fuzzers
Enable --shared-string-table and --struct-harmony on more fuzzers.

Bug: v8:13267
Change-Id: Iedea33f5c06563aac4d0f0d0eb880f7ee6208d9f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4043902
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84412}
2022-11-22 07:00:09 +00:00
Dominik Inführ
ca4d930a93 [heap] Start to fuzz shared heap flags
Enable --shared-string-table and --struct-harmony for fuzzing.

Bug: v8:13267
Change-Id: I8bf196138c5b86e1e24abcf5be2f844c406c09ce
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4044361
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84411}
2022-11-22 06:59:05 +00:00
Andrey Kosyakov
b908eb3fd2 Revert "[inspector] Pass the Context into terminateExecution"
This reverts commit 8016f5c667.

Reason for revert: Causes https://crbug.com/v8/13521 (Cannot create a handle without a HandleScope (v8::HandleScope::CreateHandle())

Original change's description:
> [inspector] Pass the Context into terminateExecution
>
> Adding and removing the MicrotasksCompletedCallback should be
> associated with the microtask queue of the Context. We store the
> context as WeakPtr and always remove the callback when it completes
> regardless of the state of the debugger.
>
> BUG=v8:13450
>
> Change-Id: I40d623b05952575febfb76accc15512a38d14ab9
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4004602
> Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
> Reviewed-by: Simon Zünd <szuend@chromium.org>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#84302}

Bug: v8:13521, v8:13450
Change-Id: Id772d192833e7adba7f4f80c28c437c336f792d2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4043829
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84410}
2022-11-22 05:22:45 +00:00
v8-ci-autoroll-builder
a608436b48 Update V8 DEPS (trusted)
Rolling v8/build: bd89361..81415f1

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/b898eb3..c996ebb

Rolling v8/third_party/depot_tools: d06e475..30e3ce8

Rolling v8/third_party/fuchsia-sdk/sdk: version:10.20221117.0.1..version:10.20221121.3.1

Rolling v8/tools/clang: ed5ed0e..77843ad

Change-Id: I8d35b14fcc7b43ddb4fb7620fcddbc92f3e23f2c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4044937
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@{#84409}
2022-11-22 04:14:25 +00:00
Shu-yu Guo
bd5b3ae542 [shared-struct] Store length per-SharedArray instance
With shared space (instead of the shared isolate), the AccessorInfo
implementation of SharedArray's length property is no longer threadsafe.
Until AccessorInfos can be put into shared or RO space, go back to
storing the length field as a per-instance in-object field, which is
unfrotunately a little wasteful.

Bug: v8:12547
Change-Id: I99c1cbf26047da48a4b4c11e14ab7def7d4e4f60
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4039309
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84408}
2022-11-21 22:14:15 +00:00
Dominik Inführ
96b83b8160 [heap] Remove OLD_TO_SHARED slots when shrinking large objects
Clear OLD_TO_SHARED slots in free memory after shrinking large objects.
This CL now clear all slots outside of the object and not just from
the next OS page boundary.

Since we are already here also stop clearing OLD_TO_NEW and OLD_TO_OLD
since they should already be cleared at this stage of the GC. Add
DCHECKs that this always holds. We also don't need to iterate large
code objects since we do not shrink such pages anyway.

Bug: v8:13267, chromium:1385717
Change-Id: I75f6e56a7c13974ce669bbba29262e95eb94d287
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4037981
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84407}
2022-11-21 21:29:27 +00:00
Michael Lippautz
5b68765f7a [handles] More diagnosing CHECKs
Adding diagnosing CHECKs. Will be reverted after fixing issue.

Bug: chromium:1380114, v8:13372
Change-Id: I1d174b0a2b4ac5e090e54d70e70eb6ca0442f07e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042291
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84406}
2022-11-21 18:17:27 +00:00
Clemens Backes
65cf467f63 [wasm] Use parallelized validation during compilation
So far we parallelized the {WebAssembly.validate} function. After recent
refactorings, we can use the same parallelized logic for validing (only
lazy or all) functions during compilation.

R=ahaas@chromium.org

Bug: v8:13447
Change-Id: I38d48e1e48d83c8e63657abb7077aa8318cf94f3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4037269
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84405}
2022-11-21 18:07:57 +00:00
Samuel Groß
9a09d96873 [sandbox] Remove use of IsWindows8Point1OrGreater in initialization
From the documentation: "Applications not manifested for Windows 8.1 or
Windows 10 return false, even if the current operating system version is
Windows 8.1 or Windows 10". As such, the sandbox initialization logic
may incorrectly conclude that it is running on an older version of
Windows and fall back to a partially-reserved sandbox.
The check for the version is not really necessary: afterwards, we check
if we can create virtual memory subspaces, which will only be possible
on Windows if VirtualAlloc2 is available. That API is only available
since Windows 10, making the explicit version check redundant.

Bug: chromium:1368009
Change-Id: Id877dcfd6e384c6af94b571f37e70a115ead8dde
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042290
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84404}
2022-11-21 17:32:18 +00:00
Michael Achenbach
c9bdd23fb0 [gcmole] Separate call graph from suspects collector
This factors out a call graph from the suspects collector which in
a future CL can be serialized as a partial call graph and later
merged.

Bug: v8:12660
Change-Id: Ie6f682195a900ba0711b8f828c63bf41f142f2b1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4035131
Reviewed-by: Alexander Schulze <alexschulze@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84403}
2022-11-21 16:32:27 +00:00
Seth Brenith
1c90992ffc Merge with cached Script after streaming compilation
Currently, if a script is compiled on the main thread or deserialized on
any thread, and a matching Script object is found in the Isolate
compilation cache, the new content is merged into the existing Script.
This CL implements the same merging for scripts which were compiled by a
background task. I expect speed changes to be minimal, because merging
is only needed in a small minority of compilations. When needed, it
usually takes about 10% as long as the deserialization of the script,
which in turn is faster than compilation from source text.

This CL also removes some code which I added in preparation for merging
on a background thread in this case. Upon further discussion, we've
determined that the extra round trip to a background thread when the
main thread is likely just waiting for completion would do more harm
than good, and performing the compilation cache lookup from the
background thread would be quite cumbersome.

Bug: v8:12808
Change-Id: Ia7a14a739779ab658b505572d19df4ec489a078e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4023904
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84402}
2022-11-21 16:04:37 +00:00
Victor Gomes
7096e7a689 [bazel] Use copts -Wno-implicit-fallthrough
Upstream cl/489478120

Change-Id: Ia23ce5f7093bf0cdfff0b6a9c19828008e9bf040
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4041511
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84401}
2022-11-21 15:54:27 +00:00
Victor Gomes
fc1b4c83d4 [maglev] Fix condition check before string builtins
... by adding unsigned check conditions to
AssertCondition class.

Bug: v8:7700
Change-Id: I1b764720296483b56c7ce59878c371c254349186
Fixed: chromium:1385945
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042502
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84400}
2022-11-21 15:20:17 +00:00
Clemens Backes
e9639b550b [wasm] Use a consistent error message for validation failures
The validation paths during decoding and compilation should generate the
same error message. To achieve this, we move the {GetWasmErrorWithName}
function from the compiler to the decoder. As a drive-by, we replace the
{WasmFunction&} parameter by just an integer, because that is all we
need.

R=ahaas@chromium.org

Bug: v8:13447
Change-Id: I469dd871c7471c0f5af12c56e19b71be136557cd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4037268
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84399}
2022-11-21 14:43:57 +00:00
Thibaud Michaud
c0743da924 [wasm] Re-enable tail-call fuzzing
The gap resolver issue that this was blocked on is fixed now.

R=clemensb@chromium.org

Bug: chromium:1269989
Change-Id: I1aa4566190dd9705bf5688f5c551923f6273f93e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042243
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84398}
2022-11-21 14:34:07 +00:00
Matthias Liedtke
26831ff6c1 [wasm-gc] Fix ref.test / ref.cast null to none, nofuncref, noexternref
Bug: v8:7748
Change-Id: Ia2014dc93868a5712fc799abe4980c54848d2712
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042665
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84397}
2022-11-21 14:16:27 +00:00
Qifan Pan
2690e2e3a3 [turbofan] Support BigInt shift operations
This CL implements Torque builtins for BigInt left shift and right
shift and truncates shift operations when the shift amount is a
constant.

- Propagate truncation if we know the operation is a left shift.
- Lower the operation to a word64 right shift if the lhs is Signed- or
  UnsignedBigInt64 and we know the op is a right shift.

A side effect of truncating left shift is it will not throw a
BigIntTooBig exception in optimized code.

Bug: v8:9407
Change-Id: Ibd42cf897ef8a35f6addd09674faf409654d6d7c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4028142
Commit-Queue: Qifan Pan <panq@google.com>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84396}
2022-11-21 14:05:07 +00:00
Manos Koukoutos
ebe19d69a5 [wasm-gc] Exit early if type validation fails in element section
Otherwise we may pass an out-of-bounds type to {IsSubtypeOf}.

Bug: v8:7748, chromium:1388938
Change-Id: Ifcbf31c68da40d7b7a365c9d756cd5fa81347291
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4040930
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84395}
2022-11-21 13:59:27 +00:00
Milad Fa
3ecadd8184 PPC/s390: [regalloc] Resolve tail-call gap moves
Port 2f4397d652

Original Commit Message:

    Tail calls generate parallel moves that don't preserve the stack
    layout, which is not always correctly handled by the current
    gap resolver algorithm. Introduce a more robust algorithm that
    handles any parallel move.

    Design doc:
    https://docs.google.com/document/d/1WbX5B4ej9MzsJ28JS4J5cF2eiJhKyX39vAUB7GSA5YE/edit?usp=sharing

    Also remove the move-splitting logic. The problem that it addresses
    (swapping aliasing FP registers of different widths on arm) is already
    handled by the new algorithm.

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

Change-Id: I6122e9fa7543171eff91435de1804f3a788455f5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4035332
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#84394}
2022-11-21 13:45:47 +00:00
Clemens Backes
2be56a5b4c [wasm] Pass a filter function to {ValidateFunctions}
This will allow us to reuse the function for validation only lazy
functions.

R=ahaas@chromium.org

Bug: v8:13447
Change-Id: I853ec0a39a4f383391bd7e3556c16e84d11df553
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4037642
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84393}
2022-11-21 13:39:17 +00:00
Clemens Backes
14b59a4bfb [wasm][fuzzer] Use Liftoff as reference is wasm-gc is enabled
The interpreter does not implement WasmGC, hence always use Liftoff as
reference if WasmGC opcodes are enabled.

R=manoskouk@chromium.org

Bug: v8:13496, chromium:1387316
Change-Id: I29f496ebc1921c727c216dda763c1e9a63d6597b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042288
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84392}
2022-11-21 13:20:07 +00:00
Andreas Haas
98415ed67a [wasm] Add test exception for serialization test with multiple isolates
The test fails with multiple isolates because with the NativeModule
cache the second isolate can create an unexpected state for the first
isolate.

R=clemensb@chromium.org

Bug: v8:13503
Change-Id: Ic83d374c61703fdeb570b65b3c444ab0ae3cef8c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4040929
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84391}
2022-11-21 13:01:20 +00:00
Victor Gomes
5171527f11 [maglev] Fix debug-pos-offset in GeneratorStore
When creating the generator object, Ignition includes the
header object size.
The uses of debug-pos-offset, such as isolate.cc:AppendAsyncFrame,
expect that.

Bug: v8:7700
Change-Id: Idbe31802ac3ad6cbac7c5f7f7bd731132c358b61
Fixed: chromium:1387883
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042664
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84390}
2022-11-21 12:23:47 +00:00
Darius M
1d90a41cf2 [turboshaft] unpark scope when tracing reductions
Bug: v8:12783
Change-Id: I950c3a882c7a848d71f6ca5cd3da445b9c370823
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042662
Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84389}
2022-11-21 12:06:42 +00:00
Hao Xu
2c3b02cc91 [csa] Support Loop Unrolling
Allow CSA to build unrolled loop by CodeStubAssembler::BuildFastLoop.
Currently this optimization is only applied to small loop to avoid
increasing code size significantly.

Before:
=========================================
  LoopHeader
  LoopBody
  Branch(cond, LoopHeader, Exit)
  Exit
=========================================

After:
=========================================
  LoopHeader
  LoopBody1
  LoopBody2
  Branch(cond, LoopHeader, AfterLoop)
  AfterLoop
  GotoIfNot(iteration_count_is_odd, Exit)
  LoopBody3
  Exit
=========================================

Change-Id: Ic519b24a3e161260e73447a1367a2e160b427369
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4022363
Commit-Queue: Hao A Xu <hao.a.xu@intel.com>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84388}
2022-11-21 12:05:37 +00:00
Manos Koukoutos
6aeec9e513 [wasm-gc] Make expressions non-constant
Bug: chromium:1391736, v8:7748
Change-Id: I120bc5b8b95a599205760593dc1103d743b5dfa8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042283
Reviewed-by: Matthias Liedtke <mliedtke@chromium.org>
Auto-Submit: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84387}
2022-11-21 11:53:59 +00:00
Clemens Backes
7856857b56 [wasm][fuzzer] Implement default ref arguments
This adds an implementation for the {kRef} case in
{MakeDefaultArguments}.

R=jkummerow@chromium.org

Bug: v8:13496, chromium:1391168
Change-Id: I4c0e85b46c50f766816f799e80cf1afbe6fa258a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042663
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84386}
2022-11-21 11:52:56 +00:00
Leszek Swirski
821c385e1e Reland "[maglev] Support call speculation disabling"
This is a reland of commit 00db0fff8c

Fix missing update_feedback_count setting, and adding update feedback to
lazy deopt.

Original change's description:
> [maglev] Support call speculation disabling
>
> Add a FeedbackSource to DeoptInfo which allows the caller to specify
> that this deopt is part of call speculation, and that call speculation
> should be disabled for this call when the speculation fails. This is a
> mechanism to prevent deopt loops, also used by TurboFan.
>
> Bug: v8:7700
> Change-Id: I59b5db3956e074ec808b218c00ae85796455742e
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4030438
> Reviewed-by: Victor Gomes <victorgomes@chromium.org>
> Auto-Submit: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#84332}

Bug: v8:7700
Change-Id: I3dee2108495776d37417982ad593f6daa460919e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042661
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@{#84385}
2022-11-21 11:40:56 +00:00
Clemens Backes
a765588a42 [wasm] Make parallelized validation a separate function
Move the {ValidateAllFunctions} method out of the
{ModuleDecoderTemplate} and provide it as a separate function. This will
allow us to reuse it for validation during compilation.

R=ahaas@chromium.org

Bug: v8:13447
Change-Id: Ie72b5e0a531eecc298e515646320ad83a3f6b9ae
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4035979
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84384}
2022-11-21 11:09:16 +00:00
Darius M
00107cb412 [turboshaft] Disable BranchElimination
BranchElimination is currently broken in turboshaft, because when
duplicating a block that contains operations with multiple outputs
(OverflowCheckedBinop, Call, Change), if a Projection for this
Operation is in a later block, then the projection input won't be
alive, because we can't merge those operations with multiple outputs.

Fixing this will require re-thinking a bit how Call, CatchException
and CheckLazyDeopt work. For now, disabling BranchElimination is a
reasonable temporary solution.

Fixed: v8:13514, chromium:1391696, chromium:1386287
Change-Id: I71e8b6cc20701749e0c26638ac8c354393c8d426
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042543
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84383}
2022-11-21 10:54:17 +00:00
Clemens Backes
6aaab3291b [wasm] Clean up decoder constructor(s)
1) Pass {WasmFeatures} by value, it's a single word.
2) Pass a {base::Vector} instead of {start} and {end} pair.
3) Remove a redundant constructor (just pass an empty wire bytes vector
   instead).

R=thibaudm@chromium.org

Change-Id: I337c3c86960505ae23c88cb6adc5646a61111f76
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4030434
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84382}
2022-11-21 10:42:57 +00:00
Manos Koukoutos
ced7875a08 [wasm] Do not load-eliminate limit for stack checks
Change-Id: I2576e6b87d0de025cc91d37cea79e6e6f80909e0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042284
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84381}
2022-11-21 10:06:57 +00:00
Michael Achenbach
3afea88feb [gcmole] Make wrapper backwards-compatible to gcmole modes
In a follow up we want to introduce a mode for just collecting or
processing. In the infrastructure however, we still call the wrapper
script with old arguments on release branches. This ensures that
we stay backwards compatible.

Bug: v8:12660
Change-Id: I08da713719d10cb58c2cd5ea7f711570bd57572c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4035976
Reviewed-by: Alexander Schulze <alexschulze@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84380}
2022-11-21 09:45:04 +00:00
Camillo Bruni
f7196c26ca [tools] Fix helper.mjs
Add missing semicolon that broke code with the auto-formatter.

Change-Id: I2bb792bc5c676f82f27501aec49748c213000b6b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4042441
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84379}
2022-11-21 09:44:00 +00:00