Commit Graph

80201 Commits

Author SHA1 Message Date
Jakob Kummerow
702fdc02a2 Revert "[liftoff] Combine "InitMerge" with the actual merge"
This reverts commit 656c74218f.

Reason for revert: crbug.com/v8/13715

Original change's description:
> [liftoff] Combine "InitMerge" with the actual merge
>
> "InitMerge" did compute the state at the merge point, and a following
> "MergeStackWith" or "MergeFullStackWith" would then generate the code to
> merge the current state into the computed state.
> As every "InitMerge" is followed by an actual merge, we can combine the
> two and save one iteration over the two states.
>
> The only change in generated code is that we initialize the merge state
> after a one-armed if from the if-state instead of the else-state. This
> could potentially make the if-branch slightly cheaper and the
> else-branch slightly slower, but will not negatively impact overall code
> size.
>
> This CL should save roughly 2% of Liftoff compilation time.
>
> R=​dlehmann@chromium.org
>
> Bug: v8:13565, v8:13673
> Change-Id: Id323a15e7fd765727f46830509fbaf7f5498c229
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4203380
> Reviewed-by: Daniel Lehmann <dlehmann@chromium.org>
> Commit-Queue: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#85616}

Bug: v8:13565, v8:13673, v8:13715
Change-Id: I5342833aaa9c8665a514b3702eaf783d512dfa5f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4222633
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#85659}
2023-02-04 21:42:37 +00:00
Milad Fa
5275c1a407 s390: [ptrcomp] Remove the distinction of TaggedAny and TaggedPointer
Port 81aa89592b

Original Commit Message:

    Known-pointer decompression used to be distinct from any-tagged-value
    decompression, since the latter used to detect Smis and decompress them
    with sign extension. However, we got rid of this distinction when we
    introduced Smi-corrupting loads (allowing the top 32-bits of
    uncompressed Smis to be undefined), which means that the TaggedPointer
    and TaggedAny decompression is now identical.

    We can remove a bunch of duplicate code by removing this distinction.

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

Change-Id: Ib741905e09c929806cf3f584c356a4a5187df270
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4221514
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#85658}
2023-02-04 16:39:29 +00:00
v8-ci-autoroll-builder
e652f5a34a Update ICU (trusted)
Rolling v8/third_party/icu: 2c51e5c..266a469

On iOS do not use minimal ICU data when use_blink is set (Dave Tapuska)
https://chromium.googlesource.com/chromium/deps/icu/+/266a469

Revert "[config] Declare the args conditionally" (Filip Filmar)
https://chromium.googlesource.com/chromium/deps/icu/+/2cce76f

Revert "[fuchsia] Limit the visibility of ICU targets" (Filip Filmar)
https://chromium.googlesource.com/chromium/deps/icu/+/d8b44f9

Change-Id: If14dee279645be30fc9fa65d420af6379b3b187a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4219570
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@{#85657}
2023-02-04 04:25:17 +00:00
v8-ci-autoroll-builder
e940b92707 Update V8 DEPS (trusted)
Rolling v8/build: f7baf4b..d0fad16

Rolling v8/buildtools: 9ad5f9f..cf6f58c

Rolling v8/buildtools/third_party/libc++/trunk: bd44075..7a7a3a7

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/7b05da8..123a98b

Rolling v8/third_party/depot_tools: 79499cf..ef2d011

Change-Id: I52157d8daeaa7f2517a01456ed280c3cbdc7ef9a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4219568
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@{#85656}
2023-02-04 04:17:03 +00:00
Shu-yu Guo
d14d17300b [test262] Roll test262
f00d4118d..e7364ea7d

Bug: v8:7834
Change-Id: Ie10ed625cea9f11167f1a8808404339eb0e3d5cf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4219942
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85655}
2023-02-03 20:31:41 +00:00
Choongwoo Han
d5784303a1 [v8windbg] Fix curisolate() again
The last CL miscalculated the address of Isolate object. We should find the thread_local base address using `_tls_index_`. And, instead of calculating the address manually, all the location information is already available in `Location`. So, we can simply use the Location object to create a typed object.

Also, adding a testcase for `curisolate()` function.

Bug: v8:13394
Change-Id: I1da55bdf43a3b6100d141917eb97a1793939dca8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4220104
Reviewed-by: Seth Brenith <seth.brenith@microsoft.com>
Commit-Queue: Choongwoo Han <choongwoo.han@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#85654}
2023-02-03 20:04:07 +00:00
Omer Katz
f18065a3ca [heap] Fix bug in external strings table cleaning
After a MinorMC we iterate over the set of young external strings,
finalize the unmarked ones, and clear their slots.
Since MinorMC no longer updates the young string set (to avoid iterating
over the set during evacuation) it may now contain an old string.
If after promoting an external string from young to old,  we get another
MinorMC cycle before we get a full GC (that will "reset" the young and
old string sets), the next MinorMC cycle may treat the promoted string
as unreachable. This is because the string is in old space are is
therefore left unmarked.

Bug: chromium:1412669, v8:12612
Change-Id: I1cacc25b74d9d3dd221c0cc1f0d8b4c4eb83a04d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4219106
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85653}
2023-02-03 18:21:44 +00:00
Dave Tapuska
0253c3a979 [ios] Fix an additional build failure on iOS.
- Adjust an is_mac to is_apple

Bug: chromium:1411704
Change-Id: I2456f8b4f793b37f4b64782e8403dd4fc84b0807
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4221871
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85652}
2023-02-03 17:55:42 +00:00
Victor Gomes
8263a03f12 [maglev][inline] Fix always deopting inlined functions
Also creates a Result wrapper,

Bug: v8:7700
Change-Id: I6a78e9ae5ee2af60dae2e62ca0a876701890de78
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4218731
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85651}
2023-02-03 17:34:25 +00:00
Mikhail Khokhlov
051df31aec Reland "Reduce build size when building with Perfetto SDK"
This is a reland of commit 0d4200055b

gn complained about headers that are only included behind the
v8_use_perfetto build flag. Added "nogncheck" to suppress this
warning.

Original change's description:
> Reduce build size when building with Perfetto SDK
>
> Building Chromium with full Perfetto SDK included increases build time
> significantly. We can reduce this overhead by including only those
> parts that are required. See b/266913150 for context.
>
> Change-Id: I0cde5cb7df7b6151ec686e993488d8467c416fac
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4212390
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Commit-Queue: Mikhail Khokhlov <khokhlov@google.com>
> Cr-Commit-Position: refs/heads/main@{#85603}

Change-Id: Ifdcc9983230b5e7bab5f66a37f193d2cee698400
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4221573
Commit-Queue: Mikhail Khokhlov <khokhlov@google.com>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85650}
2023-02-03 17:03:11 +00:00
Nico Hartmann
79efc8f090 Revert "[wasm-gc] Introduce wasm null object"
This reverts commit 2e357c4814.

Reason for revert: Speculative revert for https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Clusterfuzz%20Linux%20MSAN%20no%20origins/33231/overview

Original change's description:
> [wasm-gc] Introduce wasm null object
>
> We introduce a wasm null object, separate from JS null. Its purpose is
> to support trapping null accesses for wasm objects.
> This will be achieved by allocating a large payload for it (larger than
> any wasm struct) and memory-protecting it (see linked CL). The two null
> objects get mapped to each other at the wasm-JS boundary.
> Since externref objects live on the JS side of the boundary,
> null-related instructions in wasm now need an additional type argument
> to handle the correct null object.
>
> Bug: v8:7748
> Change-Id: I06da00fcd279cc5376e69ab7858e3782f5b5081e
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4200639
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#85648}

Bug: v8:7748
Change-Id: Ie53febf49b946217e0057959c757d811a97ca1eb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4219105
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Nico Hartmann <nicohartmann@chromium.org>
Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85649}
2023-02-03 16:57:44 +00:00
Manos Koukoutos
2e357c4814 [wasm-gc] Introduce wasm null object
We introduce a wasm null object, separate from JS null. Its purpose is
to support trapping null accesses for wasm objects.
This will be achieved by allocating a large payload for it (larger than
any wasm struct) and memory-protecting it (see linked CL). The two null
objects get mapped to each other at the wasm-JS boundary.
Since externref objects live on the JS side of the boundary,
null-related instructions in wasm now need an additional type argument
to handle the correct null object.

Bug: v8:7748
Change-Id: I06da00fcd279cc5376e69ab7858e3782f5b5081e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4200639
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85648}
2023-02-03 16:06:12 +00:00
Leszek Swirski
81aa89592b [ptrcomp] Remove the distinction of TaggedAny and TaggedPointer
Known-pointer decompression used to be distinct from any-tagged-value
decompression, since the latter used to detect Smis and decompress them
with sign extension. However, we got rid of this distinction when we
introduced Smi-corrupting loads (allowing the top 32-bits of
uncompressed Smis to be undefined), which means that the TaggedPointer
and TaggedAny decompression is now identical.

We can remove a bunch of duplicate code by removing this distinction.

Change-Id: Id66671497d63ed885f9e537494c011317dfd4788
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4221398
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85647}
2023-02-03 15:46:34 +00:00
Jakob Kummerow
1c162c83b1 [turbofan] Fix types of reduced Int64Div/Uint64Div
When folding constants in the MachineOperatorReducer, we should be
careful that arithmetic instructions producing int64 outputs aren't
replaced with booleans represented as int32.

Fixed: chromium:1407384
Change-Id: Ib536a53084b12bbb205308c642ee32c0f2e1e418
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4219023
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85646}
2023-02-03 14:30:44 +00:00
Samuel Groß
65e87d962d Introduce --experimental
This flag, together with the DEFINE_EXPERIMENTAL_FEATURE macro, allows
declaring features as "experimental", implying that they are expected to
contain bugs and are not yet ready for fuzz testing for example.

Change-Id: I1288b6c2d28ef20d19d388bf56c57c44a25ba19b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4181025
Commit-Queue: Samuel Groß <saelo@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85645}
2023-02-03 13:44:03 +00:00
Thibaud Michaud
df0e9dca39 [test] Fix Handle dereference issue in move fuzzer (bis)
Another instance of:
https://chromium-review.googlesource.com/c/v8/v8/+/4066541

R=dmercadier@chromium.org
CC=machenbach@chromium.org

Bug: v8:13544
Change-Id: Id9046bf9c5ea09aff45b4531b5f1ad03307fd100
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4221571
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85644}
2023-02-03 12:36:40 +00:00
pthier
1885a16551 [test][inspector] Add inspector test for RegExp v-flag
Bug: v8:11935
Change-Id: Idf667b07398f3a740cc210ed52769199e9622e38
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4219017
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Auto-Submit: Patrick Thier <pthier@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85643}
2023-02-03 11:34:10 +00:00
Victor Gomes
49f1450b3f Reland "[maglev] Check for strings in polymorphic loads"
This is a reland of commit 7f4a04671a

- Add heap number check.
- Use object_map in range instance check.

Original change's description:
> [maglev] Check for strings in polymorphic loads
>
> Bug: v8:7700
> Change-Id: Id3d523446f5061a78a46d1c52cf8f8339566356d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4212402
> 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@{#85626}

Bug: v8:7700
Change-Id: I72cfe2e2bf19141dffbb8df5c34600eca4d70594
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4218508
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85642}
2023-02-03 11:07:54 +00:00
Clemens Backes
a6966097a0 [trap-handler] Rename ProbeMemory
The "ProbeMemory" functions starts showing up on stack traces for random
illegal memory accesses hit by the arm64 simulator (see e.g.
https://crbug.com/1408957 or https://crbug.com/1409124).
Thus specify an explicit symbol name that will make it easier to see
that this is a v8-internal symbol related to the simulator.

R=mseaborn@chromium.org

Change-Id: If5753170cfee399aa59b11cfcd82314589990192
Cq-Include-Trybots: luci.v8.try:v8_mac_arm64_sim_rel
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4200630
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Mark Seaborn <mseaborn@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85641}
2023-02-03 10:31:53 +00:00
Matthias Liedtke
8f93980acc [wasm-gc] Turbofan: Enable loop peeling if getCodeunit is called in loop
Loop peeling currently causes performance regressions in some cases.
To be able to gradually enable loop peeling in loops that would benefit
from it, as a first step loop peeling is enabled iff the loop contains
a PrepareStringForGetCodeUnit IR instruction.

Bug: v8:7748
Change-Id: I2c04101b9cd342e35a016e59da085cbb481bdbe1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4200642
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85640}
2023-02-03 10:21:36 +00:00
pthier
5080c7727a [regexp] Add UseCounter for invalid regexp with /v, but valid with /u
Some patterns that were valid with /u are invalid with /v.
This CL adds a UseCounter for such usages in /u to get an idea how often
they are used in the wild.
This is important information w.r.t the proposal to use /v instead of /u
for the pattern attribute (http://go/gh/whatwg/html/pull/7908).

Chromium CL: https://crrev.com/c/4221395

Bug: v8:11935
Change-Id: Idc023ceba9ce03eee578d6c387ce8a8f37db292f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4212393
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85639}
2023-02-03 09:49:49 +00:00
Clemens Backes
d3a3d73384 [wasm][test][cleanup] Use more base::Vector
The {CallWasmFunctionForTesting} function currently receives arguments
as a pair of {int} and {Handle<Object>*}. Encapsulating this as a
{base::Vector} makes the relation more clear and improves readability at
call sites.

R=ahaas@chromium.org

Change-Id: I884f8d0dc1c33389b60cc53750f2e3bfcaf644a5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4218353
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85638}
2023-02-03 09:37:34 +00:00
Leszek Swirski
2c9f7ac40d [maglev] Change PushDeferredCode to return a Label
Change PushDeferredCode into MakeDeferredCode, and have it return a
Label*. This allows it to be passed in directly to functions expecting a
Label, e.g.

    JumpToDeferredIf(cond, [](){...});

could be replaced by

    JumpIf(cond, MakeDeferredCode([](){...}));

and we don't need to add "ToDeferred" overloads for the other Jump
helpers (JumpIfSmi etc.).

Bug: v8:7700
Change-Id: I716468030601964fba828666fde6aa4f2ed29c3a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4218392
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85637}
2023-02-03 08:56:03 +00:00
Liu Yu
7b86d3c7ec [mips64] Remove duplicate BranchShortMSA
Change-Id: I134188f29f7f0d0a2e61fa2a95a8bf59bdc2e1ba
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4220973
Auto-Submit: Liu Yu <liuyu@loongson.cn>
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#85636}
2023-02-03 06:49:05 +00:00
v8-ci-autoroll-builder
bd65850167 Update V8 DEPS (trusted)
Rolling v8/build: d112664..f7baf4b

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/2d3ccea..7b05da8

Rolling v8/third_party/depot_tools: 8361a9b..79499cf

Rolling v8/third_party/fuchsia-sdk/sdk: version:11.20230201.0.1..version:11.20230202.3.1

Change-Id: Ia6eb714430c94a0a24a6778bb2918fe548c6a2ae
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4220672
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@{#85635}
2023-02-03 03:44:49 +00:00
Clemens Backes
e33c3a09b3 Disable the use of preserve_most on arm64 Windows
We see crashes on arm64 on Windows. Disable the use of preserve_most
there, until we figure out (and fix) the root cause.

R=mlippautz@chromium.org

Bug: chromium:1409934
Change-Id: Ic913039d36d158fb5ad368915d95c250d8724a07
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4218354
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85634}
2023-02-02 16:37:59 +00:00
Matthias Liedtke
14f1ec8cdd [wasm-stringrefs] Add string.hash instruction
Bug: v8:12868
Change-Id: I12ee551fbffc25c591d618f1957bbabbceff255e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4217413
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85633}
2023-02-02 16:35:44 +00:00
Dominik Inführ
31654be902 [heap] Fix --code-stats with code cache
During deserialization all allocated objects are preinitialized with
Smi 0. During code cache deserialization GCs may happen. When
--code-stats is enabled as well, code stats are collected during GC.
In such situations crashes may happen because of fields in
BytecodeArray objects not being deserialized at the time of GC.

This CL introduces new raw_* getters for --code-stats which allows
accessing these fields while they still contain 0.

Bug: v8:13704
Change-Id: I767714ca1c936a031d71f3eb53d6401030ccce7e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4212406
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85632}
2023-02-02 16:31:43 +00:00
Samuel Groß
de4e49260f [base] Fix use of deprecated function getsectdatafromheader_64
Instead use getsectiondata for both the 32 bit and 64 bit use case.

Bug: v8:13428
Change-Id: I1efeb3bb69862ad11008a6a4a3fb08581ab7cd2e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4218733
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85631}
2023-02-02 15:23:45 +00:00
Jakob Kummerow
3656b47035 [turbofan] Fix ECL::LowerChangeTaggedToTaggedSigned
The EffectControlLinearizer should use accurate representations
for the values it creates.

Fixed: chromium:1412099
Change-Id: I9b6d3d1aeb11e5a4863d82fd2e1bc5b7ce777742
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4218734
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85630}
2023-02-02 15:21:53 +00:00
Clemens Backes
99936e2de9 [liftoff] Outline spilling and reloading code
The assumption is that {PopToRegister} most often finds a register stack
slot (this is backed by data). Hence put all spilling-related code
behind no-inline and preserve_most functions.
Also, annotate some methods that are supposed to be inlined with
V8_INLINE. This is not needed (they were already inlined before), but
this documents the intend better.

This saves some binary size and seems to also slightly improve
performance.

R=ahaas@chromium.org

Bug: v8:13565, v8:13673
Change-Id: Ib4b8bd361ee19c29221263f6383034933fe7dff5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4212407
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85629}
2023-02-02 15:20:49 +00:00
Jakob Kummerow
c07d8535f8 [stringrefs] Optimize get_codeunit
This patch doubles the performance of iterating over a stringview_wtf16.
It does this by:
- changing string.as_wtf16 to flatten any Cons strings; in TF this
  is represented by a new operator
- introducing a Turbofan operator PrepareStringForGetCodeunit that
  inspects the given string's internal representation and retrieves
  the pointer to the actual characters
- adapting the code emitted for `get_codeunit` to consume the output
  of this operator
- improving WasmLoadElimination to deduplicate both new operators for
  peeled loops, so that as much work as possible only needs to be done
  once.
This patch was authored about half-and-half by manoskouk@chromium.org
and jkummerow@chromium.org.

Bug: v8:12868
Change-Id: If9cf4c3ffeb5e1ca08b864cbc0bf868656ca2dec
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4198142
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85628}
2023-02-02 15:15:06 +00:00
Nico Hartmann
994c2a575d Revert "[maglev] Check for strings in polymorphic loads"
This reverts commit 7f4a04671a.

Reason for revert: Speculative revert for https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20TSAN%20-%20no-concurrent-marking/13086/overview

Original change's description:
> [maglev] Check for strings in polymorphic loads
>
> Bug: v8:7700
> Change-Id: Id3d523446f5061a78a46d1c52cf8f8339566356d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4212402
> 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@{#85626}

Bug: v8:7700
Change-Id: I87473a0cef092d457391d84c051becf06014703b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4219091
Owners-Override: Nico Hartmann <nicohartmann@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85627}
2023-02-02 15:03:59 +00:00
Victor Gomes
7f4a04671a [maglev] Check for strings in polymorphic loads
Bug: v8:7700
Change-Id: Id3d523446f5061a78a46d1c52cf8f8339566356d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4212402
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@{#85626}
2023-02-02 14:38:35 +00:00
Milad Fa
31487e43a6 PPC/s390: [liftoff] Use cross-platform conditions
Port a5eb40d90d

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

Change-Id: I0429a643658ac513c32587d71b4f4dceb65cfdf7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4214882
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#85625}
2023-02-02 14:27:34 +00:00
Clemens Backes
a5192ac12f [wasm][fuzzer] Print information about exceptions
We sometimes get non-reproducible exception mismatches in the fuzzers.
This might come from OOM exceptions.
This CL makes us print some information about them, so we learn more
from the occasional fuzzer reports. In a follow-up we can then handle
OOM exceptions better, if that turns out to cause this.

R=ahaas@chromium.org

Bug: chromium:1412084
Change-Id: Ic0bf3880fe733320c2532c0f69d8f88fe9c9ff5e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4217417
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85624}
2023-02-02 13:56:21 +00:00
Anton Bikineev
d469a70049 cppgc: Fix CombinedWriteBarrierSlow()
The function relied on passed pointers always being compressed, which
is no longer the case with subtle::UncompressedMember<>.

Bug: chromium:1412021, chromium:1412221

Change-Id: I531e41d24fcab34e527db99f8047123f254e8a74
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4217411
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85623}
2023-02-02 13:38:39 +00:00
Marja Hölttä
28771bf519 [rab/gsab|turbofan] Add missing DataView tests
Bug: v8:11111
Change-Id: I03fd90900fae521cb3e738f011fb0832770ff04a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4218351
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85622}
2023-02-02 13:34:59 +00:00
Camillo Bruni
87ab6f5500 [tools] Better arm64 support for update-compile-commands.py
- Mac Arm64 doesn't like cross-compiling to 32bit platforms
- Build the language server and torque files for the host platform
  (x64, arm64) by default

No-Try: true
Change-Id: I4df68d416c58f58335fecc52b802c4bfe4ce2f24
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4218352
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85621}
2023-02-02 13:30:43 +00:00
pthier
4001e14901 [strings] Support shared LO space in externalization
We have a shared large object space now. This CL supports
externalization of strings in shared LO space.

Bug: v8:12957
Change-Id: Ic540aed4d3e99248ef27bdccb525a0bc8ff7b28b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4217416
Auto-Submit: Patrick Thier <pthier@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85620}
2023-02-02 13:22:21 +00:00
Jakob Linke
135b63038d Refactor RootVisitor::VisitRunningCode
The contract of passing in a Code object for builtins and
InstructionStream objects for everything else was confusing. In this
CL we change it to:

 void VisitRunningCode(FullObjectSlot code_slot,
                       FullObjectSlot istream_or_smi_zero_slot)

where we *always* pass in both parts of the composite
{Code,InstructionStream} object. The istream_or_smi_zero_slot must
equal raw_instruction_stream() of the given code_slot. We pass in
both, because it is convenient at the single call site in frames.cc.

Drive-by: extract deopt literal iteration to a Code method.

Bug: v8:13654
Change-Id: I09d658fbd8d26bf483e1c778e566a53e1817f80f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4212399
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85619}
2023-02-02 13:15:23 +00:00
Nikolaos Papaspyrou
9b89942446 [heap] Add scope to object stats dumping in full GC
This accounts for a big difference between the total length of the
atomic pause (v8:gc:cycle:main_thread:full:atomic) and the sum of
the four phases, when GC stats are enabled.

Change-Id: I5d5abd1e6a8d28ae45a04739d2ca937ef54148af
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4217418
Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85618}
2023-02-02 13:05:39 +00:00
pthier
96f5bb7be4 [regexp] Ship Unicode Sets
Advance --harmony-regexp-unicode-sets to shpping, enabling it by
default.

Bug: v8:11935
Change-Id: I5dcf2c584775f25516c7a1846ac6bc53326eefbc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4217412
Auto-Submit: Patrick Thier <pthier@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85617}
2023-02-02 11:53:15 +00:00
Clemens Backes
656c74218f [liftoff] Combine "InitMerge" with the actual merge
"InitMerge" did compute the state at the merge point, and a following
"MergeStackWith" or "MergeFullStackWith" would then generate the code to
merge the current state into the computed state.
As every "InitMerge" is followed by an actual merge, we can combine the
two and save one iteration over the two states.

The only change in generated code is that we initialize the merge state
after a one-armed if from the if-state instead of the else-state. This
could potentially make the if-branch slightly cheaper and the
else-branch slightly slower, but will not negatively impact overall code
size.

This CL should save roughly 2% of Liftoff compilation time.

R=dlehmann@chromium.org

Bug: v8:13565, v8:13673
Change-Id: Id323a15e7fd765727f46830509fbaf7f5498c229
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4203380
Reviewed-by: Daniel Lehmann <dlehmann@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85616}
2023-02-02 11:49:47 +00:00
Omer Katz
69dd71dabe [heap] Disable concurrent allocation for new space
No concurrent allocation lock should be needed when allocating in new space.

Bug: v8:12612
Change-Id: I5242817b49564e0b786c16cee017762631de6bc6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4215296
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85615}
2023-02-02 10:54:15 +00:00
Olivier Flückiger
161ff8c112 Reland "[static-roots] Use static map range checks instead of instance types"
This is a reland of commit 77d08fcde5

Original change's description:
> [static-roots] Use static map range checks instead of instance types
>
> Some instance types, or type ranges, corresponds to a range of pointers
> in the static read only roots table. Instead of loading the instance
> type of a map it can therefore be beneficial to compare the map itself
> against this range.
>
> This CL adds:
>
> * Add infrastructure to compute and output a mapping of
>   `(instance_type_first, instance_type_last) ->
>      (map_ptr_first, map_ptr_last)` for interesting ranges.
> * Extend InstanceTypeChecker to use these ranges.
>
> For single instance types that map onto a range of maps it is not
> obvious which check is faster. Checking the map range saves a load,
> whereas checking the instance type saves an additional jump.
>
> Bug: v8:13466
> Change-Id: I670fc10fad9920645c0ce0d976ae7e7a13a86e60
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4188379
> Reviewed-by: Jakob Linke <jgruber@chromium.org>
> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> Commit-Queue: Olivier Flückiger <olivf@chromium.org>
> Auto-Submit: Olivier Flückiger <olivf@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#85599}

Bug: v8:13466
Change-Id: I0317a7b88e391e0a7502cc056a2fe691d294fba1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4217131
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85614}
2023-02-02 10:43:34 +00:00
Camillo Bruni
dee91eea61 [execution] Add not-terminating DCHECK in InvokeWithTryCatch
Bug: chromium:1393272
Change-Id: Id377fd048403bd9d901edfd72786b1f2bd7124c0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4215298
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85613}
2023-02-02 10:25:07 +00:00
Clemens Backes
8dfd2ce708 [base] Fix SmallVector's move constructor
The move constructor left the "other" (source) vector in an
unpredictable state, depending on the size: For "big" small-vectors
(using dynamically allocated storage) we would reset it to an empty
vector. "Small" small-vectors on the other hand were not reset.

Fix this to make it possible to reuse a SmallVector after moving its
content to another SmallVector. This also flushes out a bug more easily,
see https://crrev.com/c/4215292.

R=dlehmann@chromium.org
CC=​thibaudm@chromium.org

Change-Id: Ia188c3639e9104dfbeb589bfc49e3228f4cbeda7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4215297
Reviewed-by: Daniel Lehmann <dlehmann@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85612}
2023-02-02 10:24:04 +00:00
Daniel Lehmann
e0790d35d1 [liftoff] Fix CacheState::Steal to move, not copy
CacheState::Steal didn't actually call the move assignment operator,
even though it should (and unlike what the comment says in its body).

The reason is the incompatible const-qualifier, such that the move
assignment operater wasn't selected during overload resolution.
Due to C++'s operator overloading, the compiler silently used the copy
assignment operator instead. That works, but is naturally slower.

This actually gave `Steal` the exact same behavior as `Split` until now,
which masked yet another bug, where we called `Steal` but should have
called `Split`.

This CL fixes both issues.

Bug: v8:13673
Change-Id: I940eb0fed383d78244f497bc6f7b67730038de42
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4215292
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Daniel Lehmann <dlehmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85611}
2023-02-02 10:23:01 +00:00
Victor Gomes
ff1dba398d [codegen] Merge Turbo and Macro assemblers
There is no real difference between MacroAssembler and TurboAssembler
anymore. Initially the idea was to differentiate thread-safe
operations, but it got out of hand. With LocalHeaps we could ensure
differently by passing a local_isolate.

In this CL:

TurboAssemblerBase was renamed to MacroAssemblerBase
The file containing it also renamed from turbo-assembler to macro-assembler-base.

TurboAssembler and MacroAssembler were merged into MacroAssembler
in each of the architectures.

turbo-assembler-unittests-arch were included in
macro-assembler-unittests-arch

tasm renamed to masm

Bug: v8:13707
Change-Id: I716bbfc51b33ac890c72e8541e01af0af41b6770
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4212396
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85610}
2023-02-02 09:27:45 +00:00