Commit Graph

70509 Commits

Author SHA1 Message Date
Andreas Haas
cace2f533e Reland "[wasm] Support partial serialization of modules"
The original CL was flaky because deserialization did not wait correctly
for the compilation of missing functions to finish. The baseline-finished
event was set even when there were still some functions missing. The
combination of deserialization and lazy compilation was also not handled
correctly.

Original change's description:
> [wasm] Support partial serialization of modules
>
> At the moment a WebAssembly module can be serialized successfully when
> all functions were compiled with TurboFan. However, for some functions
> it may not be necessary to be compiled with TurboFan, e.g. for functions
> where Liftoff code is as good as TurboFan code.
>
> With this CL we allow WebAssembly modules to get serialized even when
> not all functions are compiled with TurboFan. Missing functions are
> marked as missing in the serlialization. Upon deserialization, missing
> functions either get compiled by Liftoff, or initialized with a
> lazy-compilation stub, depending on the V8 configuration.
>
> Bug: v8:11862

Change-Id: I79a9e8e14199cff87fce6ae41a87087e047bbc65
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3060485
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76017}
2021-07-30 11:18:38 +00:00
Paolo Severini
530fd795a9 [fastcall] Type-specialize CopyAndConvertArrayToCppBuffer
Rename CopyAndConvertArrayToCppBuffer as
TryCopyAndConvertArrayToCppBuffer and implement type specialization for
int32_t and double in order to speed up V8 bindings with sequences.

This API is used by Blink code, for example see
https://chromium-review.googlesource.com/c/chromium/src/+/3027405.

Bug: v8:11739
Change-Id: I026a7f5e7833fb1afcc2ea9c296b66c7f733cbb1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3036407
Commit-Queue: Paolo Severini <paolosev@microsoft.com>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76016}
2021-07-30 10:52:12 +00:00
Clemens Backes
3a44f269c5 [base] Avoid pthread_rwlock_t on Mac
pthread_rwlock_t can deadlock on Mac if signals are sent to the process
in the wrong moment. Since we use processes e.g. for sampling profiling
(in both d8 and in Chrome), we hence cannot safely use pthread_rwlock_t
on Mac. Instead, fall back to a non-shared pthread_mutex_t.

Interestingly, this shows no measurable performance impact in Wasm
compilation on my MBP.

R=mlippautz@chromium.org

Bug: v8:11399
Change-Id: Ie8bfd5288bba8c4f3315ee4502b39b59d39c9bbd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3060480
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76015}
2021-07-30 10:51:09 +00:00
Lu Yahan
e82b368b67 [riscv64][baseline] Add func FixOnHeapReferences
-- 3059689: [baseline] Fallback to handle references on heap compilation | https://chromium-review.googlesource.com/c/v8/v8/+/3059689

Change-Id: Ie055e181e5081d7acb2195ae41abaecdd0f68989
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3062030
Commit-Queue: Yahan Lu <yahan@iscas.ac.cn>
Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/master@{#76014}
2021-07-30 09:48:56 +00:00
Santiago Aboy Solanes
767101e7cd [compiler] Mark DescriptorArray as NeverEverSerialized
Bug: v8:7790
Change-Id: Id06775f9f3c7f1a505a736fcc4b992feb0d09308
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3056454
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76013}
2021-07-30 09:36:06 +00:00
Georg Neis
6af89d92e5 [heap] Add --trace-pending-allocations
Traces calls to Heap::IsAllocationPending that return true. This is
useful when debugging concurrent Turbofan.

Bug: v8:7790
Change-Id: If10e6f40c3bf03c768ad8b74403007fe86f860fe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3060488
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76012}
2021-07-30 08:03:26 +00:00
v8-ci-autoroll-builder
fdabdb04bf Update google_benchmark
Rolling v8/third_party/google_benchmark/src: ab74ae5..1067dfc

Remove dead code from PredictNumItersNeeded (#1206) (Braedy)
https://chromium.googlesource.com/external/github.com/google/benchmark/+/1067dfc

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

Change-Id: I4c52fee681f648ea2f1fbfc253e276a824de7011
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3062205
Reviewed-by: 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/master@{#76011}
2021-07-30 05:45:56 +00:00
v8-ci-autoroll-builder
5adac68ddb Update V8 DEPS.
Rolling v8/build: 82f37a4..8aa210e

Rolling v8/third_party/googletest/src: 4ec4cd2..2d924d7

Rolling v8/tools/clang: 30a89ee..d0097bc

Rolling v8/tools/luci-go: git_revision:2c98a90e4f4daa808cb69d51e71eee9289bd5422..git_revision:59603935354589d60cd8374e75889932bf84c33f

Rolling v8/tools/luci-go: git_revision:2c98a90e4f4daa808cb69d51e71eee9289bd5422..git_revision:59603935354589d60cd8374e75889932bf84c33f

Rolling v8/tools/luci-go: git_revision:2c98a90e4f4daa808cb69d51e71eee9289bd5422..git_revision:59603935354589d60cd8374e75889932bf84c33f

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

Change-Id: I1f2a40e39fdfc524bb0bd0ad4d007b564944286a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3062202
Reviewed-by: 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/master@{#76010}
2021-07-30 03:51:56 +00:00
Milad Fa
cd17e16f52 PPC [disas]: fix mtvsrdd on disassembler
mtvsrdd uses 2 gprs as input.

Change-Id: I4446a51bda1196ce262e3a90ed7c840da89c9d16
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3061478
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#76009}
2021-07-29 21:15:25 +00:00
Milad Fa
b67dd4294f PPC [simd]: optimize I64x2Mul on Power10
Cl also optimizes the usage on Power9 by using
mtvsrdd.

Change-Id: Ibd6b227111adc0c262c621be6ce4068d3de2e659
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3060493
Reviewed-by: Junliang Yan <junyan@redhat.com>
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#76008}
2021-07-29 21:13:45 +00:00
legendecas
d63ca69c22 [builtins] Implement Array#findFromLast and friends
This proposal reached Stage 3 at the July 2021 TC39.

https://github.com/tc39/proposal-array-find-from-last

Bug: v8:11990
Change-Id: I1364b46b7ed4bc56e4b3024d14bde799f9878b5a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3037160
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76007}
2021-07-29 19:37:15 +00:00
Junliang Yan
5e4e0126f1 ppc: [liftoff] implement FP rounding ops
Change-Id: I8d33239180b04afd322c99988dcf6aea0c928797
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3060495
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#76006}
2021-07-29 19:05:15 +00:00
Junliang Yan
867562a32d ppc: [liftoff] implement floating point abs/neg/sqrt
Change-Id: I4a11a5409922550119a3d8cafd254c4f8dd798e6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3060494
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#76005}
2021-07-29 18:25:15 +00:00
Milad Fa
5020d83e05 PPC/s390: [baseline] Fallback to handle references on heap compilation
Port 642a467338

Original Commit Message:

    If a GC happens between Code object allocation and Code finalization,
    we might have invalid embedded object references. We fallback and patch
    the refernces back to handles, then unbox the handles and relocate.

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

Change-Id: I680cc33fa9d06d7a00cc52c142599bb5536a9b88
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3060487
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#76004}
2021-07-29 15:42:33 +00:00
Mythri A
64556d13a4 [sparkplug] Introduce flush_baseline_code flag
Introduce a flush_baseline_code flag to control if baseline code is
flushed or not. Currently flush_baseline_code implies flush_bytecode
as well. So if flush_baseline_code is enabled both bytecode and baseline
code are flushed. If the flag is disabled we only flush bytecode and
not baseline code.

In a follow-up CL we will add support to control baseline and bytecode
flushing independently i.e. we can flush only bytecode / only baseline
code / both.

Bug: v8:11947
Change-Id: I5a90ed38469de64ed1d736d1eaaeabc2985f0783
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059684
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76003}
2021-07-29 15:04:32 +00:00
legendecas
8db991a042 [runtime] throw a realm type error when constructors are called
Each time a constructor is being called without new operator, a TypeError
is thrown. The TypeError should be the realm's one according to 10.2.1.5.b.

Refs: https://tc39.es/ecma262/#sec-ecmascript-function-objects-call-thisargument-argumentslist
Refs: https://github.com/tc39/ecma262/pull/2216
Bug: v8:11530
Change-Id: Iff10a78e96fb547fe2062c86b9f93a30d2a8be20
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3056830
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76002}
2021-07-29 14:34:22 +00:00
Marja Hölttä
140cd812a2 [rab/gsab] Update TypedArrayPrototypeByteOffset
This CL assumes https://github.com/tc39/proposal-resizablearraybuffer/issues/68
is indeed a spec bug.

Bug: v8:11111
Change-Id: I8d24f0d07f7ab40ba01b8c422868ad189d6f7e5a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3060478
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76001}
2021-07-29 14:30:12 +00:00
Marja Hölttä
faf85529f9 [rab/gsab] Add tests for destructuring
Bug: v8:11111
Change-Id: I52eb7e458fc614e3f5e936fb1761680a5cdeadb6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3056983
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76000}
2021-07-29 14:17:02 +00:00
Junliang Yan
dce2353991 ppc: [liftoff] implement sign extend ops
Change-Id: I0420b3cd9c940dbf684c0aa1478172921423c724
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3060483
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#75999}
2021-07-29 13:33:42 +00:00
Clemens Backes
af6a35c860 [runtime] Check for proper stack checks
When calling the {Isolate::StackOverflow} method, we should not have
overflown the stack limit by too much. Otherwise there might not be
enough space on the stack for handling the stack overflow exception.

This DCHECK would have failed before landing https://crrev.com/c/3059074
and https://crrev.com/c/3059075. If it fails, we might need to add more
special stack checks also in other places. Such failures should not be
considered security issues per se, but we should try to fix them to
avoid potential issues.

R=jkummerow@chromium.org
CC=ahaas@chromium.org

Bug: v8:12017
Change-Id: I25e42a20d3fcc981c266ae998f52b3f090237297
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059076
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75998}
2021-07-29 13:16:12 +00:00
Leszek Swirski
580508f868 Revert "[wasm] Support partial serialization of modules"
This reverts commit bce81d6be0.

Reason for revert: Newly introduced test is flaking, e.g. https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20ASAN/41030/overview or https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux/43171/overview

Original change's description:
> [wasm] Support partial serialization of modules
>
> At the moment a WebAssembly module can be serialized successfully when
> all functions were compiled with TurboFan. However, for some functions
> it may not be necessary to be compiled with TurboFan, e.g. for functions
> where Liftoff code is as good as TurboFan code.
>
> With this CL we allow WebAssembly modules to get serialized even when
> not all functions are compiled with TurboFan. Missing functions are
> marked as missing in the serlialization. Upon deserialization, missing
> functions either get compiled by Liftoff, or initialized with a
> lazy-compilation stub, depending on the V8 configuration.
>
> Bug: v8:11862
> Change-Id: Ic833a17639bf841c5def6fe3c35173fe0376c246
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2960209
> Commit-Queue: Andreas Haas <ahaas@chromium.org>
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#75987}

Bug: v8:11862
Change-Id: I5445c097ec47f407e5f951d4cf6d2168113f80e8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3060484
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#75997}
2021-07-29 13:05:14 +00:00
Victor Gomes
642a467338 [baseline] Fallback to handle references on heap compilation
If a GC happens between Code object allocation and Code finalization,
we might have invalid embedded object references. We fallback and patch
the refernces back to handles, then unbox the handles and relocate.

Bug: v8:11872
Change-Id: I3a7b050c20179c1708eef343ec8266441ab5dca1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059689
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75996}
2021-07-29 12:28:42 +00:00
Clemens Backes
9e0e2c150c [liftoff] Add code comments for large stack checks
This adds a code comment before the OOL code for the special stack check
for a large frame. Otherwise it is hard to see where it begins in the
code, and it might be unexpected to see that block of code at the end of
a Liftoff function.

Drive-by: Replace another "out of line: " comment by "OOL: ", which is
typically understood equally well.

R=ahaas@chromium.org

Bug: v8:12017
Change-Id: Ie8b243cedebe979ca46e0515a9fdd0695ab58304
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059081
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75995}
2021-07-29 12:17:02 +00:00
Thibaud Michaud
d66cc11c2f [wasm][eh] Rename exception to tag
The JS API constructor was renamed to "WebAssembly.Tag" to match the
spec:
https://github.com/WebAssembly/exception-handling/issues/159

Rename "exception" to "tag" throughout the codebase for consistency with
the JS API, and to match the spec terminology (e.g. "tag section").

R=clemensb@chromium.org,nicohartmann@chromium.org

Bug: v8:11992
Change-Id: I63f9f3101abfeefd49117461bd59c594ca5dab70
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3053583
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75994}
2021-07-29 12:09:02 +00:00
Marja Hölttä
ce1a9ab683 [rab/gsab] Enable code paths needed for BigInt TypedArrays
Bug: v8:11111
Change-Id: Ib3ae55349024ebeab9ceaf9472a6de2b4d86ce55
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3056975
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75993}
2021-07-29 11:30:42 +00:00
Jakob Gruber
2442ea5e80 [compiler] Only clear cached PAIs in stress modes
Clearing cached PropertyAccessInfos is used for stress-testing. Note
all this will soon be removed.

Bug: v8:7790,chromium:1234288
Change-Id: I4576563375b65830296cad295342823700d13b3a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059696
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75992}
2021-07-29 11:28:22 +00:00
Clemens Backes
72b0756ea1 [liftoff][ia32] Add explicit stack check for large frames
Add an explicit check for the available stack space before allocating a
large frame. Even though this typically does not cause problems on ia32,
we should do it to be consistent with other platforms and with TurboFan
code.

This follows the same structure as on x64: https://crrev.com/c/3059074

A follow-up CL will add a DCHECK to verify that we never overflow the
stack space by more than 4KB (https://crrev.com/c/3059076).

R=ahaas@chromium.org

Bug: v8:12017
Change-Id: Ifffe56f29feae14545e6f70e30a1c94c5eabad6f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059075
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75991}
2021-07-29 11:11:42 +00:00
Clemens Backes
bbeccc35e4 [liftoff][x64] Add explicit stack check for large frames
Add an explicit check for the available stack space before allocating a
large frame. Even though this typically does not cause problems on x64,
we should do it to be consistent with other platforms and with TurboFan
code.

After also fixing ia32 (https://crrev.com/c/3059075), we can add a
DCHECK to verify that we never overflow the stack space by more than
4KB (https://crrev.com/c/3059076).

R=ahaas@chromium.org

Bug: v8:12017
Change-Id: I4f407dc6a83d4a71636066777706f23d05002111
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059074
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75990}
2021-07-29 10:43:25 +00:00
Clemens Backes
43580d8274 [liftoff][arm64] Remove outdated comment
The comment is a left-over of the state before
https://crrev.com/c/3055302. It should have been removed as part of that
CL.

R=ahaas@chromium.org

Bug: v8:12017
Change-Id: Ic5234b230b3eda30e9a4a346e8c3b83c813a5dbf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059078
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75989}
2021-07-29 10:42:22 +00:00
Marja Hölttä
df45384de4 [rab/gsab] Fix JSTypedArray::Validate to throw for oob rab/gsab
This will change the behavior of %TypedArray%.prototype.fill.

Bug: v8:11111
Change-Id: I66e7d3decf07663a6497c3c86374b3c77ab6a682
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3056977
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75988}
2021-07-29 10:41:17 +00:00
Andreas Haas
bce81d6be0 [wasm] Support partial serialization of modules
At the moment a WebAssembly module can be serialized successfully when
all functions were compiled with TurboFan. However, for some functions
it may not be necessary to be compiled with TurboFan, e.g. for functions
where Liftoff code is as good as TurboFan code.

With this CL we allow WebAssembly modules to get serialized even when
not all functions are compiled with TurboFan. Missing functions are
marked as missing in the serlialization. Upon deserialization, missing
functions either get compiled by Liftoff, or initialized with a
lazy-compilation stub, depending on the V8 configuration.

Bug: v8:11862
Change-Id: Ic833a17639bf841c5def6fe3c35173fe0376c246
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2960209
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75987}
2021-07-29 10:27:42 +00:00
Omer Katz
acb0263c7f cppgc: Fix flaky crash due to used bytes counters mismatch
Cppgc reports used bytes statistics to CppHeap. CppHeap should forward
the stats to v8. However, if we are not allowed to trigger a GC, CppHeap
will cache the stats until the reporting.
On GC finalization, CppHeap resets v8's counters to the current marked
bytes counter.
If the last reported stats before GC finalization are cached, CppHeap
doesn't clear the cache on GC finalization. On the next stats reporting,
CppHeap will report the cached values. If the cache is a decrease that
is larger than the current marked bytes, a DCHECK in
LocalEmbedderHeapTracer::DecreaseAllocatedSize will fail.

Bug: chromium:1056170
Change-Id: I47933abc3e5f5c4a91454e0ec03adde5cf61d8fc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3056970
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75986}
2021-07-29 10:11:42 +00:00
Camillo Bruni
1d249e8cb4 [runtime][microtask] Various smaller performance tweaks
- Make sure we use fast prechecks in the header files
- MicrotaskQueue::CallEnqueueMicrotask returns a Smi instead of a
  more costly undefined value (the return value is enforced by the
  calling convention, but unused)
- Merge FireMicrotasksCompletedCallback into OnComplete

Change-Id: I3797b946bcffb6349e5693c41478bd2bad1f93fb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3024154
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75985}
2021-07-29 10:07:18 +00:00
Clemens Backes
02ba58d59d [ycm] Fix python script
This fixes the youcompleteme config script to look for ninja_output.py
in tools/vim instead of tools/ninja (it was moved there in
https://crrev.com/c/2797536), and makes a minor adjustment for python3
compatibility.

R=machenbach@chromium.org

Bug: v8:11879
Change-Id: Ia825903fb6019865244c5529bf2d23935a10ad5e
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059077
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75984}
2021-07-29 09:48:32 +00:00
Camillo Bruni
2049e188c6 [runtime] Remove is_runtime_stats_enabled without RCS
If v8_enable_runtime_call_stats == false, we don't need
TracingFlags::is_runtime_stats_enabled and can save a bit of code and
needless overhead.

Bug: v8:11299
Change-Id: Ia5ec51c29b2408b77b65984c5bba0ae16e0de243
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3024155
Reviewed-by: Patrick Thier <pthier@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75983}
2021-07-29 09:25:42 +00:00
Leszek Swirski
86c81a842e Reland^3 "[sparkplug] Enable sparkplug by default on desktop"
This is a reland of 1494106756
which is a reland of 0f79565bb7
which is a reland of 85e6c4b643

The _other_ gc-stress issue should be now be fixed with
https://crrev.com/c/3059072.

Relanding without changes.

TBR=verwaest@chromium.org

Original change's description:
> Reland^2 "[sparkplug] Enable sparkplug by default on desktop"
>
> This is a reland of 0f79565bb7
> which is a reland of 85e6c4b643
> GC-stress issue was still flushing, now fixed for real with
> https://crrev.com/c/3054117.
>
> Relanding without changes.
>
> TBR=verwaest@chromium.org
>
> Original change's description:
> > Reland "[sparkplug] Enable sparkplug by default on desktop"
> >
> > This is a reland of 85e6c4b643
> > GC-stress issue was flushing, fixed with https://crrev.com/c/3048172.
> > Relanding without changes.
> >
> > TBR=verwaest@chromium.org
> >
> > Original change's description:
> > > [sparkplug] Enable sparkplug by default on desktop
> > >
> > > Bug: v8:11420
> > > Change-Id: I07ac7f30b5ffffe40170ac15d5df0d3bf8a53523
> > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3041418
> > > Auto-Submit: Leszek Swirski <leszeks@chromium.org>
> > > Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> > > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> > > Cr-Commit-Position: refs/heads/master@{#75868}
> >
> > Bug: v8:11420
> > Change-Id: I44ac0e4a5df07db79fa50db3134cdae3af41c88c
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3053588
> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#75916}
>
> Bug: v8:11420
> Change-Id: I24c7aea81ca58c339fc3bcc904663bdefb93106b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3054118
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Cr-Commit-Position: refs/heads/master@{#75926}

Cq-Include-Trybots: luci.v8.try:v8_linux_gc_stress_dbg_ng,v8_linux_arm64_gc_stress_dbg_ng,v8_mac64_gc_stress_dbg_ng
Bug: v8:11420
Change-Id: I94f9927b689d876135750f6151de14f295035c72
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3056986
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75982}
2021-07-29 09:10:22 +00:00
Anton Bikineev
0da245a895 base: Fix races in BoundedPageAllocator
Due to missing locks, there is a race between AllocatePagesAt (or
ReserveForSharedMemoryMapping) and other functions that modify
std::sets in RegionAllocator (e.g. AllocatePages or ReleasePages).

The CL adds locks to AllocatePagesAt and ReserveForSharedMemoryMapping.

Bug: chromium:1232067
Change-Id: I0ec503ab1ab432952ea067eb916299ea88566879
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3056985
Auto-Submit: Anton Bikineev <bikineev@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75981}
2021-07-29 09:05:53 +00:00
Andrew Comminos
9bd74dfdbf [cpu-profiler] Include empty samples when context filter fails
If context filtration fails, ensure that we still include an empty
sample. This ensures that we can properly terminate stacks.

Bug: chromium:956688
Change-Id: I3edeb3434960c420e24827c209055f7c378361bf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3058053
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Andrew Comminos <acomminos@fb.com>
Cr-Commit-Position: refs/heads/master@{#75980}
2021-07-29 08:32:20 +00:00
Yoshisato Yanagisawa
e0a0350a67 Add two V8 Linux64 - builder shadows.
- goma cache silo is a builder to build the same target with cache silo.
  This is needed for fair build performance comparison between reclient
  and Goma.
- reclient compare is a builder to verify artifacts generated in remote
  and that generated locally matches.

Bug: chromium:1233780
Change-Id: I5854d20880e972a07fa09cfc5d4a6f9385844fbb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3058059
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75979}
2021-07-29 08:31:17 +00:00
Leszek Swirski
b4e62f2d14 [sparkplug] Fix invalid stack on baseline install
InterpreterOnStackReplacement_ToBaseline spills the accumulator register
without a frame, but can then call kInstallBaselineCode. If that
function then allocates, then the GC will see an invalid stack.

Fix this by making sure that the accumulator register is spilled inside
the internal frame of the kInstallBaselineCode, and either don't spill
it at all outside that frame, or at least make sure that we pop/re-push
the spilled value so that it moves inside the frame.

Bug: v8:11420
Change-Id: Iad2aa718b0477ff960544d881fecae9efcbeef54
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059072
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75978}
2021-07-29 08:13:47 +00:00
Leszek Swirski
b223262da5 Revert "Mark json-parser-recursive as slow"
This reverts commit 71e27849bb.

Reason for revert: As of https://crrev.com/c/3059685 it's fast.

Original change's description:
> Mark json-parser-recursive as slow
>
> Bug: v8:12029
> Change-Id: I0d25f8c844c9826e10ca2ccc6beb385439e97dde
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3058451
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Commit-Queue: Zhi An Ng <zhin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#75968}

Bug: v8:12029
Change-Id: I9536adbe4d8434e44d3e113104694baa3b3cea47
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059687
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#75977}
2021-07-29 08:08:50 +00:00
Leszek Swirski
89cf666e14 [test] Lower the stack size & iterations on JSON test
The test makes sure that JSON parsing doesn't stack overflow if given a
deeply nested JSON object. This deep nesting makes the test slow, so we
can test ~the same thing by lowering both the nesting and the stack
size.

Bug: v8:12029
Change-Id: I689ffc1b9db167a1cf1de93beeb09c89e03264a4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059685
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75976}
2021-07-29 08:07:48 +00:00
Yang Guo
19400b909d Include test/inspector/regress to swarming
R=machenbach@chromium.org

Bug: chromium:1234045
Change-Id: Id72ac120d161d1419a1c07d68dbe6314bf865e84
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059084
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Auto-Submit: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75975}
2021-07-29 08:00:47 +00:00
Leszek Swirski
f298b11b5e [profiler] Avoid double lookup in script map
Use the result of scripts.find() instead of using operator[] when
looking up scripts. This avoids an ugly const_cast, and avoids doing the
lookup twice.

Change-Id: I7c1a6be28928e2e3d928c389328be8785be3cff7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3056989
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75974}
2021-07-29 07:36:17 +00:00
Jakob Gruber
da3698523a [compiler] Remove invalid CHECK on mutable map bits
is_deprecated and is_stable are mutable and can be changed
concurrently.  We protect against changes through dependencies. CHECKs
on such fields are invalid.

Bug: v8:7790,chromium:1234206
Change-Id: I9bb7fab0342e0e2c33377c162b1912a8f93e760b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059682
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75973}
2021-07-29 07:12:27 +00:00
v8-ci-autoroll-builder
79c612b526 Update V8 DEPS.
Rolling v8/build: 0c49d51..82f37a4

Rolling v8/buildtools/third_party/libunwind/trunk: e6a0f63..cdb04dc

Rolling v8/tools/clang: def6c30..30a89ee

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

Change-Id: I422cf12eb5927bec02723c9b2937edaf0da84bfa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3058304
Reviewed-by: 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/master@{#75972}
2021-07-29 03:18:20 +00:00
Liu Yu
8c4188bf74 [mips][codegen] Remove PrepareForTailCall
Port: ec7171608b

Bug: v8:11879
Change-Id: Ib1ef3d984d559e4d4cec4d4daa9e1fec856f3686
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3058062
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/master@{#75971}
2021-07-29 01:31:27 +00:00
Milad Fa
06ae01909d Skip regress-crbug-1233401 for jitless mode
The test currently fails on machines with sparkplug enabled:
```
Flag --sparkplug: value implied by --jitless conflicts
with explicit specification
```
And passes on platform without sparkplug.

Bug: chromium:1233401
Change-Id: Ia0277f8d356e34efb611ca9960c11ec78b9b94ae
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3058300
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75970}
2021-07-28 21:30:37 +00:00
v8-ci-autoroll-builder
768e1570af Update V8 DEPS.
Rolling v8/build: 96a4da9..0c49d51

Rolling v8/third_party/aemu-linux-x64: LiTUyHa0AyC2fE72v094aZIjv1aTdQEZfYm-LIJVQIwC..EfaAueisHmQB3i2Cqncpzj07xFoDNrwT09yreit16bgC

Rolling v8/tools/clang: 2a8bb1c..def6c30

Rolling v8/tools/luci-go: git_revision:75ff299b9adf969190cafebe902255856a346f0b..git_revision:2c98a90e4f4daa808cb69d51e71eee9289bd5422

Rolling v8/tools/luci-go: git_revision:75ff299b9adf969190cafebe902255856a346f0b..git_revision:2c98a90e4f4daa808cb69d51e71eee9289bd5422

Rolling v8/tools/luci-go: git_revision:75ff299b9adf969190cafebe902255856a346f0b..git_revision:2c98a90e4f4daa808cb69d51e71eee9289bd5422

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

Change-Id: I39ed6b937454484fff5edd7ce34ba9befdb1478d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3058298
Reviewed-by: 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/master@{#75969}
2021-07-28 18:45:56 +00:00
Ng Zhi An
71e27849bb Mark json-parser-recursive as slow
Bug: v8:12029
Change-Id: I0d25f8c844c9826e10ca2ccc6beb385439e97dde
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3058451
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75968}
2021-07-28 18:09:06 +00:00