Commit Graph

77958 Commits

Author SHA1 Message Date
Igor Sheludko
cd505b3258 Revert "[runtime] Invalidate XxxIteratorLookupChain protectors"
This reverts commit 178148045f.

Reason for revert: regresses JetStream2 a lot.

Original change's description:
> [runtime] Invalidate XxxIteratorLookupChain protectors
>
> ... when "return" property is added to respective iterator or might be
> added somewhere up the prototype chain.
>
> According to the iterator protocol the "return" callback must be
> called when iteration is aborted in the middle.
>
> Bug: chromium:1357318
> Change-Id: I36d81b90cfd40e417136ab97ec53ad7054f4df77
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3916630
> Reviewed-by: Marja Hölttä <marja@chromium.org>
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#83427}

Bug: chromium:1357318, chromium:1368400, v8:13335
Change-Id: I8b14a2c47819a89d9b2c869a7bcb52e2c2457427
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3925199
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83466}
2022-09-28 09:20:44 +00:00
jameslahm
031b98b25c [runtime] Clear array join stack when throwing uncatchable
... exception.

Array#join depends array_join_stack to avoid infinite loop
and ensures symmetric pushes/pops through catch blocks to
correctly maintain the elements in the join stack.
However, the stack does not pop the elements and leaves in
an invalid state when throwing the uncatchable termination
exception. And the invalid join stack state will affect
subsequent Array#join calls. Because all the terminate
exception will be handled by Isolate::UnwindAndFindHandler,
we could clear the array join stack when unwinding the terminate
exception.

Bug: v8:13259
Change-Id: I23823e823c5fe0b089528c5cf654864cea78ebeb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3878451
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#83465}
2022-09-28 07:40:55 +00:00
jameslahm
7f5daed62d [symbol-as-weakmap-key] Add tests to check weak collection size
... after gc.

This CL also adds a runtime test function GetWeakCollectionSize
to get the weak collection size.

Bug: v8:12947
Change-Id: I4aff39165a54b63b3d690bfea71c2a439da01d00
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3905071
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#83464}
2022-09-28 07:20:24 +00:00
v8-ci-autoroll-builder
320edbee82 Update V8 DEPS (trusted)
Rolling v8/build: d344836..4f7a8d7

Rolling v8/buildtools: 7fca26a..f9d0f84

Rolling v8/buildtools/third_party/libc++/trunk: c23f69f..71619e7

Rolling v8/third_party/zlib: 8f22e90..cbb6b98

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

Change-Id: I9db8099c4b5766deb080f93e8af8498f38d7109f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3923757
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@{#83463}
2022-09-28 04:06:35 +00:00
Hao Xu
a8dc9ed235 [compiler] Fix left shift of negative value
Bug: chromium:1367589
Change-Id: I1ea095bdb58c35366188e09afd5f7169b77b0667
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3921058
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Hao A Xu <hao.a.xu@intel.com>
Cr-Commit-Position: refs/heads/main@{#83462}
2022-09-28 01:37:35 +00:00
Milad Fa
c3b18c6fb4 PPC [liftoff]: implement simd add/sub saturate ops
Change-Id: Ie3d70edf787048982f20dce1725fbfe4611b8936
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3918711
Reviewed-by: Milad Farazmand <mfarazma@redhat.com>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#83461}
2022-09-27 20:54:34 +00:00
Frank Tang
de1d7b33d6 [Temporal] Clean up parser
Remove unused parser function/rule
ParseTemporalTimeZoneString and ParseTemporalCalendarString
were obsoleted by PR 2385 and 2394
in https://chromium-review.googlesource.com/c/v8/v8/+/3893552
https://chromium-review.googlesource.com/c/v8/v8/+/3901196

This cl is purely unused code removal.

Bug: v8:11544
Change-Id: Ib7ff4a3860cffa09afe7c7f6866f8dc526273f34
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3917039
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83460}
2022-09-27 20:38:54 +00:00
Timo Teräs
0c1457ea28 Add postmortem metadata to access inlining info
Bug: v8:13306
Change-Id: I7c1ead9b60bae79f38535b982e7c49593d14fd15
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3902524
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83459}
2022-09-27 19:39:04 +00:00
Pierre Langlois
aee072cbc3 [arm64] Enable CFI by default on Android and Linux.
The `v8_control_flow_integrity` build flag was already on by default in
Chromium on those platforms, by depending on
`arm_control_flow_integrity`. We should also turn it on by default when
building V8 standalone.

Co-authored-by: Richard Townsend <richard.townsend@arm.com>

Bug: v8:10026, v8:12963
Change-Id: I361a6426f44e569c08c763cf84a687ca70b89f08
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3829068
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Cr-Commit-Position: refs/heads/main@{#83458}
2022-09-27 16:15:34 +00:00
Matthias Liedtke
e002faf111 [wasm-gc] Function body decoder: Fix dcheck in case of local with invalid heap type
Bug: v8:7748
Change-Id: I9d3e2245db4d98d370291ea86d615b355f2c941a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3921518
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83457}
2022-09-27 15:07:34 +00:00
Dominik Inführ
0582087685 [heap] Request GC using Heap::CollectGarbageShared
This CL moves the code for requesting a GC from a non-main thread from
LocalHeap to Heap into CollectGarbageBackground().

The CL then makes use of this method in CollectGarbageShared() to
request a GC with --shared-space.

Bug: v8:13267
Change-Id: I2946cf5068ef8eb9eb99f9d396ac466d68abc7ec
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3916634
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83456}
2022-09-27 14:58:36 +00:00
Benedikt Meurer
c45a214cb5 [debug] Remove confusing destructuring statement positions.
This change removes the confusing statement positions that were
previously emitted for every binding identifier within both array
and object destructurings. These statement positions were reported as
breakable positions to the debugger front-end, and during stepping, the
debugger would also stop on them. This is confusing and very different
from how other expressions work (we don't emit statement positions
within expressions normally).

Instead we emit expression positions for the binding identifiers, which
are used to construct the source positions for stack traces. As a drive
by we also add the missing position (and test cases) for sub-patterns.

In particular this aligns the stepping and breakpoint behavior around
destructuring expressions with that of Firefox DevTools.

We also remove the original test cases, introduced with
https://codereview.chromium.org/1542813003 and
https://codereview.chromium.org/1533313002, which were written as
debugger tests, with new inspector tests that also ensure that the
call positions are correct.

Fixed: chromium:1368444
Bug: v8:811
Doc: http://go/chrome-devtools:destructuring-breakpoints-design
Change-Id: I4d53ad059b5eede73abd01d9bc9fdf8263c55c9d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3916453
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83455}
2022-09-27 14:19:24 +00:00
Leszek Swirski
54e5675478 [maglev] Initialise known node aspects with Clone
Fix a bug where merge point known_node_aspects was initialised with
empty aspects instead of a clone of the current state.

Bug: v8:7700
Change-Id: Ibdde32197873b4c04e5884dd55f90ead4c1199e6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3921519
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83454}
2022-09-27 14:06:34 +00:00
Dominik Inführ
24a6f3fc4d [heap] Add compaction space for shared space
Compacting pages in the shared space during Full GC requires a
corresponding shared space.

Bug: v8:13267
Change-Id: I1952c6b907847220018e2255956cc405fb88d144
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3918271
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83453}
2022-09-27 13:49:53 +00:00
pthier
9211d5fe34 [regexp] v-Flag enables unicode mode in engine
When unicode sets (/v) are enabled, the regular expression is treated as
unicode, similar to /u.

Bug: v8:11935
Change-Id: I07dc617c1fcd9975ad5a3d226cec025c63489fd9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3918417
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83452}
2022-09-27 13:27:19 +00:00
pthier
afc4838a34 [regexp][cleanup] Remove property-sequences
Implementation of property sequences for regular expressions is unused
(likely since switching to icu).

Bug: v8:11935
Change-Id: Ic4cf6219de8d6eb99464292a20f637e1fd423341
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3920135
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Auto-Submit: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83451}
2022-09-27 10:52:43 +00:00
Jakob Linke
83d268a161 [maglev] Add a DebugBreak opcode
.. which can be inserted into the graph for easy int3 placement. Quite
often, this can be done in Foo::GenerateCode instead, but not always
(e.g. when multiple bytecode translate to the same Maglev opcode).

Bug: v8:7700
Change-Id: I6ffdf41f8dc4bd3c06e8323d33e92a5e6460de9f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3921394
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83450}
2022-09-27 10:41:23 +00:00
Simon Zünd
a39d7a15ce [debug] Handle null outer ScopeInfo for locals block list cache
This CL changes LocalsBlockListCacheSet/Get to handle the case when we
don't have an outer ScopeInfo. Instead of writing undefined/null into
the tuple we skip using the tuple alltogether and store the block list
directly as the value of the map entry.

The only purpose of stashing the outer ScopeInfo together with the
block list is to keep all the block lists of outer scopes alive as
well.

Doc: https://bit.ly/chrome-devtools-debug-evaluate-design
Bug: chromium:1363561
Change-Id: Ic8039072d62c1a99e23537d4702f1cd21d956121
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3920133
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83449}
2022-09-27 09:46:03 +00:00
Lu Yahan
bdd1e640b9 [riscv] Fix not calling vsetvli to set vtype correctly after branch
Add VectorUnit clear in branch link and block start.

Bug: v8:13305
Change-Id: Ibe6fa03183d7fc21cde78c87db9f2550e8e88562
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3917324
Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#83448}
2022-09-27 09:24:13 +00:00
Simon Zünd
e5fb9841fe [debug] Add new experimental flag for re-using locals block lists
Besides adding the flag, the CL also changes debug-evaluate to collect
the existing block lists only if the flag is not enabled.

R=jarin@chromium.org

Doc: https://bit.ly/chrome-devtools-debug-evaluate-design
Bug: chromium:1363561
Change-Id: I225913908e97b0b662ae97c0ae7c27c69496805a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3918273
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83447}
2022-09-27 09:18:24 +00:00
Leszek Swirski
43218eb92d [turbofan] Port Array#push to GraphAssembler
A clean-up of Array#push which uses GraphAssembler; otherwise no
functional changes.

Change-Id: Ie655c4360ace6def3e3282b4dbfdaa8c7fdc763e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913350
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83446}
2022-09-27 08:44:43 +00:00
Al Muthanna Athamina
8c943bdbd8 [infra] Skip mjsunit/harmony/regress/regress-crbug-1367133 on the interrupt fuzzer as well
Bug: v8:13331
No-Try: true
Change-Id: Ib6869b72c26a7a339e39749024f4f4e7d4105e84
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3918378
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
Auto-Submit: Almothana Athamneh <almuthanna@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83445}
2022-09-27 08:00:13 +00:00
Dominik Inführ
0ff080d1f7 [heap] Enable map space compaction and disable map space by default
Bug: v8:12578
Change-Id: If6a2cd9cf950e395bff9f7a36ac8300f9091f27a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3918496
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83444}
2022-09-27 06:53:48 +00:00
Leszek Swirski
3b289d05d0 [maglev] Warm up NodeInfo with static knowledge
For constants and smi-tagging, we have some static knowledge of the node
type, so warm-up the NodeType of NodeInfo in the Build*Check helpers.
Similarly, don't emit map checks for constant nodes that have a known
stable map.

Bug: v8:7700
Change-Id: I36e4d3000cf2f4dc689e8a9ab612a88dd751cdb5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3918770
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83443}
2022-09-27 06:20:49 +00:00
v8-ci-autoroll-builder
0688729cbe Update V8 DEPS (trusted)
Rolling v8/build: f87b9ff..d344836

Rolling v8/buildtools: 15fa3e7..7fca26a

Rolling v8/buildtools/third_party/libc++/trunk: 4d2c483..c23f69f

Rolling v8/third_party/depot_tools: 08bb5c4..9ef048c

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

Change-Id: I4323b9f0ac5ee62084a5c9c56235244a7e169e98
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3919972
Bot-Commit: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#83442}
2022-09-27 03:57:17 +00:00
Shu-yu Guo
54c19d7e04 [change-array-by-copy] Support large arrays in toSpliced
Also drive-by adds a test for toSpliced on an empty array.

Bug: chromium:1367651, v8:12764
Change-Id: I59ff19ef73dd6c5ea972dc6f39f1968858099ef8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3919870
Commit-Queue: Adam Klein <adamk@chromium.org>
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83441}
2022-09-26 20:47:50 +00:00
Shu-yu Guo
6cd16f02cb [change-array-by-copy] Split out slow toReversed test
Bug: v8:13328, v8:12764
Change-Id: Idd079b6eaa7e47b0cbe57840e9cd185c2abfe7dd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913771
Reviewed-by: Adam Klein <adamk@chromium.org>
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83440}
2022-09-26 18:28:38 +00:00
Seth Brenith
890ee74ca7 Allow no-op background merges to complete
It is possible, though unlikely, that V8 will deserialize code cache
data, decide to merge that new data with an existing script from the
Isolate compilation cache, and subsequently do nothing in the background
portion of the merge (make no heap changes, and request no follow-up
changes on the main thread). In this case, the most optimal outcome is
to reuse the script from the Isolate compilation cache, not to use the
newly deserialized script.

CodeSerializer::FinishOffThreadDeserialize uses
BackgroundMergeTask::HasPendingForegroundWork to determine whether it
should complete the merge and use the Script from the compilation cache
or complete the deserialization and use the newly deserialized Script.
This change updates HasPendingForegroundWork so that it will return true
even if the merge was a no-op.

Bug: v8:12808
Change-Id: I08fcb814e797218e5be2b4ce4f45bd4e0637ec80
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3916270
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83439}
2022-09-26 17:03:28 +00:00
Leszek Swirski
7bf63faf9a [turbofan] Use receiver maps for Array#push reduction
The current Array#push reduction supports some amount of non-redundant
homogeneous from its receiver maps, and unifies polymorphism by
generating a push implementation per unique receiver elements kind,
rather than per receiver map. It does this by dynamically reading off
the receiver's elements kind, and branching on it.

Reading off the receiver's elements kind dynamically is a bit of a waste
though, since we already know the small subset of maps that are possible
at this point, and have probably emitted diamonds for checking those
maps which can't be merged with the dynamic elements kind lookup.

In this patch, this code is changed in two major ways:

  1. We perform comparisons on the receiver map, rather than the
     receiver elements kind, and dispatch to the per-elements kind
     implementation after that check.

  2. We allow the Smi path to fallthrough into the Object elements path,
     once its Smi checks complete, to avoid generating distinct but
     identical grow-and-set code for both PACKED_ELEMENTS and
     PACKED_SMI_ELEMENTS.

Change-Id: Ie7764339a0220cb30aee0592553e0dc98539ac79
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3912765
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83438}
2022-09-26 17:01:34 +00:00
Manos Koukoutos
798c51cdc7 [turboshaft] Split out ProtectedLoad and ProtectedStore
Those operators are not eliminable and need different properties than
the rest of loads/stores.

Bug: v8:12783
Change-Id: I7cd478fa827589612ca5d7628c628c09f3f4a3a8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3909361
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83437}
2022-09-26 16:18:22 +00:00
Leszek Swirski
3998577340 [printer] Robustify handler printing
Make Load/StoreHandler printing a bit more robust against unexpected
values, which we may have missed in the printing definition (or the
value is corrupt, or the caller of the print is passing the wrong value
in) -- for printing like this it's better to be able to not crash on
invalid state.

Change-Id: Ibf5c2064d6aac3da1ac6c19469fe31d5f761b6dc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3918710
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83436}
2022-09-26 16:06:18 +00:00
Matthias Liedtke
3ff531f50d [wasm-gc] Use experimental wasm GC flag for string <-> array conversions
This CL decouples the Wasm GC JS interop from the experimental
string <-> array conversions as the interop is now enabled by
default, still there are some issues discovered with the
conversions.
The functions are fixed via https://chromium-review.googlesource.com/c/v8/v8/+/3916633.

Bug: chromium:1366881
Change-Id: I27730523a51d24a7ea18199e1668e8c76f0bcb4d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3916088
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83435}
2022-09-26 15:53:48 +00:00
Jake Hughes
bf4d6b354f [handles] Add direct handles
This introduces a new DirectHandle class with a deliberately similar API
to Handle. It uses an API that uses identical method names for symmetry,
but with an address field containing a direct pointer to JS heap objects
(or SMI).

Direct handles are experimental and can be enabled with the
v8_enable_conservative_stack_scanning gn option. The motivation for them
is described in the design doc [1].

[1]: https://docs.google.com/document/d/1uRGYQM76vk1fc_aDqDH3pm2qhaJtnK2oyzeVng4cS6I/

Bug: v8:13270
Change-Id: I0a6e0581adb5fa3b420efec3ba2b6d609d945c52
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820483
Commit-Queue: Jake Hughes <jh@jakehughes.uk>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83434}
2022-09-26 15:39:58 +00:00
Adam Kallai
6037547c41 [woa] Fix the V8 build with clang-cl for Windows on ARM
This CL fixes the build with neon intrinsics using clang-cl.
Seems it doesn't need to apply MSVC workaround for uint32x4_t and uint64x2_t.

Bug: v8:13333
Change-Id: Ic053a5c344de492458f9da749d81808775491dcf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3916643
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83433}
2022-09-26 15:28:28 +00:00
Toon Verwaest
5e1ebeb9a5 [maglev] Revive resumable loops
It's possible the path into resumable loop looks dead, while the loop
body itself is resumable and is being optimized due to an active
generator running the loop. By reviving resumable loop headers we have a
chance to properly optimize such generators (and avoid deoptimizing them
prematurely).

Bug: v8:7700
Change-Id: Icf5dadba17a7fd38409193e1e3f702f108a5639e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3918093
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83432}
2022-09-26 15:09:49 +00:00
Milad Fa
2cda9fc676 PPC [liftoff]: Implement simd 8x16 population count
Drive-by: dtype and stype are removed from SIMD_UNOP_LIST,
toSimd() requires them to all be of type `fp`.

Change-Id: Ifdfe187e2b143fb8fa785c44344bea38ea7e10f8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3916553
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#83431}
2022-09-26 14:20:48 +00:00
Matthias Liedtke
4993fc1241 [wasm-gc] Change ref.cast_nop from 0xfb48 to 0xfb4c
ref.cast_nop is used for internal testing only.
0xfb48 will become ref.test null.

Bug: v8:7748
Change-Id: Iaee762dd97a993a361edddf656090210876178a2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913205
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83430}
2022-09-26 13:59:48 +00:00
Jakob Kummerow
1f89cb9309 [wasm] Make experimentalConvertArrayToString fuzzer-proof
Non-well-behaved test cases may pass too few arguments. The builtins
shouldn't attempt to inspect arguments that aren't there.
Not bothering with a regression test because these experimental
builtins are probably short-lived at this point anyway.

Fixed: chromium:1366881
Change-Id: Ifee8929c6a97539eac7609c64082d66cd53cec89
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3916633
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83429}
2022-09-26 13:58:38 +00:00
Leszek Swirski
fcefb02598 [printer] Add printing of StoreIC feedback slots
Change-Id: I947359645587f63fad4413e340177027e42812d0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3916642
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83428}
2022-09-26 13:55:38 +00:00
Igor Sheludko
178148045f [runtime] Invalidate XxxIteratorLookupChain protectors
... when "return" property is added to respective iterator or might be
added somewhere up the prototype chain.

According to the iterator protocol the "return" callback must be
called when iteration is aborted in the middle.

Bug: chromium:1357318
Change-Id: I36d81b90cfd40e417136ab97ec53ad7054f4df77
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3916630
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83427}
2022-09-26 13:50:28 +00:00
Marja Hölttä
8e72e03d1e [compiler] Omit calling default ctors
I.e., implement the TurboFan handler for the FindNonDefaultConstructor
bytecode.

Bug: v8:13091
Change-Id: I021b5d24817b47e3ce86cc1ac1377056cfd5e2a5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3885892
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83426}
2022-09-26 13:22:58 +00:00
Leszek Swirski
5a7977a3cf [maglev] Add trace events for maglev compilation
Similar to existing v8.compile trace events for Turbofan. Also, augment
both with flow events.

Bug: v8:7700
Change-Id: I1de96120ce1da98fe3ea1670b5f52cc7d65929cd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3918090
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83425}
2022-09-26 12:32:28 +00:00
Leszek Swirski
858602d8d9 [turbofan] Add dynamic sized GraphAssemblerLabels
The GraphAssemblerLabel VarCount template parameter now can have a
marker value ~0 which is marker for it being dynamic sized -- this means
that a bit of template magic turns its std::arrays into std::vectors.
Merging GraphAssemblerLabels works by duck-typing access to these
arrays/vectors.

These dynamic GraphAssemblerLabels are created whenever a single

GraphAssemblerLabels being created when instead a list of values
convertible to MachineRepresentation is passed in. Passing anything else
will result in a GraphAssemblerLabel with marker value ~1, which is
considered "invalid" and will give a compilation error down the line.

std: :vector is passed into MakeLabel, with the static
Change-Id: I833bdedac2f8e26fcc88aa59dd67b7e4b1c4296d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913349
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83424}
2022-09-26 11:58:58 +00:00
Al Muthanna Athamina
a3485e7c7c [infra] Skip mjsunit/harmony/regress/regress-crbug-1367133
Bug: v8:13331
No-Try: true
Change-Id: Id9fcee30d955f3668f8c2bfbb01757dbd5b54337
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3916641
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Auto-Submit: Almothana Athamneh <almuthanna@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83423}
2022-09-26 11:48:42 +00:00
Manos Koukoutos
cab9ad05dc [wasm] Documentation and small cleanups
Change-Id: Ia3ef956926b54add138936e3e7d03a0faa457ff9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913127
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83422}
2022-09-26 11:44:48 +00:00
Dominik Inführ
6eb9979620 [heap] Prepare MarkCompactCollector for shared space isolate
When performing full GC on a shared space isolate, the GC also needs
to visit OLD_TO_SHARED slots in client isolates and update pointers.

Bug: v8:13267
Change-Id: Ida48c666dce8f5ed703a6920ad007add9235d64a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913347
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83421}
2022-09-26 11:43:08 +00:00
Tobias Tebbi
d792c27353 [turboshaft] fix single-block loop bug
Bug: v8:12783
Change-Id: Ia4aaf245428dd63be09a33bfb684f0573f6b9296
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913084
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83420}
2022-09-26 11:31:28 +00:00
Qifan Pan
f21ae18515 [turbofan] Collect feedback for BigInt64 in addition
Collect feedback for BigInt64 in interpreter and change the runtime
for BigInt64 addition.

Bug: v8:9407
Change-Id: Ic69ba2c1f5ada998ac5ee3279e8296efe084d600
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3909809
Commit-Queue: Qifan Pan <panq@google.com>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83419}
2022-09-26 10:49:48 +00:00
Jakob Linke
8e50bdb89d [maglev] Implement function context specialization
See also Turbofan's JSContextSpecialization reducer.

For all context loads and stores, this CL implements:

1) depth reduction through graph walks (even without FCS)
2) conversion from the context node to a heap constant
3) if possible, conversion of a load of an immutable context slot load
   to a heap constant

Bug: v8:7700
Change-Id: Ie4d1acd0ff206f25dd5373a860d23b006a31dcee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3904914
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83418}
2022-09-26 10:46:48 +00:00
Samuel Groß
985aec3133 Revert "[sandbox] Improve the default ArrayBufferAllocator for the sandbox"
This reverts commit f08547afd4.

Reason for revert: Causes failures due to virtual address space
exhaustion inside the sandbox.

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: I3e3cc18c0e75cac586b7f014a75df1028bbfa86f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3916637
Commit-Queue: Samuel Groß <saelo@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83417}
2022-09-26 10:12:58 +00:00