Commit Graph

73797 Commits

Author SHA1 Message Date
Thibaud Michaud
846790f1c1 [wasm] Cleanup wasm asm builtin wrappers
Split small chunks of assembly instructions into separate functions.
This makes the code easier to follow and to maintain, especially for
register allocation.

Drive-by: simplify stack-switching test.

R=ahaas@chromium.org

Bug: v8:12191
Change-Id: Id7544a3b2d16085540d9f1863a0eabd1f72f22bb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3461929
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79105}
2022-02-15 15:30:37 +00:00
Dominik Inführ
e782129040 [heap] Rename local-allocator.h to evacuation-allocator.h
LocalAllocator was already renamed to EvacuationAllocator some time ago.
Rename files now as well.

Bug: v8:10315
Change-Id: I337f693998aaf5187a5ba05842cdb2474837b68d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3463719
Auto-Submit: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79104}
2022-02-15 15:21:16 +00:00
Clemens Backes
17b46632cb [wasm] Ship code protection via memory protection keys
Both stability and performance looks good on Linux and ChromeOS, which
is the only operation systems that currently support PKU.

Hence enable the feature by default before launching via finch.

R=ahaas@chromium.org

Bug: v8:11974, chromium:1204982
Change-Id: I2c1e7e7bb70ba73218d4db630219870b198ba6e6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3461934
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79103}
2022-02-15 14:49:57 +00:00
Leszek Swirski
7c369ec821 [compiler] Use templates to speed up liveness calculation
Instead of using runtime lookups of various bytecode properties (like
whether they read/write the accumulator, what their operands do to
registers, etc), do a switch over the bytecode itself once and dispatch
to update methods that are templated on the bytecode and statically know
everything about it.

Change-Id: I0ae111af54277c26c7d0d67a404a2ef75f81fcf4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3455826
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79102}
2022-02-15 14:17:52 +00:00
Jakob Gruber
adfe633a0f Rename RuntimeProfiler to TieringManager
.. to resolve the overloaded 'runtime' term and overall pick a more
meaningful name for this class. It's neither very related to runtime
(instead it's called periodically when the bytecode interrupt budget is
exhausted); nor is profiling its main purpose.

This class is responsible for controlling tiering decisions, hence the
new name 'TieringManager'.

Bug: v8:7700
Change-Id: Id6f1edf4ebe016d0d81903d0a13e0e1fe6e02142
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3463716
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79101}
2022-02-15 14:15:07 +00:00
Dominik Inführ
a380537d97 [flags] Enable --compact-map-space with --future
Now that all known correctness issues with map space compaction are
fixed, add more test coverage by enabling it with --future.

Bug: v8:12578
Change-Id: I23d04a162f742480c4e83de1f3980509543e5a97
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3460409
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79100}
2022-02-15 12:45:27 +00:00
Omer Katz
f146ada4b2 heap: Avoid copying objects in MinorMC
This CL replaces evacuation in MinorMC with always promoting pages.
Pages in new space are promoted first within new space and then to old
space upon a second GC.

This implementation should not yet be used in production and is guarded
behind a runtime flag.

In case all pages in new space have at least one live object on them,
all pages will be promoted and new space will still be out of memory,
thus immediately triggering a second young gen GC that will promote all
objects to old space.
Further CLs will mitigate this issue.

Bug: v8:12612
Change-Id: I329ea01d6d15c0942db2eeeea87c5cefcac75502
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3448385
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79099}
2022-02-15 12:37:28 +00:00
Omer Katz
f219f69878 heap: Make sure no pages are left with promotion markings
Bug: v8:12612
Change-Id: I120da76c304496b9b89ce764e5f1bfa4778e130f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3460413
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79098}
2022-02-15 12:36:17 +00:00
Jakob Gruber
c9d003f807 Consistent names for --interrupt-budget flags
1. feedback_vector_allocation -> feedback_allocation like elsewhere.
2. A consistent --interrupt-budget prefix.
3. Remove the on-by-default --feedback-allocation-on-bytecode-size.

Bug: v8:7700
Change-Id: I1d0af11e89398973a65bf9cb7c7722740d9452ea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3463718
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79097}
2022-02-15 11:54:58 +00:00
jameslahm
5e060e4152 [errors-test] Add test for correct 'Promise.allSettled.call()' error message
Originally, 'Promise.allSettled.call()' will throw
"Promise.all called on non-object". It should be
"Promise.allSettled called on non-object". Add test
for it.

Bug: v8:12122
Change-Id: I496a7c9d31baeb5b99012461387cfbccc4100d2b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3463063
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79096}
2022-02-15 11:07:34 +00:00
Clemens Backes
d7b2dd098a [codegen] (Slightly) speed up hashing of signatures
The hash of signatures currently has redundancy: We hash both the
parameter count and the return count, plus all contained values.
The total count of contained values is already implicitly captured by
{hash_combine}ing the individual values, thus it's enough to only
include one of parameter count and return count.

R=manoskouk@chromium.org

Bug: v8:12593
Change-Id: I6d3e8b15f4251964e3a74ae5411d06a7d41183a8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3460415
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79095}
2022-02-15 11:04:18 +00:00
Omer Katz
ca68fc7390 heap: Remove SWEEP_TO_ITERATE
Bug: v8:12612
Change-Id: Ife6fd532a49b7f164e890fc9ddea5001d4547b38
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3461928
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79094}
2022-02-15 11:00:59 +00:00
jameslahm
60ac939f07 [bytecode-generator] dont get value when destructuring assignment with hole
according https://tc39.es/ecma262/#sec-runtime-semantics-iteratordestructuringassignmentevaluation,
when desturcturing assignment with elision, iteratorValue should not be called, thus
the returned object's "value" property should not be read during the assignment.

Bug: v8:12595
Change-Id: Id4b2c236c30486397683b4ccd4d156b718e12df3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3459922
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79093}
2022-02-15 10:53:20 +00:00
Jakob Gruber
aa08c41ae9 Rename OptimizationMarker values and related runtime functions
.. in preparation for integrating addtl tiers into a single tiering
system.

1. Explicitly spell out whether the request is concurrent or not.
2. Explicitly request the target compiler.

Bug: v8:7700
Change-Id: I9d6e9f6a5d5f0f7218fe136ff50cea2ad7987f67
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3460739
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79092}
2022-02-15 10:05:37 +00:00
Clemens Backes
ef55d88c14 [wasm][fuzzer] Correctly generate function imports
The --wasm-fuzzer-gen-test functionality didn't handle imported
functions correctly.

R=manoskouk@chromium.org

Bug: v8:11863
Change-Id: I0486e15465bfabead7bc352d1a94326a39439e43
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3460412
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79091}
2022-02-15 10:02:08 +00:00
Clemens Backes
0ad95cf26b [wasm] Fix data segment address emission in module builder
The module builder was outputting the address as an unsigned LEB value
instead of a signed value, leading to wrong results.

R=manoskouk@chromium.org

Bug: v8:11863
Change-Id: I547ca98defcae0ba15b4004a506b65387534b08a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3463715
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79090}
2022-02-15 09:58:23 +00:00
Dominik Inführ
516341f30c [heap] Avoid TransferColor in scavenger on shared objects
We must not use TransferColor on objects promoted into shared objects
when performing a scavenger during incremental marking.

Bug: v8:12628, v8:11708
Change-Id: I5833c0da8aa3dcd03287d3803a68189e85875bc1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3463714
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79089}
2022-02-15 09:48:38 +00:00
Kim-Anh Tran
6913ef79df [debug] Allow removal of instrumentation breakpoints in wasm
This CL adds the functionality to remove instrumentation breakpoints
in wasm.

Bug: chromium:1133307
Change-Id: I05ec7f8ac634267d95744ef4565d81cd0c372a2d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3460407
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79088}
2022-02-15 09:36:27 +00:00
jameslahm
05c199ce70 [bootstrapper] copy accessors in deserialized global into global object created using global proxy template
Originally, the accessors wont be copied into global object from
deserialized global. And the accessors in serialized global object
will be lost. Fix to copy accessors in deserialized global
into global object when recreating new global object using passed
global proxy template.
Tests credited to xiangyangemail@gmail.com https://chromium-review.googlesource.com/c/v8/v8/+/3405405

Bug: v8:12564
Change-Id: Iefb3a6dbfa5445b227d87c26eb423cf1b924dbb4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3459937
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79087}
2022-02-15 09:18:39 +00:00
Balakrishna Avulapati
9eb7568b5f Add ldflags for aix
Adding ldflags for aix. This is a todo item noticed

Change-Id: I09dc86a3e956408edb1bfeba6b60bf67843caf4d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3439339
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79086}
2022-02-15 09:00:58 +00:00
jameslahm
33d95eeb7d [errors] Correct 'Promise.allSettled.call()' error message
Originally, 'Promise.allSettled.call()' will throw
"Promise.all called on non-object". It should be
"Promise.allSettled called on non-object".

Bug: v8:12122
Change-Id: Ib2c8eba32abec474feece3aaebf0e6c7d09c433a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3459923
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79085}
2022-02-15 08:36:48 +00:00
v8-ci-autoroll-builder
8568ac6587 Update ICU
Rolling v8/third_party/icu: 2e0f298..e94822c

icu: Add icualign and icuhash scripts (Andrea Orru)
https://chromium.googlesource.com/chromium/deps/icu/+/e94822c

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

Change-Id: I971e201db3bce630b6db61b45f9fb673494c0036
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3460070
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@{#79084}
2022-02-15 05:57:47 +00:00
v8-ci-autoroll-builder
8c40a25124 Update V8 DEPS.
Rolling v8/build: 4309020..d5f9249

Rolling v8/buildtools/third_party/libc++abi/trunk: 9a29c97..01efcb5

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/516c0b3..7bede42

Rolling v8/third_party/depot_tools: 54e30e7..4e4a2b8

Rolling v8/third_party/googletest/src: 0e40217..ea55f1f

Rolling v8/third_party/zlib: d8f49e6..03f3212

Rolling v8/tools/clang: b9894ca..ad74e59

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

Change-Id: I7d6e9c8223a6de3a78ada5032eea1f2a4e41b398
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3460068
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@{#79083}
2022-02-15 03:58:57 +00:00
Milad Fa
359887099e S390: use the output register on qfma ops
Change-Id: I48842264abfec4792685f0db33dac3fdb0d9b785
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3462689
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#79082}
2022-02-14 22:09:27 +00:00
Manos Koukoutos
3610ef7d61 [wasm][fuzzer] Emit the correct function index
Since we do not yet have canonicalization for types, when emitting
ref.func in the fuzzer, it is not enough to pick a function whose
signature is equivalent with the requested type; we have to pick a
function that is declared exactly with the requested signature index.

Bug: chromium:1296936
Change-Id: Ie307a9a370bb9ba2c8c334ddf05268ed9c7077d6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3460411
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79081}
2022-02-14 17:47:17 +00:00
Shu-yu Guo
460e5b538c [string] SLOW_DCHECK string hash during lifetime of String::FlatContent
With String contents being accessible off-main-thread or from multiple
main threads, add a SLOW_DCHECK that the hash of the string contents
inside a String::FlatContent doesn't change during its lifetime.

Bug: v8:12007
Change-Id: Iaf6bb785e44c97c13ac2fe9c5c20099bf1e0d2fd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3451355
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79080}
2022-02-14 17:26:37 +00:00
Victor Gomes
039d508ffe Revert "[bazel] Don't include handler-inside-posix.h for non-posix platforms"
This reverts commit 284aa5e3ea.

Original change's description:
> [bazel] Don't include handler-inside-posix.h for non-posix platforms
>
> Change-Id: I1e6054b741e17ea4a706ad90f259553a69dfa0fc
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3461930
> Auto-Submit: Camillo Bruni <cbruni@chromium.org>
> Reviewed-by: Andreas Haas <ahaas@chromium.org>
> Commit-Queue: Andreas Haas <ahaas@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79076}

Change-Id: Ia5925c1d5978d5652b18bc1d2e5c9e755f16f58b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3461931
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79079}
2022-02-14 17:20:58 +00:00
Nikolaos Papaspyrou
10c15dbe10 heap: Explicitly clear moved-away struct
This struct is reused across various GC cycles. In the way that it's
used here, std::move does not clear the vector of events.

Change-Id: I21e3f74e3ce13fad063499bed19c287902cb90cf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3460408
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79078}
2022-02-14 17:15:07 +00:00
Omer Katz
18ced8a511 heap: Young gen cleanups
Various cleanups around young generation GCs.

These include:
(*) Repalce minor_mark_compact_collector_ with a unique_ptr and merge
    initialization with the mark_compact_collector_ and
    scavenger_collector_.
(*) Rename IncrementalMarking::UpdateMarkingWorklistAfterScavenge to
    IncrementalMarking::UpdateMarkingWorklistAfterYoungGenGC.
(*) Remove redundant MarkingTreatmentMode parameter from
    MakeIterable.

Bug: v8:12612
Change-Id: Ifac7006d3425808a4b9e4c8e1af054a60c073180
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3448380
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79077}
2022-02-14 16:42:58 +00:00
Camillo Bruni
284aa5e3ea [bazel] Don't include handler-inside-posix.h for non-posix platforms
Change-Id: I1e6054b741e17ea4a706ad90f259553a69dfa0fc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3461930
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79076}
2022-02-14 16:36:27 +00:00
Nikolaos Papaspyrou
29d82a5625 heap: Move call to ReportFullCycleToRecorder
This CL simplifies the reporting of full GC cycles and the connection
between the GC of the managed C++ heap and the managed Javascript heap.
It moves the call to GCTracer::RecordFullCycleToRecorder to be part of
GCTracer::StopCycle.

Bug: v8:12503
Bug: chromium:1154636
Change-Id: I332dbcd81d2e5bdda83f3353c6526fc18e23ebd5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3456563
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79075}
2022-02-14 16:24:58 +00:00
Harshil Jain
0bca3b4563 [message] Remove deprecated PrintCurrentStackTrace function which take a FILE*
Change-Id: I598b3e7b0ad349c504d8729eb288d19b14319253
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3439336
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Harshil Jain <twitharshil@gmail.com>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79074}
2022-02-14 14:36:38 +00:00
Anton Bikineev
3f5c2dda67 cppgc: young-gen: Implement GenerationalBarrier for source objects
The generational barrier for source objects records the entire source
object to be processed later during remembered set visitation. It's
planned to be used for Blink backing stores when an inlined object (or a
range thereof) is added (HeapAllocator::NotifyNewObject(s)).

An alternative approach would be to eagerly process the inlined objects
using a custom callback. However, this requires changing Visitors to
bring slots into the context. This approach should better work for
scenarios where small ranges or single elements are added, to avoid
processing potentially large backing stores. The followup CL implements
this idea.

Bug: chromium:1029379
Change-Id: Iacb59e4b10a66354526ed293d7f43f14d8761a8f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3460402
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79073}
2022-02-14 13:58:07 +00:00
Darshan Sen
620158f840 [cleanup] Fix -Wrange-loop-analysis compiler warning
Here is the warning:

```
src/compiler/persistent-map.h:81:47: warning: loop variable 'triple' is always a copy because the range of type
      'v8::internal::compiler::PersistentMap<v8::internal::compiler::Variable, v8::internal::compiler::Node *, v8::base::hash<v8::internal::compiler::Variable> >::ZipIterable'
      does not return a reference [-Wrange-loop-analysis]
    for (const std::tuple<Key, Value, Value>& triple : Zip(other)) {
```

So this changes the const ref into a copy.

Signed-off-by: Darshan Sen <raisinten@gmail.com>
Change-Id: I28bdd4e28e7536bd8dcb17cf2a6bf3342a79f504
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3459925
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79072}
2022-02-14 13:36:48 +00:00
Leszek Swirski
59ea488141 [utils] Move BitVector's iterator to STL-like interface.
Replace the Advance/Done methods on BitVector::Iterator with
STL-compatible operator overloads, and add begin/end methods to
BitVector itself, so that BitVectors can be iterated with ranged for
loops.

As a drive-by cleanup, make GrowableBitVector hold the BitVector by
value (to avoid needing to allocate one for empty iteration), and remove
its unused (and inefficient) Union method.

Change-Id: Idcd34e26bfb087e3ec8297b4a769a51bfab4b6e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3455803
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79071}
2022-02-14 13:19:57 +00:00
Dominik Inführ
e459c84b5f Reland^3 [heap] Support client-to-shared refs in Code objects
This is a reland of 2694b75eb9

The reason for the revert was fixed and landed in
https://crrrev.com/c/3456023, together with all changes in d8.cc. This
reland itself doesn't change the CL apart from rebasing.

Original change's description:
> Reland "Reland "[heap] Support client-to-shared refs in Code objects""
>
> This is a reland of 4b8f1b1cff
>
> After landing https://crrev.com/c/3447371, we can reland this CL as-is
> correctness-wise.
>
> What's new in this CL is that we now treat references from client
> objects into the shared heap as roots for the --track-retaining-path
> feature.
>
> Original change's description:
> > Reland "[heap] Support client-to-shared refs in Code objects"
> >
> > This is a reland of 12e46091a0
> >
> > Original change's description:
> > > [heap] Support client-to-shared refs in Code objects
> > >
> > > Support references from code objects in the client heaps to shared heap objects. Such references are stored in a remembered set during marking, which is later used for updating pointers.
> > >
> > > Bug: v8:11708
> > > Change-Id: I8aeb508ddd14514ca65fa5acf3030dd8c2040168
> > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401588
> > > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> > > Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> > > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> > > Cr-Commit-Position: refs/heads/main@{#78819}
> >
> > Bug: v8:11708
> > Change-Id: I47bcf44b452fcffe8675fba03244b736ede14247
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3422630
> > Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#78838}
>
> Bug: v8:11708
> Change-Id: I5b48e942fa469eabb40e797e221d06c25af16443
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3425358
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79023}

Bug: v8:11708
Change-Id: I83de1dc4dc4701cba4936a68923f6d9b97f7a6a8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3455242
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79070}
2022-02-14 12:33:57 +00:00
Victor Gomes
24ff6e28c7 Reland "[runtime] Refactor TransitionsAccessor"
This is a reland of c927ada76c

Fix: Recalculate encoding after an allocation (that can potentially
trigger GC) in EnsureHasFullTransitionArray.

Original change's description:
> [runtime] Refactor TransitionsAccessor
>
> Problems:
> - The class uses a bare Map field, but some methods can trigger GC
> causing it to have a potential dangling pointer in case of map
> compaction.
> - Some methods invalidate the object state and should not be used again.
> - Complicate logic with a no_gc and a gc aware constructors. Some
> methods can only be called if the object is constructed with a
> particular constructor (e.g, Insert and PutPrototypeTransition).
>
> Note: Most usages of this class is done by constructing an object and
> calling a single method:
> `TransitionAccessor(...).Method(...)`
> So we can easily change them to a static method.
>
> This CL:
> 1. Adds DISALLOW_GARBAGE_COLLECTION to the class.
> 2. Makes methods that can trigger GC static.
> 3. Creates static helper functions that wrap the class in a different
> scope, since TransitionsAccessor now forces the scope to disallow gc.
> 4. Removes now unnecessary "Reload" logic.
>
> Bug: chromium:1295133, v8:12578
> Change-Id: I85484e7235fbd5e69894e26f5e1c491c6f69635e
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3450416
> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Commit-Queue: Victor Gomes <victorgomes@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79051}

Bug: chromium:1295133, v8:12578
Change-Id: If3880c2480433b78567870c8d14508d6ad9eccbd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3460405
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79069}
2022-02-14 12:05:06 +00:00
Samuel Groß
af78745f2e Initialize V8 sandbox in samples
Bug: v8:10391
Change-Id: If54ba6ddaabd14e5f4c232cdc3c29746f89e1cb3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3455822
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79068}
2022-02-14 11:15:10 +00:00
Dominik Inführ
60245d8397 [d8] Prepare for shared GCs in d8
With shared GCs we need to stop all isolates in a safepoint. But in
some cases not every main thread of each isolate is able to reach a
safepoint. We need to park the main thread manually here in d8.

Bug: v8:11708
Change-Id: I45d495cecce92ebef7e25ff16ea852430f3645e5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3456023
Auto-Submit: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79067}
2022-02-14 11:14:07 +00:00
Leszek Swirski
2b96e854f5 [compiler] Make accumulator index 0 in liveness bitvectors
Previously, the accumulator was at the end of liveness bitvectors, which
meant that checking for accumulator liveness required a length lookup.
This CL moves it to the start of the bitvector, with registers starting
at index 1 -- the assumption is that the addition of 1 to the index on
register liveness access can be constant folded away.

As a cleanup, replace all the custom liveness printing code with a
single unified ToString. This places the accumulator at the end of the
printed liveness, to avoid having to change test expectations (also, the
position of the accumulator is now an implementation detail). As a
similar cleanup, change StateValue node building to use the
BytecodeLivenessState interface rather than the underlying bitvector.
These two cleanups allow us to remove the raw bitvector accessor from
liveness entirely.

Change-Id: Ic2744b5e8e16b8527e6a4e8d3b4ddad7096289d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3455144
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79066}
2022-02-14 10:15:06 +00:00
Yang Guo
be7b0e8263 Mark Reflect methods as side-effect free
R=bmeurer@chromium.org

Fixed: chromium:1295387
Change-Id: I64461b7360f904fe5e0163263163db48a1c7c69c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3460404
Auto-Submit: Yang Guo <yangguo@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79065}
2022-02-14 09:27:50 +00:00
Pan, Tao
ba94a6c149 [runtime-profiler] Use the OSR cache earlier if enter loop range of OSR cache
If function's SFI has OSR cache, once enter loop range of OSR cache, set
OSR loop nesting level for matching condition of OSR (loop_depth <
osr_level), soon later OSR will be triggered when executing bytecode
JumpLoop which is entry of the OSR cache, then hit the OSR cache.
This CL can improve JetStream2 case gaussian-blur by ~3%, it's
introduced by 18 profiler ticks earlier use OSR code cache.

Change-Id: Ibf404d74a4a32bc34974f129828c594c9d551355
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3379240
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Tao Pan <tao.pan@intel.com>
Cr-Commit-Position: refs/heads/main@{#79064}
2022-02-14 09:25:06 +00:00
Michael Lippautz
d89579b3ce heap: Factor out AllocationResult from heap.h
Allows separating out the allocator from Heap without requiring a
heap.h include.

Drive-by:
- Rename "Retry" to "Failure".
- Avoid implicit constructors.
- Rename "RetrySpace" to "GarbageCollectionSpace" which is its only
  use.

Bug: v8:12615
Change-Id: Idac17cded8f0b2b645a2be9045ab31ffd71999b3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3456562
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79063}
2022-02-14 08:54:16 +00:00
v8-ci-autoroll-builder
9ac64a9d98 Update V8 DEPS.
Rolling v8/build: a00adb7..4309020

Rolling v8/tools/luci-go: git_revision:462d0a9cdbe947cd652fcd0c54f64ebc712858a5..git_revision:fbbb5b9748a05dd16fe621f7ea48a4ece1913874

Rolling v8/tools/luci-go: git_revision:462d0a9cdbe947cd652fcd0c54f64ebc712858a5..git_revision:fbbb5b9748a05dd16fe621f7ea48a4ece1913874

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

Change-Id: Iadaab4cb52265ab5dcba20dda863954373027478
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3460234
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@{#79062}
2022-02-14 03:55:35 +00:00
Manos Koukoutos
fee084f3f4 [wasm-gc] Optimize trivial abstract type checks
We optimize trivial type checks in the function body decoder, i.e.,
ref.as_<type> and ref.is_<type> when invoked on a value that is
statically known to be of typeable as <type>.

Bug: v8:7748
Change-Id: Ieee608a965ba44c4cadd9c7171ed8bdc129fce8b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3447375
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79061}
2022-02-13 23:44:15 +00:00
v8-ci-autoroll-builder
5b08f5ddf3 Update V8 DEPS.
Rolling v8/build: 1de0c65..a00adb7

Rolling v8/third_party/zlib: dd9a133..d8f49e6

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

Change-Id: Ie4bfc3d4e762528704a4a4c1adb50095aea08d3b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3459290
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@{#79060}
2022-02-13 03:47:38 +00:00
v8-ci-autoroll-builder
adeab3f00f Update google_benchmark
Rolling v8/third_party/google_benchmark/src: d2cbd4b..6e51dcb

Expose default display reporter creation in public API (#1344) (Dominic Hamon)
https://chromium.googlesource.com/external/github.com/google/benchmark/+/6e51dcb

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

Change-Id: I2fd5613b838800fc553ebffaae05dcf0f97f91f8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3457039
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@{#79059}
2022-02-12 05:24:53 +00:00
v8-ci-autoroll-builder
d0dd020ea5 Update V8 DEPS.
Rolling v8/build: 3408ba5..1de0c65

Rolling v8/buildtools/third_party/libc++abi/trunk: c69bde2..9a29c97

Rolling v8/buildtools/third_party/libunwind/trunk: 2b08f99..b323ac8

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/7b5325d..516c0b3

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

Change-Id: I0d288bf6f1197d1142836af8736a9b10d1a320b7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3457037
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@{#79058}
2022-02-12 03:53:34 +00:00
Milad Fa
0674165df1 S390 [liftoff]: Implement simd swizzle and shuffle
Change-Id: I26a9c7567c36422c01c089d9f71411b3e73c681d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3457684
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#79057}
2022-02-11 22:16:23 +00:00
Milad Fa
d022238167 S390 [liftoff]: Implement simd const128
Change-Id: I39049c88f48c81b2f8ce84e9589e05405abce3a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3453783
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#79056}
2022-02-11 19:22:25 +00:00