Commit Graph

79934 Commits

Author SHA1 Message Date
Milad Fa
3123e9537e PPC/S390: cleanup owner files
... from inactive users.

Change-Id: Ibaf30311cb74402a71a51995f05479295899f87c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4184557
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85442}
2023-01-23 17:07:21 +00:00
Clemens Backes
0488582da8 [wasm] Add DCHECK that we do not validate unexpectedly
After several fixes (https://crrev.com/c/4152483,
https://crrev.com/c/4152489, https://crrev.com/c/4152950,
https://crrev.com/c/4168411, https://crrev.com/c/4168412), we can
finally add the DCHECK that we do not have to validate functions under
normal circumstances (if no non-default flags are enabled).

This should protect us against future bugs that lead to
double-validation and hence unnecessary overhead.

R=ahaas@chromium.org

Change-Id: I519b221b96c43f921677e0ab8e519ede249ef12e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4178823
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85441}
2023-01-23 16:48:27 +00:00
Milad Fa
a41eb50499 S390[liftoff]: refactor simd relaxed ops
Cleanup the emitters by using non-relaxed simd ops.

Change-Id: I079d999ee5bb194c538ad7c4b0192ac552b1b601
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4184556
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#85440}
2023-01-23 16:38:12 +00:00
Seth Brenith
78addf2f16 Improve encoding of common translation instructions
This change reduces the size of translation arrays by adding two more
translation opcodes to reduce the number of operands that must be
written. In particular:

- The last two operands for INTERPRETED_FRAME are usually zero, so we
  can add a separate opcode with two fewer operands where those values
  are implicitly zero.
- The update_feedback operand for BEGIN is always either zero or one, so
  we can split BEGIN into _WITH_FEEDBACK and _WITHOUT_FEEDBACK variants.

This change saves about 13% of the total generated TranslationArray
bytes in an Octane run, a reduction from around 1.4 MB to 1.2 MB. I
don't see any difference in the time taken by V8.TFCodeGeneration with
this change.

Bug: v8:11354
Change-Id: Ic049d0b636693cd3278514e5e5e975b80a78d8e9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4178895
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85439}
2023-01-23 16:26:23 +00:00
Omer Katz
29d54b0408 Fix data race when writing to Profiler::overflow_
This CL resolves the races in
https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket/8791194392783872945/+/u/Check/LogAllTest.LogAll

Bug: v8:13665
Change-Id: Ic40fe995eb9a335cdb0477106009a4d455273cb6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4187215
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85438}
2023-01-23 16:19:43 +00:00
Tobias Tebbi
b691cca3de [runtime] add protector for String/Number prototype @@replace lookup
This improves performance of `String.prototype.replace` by avoiding
a runtime call in the case of strings.

Change-Id: Id2339defa660b28ffde3d2e116c0a666ad1bfb1a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4173577
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85437}
2023-01-23 15:55:52 +00:00
Omer Katz
7731b0781b Skip tests for tsan debug bot
Bug: v8:13665
Change-Id: Ib5530deab091542ef86e511ff0cabbfc44fe9263
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4188377
Reviewed-by: Almothana Athamneh <almuthanna@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85436}
2023-01-23 15:21:39 +00:00
Jakob Kummerow
4724f988ae [profiler] Support WasmGC objects in heap snapshots
Since the heap snapshot generator is based on generic objects-visiting
infrastructure, it already reported all objects, but it showed WasmGC
objects as generic "system" objects. This patch adds proper categorization,
including support for named types and fields.

Bug: v8:7748
Change-Id: I1b0997059c9cf0290fe5d6c5402412ba09ecf143
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4181031
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85435}
2023-01-23 14:21:36 +00:00
Matthias Liedtke
186068ad3f String.p.toLocaleLowerCase: Perform locale validation also on empty string
The fast path implementation for toLocaleLowercase (added in
333db24b55, https://crrev.com/c/3952317)
skipped the locale validation if the string to be converted is the empty
string.
This CL addresses it by delaying the early return for empty string to be
performed after the locale validation.

Bug: chromium:1409058
Change-Id: I2f2839dc836d8de662d308c86099707bf9ddfd9e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4184199
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@{#85434}
2023-01-23 13:55:09 +00:00
Jakob Kummerow
b4ae834223 [bigint] Implement NoSideEffectsToString
When our various debugging and error reporting facilities want to
perform a side effect free conversion of a value (which could be
a BigInt) to a String, then the usual BigInt::ToString is not a
great fit because it reacts to termination requests.
This patch adds a method BigInt::NoSideEffectsToString, which uses
a low upper bound instead of termination requests.

Fixed: chromium:1406774
Change-Id: Ibc5d37027823e4a03c470f1dd0a63c16c552850c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4177099
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85433}
2023-01-23 13:47:15 +00:00
Jakob Linke
11c4c8e3d2 Remove the AbstractCode == InstructionStream case
.. and only keep BytecodeArray || Code. This is part of the effort to
reduce the number of InstructionStream references.

Drive-by: Fix a few outdated InstructionStream uses.

Bug: v8:13654
Change-Id: If70fd6a0cb3c8d7e677495d133db64f5c5a26101
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4178821
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85432}
2023-01-23 13:39:18 +00:00
Matthias Liedtke
3e64021c7e [wasm-gc] Add cache lookup to wrapper compilation
Bug: v8:7748
Change-Id: I3599be973b8f20d6fe3a9a7a25f18c06e1bc2a87
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4177096
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85431}
2023-01-23 12:05:51 +00:00
Omer Katz
21ab8287a6 Mark slow tests for tsan debug bot
Bug: v8:13665
Change-Id: I228e847de411d2b18b1529b6c25208ae2d7f8ce0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4187217
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85430}
2023-01-23 10:17:58 +00:00
Michael Achenbach
29b3bd3826 [test] Include shard info in test records
This will allow on the infra side to easier link to the respective
shard on a test failure. Without that it's a hassle to find out on
which shard the failing test ran.

This also simplifies how the global test_config stores information.
Some information was duplicated, but is now rather shared through
properties if the owning object is already present.

Bug: v8:13681
Change-Id: I52f01a4fac74627575d80f25923faba99eb6a1fb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4181030
Reviewed-by: Liviu Rau <liviurau@google.com>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85429}
2023-01-23 09:50:01 +00:00
Jakob Linke
7a3a6e88bd Revert "[turbofan] Optimize access to the length property of functions"
This reverts commit 7eb8937bca.

Reason for revert: crbug.com/1408957

Original change's description:
> [turbofan] Optimize access to the length property of functions
>
> When compiling to JavaScript a language that supports curryfication, it
> is convenient to be able to efficiently get the arity of a function to
> check for partial application.
>
> Change-Id: I6611b523b2c3795f1f8fb123f63f5b6d604d793d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4111447
> Reviewed-by: Jakob Linke <jgruber@chromium.org>
> Commit-Queue: Jakob Linke <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#85409}

Fixed: chromium:1408957
Change-Id: I5200392af7532a864afd73fb0e88be9a2153a312
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4187075
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#85428}
2023-01-23 08:58:42 +00:00
Jakob Linke
05a3ad7c72 Revert "[maglev] Load SFI::length as int16"
This reverts commit d236b0ebb7.

Reason for revert: Reverting the CL that introduced the bug, see crbug.com/1408957

Original change's description:
> [maglev] Load SFI::length as int16
>
> Bug: v8:7700
> Change-Id: I853ef2c81d180a98a0c97322832f4b35789baeb2
> Fixed: chromium:1408956
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4183487
> 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@{#85418}

Bug: v8:7700
Bug: chromium:1408957
Change-Id: I2f5b163505e437232121c8a142cd03d16f228381
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4187095
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#85427}
2023-01-23 08:27:00 +00:00
Dominik Inführ
d31e52879b [heap] Introduce getters for MemoryReducer::State
This CL hides the ctor of the MemoryReducer::State class and only
provides factory methods for creating states. This simplifies creation
of states and makes it impossible to misuse the API.

Direct field accesses are also replaced with invocations of their
corresponding getter methods. The getter method will check whether
the current state is allowed to access that field.

Bug: v8:13653
Change-Id: I252a6d75d0ddb4813b16a706061ad1951cfa35ea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4181026
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85426}
2023-01-23 07:54:44 +00:00
v8-ci-autoroll-builder
417ce7ef46 Update V8 DEPS (trusted)
Rolling v8/build: e58773a..6b5cc8f

Rolling v8/third_party/android_sdk/public: oWlET2yQhaPKQ66tYNuSPaueU78Z9VlxpyxOoUjwRuIC..3Yn5Sn7BMObm8gsoZCF0loJMKg9_PpgU07G9DObCLdQC

Rolling v8/third_party/fuchsia-sdk/sdk: version:11.20230121.2.1..version:11.20230122.2.1

Change-Id: I2c6af834b1e12c22917bb4f7b3c8c68df8bd4052
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4186875
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@{#85425}
2023-01-23 03:59:21 +00:00
v8-ci-autoroll-builder
f2587421d4 Update V8 DEPS (trusted)
Rolling v8/build: 372a5a7..e58773a

Rolling v8/third_party/depot_tools: 18de1f6..e852391

Rolling v8/third_party/fuchsia-sdk/sdk: version:11.20230118.2.1..version:11.20230121.2.1

Change-Id: Id0e728455c851d754111efae8aa1f39a50fb2f51
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4184920
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@{#85424}
2023-01-22 04:04:12 +00:00
v8-ci-autoroll-builder
de3ef68ca0 Update V8 DEPS (trusted)
Rolling v8/build: dac013f..372a5a7

Rolling v8/buildtools/third_party/libc++abi/trunk: dc82f30..d520d58

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/e1ae723..c4e9d16

Rolling v8/third_party/depot_tools: aec39c3..18de1f6

Rolling v8/tools/clang: 16bb37b..bae2f66

Change-Id: I32f90bfb82a03202e01b3787a719ecbd790b47c2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4184565
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@{#85423}
2023-01-21 03:55:09 +00:00
Joyee Cheung
3f3b10b6ac [ic] store the slow handler for proxies in DefineKeyedOwnIC
Previously we stored kProxy in this case, which resulted in
set semantics for proxies.

Bug: chromium:1408310
Change-Id: Id9f215b4c3c08416b6d6c5f4605839668a5df340
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4178811
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Cr-Commit-Position: refs/heads/main@{#85422}
2023-01-20 22:30:24 +00:00
Joyee Cheung
4d0d31f41b [class] support out-of-scope private member access in debug-evaluate
Previously in the DevTools console, users could inspect a preview of all private class members on an instance, but if they wanted to evaluate or inspect a  specific private class member out of a long list, they had to be debugging and in a scope that has access to those private names.

This patch adds support for extraordinary access of out-of-scope private member access in debug-evaluate, specifically for Debugger.evaluateOnCallframe() (for console calls invoked during debugging) and Runtime.evaluate() (for console calls invoked when the user is not debugging). This kind of access is not otherwise allowed in normal execution, but in the DevTools console it makes sense to relax the rules a bit for a better developer experience.

To support this kind of extraordinary access, if the parsing_while_debugging or is_repl_mode flag is set, when we encounter a private name reference that's in a top-level scope or an eval scope under a top-level scope, instead of throwing immediately, we bind the reference to a dynamic lookup variable, and emit bytecode that calls to %GetPrivateName() or %SetPrivateName() in the runtime to perform lookup of the private name as well as the load/store operations accordingly.

If there are more than on private name on the receiver matching the description (for example, an object with two `#field` private names from different classes), we throw an error for the ambiguity (we can consider supporting selection among the conflicting private names later, for the initial support we just throw for simplicity).

If there are no matching private names, or if the found private class member does not support the desired operation (e.g. attempting to write to a read-only private accessor), we throw an error as well.

If there is exactly one matching private name, and the found private class member support the desired operation, we dispatch to the proper behavior in the runtime calls.

Doc: https://docs.google.com/document/d/1Va89BKHjCDs9RccDWhuZBb6LyRMAd6BXM3-p25oHd8I/edit

Bug: chromium:1381806
Change-Id: I7d1db709470246050d2e4c2a85b2292e63c01fe9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4020267
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85421}
2023-01-20 22:26:44 +00:00
Leszek Swirski
d2ff82cbc9 [maglev] Add BranchIfTypeOf
Add a shortcutting branch for TestTypeOf, similar to the compare
branches.

To do this, move the TestTypeOf implementation into MaglevAssembler. We
want to support label distances and fallthroughs correctly, so
additionally implement a generic Branch for labels with distances and
support for fallthroughs.

Bug: v8:7700
Change-Id: Ib8c6b0eeeec0a7f3429d3692081853d25278fba4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4181034
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85420}
2023-01-20 16:10:43 +00:00
Milad Fa
da27bc1719 PPC[liftoff]: Implement simd relaxed ops
Change-Id: Ieb8d8838df7e27a70734dc667460cfb5e6317961
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4157699
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#85419}
2023-01-20 14:48:02 +00:00
Leszek Swirski
d236b0ebb7 [maglev] Load SFI::length as int16
Bug: v8:7700
Change-Id: I853ef2c81d180a98a0c97322832f4b35789baeb2
Fixed: chromium:1408956
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4183487
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@{#85418}
2023-01-20 13:14:39 +00:00
Lu Yahan
b06b015d7a [riscv] Rename CodeDataContainer to Code
Port commit c53c026e6e


Change-Id: Ib23c7c224e7e37914b830b77d571f19ed0281ead
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4178897
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#85417}
2023-01-20 13:07:55 +00:00
Dominik Inführ
401b3d5bf6 [heap] Add shared large object space to old generation stats
This CL adds the shared large object space to OldGenerationCapacity(),
CommittedOldGenerationMemory() and OldGenerationSizeOfObjects().

Bug: v8:13267
Change-Id: Ifdf5f78452d226266cf18c4c0bb1ed0117b1da60
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4183485
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Auto-Submit: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85416}
2023-01-20 10:41:37 +00:00
Victor Gomes
f680face5e [maglev] Reuse scratch in CheckMapsWithMigration
Reuse scratch register in deferred code instead of acquire a new one.

Note that with MaglevAssembler::ScratchRegisterScope, it is now
safe to pass a scratch to DeferredCode.

Fixed: chromium:1408900
Bug: v8:7700
Change-Id: I1e82285a0bd93a76e7f28b9a483b95c9b2f84712
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4183484
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85415}
2023-01-20 09:47:24 +00:00
Omer Katz
185c08fdc4 Fix race in ExternalPointerTable::Mark
See race details in
https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket/8791534956079065361/+/u/Check__flakes_/grow-memory

Bug: v8:13665
Change-Id: I8b842f242d89e1294f5deee90e44b65a15c14bf6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4181035
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85414}
2023-01-20 09:35:57 +00:00
pthier
ef23ae1c31 [maglev] Cache truncated int32 values
Drive-by: Add (unchecked) TruncateNumberToInt32 for known numbers.

Bug: v8:7700
Change-Id: Ie1be49648530ea5ea22e75c8a22459f7ce23ae9b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4181036
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85413}
2023-01-20 09:17:02 +00:00
Omer Katz
54d255ab23 [heap] Fix race in MarkingBarrier
The data race in [1] occurs because when reaching marking-barrier-inl.h,
value is in the shared heap while host is in the client heap.
Generally concurrent sweeping and marking barriers should not be active
at the same time. However, that only holds for a single heap.
In this case, the client is in the midst of incremental marking, thus
marking barriers are active for it, while concurrent sweeping is active
on the shared heap/space. This results in a race between reading the
value's mark bit and clearing the mark bit for the chunk.

[1] https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket/8791534956079065361/+/u/Check__flakes_/regress-crbug-1394741

Bug: v8:13665
Change-Id: I1b6210b9162b78b3c3635802a1e74432f5c89757
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4181038
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85412}
2023-01-20 08:53:17 +00:00
v8-ci-autoroll-builder
c9ccba71ae Update V8 DEPS (trusted)
Rolling v8/build: b999a0b..dac013f

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/de8aae6..e1ae723

Rolling v8/third_party/depot_tools: 8c5174b..aec39c3

Rolling v8/third_party/fuchsia-sdk/sdk: version:11.20230118.1.1..version:11.20230118.2.1

Rolling v8/tools/clang: dced190..16bb37b

Change-Id: Ic03b9f4e0cfe618fe8a8c2443a637df9904b5151
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4182091
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@{#85411}
2023-01-20 03:49:44 +00:00
Omer Katz
b584c571b8 Fix race when calling raw_properties_or_hash concurrently
See race details in
https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket/8791534956079065361/+/u/Check/duplicate-param-gc-crash

Bug: v8:13665
Change-Id: I5e119083ec6e14fb1826be4dc7a6350c29be1db4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4181033
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85410}
2023-01-19 19:49:10 +00:00
Jérôme Vouillon
7eb8937bca [turbofan] Optimize access to the length property of functions
When compiling to JavaScript a language that supports curryfication, it
is convenient to be able to efficiently get the arity of a function to
check for partial application.

Change-Id: I6611b523b2c3795f1f8fb123f63f5b6d604d793d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4111447
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85409}
2023-01-19 19:16:48 +00:00
Michael Lippautz
48e79783ee cppgc: Optimize MakeGarbageCollected
Annotate slow path call for creating a new GCInfo accordingly. This
path will only hit for the first object allocation for a given type.
All subsequent allocations will use the fast path.

Bug: chromium:1408821
Change-Id: Ifc1d3491a94b30dfeee1a2c9679c64939025fefe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4161752
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85408}
2023-01-19 18:46:28 +00:00
Olivier Flückiger
2670e3d0cc [static-roots] Test to ensure mksnapshot creates a predictable r/o heap
To replace the test that ensured it accidentally and was removed in
https://chromium-review.googlesource.com/c/v8/v8/+/4178814

Bug: v8:13466
Change-Id: Ie5b123af94d12ffc444358f6631d67334e46b711
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4178826
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85407}
2023-01-19 17:27:58 +00:00
Matthias Liedtke
5628a2be90 [wasm-stringrefs] Add string.new_utf8_try
The built-in wasm function behaves similar to string.new_utf8
but in case of invalid characters returns `null` instead of
throwing an exception.

Bug: v8:12868
Change-Id: Idde9bc2563d6bff1ab163ca8ed2219b6db23ca28
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4177105
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85406}
2023-01-19 17:10:06 +00:00
Dominik Inführ
0acb75d56e [heap] Move Event object creation into MemoryReducer
This allows MemoryReducer::Event to be an internal implementation
detail except for tests and make it impossible to misuse the API.

Bug: v8:13653
Change-Id: I333a6e17368ddaba562ec929b4950b6c234fc312
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4178818
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85405}
2023-01-19 16:15:09 +00:00
Jeremy Roman
b71cdae42a Use FieldIndex::ForDetails in a few more places.
This CL recently landed:
  https://chromium-review.googlesource.com/c/v8/v8/+/4115749
which is similar to a CL I abandoned in 2017:
  https://chromium-review.googlesource.com/c/v8/v8/+/788491

So this ports over some of the other opportunities to use
FieldIndex::ForDetails that I found at that time.

Change-Id: I147d0a7e9fd393409d3213119d1fa64d2098d960
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4178790
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85404}
2023-01-19 15:47:32 +00:00
Thibaud Michaud
0bfae5d165 [gap-resolver] Emit move based on destination representation
If the phi moves are the same for all predecessors, the move optimizer
will merge them by picking an arbitrary move among them,
moving it to the phi's block, and eliminating the moves in the
predecessor blocks.
However, phi inputs may have different width, and this can result in a
mismatch between the source and destination representation.
Always emit gap moves based on the destination operand's
representation, to ensure that in this case the wider phi inputs are not
truncated.

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

Bug: chromium:1407571
Change-Id: I0263cd5024e8e1340fb971267b133a2a91090f8f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4178824
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85403}
2023-01-19 14:32:57 +00:00
Leszek Swirski
5dea4a4055 [gdbinit] Fix sim command
Explicitly null terminate the string passed in as a simulator debug
command from gdb. Otherwise, gdb was creating a char[strlen(arg)] from
the argument, and storing it non-zero-terminated.

Change-Id: I9f80530b172e6de7c3ed174393f07351e7f1ee00
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4181021
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85402}
2023-01-19 14:00:32 +00:00
Leszek Swirski
a4f3a2c045 [maglev] Fix elements clobbering in LoadFixed[Double]ArrayElement
Bug: v8:7700
Change-Id: I8e80fad1b022d7a9c6c27d7577fe25dc0824ac02
Fixed: chromium:1408603
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4181023
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85401}
2023-01-19 13:59:30 +00:00
Olivier Flückiger
a88495623a [ptr-compr] Fix compress(decompress(v)) == v
The fix introduced in
https://chromium-review.googlesource.com/c/v8/v8/+/4173582
was not enough to restore this optmization in clang.

See https://godbolt.org/z/97vqoxj5o

Bug: v8:1408009
Change-Id: I1e9033f5cd93081c722fa761ca7eeb5c340a256e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4178827
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85400}
2023-01-19 13:53:36 +00:00
Nico Hartmann
5379910122 [turboshaft] Redesign UniformReducerAdapter
The new UniformReducerAdapter provides an easier way for reducers to
add special handling for certain operations.

Bug: v8:12783
Change-Id: Ib3b08a4c8383d7df4362579ec5ade8c6df01debe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4178820
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85399}
2023-01-19 13:15:58 +00:00
Marja Hölttä
1972d7a389 [performance|regepx] Allocate the FixedArray for regexp matches lazily
In real world use cases, it's quite typical to not have any matches.
In these cases, allocating the match array lazily improves performance
(e.g., Speedometer2 0.2%).

Change-Id: Ib1ae5aecb2e14714c93092c4786763f272025a8f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4174089
Commit-Queue: Marja Hölttä <marja@chromium.org>
Auto-Submit: Marja Hölttä <marja@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85398}
2023-01-19 13:12:37 +00:00
Victor Gomes
52cbf1dfe4 [maglev] MaglevAssembler Scratch Register Scope
An unified scratch scope for Maglev.
- For arm64 we reuse the architecture scope.
- For x64, we create a simple linked list scope.

DeferredCode carries the same temporary scope.

The node temporaries registers now represents the available
temporary registers (i.e., minus fixed/specific ones).

Also refactor some shared code to maglev-assembler-inl.h, so
that DeferredCode can use scratch scopes.

Bug: v8:7700
Change-Id: I1019a03627f390aa8a69916a227e0007229d63ae
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4178817
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85397}
2023-01-19 13:07:47 +00:00
Olivier Flückiger
d76342dd56 [static-roots] Remove unused Isolate::InitWithReadOnlySnapshot
In the end we managed to have static root builds without a two stage
isolate setup. Thus, the mode for creating isolates with an existing
read only page is unused. Also, no other usecase for this mode emerged.

Bug: v8:13598
Bug: v8:13466
Change-Id: I0a8174ba9383db7364b6e4545702aafc6f48170c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4178814
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85396}
2023-01-19 12:49:49 +00:00
Leszek Swirski
fe4a6f0325 [maglev] Allow fast-path const stores for kDefine
These stores were disallowed (emitting a generic path which was
expected to deopt) for all access modes, but only need to be disallowed
for stores. This now matched TurboFan behaviour.

Bug: v8:7700
Change-Id: Idbf0b45a538981ebf6124d255b395b338e14e097
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4177101
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85395}
2023-01-19 12:45:53 +00:00
Nikolaos Papaspyrou
472429e623 [heap] Fix saving the callee-saved registers on stack
This CL reinstates the trampoline for pushing the values of
callee-saved registers on the stack, which is used for stack scanning.
It reintroduces the set of architecture-specific functions
PushAllRegistersAndIterateStack, removed in crrev.com/c/3989143.
The reason for this change is that the simpler architecture-specific
functions SaveCalleeSavedRegisters failed to correctly save the
values of the registers, in the presence of C++ compiler optimizations.

It also removes the stack context, introduced in crrev.com/c/4017512,
and uses again the trampoline for iterating through the stack.

Bug: v8:13257
Change-Id: I9e656a9b3ba6616168602300f2180b4f340593f3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4171639
Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85394}
2023-01-19 12:29:05 +00:00
Omer Katz
562b65a86e [heap] Fix data races in debug builds
These fixes address race observed in
https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket/8792972887942555249/+/u/Benchmarks__flakes_/splay
and
https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket/8792972887942555249/+/u/Check_-_extra/regress-1146013

Bug: v8:13665
Change-Id: Ief02d57907dd1930fc5c719503fd98e42171991b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4171638
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85393}
2023-01-19 12:28:01 +00:00