Commit Graph

69607 Commits

Author SHA1 Message Date
Manos Koukoutos
546929280e [wasm-gc] Add array.init constant expression
Bug: v8:7748
Change-Id: I3fa510b4dc35d3f58532ecbbeecd79d2826ff667
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2951722
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75115}
2021-06-14 08:23:06 +00:00
Al Muthanna Athamina
e4921a2ae4 Alpha-sort dependencies
Bug: chromium:1217912
Change-Id: Ic34e56a223ce4068c4ce62e001dd22b49f153d67
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2959608
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75114}
2021-06-14 08:13:26 +00:00
Andreas Haas
fd93f33824 [wasm][liftoff] Cache the memory start register
WebAssembly functions often have subsequent memory accesses, and each of
these memory accesses need the start address of the memory in a register.
With this CL the register with the memory start address is cached, so
only the first memory access has to load the memory start address into a
register, subsequent memory accesses can just reuse the register.

In first measurements with the epic benchmark this reduces the size of
the generated Liftoff code by a bit more than 5%.

R=clemensb@chromium.org

Bug: v8:11862
Change-Id: Ic33e7e3c00a4209570821269c728187affbeadcf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2947403
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75113}
2021-06-14 07:49:16 +00:00
Al Muthanna Athamina
64828e21b0 Add dependency for logdog
Bug: chromium:1217912
Change-Id: I61f1dd82a5fdcae3d134d05c76c06ee47feffcca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953281
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75112}
2021-06-14 07:41:06 +00:00
Georg Neis
65cb085234 Revert "[turbofan] Turn on --turbo-optimize-apply by default"
This reverts commit 26f4585eb6.

Reason for revert: Clusterfuzz issues

Original change's description:
> [turbofan] Turn on --turbo-optimize-apply by default
>
> Bug: v8:9974
> Change-Id: I5853177be27d0d31087e436f0311d5a077cc2124
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2951723
> Reviewed-by: Andreas Haas <ahaas@chromium.org>
> Commit-Queue: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#75098}

Bug: v8:9974
Change-Id: I6ead63c2ae8ed2693805c337b68435b3de99d018
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2960208
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75111}
2021-06-14 06:26:46 +00:00
Marja Hölttä
8539660060 [web snapshot] Add arrays
Drive-by: Also add deferred function references.

Bug: v8:11525
Change-Id: If546f2e6c5a991372f1b99dac149504941a24b3e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2951731
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75110}
2021-06-12 09:20:24 +00:00
Igor Sheludko
775303f4b9 [wasm-gc] Support WasmObject elements loading in runtime
This CL adds WASM_ARRAY_ELEMENTS to distinguish WasmArray maps.

Bug: v8:11804
Change-Id: I243ce24c2f2246efbc223af14361c28506e9a2d2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2922884
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75109}
2021-06-11 21:47:44 +00:00
Zhi An Ng
14fda80410 Revert "[heap] Introduce ParkedSharedMutexGuardIf and use it in compiler"
This reverts commit 4cd856eee4.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20UBSan/16843/overview

Original change's description:
> [heap] Introduce ParkedSharedMutexGuardIf and use it in compiler
>
> In some cases it could happen that the concurrent compiler tries to get
> a shared lock on a mutex that is already exclusively held by the main
> thread. The background thread will then block itself until the
> main thread leaves the critical section. If the main thread then also
> starts a GC while holding the lock, this will result in a deadlock.
>
> A GC can't start until the background thread reaches a safepoint and
> the main thread can't leave the critical section before the GC ran.
>
> This CL introduces a new version of SharedMutexGuard named
> RecursiveSharedMutexGuardIfNeeded. This class will park the thread
> when blocking is needed and will unpark the thread again as soon as
> the lock was acquired successfully. This resolves the deadlock on
> safepointing.
>
> Turbofan can then simply use that class internally for
> MapUpdaterGuardIfNeeded.
>
> Bug: v8:10315, chromium:1218318
> Change-Id: Ice04b222cc979e4905791118caede26e71fca6de
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953288
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#75107}

Bug: v8:10315
Bug: chromium:1218318
Change-Id: Ied5d8d8f3e4c7e036a5a42a25c43e8ca1ecc1218
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2956698
Auto-Submit: Zhi An Ng <zhin@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@{#75108}
2021-06-11 20:29:05 +00:00
Dominik Inführ
4cd856eee4 [heap] Introduce ParkedSharedMutexGuardIf and use it in compiler
In some cases it could happen that the concurrent compiler tries to get
a shared lock on a mutex that is already exclusively held by the main
thread. The background thread will then block itself until the
main thread leaves the critical section. If the main thread then also
starts a GC while holding the lock, this will result in a deadlock.

A GC can't start until the background thread reaches a safepoint and
the main thread can't leave the critical section before the GC ran.

This CL introduces a new version of SharedMutexGuard named
RecursiveSharedMutexGuardIfNeeded. This class will park the thread
when blocking is needed and will unpark the thread again as soon as
the lock was acquired successfully. This resolves the deadlock on
safepointing.

Turbofan can then simply use that class internally for
MapUpdaterGuardIfNeeded.

Bug: v8:10315, chromium:1218318
Change-Id: Ice04b222cc979e4905791118caede26e71fca6de
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953288
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75107}
2021-06-11 18:52:54 +00:00
Michael Achenbach
ce9cc71c4b Revert "[no-wasm] Exclude trap-handler implementation"
This reverts commit 5d84b6cb9a.

Reason for revert: Breaks mac-arm64:
https://ci.chromium.org/p/v8/builders/ci/V8%20Mac%20-%20arm64%20-%20release/4636
https://chromium-swarm.appspot.com/task?id=5414a227cc3d6b10

Original change's description:
> [no-wasm] Exclude trap-handler implementation
>
> The trap handler is only needed for WebAssembly, hence it can be
> excluded in no-wasm builds (v8_enable_webassembly = false).
> This makes it easier to port WebAssembly to platforms that do not need
> to support WebAssembly.
>
> R=​ahaas@chromium.org, jkummerow@chromium.org
> CC=​johnx@google.com
>
> Bug: v8:11877
> Change-Id: I25c34c2c4f1122227047e13add532ee2b9f73d2f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953285
> 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@{#75101}

Bug: v8:11877
Change-Id: I7a98341f6c03667c6400dced2bc69746011dd3d4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2956868
Auto-Submit: Michael Achenbach <machenbach@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@{#75106}
2021-06-11 18:06:14 +00:00
Dominik Inführ
6b32e7d193 [heap] Fix concurrent allocation in shared map space
Two DCHECKS had to updated to allow for concurrent MAP_SPACE
allocations.

Bug: v8:11708
Change-Id: I8a059d2e5942f511802a95ec27cf566414dd740e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2951724
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75105}
2021-06-11 18:00:44 +00:00
Junliang Yan
a566732140 PPC:s390: [sparkplug][arm][arm64[ia32] Callee-saved registers for RecordWrite
Port c5d41ae6d2

Original Message:
    Migrate the remaining architectures to the new callee save
    RecordWrite approach.

Bug: v8:11420
Change-Id: I20ddf47690203fe9a0cd76dea3a08658582faf9d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953486
Auto-Submit: Junliang Yan <junyan@redhat.com>
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#75104}
2021-06-11 16:30:14 +00:00
Dan Elphick
c26965bded [build] Reduce size of inline header cycles
This removes/replaces header includes with the aim of shrinking the
size of the inline header cycle. Specifically before this CL, there was
a single Strongly-Connected Component comprising 60 header files from
src/objects and src/heap.

Now there are two 2 SCCs. The src/heap SCC has 6 files and depends on
the src/objects SCC, which has 50 files. Additionally some previously
implicit dependencies have been added.

Dependencies calculated using:
git grep "#include \"" *.h *.cc | sed 's/:#include "/ /;s/".*$//' | \
awk 'BEGIN {print "digraph deps {" } END {print "}"} {print "\""$1"\" -> \""$2"\""}'

SCCs found using sccmap from graphviz.

Also removes unused Cell::FromValueAddress method.

Change-Id: Ib19d00ccd14e490ee64d57be4d99b1b3686ac32a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2951734
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75103}
2021-06-11 15:36:04 +00:00
Daan de Graaf
930fb6463b [wasm-simd][arm64] Fuse add and extadd_pairwise_u.
The two instructions are fused into a single Uadalp instruction,
improving performance of quantized neural network operator
implementations such as XNNPACK.

Bug: v8:11546
Change-Id: Ic11b35d1e7758ee0b4ccfe8f592edc1aa798f6f2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2939997
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Daan de Graaf <daagra@google.com>
Cr-Commit-Position: refs/heads/master@{#75102}
2021-06-11 15:33:24 +00:00
Clemens Backes
5d84b6cb9a [no-wasm] Exclude trap-handler implementation
The trap handler is only needed for WebAssembly, hence it can be
excluded in no-wasm builds (v8_enable_webassembly = false).
This makes it easier to port WebAssembly to platforms that do not need
to support WebAssembly.

R=ahaas@chromium.org, jkummerow@chromium.org
CC=johnx@google.com

Bug: v8:11877
Change-Id: I25c34c2c4f1122227047e13add532ee2b9f73d2f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953285
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@{#75101}
2021-06-11 14:24:54 +00:00
Thibaud Michaud
0db4391f17 [wasm][eh] Make try block handler optional
A try block may have no handler. Relevant links:
https://github.com/WebAssembly/exception-handling/issues/131
https://github.com/WebAssembly/exception-handling/pull/157

R=clemensb@chromium.org

Bug: v8:8091
Change-Id: Ia429762714dd87ed6b043f95c3496c65aaa8495f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2949100
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75100}
2021-06-11 13:16:43 +00:00
Vicky Kontoura
25c3eda997 [web snapshot] Fix GC issue when creating a FunctionContext
This CL fixes WebSnapshotDeserializer::DeserializeContexts(), so that
the new FunctionContext is allocated after the ScopeInfo is set up.

Bug: v8:11525, v8:11706
Change-Id: Idb14c0fa5b5d51827e9f208f54c82a94535343a4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953292
Commit-Queue: Vicky Kontoura <vkont@google.com>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75099}
2021-06-11 12:26:43 +00:00
Georg Neis
26f4585eb6 [turbofan] Turn on --turbo-optimize-apply by default
Bug: v8:9974
Change-Id: I5853177be27d0d31087e436f0311d5a077cc2124
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2951723
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75098}
2021-06-11 12:25:38 +00:00
Dominik Inführ
7b1d3f7a42 [heap] Optimize ParkedMutexGuard
We do not need to park/unpark when we can acquire the lock without
blocking.

Bug: v8:10315, chromium:1218318
Change-Id: I7909936531ffe83087182d50e759113a9305fbcf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953287
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75097}
2021-06-11 12:24:33 +00:00
Clemens Backes
de252121e5 [wasm] Remove redundant inline annotations
Functions defined inside a class declarations are inline by default.
Thus remove the 'inline' annotation from all such definitions.

Drive-by: Move the 'inline' annotation of
{WasmFunctionBuilder::signature} from the definition to the declaration.

R=jkummerow@chromium.org

Bug: v8:11384
Change-Id: I18be0b7d83c2414b3237e2f834e470c613143d7f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953320
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75096}
2021-06-11 11:09:43 +00:00
Leszek Swirski
0e9f9aabfd [system-analyzer] Use Streams API for log files
Use the Streams API for file Blobs, instead of FileReader, to allow
large files to be loaded in chunks.

Change-Id: I241e0daff3f9c3d491dde2f3e8e52ea2236f05be
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953286
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75095}
2021-06-11 11:07:08 +00:00
Sigurd Schneider
fdf0a3a7a6 Only enumerate own properties in value-mirror.cc
We previously enumberated properties and then restricted them
to real named properties. This CL changes it to only enumerate
own properties in the first place.

Bug: chromium:1213393
Change-Id: I8665a19a9beccae3bef99106924b65fb219d48ca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953284
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75094}
2021-06-11 11:06:03 +00:00
Liu Yu
d50363610b [mips][sparkplug] Port Sparkplug to mips and mips64
Bug: v8:11421

Change-Id: I1d3f8d3211d06d3e47ffd530715c1dbfbaf79fe8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2954905
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#75093}
2021-06-11 10:53:43 +00:00
Georg Neis
d9726d1aec [compiler] Improve --trace-turbo-scheduler printing of blocks
The output was utterly confusing because block identities were printed
in different ways:

- "id:5" for a block with id 5
- "B5" for a block with rpo number 5
- also (!!!) "B5" for a block with id 5


With this CL, the last case above is eliminated such that there is no
ambiguity. I originally wanted to unify the prefix syntax as well (e.g.
"id:5" and "rpo:5"), but the prefixes are hard-coded in countless
places including CodeGenerator, Turbolizer, and Verifier. Many of these
are format strings that are painful to write more generically.

Change-Id: I0eb70731c7b1ef9a9999e0bcb58b673288932e93
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2940890
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75092}
2021-06-11 10:50:13 +00:00
Michael Achenbach
118b1b0098 [test] Print Python version that's running on bots
Bug: v8:9871
Change-Id: I66976c3490ec9fd732f99a8500bae9925bb89446
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953185
Auto-Submit: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75091}
2021-06-11 08:35:36 +00:00
Fanchen Kong
dd740bc2cb Fix CSA_ASSERT failure in CollectCallFeedback
This failure comes as the feedback is cleared but the CallFeedbackContent field remain unchanged.

Bug: v8:11851
Change-Id: I75a0acad74dcaab1feafe97779e03caa8b7833de
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2948426
Commit-Queue: Fanchen Kong <fanchen.kong@intel.com>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75090}
2021-06-11 02:14:42 +00:00
Frank Tang
6ec261dcae [intl] Stage Intl.DisplayNames v2
Stage 3 proposal
Spec: https://tc39.es/intl-displaynames-v2/
R2T: https://groups.google.com/a/chromium.org/g/blink-dev/c/XOJE7zVlxnI/m/cnkuazxHAwAJ
Design Doc: https://docs.google.com/document/d/17hQz4nOC7PJYhxc_MU-BRoT6BnYGZv66XlU1iGX0ywQ

Bug: v8:11637
Change-Id: I6183f53bd7c3eae174c306debf0779a5be051d29
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2952040
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75089}
2021-06-10 20:28:09 +00:00
Andreas Haas
57658dd9d6 [wasm][liftoff] Use the comparison lookahead also for kExprIf
There was already a lookahead implementation in Liftoff for the case
where a comparison was followed by kExprBrIf. This CL extends this
lookahead implementation to kExprIf as well. This extension reduces the
size of the code generated by Liftoff in the Epic benchmark by 1.5%.

R=clemensb@chromium.org

Bug: v8:11873, v8:11862
Change-Id: If4428bdd64eedcdd6dc543efc3b9945cbd8be3cc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953322
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75088}
2021-06-10 19:22:49 +00:00
Junliang Yan
67f489a29a ppc: Unify Memory Operation 8 final
Change-Id: I8b17676bbd9f614271f414a3a1432d0db0994adf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953044
Commit-Queue: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Auto-Submit: Junliang Yan <junyan@redhat.com>
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#75087}
2021-06-10 18:21:59 +00:00
Clemens Backes
fd8b734958 [wasm] Skip SAB test in predictable mode
This test is nondeterministic because it uses a SAB to synchronize
between workers. Workers still execute in their own thread (with their
own isolate) in predictable mode. Thus timing, and hence allocations,
are unpredictable in both isolates.

R=zhin@chromium.org

Bug: v8:11746
Change-Id: Ic6b213f7e4062b2146e2b203c724bfc705b6e68d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953323
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75086}
2021-06-10 18:13:09 +00:00
Manos Koukoutos
862ddf1efd [wasm] Do not enforce LE for globals and WasmValue
Changes:
- Remove endianness transformations from WasmValue contstructors.
  WasmValue will now use the system's endianness. Remove
  CopyToWithSystemEndianness.
- Remove endianness transformation from global variable load/stores in:
  wasm-compiler.cc, liftoff-compiler.cc, wasm-objects{.cc, -inl.h}, and
  wasm-interpreter.cc
- Adjust SIMD tests that directly access part of a value by changing
  which lane they access within that value. We do that by introducing
  a LANE macro and use it over ReadLittleEndianValue.

Change-Id: I99e97c6eae72e9a135b184633ec266049803bb03
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2944437
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75085}
2021-06-10 18:08:38 +00:00
Camillo Bruni
da438d9eac [tools][system-analyzer] Fix stack calculation
Traverse the sampled stack in the correct order. This results in several
order of magnitudes fewer flames rects.

- Fix flame rendering by having a fixed-width border
- Speed up flame rendering by setting shape-rendering to optimizeSpeed
- Fix rendering empty timelines

Bug: v8:10644, v8:11835
Change-Id: I5195d4d16a15c927ab25c7c111db69eeb0b0641a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2951728
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75084}
2021-06-10 18:01:59 +00:00
Junliang Yan
13e9525843 ppc: remove StoreTaggedFieldX
Change-Id: Ide62ce4c8ac13e6ae8e417bbe06a28c3772be785
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953040
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#75083}
2021-06-10 17:45:38 +00:00
Jakob Kummerow
f1acce32c5 [wasm] Make a few more traps uncatchable
With the upcoming "exception handling" proposal, we have to ensure
that traps are not catchable. This patch adds missing "uncatchable"
annotations to traps in the C-API and table-related instructions.

Fixed: v8:11813
Change-Id: I7bbd5043ede58a5315bd5117eb496ed014e79e91
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953160
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75082}
2021-06-10 15:33:17 +00:00
Michael Lippautz
74dde2fce1 cppgc-js: Fix weakness in heap snapshot
- Fix an issue where weak containers would not be marked properly when
  running with full object names. The problem was that in this
  configuration the object graph was not traversed at all in the first
  phase, meaning that no weak links would be found.
- Add edges to weak containers in the second phase that actually builds
  the snapshot.
- Mark all weak containers instead of just ephemerons, to avoid having
  fully weak containers show up as retainers.

Bug: chromium:1056170
Change-Id: I8b29e00a5d77028892c16e3c29258cd598083082
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2951730
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75081}
2021-06-10 14:51:15 +00:00
Michael Lippautz
7144f64189 cppgc-js: Fix node merging in C++/JS snapshots
JS nodes that are connected to C++ nodes are merged with them in the
snapshot.

Bug: chromium:1056170
Change-Id: I137a21b3d847e669bf65962224050f5402bcff7c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2951732
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75080}
2021-06-10 14:50:05 +00:00
Patrick Thier
f5a3017122 [test] Disable --always-opt for mjsunit/baseline/batch-compilation.js
Explicitliy add --no-always-opt to prevent Fuzzer failures.

Bug: v8:11853
Change-Id: Idf1ee842fd7e404516e27d1f5f5e6afe87fc5bd1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2951726
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75079}
2021-06-10 14:47:55 +00:00
Liu Yu
43aca435cb Reland "[sparkplug] Adjust compare and jump function in sparkplug"
This is a reland of febfbb21b9

Original change's description:
> [sparkplug] Adjust compare and jump function in sparkplug
>
> Mips and risc-v do not have the flag register and can not decide
> whether to jump through flags in JumpIf();
>
> Therefor, we merge the comparison with the jump;
>
> Bug: v8:11803
>
> Change-Id: If53752da93b97e8ff65affdfe99e5de8e1a1493f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2921034
> Auto-Submit: Liu yu <liuyu@loongson.cn>
> Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#75001}

Bug: v8:11803
Change-Id: Ib3cb89d8a9f59aad3fbd857881699e84e8fcd8aa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2945538
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75078}
2021-06-10 13:54:35 +00:00
Santiago Aboy Solanes
ae922188a4 [compiler] Add TSAN support for generated code movq and movl
We have to not have any instructions between EmitOOLTrapIfNeeded and the
movs. For this reason, we are now emitting EmitTSANStoreOOLIfNeeded
after the store rather than before.

We are also now requiring the code_kind to know if we are compiling a
FOR_TESTING function.

Finally, we have to differentiate between two different wasm-to-js
functions: one lives in the wasm code space, and another one lives on
the heap. The one that lives in wasm code space calls wasm stub calls,
and the other one calls the builtin like JS does.

Bug: v8:7790, v8:11600
Change-Id: Iafb4643068ae4e31881662e032f73af98a66baca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2945185
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75077}
2021-06-10 13:37:55 +00:00
Milad Fa
2b9cd1c963 PPC: optimize load/store of reversed bytes
We can detect the sequence during instruction selection and
if possible emit a single load/store byte reversed opcode instead
of doing the same separately (i.e load/store and then reverse).

Change-Id: Ib7d0c8c7105382637c33cafac5b5f4e23e8e553d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2950243
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#75076}
2021-06-10 13:36:15 +00:00
Camillo Bruni
c5d41ae6d2 [sparkplug][arm][arm64[ia32] Callee-saved registers for RecordWrite
Migrate the remaining architectures to the new callee save RecordWrite
approach.

Bug: v8:11420
Change-Id: I9da56cbb5bf8c6ca4bcc7c0e2a1233e2f5ef587c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2944844
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75075}
2021-06-10 13:16:35 +00:00
Camillo Bruni
86952023f1 [tools][system-analyzer] Improve flamechart
- Vertically adjust flamechart to show deep stacks
- Highlight currently hovered function in the complete flamechart

Bug: v8:10644, v8:11835
Change-Id: Ibb5839c332f28c552162943f3eb65435de11a36a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2950244
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75074}
2021-06-10 13:07:45 +00:00
Lu Yahan
900d6b930a [riscv64] Optimize Branch with near label
If a label was binded after Branch in 4096 offst, we should use Branchshort.

Change-Id: I2197e2a18a43627370ed9b67b7ef7d678a2a62a8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2944795
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Commit-Queue: Brice Dobry <brice.dobry@futurewei.com>
Reviewed-by: Brice Dobry <brice.dobry@futurewei.com>
Cr-Commit-Position: refs/heads/master@{#75073}
2021-06-10 12:56:42 +00:00
Lu Yahan
998370fd81 [riscv64] Optimize-trampoline
In trampoline, we emit auipc+jalr first. But the offset between target and trampoline is less than int21, so we can use jal to replace auipc+jalr.
It can reduce number of execution instruction.

Change-Id: Idc37d80341030130c478209681cb54c63d1ddf27
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2939442
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Commit-Queue: Brice Dobry <brice.dobry@futurewei.com>
Reviewed-by: Brice Dobry <brice.dobry@futurewei.com>
Cr-Commit-Position: refs/heads/master@{#75072}
2021-06-10 12:55:02 +00:00
Milad Fa
088e252d16 [sparkplug] Disable Batch compilation on unsupported platforms
Batch compilation needs to remain disabled on unsupported platforms
to avoid this compilation error:

error: assignment of read-only location '* conclusion_pointer'

Bug: v8:11790, v8:11420
Change-Id: I64aaf6476fdb585f8210331f31b01ebefe9c61c0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2949969
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#75071}
2021-06-10 12:09:34 +00:00
John Xu
0395c42b1e Revert to use memcpy instead of base::Memcpy
For Cobalt's purpose in the past, we introduced base::Memcpy to
intercept memcpy calls and replace it with SbMemoryCopy on
Starboard/Cobalt. Recently Cobalt removed SbMemoryCopy because we found
out that memcpy implementation is universal. To reduce the cost to
maintain base::Memcpy, let us remove it and revert back to raw memcpy.

Bug: v8:10927
Change-Id: I060f191f8f1aed8b78ffe4558a3743f3a2da008b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2951462
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: John Xu <johnx@google.com>
Cr-Commit-Position: refs/heads/master@{#75070}
2021-06-10 10:19:24 +00:00
Marja Hölttä
c1e9da818a [web snapshot] Implement deferred references
This allows forward references among objects as well as contexts
referencing objects.

Bug: v8:11525
Change-Id: I45fd132344c5e0125d8287c668eac444fe1f8802
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2947408
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75069}
2021-06-10 09:58:14 +00:00
Sathya Gunasekaran
e3d280ce5d Revert "Reland "heap: Fix initial GC configuration for C++-only heaps""
This reverts commit 1f0b0ed0e4.

Reason for revert: still crashing https://ci.chromium.org/ui/p/chromium/builders/try/android-marshmallow-arm64-rel/877258/test-results

Original change's description:
> Reland "heap: Fix initial GC configuration for C++-only heaps"
>
> This is a reland of 7ef67b2e9e
>
> Manually checked that the CL was not the culprit breaking
>   media_blink_unittests --gtest_filter=WebMediaPlayerImplTest.MemDumpReporting
>
> Original change's description:
> > heap: Fix initial GC configuration for C++-only heaps
> >
> > Heaps in V8 start with a large limit that is shrunk upon young
> > generation GCs, based on some liveness estimate. This provides best
> > throughput during startup while at the same time finding a reasonable
> > first limit.
> >
> > For C++ (embedder memory) there is no estimate which is why it was
> > piggy-backing on V8. This breaks in scenarios where no JS memory is
> > allocated.
> >
> > In this fix we start a memory reducer after embedder memory has hit
> > the activation threshold if no GC happened so far. As soon as a single
> > Scavenger has happened, we leave it up to the JS estimate to figure
> > out a limit. Memory reducing GCs will then find a regular limit based
> > on the initial live size.
> >
> > Drive-by: Give embedders the same activiation threshold of 8MB as JS.
> >
> > Bug: chromium:1217076
> > Change-Id: I8469696002ac2af8d75d6b47def062d2608387a1
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2944935
> > Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> > Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#75012}
>
> Bug: chromium:1217076
> Change-Id: I482d8525379e33095834d5b41be8bb49bdd8a5d4
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2949094
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#75048}

Bug: chromium:1217076
Change-Id: Ia409d7a3a22127af749cff5eb5db1ff508b969e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2951468
Auto-Submit: Sathya Gunasekaran  <gsathya@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@{#75068}
2021-06-10 08:20:04 +00:00
Dylan Cutler
479df6a27d Use more inclusive language in ./test/inspector/debugger/.
Bug: chromium:1097184
Change-Id: Ifa64885cb74ffe05ef56aca59150c89d8f11dd1d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2945276
Auto-Submit: Dylan Cutler <dylancutler@google.com>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75067}
2021-06-10 07:51:04 +00:00
Benedikt Meurer
887bacacb0 [debug] Consistent Step-In behavior for generator functions.
This change addresses inconsistencies wrt. to stepping into generator
functions and breaking on the implicit initial yield. The new behavior
is the following:

 1. Stepping into a generator function doesn't trigger "generator
    stepping", but rather pauses right before the initial yield
    (assuming there a no non-simple parameters in between).
 2. When paused on the initial yield and stepping into or over, we also
    don't turn on "generator stepping" immediately, but rather return to
    the caller and only enter "generator stepping" on SuspendGenerator
    bytecodes that correspond to `yield`s or `await`s in the source
    code.

This matches the stepping behavior of regular functions more closely and
seems like a good compromise.

Fixed: chromium:901814
Change-Id: Ifc6c174011df1afea183e2c6ec21de27d72b17a7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2949099
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75066}
2021-06-10 07:49:04 +00:00