Commit Graph

58723 Commits

Author SHA1 Message Date
Adam Klein
5d787082b1 Revert "cppgc: Add targeted CHECK for diagnosing Peristent issue"
This reverts commit 4997ce58dd.

Reason for revert: CHECK triggers on content_browsertests, blocking V8 roll
https://cr-buildbucket.appspot.com/build/8829191878491185313

Original change's description:
> cppgc: Add targeted CHECK for diagnosing Peristent issue
>
> The added CHECK aims at finding problems where Peristent is used off
> the owning thread.
>
> Bug: chromium:1253650, chromium:1243257
> Change-Id: Ia0cbc6005aba38c0d98197ed18c3b40dd2dc33fd
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3306972
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Anton Bikineev <bikineev@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#78137}

Bug: chromium:1253650, chromium:1243257
Change-Id: I6b5c3d3ac0a01e1e3de31a10d5903ea26cf5ae9a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3308373
Auto-Submit: Adam Klein <adamk@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/main@{#78142}
2021-11-30 04:09:20 +00:00
Hao Xu
f9cb3fe60c [baseline] Optimize Binop with Smi rhs
Current Baseline compiler generates calls to Binop_Baseline for both
Binop and Binop with Smi rhs. This CL make BinopSmi calls to
BinopSmi_Baseline which does not do speculation for rhs.

Bug: v8:12442
Change-Id: Ied786af028429aa0842b9b6d2a5736779f24b568
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3303807
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Hao A Xu <hao.a.xu@intel.com>
Cr-Commit-Position: refs/heads/main@{#78141}
2021-11-30 02:11:57 +00:00
Manos Koukoutos
91ac9163d6 [wasm-gc] Fix WasmJSFunction polymorphic spec-inlining
{WasmInternalFunction::external} might return a function that is not
a WasmExportedFunction, at which point the code in ProcessTypeFeedback
fails.

See crrev.com/c/3277878 for context.

Bug: v8:12436, v8:12166
Change-Id: I09ef96df3fc051586044dd9c2ce88d6aeeb34b9f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3306391
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78139}
2021-11-29 21:11:27 +00:00
Milad Fa
2d34bb3de6 S390 [lifotff]: Fix endianness issue in atomic ops
result needs to byte-swapped as it's currently in machine
native order and Wasm requires LE ordering.

Change-Id: Ib29e26985b122a4c1ebba715c47a4d4477bbad54
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3301460
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#78138}
2021-11-29 19:56:07 +00:00
Michael Lippautz
4997ce58dd cppgc: Add targeted CHECK for diagnosing Peristent issue
The added CHECK aims at finding problems where Peristent is used off
the owning thread.

Bug: chromium:1253650, chromium:1243257
Change-Id: Ia0cbc6005aba38c0d98197ed18c3b40dd2dc33fd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3306972
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78137}
2021-11-29 19:50:57 +00:00
Nico Weber
496d95ff25 Make torque run fine in CFI builds with -std=c++17
It's not yet understood how this worked with c++14. Add the workaround,
so that we can figure this out in parallel with -std=c++17 enablement.

Bug: chromium:1273966
Change-Id: I7098d345a5df6e208dfd582eeaecab22e52fecb9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3304143
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78135}
2021-11-29 18:24:53 +00:00
Dominik Inführ
7b85e666ee [d8] Annotate global handles for realms
Annotating the global handles gives us a nice description in heap
snapshots.

Bug: v8:12198
Change-Id: Ie6385794a6b5a1d43f5730b6ff521611f1b366af
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3304067
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78134}
2021-11-29 17:43:08 +00:00
Seth Brenith
3bc5db7b7d Fix some incorrect retainers in heap snapshots
JSWeakRef and WeakCell both have weak pointers, which should be marked
as such in heap profiler snapshots.

Bug: v8:12112
Change-Id: Ie7aaa2cd3e44552427679e650e462d64704725d1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3299592
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#78133}
2021-11-29 17:10:08 +00:00
Omer Katz
74d0c0aaeb cppgc: CppHeap no longer inherits from EmbedderHeapTracer api
This CL removes registration of CppHeap as a remote tracer, and
revises LocalEmbedderHeapTracer as a switching point between CppHeap
and a remote tracer. Currently it is assumed that CppHeap and a remote
tracer are mutually exclusive and only one can be used at any given
time.

Bug: v8:12407
Change-Id: I53513d181ab63f56a88f05c3b76b47ac4dffe86f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289167
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78132}
2021-11-29 16:29:08 +00:00
Samuel Groß
afcd219181 [platform] Introduce AddressSpaceReservation API
This low-level API implements virtual address space reservations on the
supported platforms. An AddressSpaceReservation supports similar
functionality as the global page management APIs in the OS class but
operates inside a continuous region of previously reserved virtual
address space. A reservation is backed by regular mmap mappings on
Posix, by placeholder mappings on Windows, and by VMARs on Fuchsia.

Bug: chromium:1218005
Change-Id: I99bc6bcbc26eb4aa3b54a31c671c9e06e92c471b
Cq-Include-Trybots: luci.v8.try:v8_linux64_heap_sandbox_dbg_ng,v8_linux_arm64_sim_heap_sandbox_dbg_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3270540
Commit-Queue: Samuel Groß <saelo@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78130}
2021-11-29 15:31:01 +00:00
Marja Hölttä
76059a8612 [exceptions] Simplify the logic for determining which handler is on top
We had IsJSHandlerOnTop and IsExternalHandlerOnTop, which were almost
opposites but not quite. We often did the same computation repeatedly
for determining which kind of a handler is at the top (if any).

This CL simplifies the logic, and only does the three-way logic once:
either there's an external handler, a JS handler, or neither.

It also removes dead code from Isolate::ReportPendingExceptions: we
already do an early return if there's a JS handler on top, so we don't
need to re-check.

Bug: v8:12437
Change-Id: Ic15675bf2177772037d9fcec31c79019e4f0e02c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3302802
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78129}
2021-11-29 13:58:21 +00:00
Dominik Inführ
a6c6706ad4 [runtime] Add %TakeHeapSnapshot method for creating heap snapshots
This method should make it easier to debug memory leaks or out-of-memory
errors with d8.

Bug: v8:12198
Change-Id: I66d0ce8e04732badb7902453a1cd95ba9c29f3e4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3303801
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78128}
2021-11-29 13:50:35 +00:00
Benedikt Meurer
f1ddb2faa4 [inspector] Account for dynamic nature of the fn.name property.
With https://crrev.com/c/3272577 we introduced a `StackFrame` cache for
the inspector, which is keyed on the script ID, line and column number,
so the syntactic properties of the function. However, the name that we
report for functions is dynamic and can change (per closure) by
explicitly reconfiguring the "name" property via

```js
var f = function() { /* ... */ }
Object.defineProperty(f, "name", {value: "super duper function"});
```

for example, so we need to take that into account as well, and only use
the cached `StackFrame` instance if the dynamic names still match up.
Otherwise we just overwrite the cached entry with a new instance (the
assumption here is that "name" isn't reconfigured often).

Fixed: chromium:1274529
Bug: chromium:1268436
Change-Id: I519017c762aed5b4f93b9dc4553fa81d5979f1a1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3306376
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78127}
2021-11-29 13:28:54 +00:00
QiuJi
97b89b6a6d [wasm] Check for WasmExportedFunction before cast
{WasmInternalFunction::external} might return a function that is not
a WasmExportedFunction, at which point the code in ProcessTypeFeedback
fails.

See crrev.com/c/3277878 for context.

Bug: v8:12436
Change-Id: I447710cfa2dbdb64cba27922da85871d18bc79a3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3303613
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78126}
2021-11-29 13:24:05 +00:00
Nikolaos Papaspyrou
5c47acfcae heap: Create counter histograms lazily
Until now, histograms associated with isolate counters were created
at the time of isolate initialization. This is too early because it
happens before persistent memory is configured. Histograms created
before persistent memory is set up are retrieved periodically but
infrequently and are not "flushed" on process termination. As a result,
a lot of samples from V8 are lost.

This CL implements lazy creation of counter histograms, the first time
that they are used.

Bug: chromium:1270428
Change-Id: I8540b50b6c3dde1f477853a011b6c3f2c2c6ef9d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3284888
Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78125}
2021-11-29 13:20:26 +00:00
Michael Lippautz
db9c81d688 Reland "cppgc: Fix data race ObjectSizeTrait"
This is a reland of 76f6c27674

Original change's description:
> cppgc: Fix data race ObjectSizeTrait
>
> Fix benign race in
>   https://clusterfuzz.com/testcase-detail/5203237072076800
>
> Change-Id: I558b230e4905a48342d8e7cf70d39be5a1b7fdb8
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3306375
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Omer Katz <omerkatz@chromium.org>
> Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Omer Katz <omerkatz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#78121}

Change-Id: Ifa50f35591b2ae40f11a384f0fb2ff50115b2511
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3306379
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78124}
2021-11-29 13:14:25 +00:00
Maya Lekova
b52a7c66a2 Revert "cppgc: Fix data race ObjectSizeTrait"
This reverts commit 76f6c27674.

Reason for revert: Mac64 ASAN is unhappy, please see https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Mac64%20ASAN%20-%20builder/194/overview

Original change's description:
> cppgc: Fix data race ObjectSizeTrait
>
> Fix benign race in
>   https://clusterfuzz.com/testcase-detail/5203237072076800
>
> Change-Id: I558b230e4905a48342d8e7cf70d39be5a1b7fdb8
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3306375
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Omer Katz <omerkatz@chromium.org>
> Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Omer Katz <omerkatz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#78121}

Change-Id: I96c40a1e3421f59cf97efd4a844a041280989171
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3306377
Auto-Submit: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78122}
2021-11-29 12:33:16 +00:00
Michael Lippautz
76f6c27674 cppgc: Fix data race ObjectSizeTrait
Fix benign race in
  https://clusterfuzz.com/testcase-detail/5203237072076800

Change-Id: I558b230e4905a48342d8e7cf70d39be5a1b7fdb8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3306375
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78121}
2021-11-29 12:15:42 +00:00
Tobias Tebbi
bfaa4b2fe7 [builtins] fix Object.fromEntries fast-path
Bug: chromium:1272026
Change-Id: Ic569c61b21d4c9c95d62e731a48076c871dd74ec
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3303804
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78119}
2021-11-29 09:12:15 +00:00
Kim-Anh Tran
426eda0238 [debugger] Explicitly encode 'other' as a reason when stepping
Previously, we would encode 'other' as a reason for pausing when
stepping too, however, it would not show as such in case it would
overlap with another reason. This CL makes sure that we always report
'other' as a reason if we are stepping.

Drive-by: only encode 'other' as a reason once

Bug: chromium:1229541
Change-Id: Id73822dff68d1d54a2f1fafdf2a097e1377ece75
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295346
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78118}
2021-11-29 07:19:56 +00:00
Milad Fa
4b6b55372c AIX [lifotff]: Fix endianness issue in atomic ops
result needs to byte-swapped as it's currently in machine
native order and Wasm requires LE ordering.

Change-Id: I9c1d6752fbdaba18fb7a8d49a9848d04c1a21be8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3303954
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#78114}
2021-11-26 16:49:50 +00:00
Michael Lippautz
a1e49bf85b cppgc: Allow querying whether sweeping is active on owning thread
This allows the embedder to determine whether some function has been
called from a destructor.

See discussion in
  https://crrev.com/c/3302810

Bug: chromium:1273928
Change-Id: Icb5d98eff777574488a7d6de5e693c502c2fb53e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3303793
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78113}
2021-11-26 15:51:30 +00:00
Milad Fa
de058e5497 cppgc: Fix compilation error on gcc
Fixing a dcheck compilation error missed by
https://crrev.com/c/3302850

Change-Id: I98c7394cbe64d99647656aebd175c8321f53c2de
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3300927
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#78112}
2021-11-26 15:23:10 +00:00
Michael Lippautz
485ed82788 heap: MinorMC convert uses of Worklist to heap::base::Worklist
The CL converts uses of v8::internal::Worklist to heap::base::Worklist
which does not require to know the number of tasks working with the
work list upfront. heap::base::Worklist is the common implementation
for V8's heap and cppgc and should be used/optimized going forward.

Bug: v8:12426
Change-Id: If219edb8c0a8890c7bd0a131b8847b66256fdc21
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3302799
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78110}
2021-11-26 15:06:00 +00:00
Manos Koukoutos
2fa5551932 [wasm] Keep external function reference for externref tables/globals
See crrev.com/c/3277878 for context.

We should only transform extenral to internal function references when
passing a function value to a function-typed global or table. For their
externref counterparts, we should preserve the reference unchanged.

Bug: v8:11510, chromium:1273705
Change-Id: Ic1719c4d31e175f3a37ced6e4e4dfcd61a19ae57
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3302790
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78108}
2021-11-26 13:57:42 +00:00
Liu Yu
1d6dc2b9d9 [loong64][mips64][fastcall] Enable float support on loong64 and mips64
Port commit 098f31f495

Bug: chromium:1052746

Change-Id: I4f9fd952c2ce8b51772eac89d4852d55363d1ed1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3292352
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78106}
2021-11-26 13:22:49 +00:00
Igor Sheludko
2aa8722d9c [ext-code-space] Use cage-friendly HeapObject::map() in GC
... and thus avoid the need for special handling of objects located
in external code space.

This will also allow making HeapObject::IsBlah() checks faster when
external code space is enabled.

Bug: v8:11880
Change-Id: I12d07c05451ff198f0a6182d9b5849f76015e7fb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3300140
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78104}
2021-11-26 11:56:00 +00:00
Ben Noordhuis
7c90567a34 [base] fix glibc 2.34 build
PTHREAD_STACK_MIN is an alias for __sysconf(__SC_THREAD_STACK_MIN_VALUE)
in glibc 2.34.

__sysconf() returns long, causing a -Werror,-Wsign-compare error build
error.

Change-Id: I15da8e7ee57a6979682ff7166990698965481586
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3301464
Commit-Queue: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78097}
2021-11-25 23:49:40 +00:00
Milad Fa
befbf715e2 cppgc: Fix compilation error on gcc
After https://crrev.com/c/3301477 compilation with gcc could
fail with the following errors:
```
error: reference to 'MarkingType' is ambiguous
error: reference to 'SweepingType' is ambiguous
```

Change-Id: Idb0f52853d377ec0c0f373f2e908e6c7fa0da914
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3302850
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#78095}
2021-11-25 20:53:09 +00:00
Junliang Yan
28a83ead48 s390x: [baseline] implement Jump pt.1
Change-Id: Ie2815722ae1507cc5e2e7d510148063df3ebbf32
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3302848
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#78094}
2021-11-25 20:39:49 +00:00
Dominik Inführ
956d32e3f9 [heap] Fix accounting for left-trimmed arrays
ShouldVisit() uses obj.Size() to increment the live bytes counter after
the object was successfully marked grey. However, this re-reads the
length field which could have already been overwritten by a
concurrent left-trimming operation on the main thread. Fix this by
calculating the object size later with the length field we read before
marking that object black. That value is guaranteed to be a SMI.

Bug: chromium:1273352
Change-Id: I47e5a2df3eef61b4ef07af943f30123e5c2f7f9d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3302793
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78093}
2021-11-25 20:36:19 +00:00
Omer Katz
88c9b832cd Reland "cppgc: Parallel marking in atomic pause"
This is a reland of 6747144c82

Original change's description:
> cppgc: Parallel marking in atomic pause
>
> Bug: v8:12424
> Change-Id: I0633e1bd8c890c14ce2c5519253a5e6eb7592f04
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295580
> Commit-Queue: Omer Katz <omerkatz@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#78081}

Bug: v8:12424
Change-Id: I66a030b4e66647a76bbe3d114785d3052358b403
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3301477
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78092}
2021-11-25 19:38:14 +00:00
Victor Gomes
12c8801890 [baseline] Don't install if bytecode has been flushed
The bytecode can be flushed and/or the function can be
compiled and installed before the interruption to install
the new batch of compiled baseline code.

Bug: v8:12415, v8:12054
Change-Id: I092c8e0f31735119e6b2c6c46ce97ba8a4cdc91e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3302788
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78091}
2021-11-25 17:42:31 +00:00
Nico Hartmann
81b3178742 Revert "cppgc: Parallel marking in atomic pause"
This reverts commit 6747144c82.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/Linux%20V8%20FYI%20Release%20(NVIDIA)/17679/test-results

Original change's description:
> cppgc: Parallel marking in atomic pause
>
> Bug: v8:12424
> Change-Id: I0633e1bd8c890c14ce2c5519253a5e6eb7592f04
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295580
> Commit-Queue: Omer Katz <omerkatz@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#78081}

Bug: v8:12424
Change-Id: I8cd6ad8bb72906329bf820a8c1df06e8fa8d89a2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3301469
Owners-Override: Nico Hartmann <nicohartmann@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78089}
2021-11-25 13:42:59 +00:00
Hao Xu
aa58053d3a [CSA] Load jump offset on the branch it is used in JumpIf Handler
Some of the JumpIf Bytecode Handlers will load the jump offset from
bytecode array or constant pool before checking whether the condition is
matched, and this jump offset is unused if the jump not actually happens.

This CL move the Load operations to the branch on which the condition is
matched.

Bug: v8:12431
Change-Id: I3cb2fa7447ee2a9cb514148efb605617f95b1b68
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3300994
Commit-Queue: Hao A Xu <hao.a.xu@intel.com>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78088}
2021-11-25 12:36:29 +00:00
Igor Sheludko
56f44fc3ea [runtime] Fix constructors with custom instance types
Bug: v8:11256, chromium:1271807
Change-Id: Ifcef3d4cce0bda8dd18723b9b0ac22ad73c86773
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3296287
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78086}
2021-11-25 10:26:50 +00:00
Marja Hölttä
86e64bf119 [codegen] compiler.cc OWNERS += marja
Change-Id: I60734c6aa33298fad43d37b78cba8a7af2cc3cfe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3300131
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78085}
2021-11-25 10:15:39 +00:00
Victor Gomes
6993e5ab82 [baseline] Check dequeue compilation job success
Between the loop entry and the Dequeue call, another
thread might exhaust the queue itens and the Dequeue
call will return false without setting the job.

Bug: chromium:1272009
Change-Id: Ia254d97de36395676f069c100f46747b41483783
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3300130
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78084}
2021-11-25 09:24:49 +00:00
Omer Katz
6747144c82 cppgc: Parallel marking in atomic pause
Bug: v8:12424
Change-Id: I0633e1bd8c890c14ce2c5519253a5e6eb7592f04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295580
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78081}
2021-11-25 05:49:50 +00:00
Lu Yahan
4f06ec6de2 [riscv64] Implement simd for liftoff
Bug: v8:11976

Change-Id: Ifdce8e668c4b0fe20180c8d28b9c1d4abe705a67
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3297354
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#78078}
2021-11-25 01:42:30 +00:00
Michael Lippautz
53d9e8b19c cppgc: Fix data race in DCHECK in ObjectSizeTrait
The DCHECK must use atomic accessors as well.

Change-Id: I94983c1e38bc9d436f1577509788fc21e3d4e374
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3300143
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78077}
2021-11-24 20:52:40 +00:00
Milad Fa
cd52c01b08 PPC: use scratch as src register when sign extending
Liftoff is also fixed to make sure r0/ip don't get used as
scratch as they might be already used as offset registers.

Change-Id: I8b5636b805acdb7df12af4a7a2f2868bf5889cd2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3298254
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#78076}
2021-11-24 17:32:10 +00:00
Marja Hölttä
e9dfaac532 [rab / gsab] Add tests for the recent DataView bugs
In addition, make the code less confusing and more future proof:
- initialize the JSArrayBufferView bit_field to 0 (not only zeroing the
relevant bits)
- serialize it as uint32, since it's an uint32.

Bug: v8:11111
Change-Id: Iffbbb27cc8c821587f992668bfbcf2448a776f15
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3300132
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78075}
2021-11-24 16:20:29 +00:00
Manos Koukoutos
ac6fdfbfac [wasm] Fix heap sandbox compilation
This fixes an oversight in crrev.com/c/3277878.

Bug: v8:11510
Change-Id: I91b55682fd27c55ef556e919d7f04a9dbbecadea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3300137
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78072}
2021-11-24 14:48:59 +00:00
Samuel Groß
6e68daf7fd ArrayBuffer refactoring in preparation for CagedPointers
The main changes of this CL are:

It should no longer be assumed that an empty ArrayBuffer has a nullptr
backing store. This is in preparation for the move to caged pointers,
which cannot represent nullptr, and will instead likely provide a
EmptyBackingStore constant pointing inside the virtual memory cage. For
that reason, a new JSArrayBuffer::IsEmpty() helper is introduced, which
should be used instead of checking against nullptr.

CodeStubAssembler::GetTypedArrayBuffer now checks for on-heap
TypedArrays instead of comparing the backing store pointer to nullptr.
This is consistent with the implementation in JSTypedArray::GetBuffer.

v8::ArrayBufferView::CopyContents now uses JSTypedArray::DataPtr instead
of relying on nullptr backing stores to handle on-heap TypedArrays.

The serializer and deserializer now check for IsEmpty() and use the
kEmptyBackingStoreRefSentinel value to serialize empty backing stores.

Empty ArrayBuffers allocated for on-heap TypedArrays now have a
byte_length of zero. This allows removing the allocation_length() (and
allocation_buffer()) methods, which were only (incorrectly, as they
don't account for GSABs) used for memory measurements.

Bug: chromium:1218005
Change-Id: Ib889ccf855f68525f7a614f3963e46ea56865fa3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3297709
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78069}
2021-11-24 13:30:49 +00:00
Manos Koukoutos
f60132e96a [wasm] Internal representation for function references
Design doc: bit.ly/3jEVgzz

We separate the internal representation of function references in Wasm
from their JSFunction-based (external) representation. This improves
performance of call_ref by requiring less indirections to load the
context and call target from a function reference. In the boundary
between wasm and JS/the C API, we add transformations between the two
representations.

Detailed changes:
- Introduce WasmInternalFunction, containing fields required by
  call_ref, as well as a reference to the corresponding
  WasmExternalFunction. Add a reference to the WasmInternalFunction in
  WasmFunctionData. The {WasmInternalFunction::FromExternal} helper
  extracts the internal out of an external function.
- Change {WasmInstanceObject::external_functions()} to internal
  functions.
- Change wasm function tables to contain internal functions.
- Change the following code to use internal functions:
  - call_ref in liftoff and Turbofan
  - function type checks in liftoff and Turbofan
  - CallRefIC and GenericJSToWasmWrapper builtins
  - {InitExprInterface::RefFunc}
  - module-compiler.cc in {ProcessTypeFeedback}
  - In module-instantiate.cc, in function-rtt creation.
- Add transformations between internal and external functions in:
  - WasmWrapperGraphBuilder::{ToJS, BuildUnpackObjectWrapper, FromJS,
    BuildJSToJSWrapper}.
  - debug-wasm-objects.cc in {FunctionProxy::Get},
    {WasmValueObject::New} and {AddWasmTableObjectInternalProperties}.
  - runtime-wasm.cc in ReplaceWrapper
  - the C and JS APIs
  - module-instantiate.cc, in import and export processing, as well as
    {InitializeIndirectFunctionTables}
  - WasmTableObject::{IsValidElement, SetFunctionTableEntry}
  - {WasmGlobalObject::SetFuncRef}
- Simplify body descriptors of WasmExternalFunction variants.
- Adjust tests.

Bug: v8:11510

Change-Id: I8377f46f55c3771391ae1c5c8201a83854ee7878
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3277878
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78068}
2021-11-24 13:07:28 +00:00
Tobias Tebbi
42da0c3918 [turbofan] add WasmObject to Turbofan types
Bug: v8:12185
Change-Id: I7d5fbf624fff262b7777e443b12cb7a72d6165e5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3293404
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78067}
2021-11-24 12:46:00 +00:00
Michael Lippautz
19b9b6ebb5 heap: Scavenger convert uses of Worklist to heap::base::Worklist
The CL converts uses of v8::internal::Worklist to heap::base::Worklist
which does not require to know the number of tasks working with the
work list upfront. heap::base::Worklist is the common implementation
for V8's heap and cppgc and should be used/optimized going forward.

Bug: v8:12426
Change-Id: I35713938ff80f43a763470f8bdf7e242439080f5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3297903
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78066}
2021-11-24 12:42:59 +00:00
Marja Hölttä
aebd506e3f [web snapshot] Store function formal parameter count
In the final version, we might parse the parameters when deserializing
instead, but this approach is more suitable for prototyping.

Bug: v8:11525
Change-Id: I000869877b03fd1909acf602ab5190951b1939e5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295456
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78065}
2021-11-24 12:40:39 +00:00
Andreas Haas
3c367f29b9 [wasm] Rename metric for consistency
R=jkummerow@chromium.org

Bug: v8:12281
Change-Id: I94191b592350cfc8d06cf6fbadca6eaa8d37569f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3297897
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78064}
2021-11-24 12:24:39 +00:00
Maya Lekova
a6da816119 Reland^2 "[fastcall] Enable float support on arm64 simulator""
This is a reland of d7c3f1cd8a. It fixes
a build failure on native arm64.

Original change's description:
> Reland "[fastcall] Enable float support on arm64 simulator"
>
> This is a reland of b9ddcbc86f
>
> The original CL was reverted due to an MSAN issue, that is fixed by
> moving the signature mapping onto the Isolate (instead of having
> per-thread storage, which got invalid on multithreaded compilation).
>
> This CL also contains fixes for the Bazel config and for a data race
> when obtaining the PerIsolateSimulatorData.
>
> Original change's description:
> > [fastcall] Enable float support on arm64 simulator
> >
> > This CL adds support for handling calls to C functions with arbitrary
> > signatures on the arm64 simulator. It adds infrastructure for
> > encoding the signature data from CallDescriptor and FunctionInfo
> > classes into a compact representation, stored in the simulator and
> > called EncodedCSignature.
> >
> > Design doc:
> > https://docs.google.com/document/d/1ZxOF3GSyNmtU0C0YJvrsydPJj35W_tTJZymeXwfDxoI/edit
> >
> > This CL is a follow up on the native support added in
> > https://chromium-review.googlesource.com/c/v8/v8/+/3182232
> > and is partially based on the previous attempt:
> > https://chromium-review.googlesource.com/c/v8/v8/+/2343072
> >
> > Bug: chromium:1052746
> > Change-Id: I0991b47bd644b2fc2244c5eb923b085261f04765
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3060486
> > Commit-Queue: Maya Lekova <mslekova@chromium.org>
> > Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#77744}
>
> Bug: chromium:1052746, chromium:1267854
> Change-Id: I89bbd01e33fb1080543d98bcfd4c2d17b5c76861
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3270541
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Commit-Queue: Maya Lekova <mslekova@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#78018}

Bug: chromium:1052746, chromium:1267854
Change-Id: Ib495573569a6c930b8f9e5f1fe7ff46eb57a0aa7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295461
Auto-Submit: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78063}
2021-11-24 11:58:39 +00:00
Ng Zhi An
97f574a6da [cleanup][profiler] Rename CodeEventRecord::NONE to kNoEvent
Make it an enum class too, and fix all the enums to follow style guide.

Fixes a -Wshadow warning, NONE shadows PropertyAttributes::None.

Bug: v8:12244,v8:12245
Change-Id: I9a8181a35d5690a32a6ce58587f0d8704aa1ab40
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3291696
Auto-Submit: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78062}
2021-11-24 11:54:49 +00:00
Marja Hölttä
1efe967bcb [web snapshot] Support web snapshot magic when the source string is two byte
Bug: v8:11525
Change-Id: I28548c4eddcc7764be950950e16ac30b12ac8cdd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3297890
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78061}
2021-11-24 11:51:39 +00:00
Tobias Tebbi
f2ceaf9066 [torque] allow @if/@ifnot annotations in more places
Conditional compilation with @if/@ifnot is now allowed for
- statements
- typeswitch cases
- enum constants
- bitfield struct fields
- struct fields and methods

Bug: v8:7793
Change-Id: I701e8b1f4fb5c5494eaf0af6d0b540bc9166b5ca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3296283
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78060}
2021-11-24 10:56:39 +00:00
Victor Gomes
666dcfd916 [heap] Fix TypedSlots data race when compiled off-thread
When a LocalHeap is destroyed, we update (publish) the changes
in the TypedSlots, this need to be protected by a mutex, since
we may read the RecordRelocSlot in a different thread.

Bug: v8:12054, v8:12411, chromium:1272364
Change-Id: Id1684dad3ed9e02c597099c440d1fbfdbd8c47ce
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3297892
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78059}
2021-11-24 10:53:39 +00:00
Ng Zhi An
c4a3cede2d [cleanup][codegen] Fix -Wshadow warnings (attempt 2)
The fix in https://crrev.com/c/3283620 doesn't work, it was meant to be
a general way to fix shadow whenever ASM_CODE_COMMENT is used, by
appending the current line, via __LINE__ macro to the variable name.
However, __LINE__ is not expended correctly when it is directly part of
a variable name.

To fix the shadowing, we use UNIQUE_IDENTIFIER to give unique names.

Bug: v8:12244,v8:12245
Change-Id: I7b9b9da74d62023ac631ff0876f41e80971e2f09
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3291804
Auto-Submit: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78058}
2021-11-24 10:38:40 +00:00
Marja Hölttä
2bf99739d4 [web snapshot] Fix error reporting on the snapshotting side too
Bug: v8:11525
Change-Id: Ied08cccce533342474d520c9668d52846156a352
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295452
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78057}
2021-11-24 10:19:20 +00:00
Dominik Inführ
9ed0ec65ed [heap] Improve --track-retaining-path for incremental marking
This CL improves --track-retaining-path with incremental marking:

* Retainers need to be cleared *after* the GC and for full GCs only.
  Otherwise a scavenger that runs during incremental marking would
  clear all retainers.
* Register marked root objects in IncrementalMarking::MarkRoots with
  retaining_root_.

Change-Id: I18ab9da48fb7ac45f9ec0826334fd338dc202edc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3297893
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78056}
2021-11-24 10:13:21 +00:00
Liu Yu
a56a7097c4 [loong64][mips][turbofan] Handle class constructor
Port commit e127f58410

Bug: chromium:1260623

Change-Id: I1462126391189f328bb5d8a8fbfb00f3bce642a8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3299283
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#78054}
2021-11-24 08:31:13 +00:00
Jakob Gruber
dadd34d9ef [intl] Fix two issues in the localeCompare fast path
1. The default locale may be reset / is not immutable as we thought.
2. A suffix of ignorable code points after the common length affects
   the comparison result.

Bug: v8:12196
Fixed: v8:12398
Change-Id: I6f60f56352956779df801c43de6ebac8cd9c592d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3291314
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78053}
2021-11-24 08:28:39 +00:00
Benedikt Meurer
d915b90254 [inspector] Remove unused V8StackTrace::buildInspectorObject().
This is an unused overload, which doesn't add any value to keep around.

Bug: none
Change-Id: I6e004e28f6ec8d4c8de87a1e86d331a624694659
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3297896
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78052}
2021-11-24 07:33:54 +00:00
Frank Tang
8cb0a45a65 [Temporal] Part 2.1 Add TemporalParser to parse ISO8601
Parser based on
https://tc39.es/proposal-temporal/#sec-temporal-iso8601grammar

Bug: v8:11544
Change-Id: I18eafc86da86005d5aee7b672c145fcf38a3ef5e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3271827
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78049}
2021-11-24 00:50:24 +00:00
Milad Fa
407922fad8 PPC [liftoff]: optimize unsigned byte reverse ops
This CL optimizes ByteReverse 16/32/64 ops on PPC<10 as
well as PPC_10_PLUS.

A 32bit sign extension is also added to `ByteRev32` in codegen.

Change-Id: I6379ac4222f3574ab226971546238142039fe977
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3298308
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#78048}
2021-11-23 19:12:04 +00:00
Marja Hölttä
8d0404d80b Reland [rab/gsab] Add RAB / GSAB support to DataViews
Previous version: https://chromium-review.googlesource.com/c/v8/v8/+/3259648

Fix 1: ValueSerializer <3 JSArrayBufferView
Fix 2: set flags correctly when creating DataViews via the API

Bug: v8:11111
Change-Id: I9cbfdaff29f97c7823eaa3d931689b363e1f4cf7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3297708
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78046}
2021-11-23 16:48:54 +00:00
Andreas Haas
9c8a8c6d5d [wasm] Add counter for the number of cache events
With dynamic tiering, caching is triggered multiple times as there is
no single event anymore that triggers when the module should be cached.

This CL adds a counter for the number of times caching is triggered.
This counter can indicate whether our current caching heuristics are
good or should get adjusted.

R=thibaudm@chromium.org

Bug: v8:12281
Change-Id: I8ed9ed73a556d11df643c31ec6d20760a257e0d4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295578
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78045}
2021-11-23 16:25:54 +00:00
Hiroshige Hayashizaki
b0c6dd86bd Allow compiled module invalidation at WasmStreaming::Finish()
This CL adds `can_use_compiled_module` parameter to
WasmStreaming::Finish() that is used by Chromium
https://chromium-review.googlesource.com/c/chromium/src/+/3282643
to invalidate compiled module bytes after SetCompiledModuleBytes().

Bug: chromium:1260939
Change-Id: Iebf0e8615c27c8622721777c664b06a53fb9ee91
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3297548
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78044}
2021-11-23 16:05:34 +00:00
Tobias Tebbi
6e978db88d [turbofan] fix typing of JSLoadProperty
Private methods use a property with symbol name that stores a context.
This is then loaded to perform the brand check. Since this uses
JSLoadProperty in Turbofan, we should not type JSLoadProperty as
NonInternal.

Bug: chromium:1269063, v8:12359
Change-Id: I920ccf46e939ab0477ff2fdb3cda6d7d94bab0af
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3293089
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78042}
2021-11-23 15:01:04 +00:00
Marja Hölttä
a68aa67276 Revert "[rab/gsab] Add RAB / GSAB support to DataViews"
This reverts commit 8f3e53b81d.

Reason for revert: Blink test failures

Original change's description:
> [rab/gsab] Add RAB / GSAB support to DataViews
>
> Bug: v8:11111
> Change-Id: Ice66accee734484302d499b8098056ae1c68faf3
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3259648
> Commit-Queue: Marja Hölttä <marja@chromium.org>
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#78028}

Bug: v8:11111
Change-Id: Icaae7276dfede8c021f3ce1a7e96ed3ec13fe4fe
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295577
Auto-Submit: Marja Hölttä <marja@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78039}
2021-11-23 09:55:35 +00:00
Anton Bikineev
431d2bf6fa cppgc: Store the list of to-be-finalized object inlined in HoH
The list of to-be-finalized objects can grow significantly. While
running Speedometer2, the metadata that stores to-be-finalized objects
can be the second largest contributor to heap consumption (overall
taking up 2.6MB, checked with heaptrack).

The CL changes the list to be stored inlined in HoH, if cage-heap is
enabled, rather than in a separate vector.

Bug: chromium:1249550
Change-Id: I04a0c84d118655fa6ff8e2440423e802cd722842
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295448
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78038}
2021-11-23 09:15:24 +00:00
JianxiaoLuIntel
c0bc99e0f4 [heap] remove redundant branch in AllocateReadOnlyPage
Change-Id: I6411c752e3de1fb6e1547ccfe41265c5615eb421
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3296148
Auto-Submit: Jianxiao Lu <jianxiao.lu@intel.com>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78037}
2021-11-23 07:48:21 +00:00
jiepan
96d2d90491 [wasm] Fix mnemonic of ProtectedStore operator
Change-Id: Icc245d9939649386d44ca95b9e57933b436b5cb5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3293414
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Jie Pan <jie.pan@intel.com>
Cr-Commit-Position: refs/heads/main@{#78034}
2021-11-23 02:38:18 +00:00
jiepan
dc34109f4a [x64] Implement 256-bit assembler for vmov[au]p*
Bug: v8:12228
Change-Id: I21b2ee1e640ba75227a03d765bb1552eff68e3fa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3293415
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Jie Pan <jie.pan@intel.com>
Cr-Commit-Position: refs/heads/main@{#78033}
2021-11-23 02:02:38 +00:00
Paolo Severini
daf8df62ac [wasm][turbofan] Re-add future implication for --turbo-inline-js-wasm-calls
Bug: chromium:1271456
Change-Id: I54b81fc8e450ba65c9895ec5e22366446098dd64
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3296146
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Paolo Severini <paolosev@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#78032}
2021-11-23 01:32:13 +00:00
Paolo Severini
9324d7fd21 [wasm][turbofan] Pass correct instance when inlining JsToWasm wrappers
It is possible to inline a JSToWasm wrapper that directly calls a
WasmToJS wrapper. In this case we need to make sure that the instance
we pass is a WasmApiFunctionRef, not a WasmInstanceObject.

Bug: chromium:1271456
Change-Id: I684a769922895860a43c73ba43c2598c9bda4b64
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3293423
Commit-Queue: Paolo Severini <paolosev@microsoft.com>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78031}
2021-11-23 00:47:59 +00:00
Omer Katz
d315657ef5 heap: Mark EmbedderHeapTracer::GarbageCollectionForTesting as deprecated
Bug: v8:12407
Change-Id: Iedf6154796423267fdb32125a408e580bb3c205b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295349
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78030}
2021-11-22 23:15:28 +00:00
Anton Bikineev
39cd76ce7a cppgc: Free up memory taken by SweptPageState
For large working set, the sweeper metadata can significantly increase.
Currently, the backing of swept_unfinalized_pages never gets freed,
which causes about 300KB of memory be occupied (checked on
Speedometer2). The CL makes sure to shrink (actually free) the backing
after each GC cycle.

Bug: chromium:1249550
Change-Id: I7c7e5248983960a498afc252a344fa71cb1444c3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295347
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Auto-Submit: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78029}
2021-11-22 21:26:40 +00:00
Marja Hölttä
8f3e53b81d [rab/gsab] Add RAB / GSAB support to DataViews
Bug: v8:11111
Change-Id: Ice66accee734484302d499b8098056ae1c68faf3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3259648
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78028}
2021-11-22 19:04:58 +00:00
Frank Tang
094a762316 [temporal] Temporally Turn OFF tracking for Temporal
Reduce unnecessary size during development

Bug: chromium:1260432
Change-Id: I690e511900abf0f8218f6ece8a5d1f144947b584
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3292484
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78027}
2021-11-22 18:50:18 +00:00
Ng Zhi An
f3ad100a11 [wasm-relaxed-simd][arm64] Implement relaxed trunc
Bug: v8:12284
Change-Id: Ia5dd40ffd1854ed8f1d6138a1bf40d8f2ca79793
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3272642
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78025}
2021-11-22 17:41:31 +00:00
Ng Zhi An
caddd5ee65 [cleanup] Fix a bunch of -Wshadow
Bug: v8:12244,v8:12245
Change-Id: I49326278fa43cd07c17a01b70253303d2e861b06
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3291558
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78024}
2021-11-22 17:27:38 +00:00
Omer Katz
05f0aed1ff Missing call to PatchValue
Change-Id: Id592b919b307637a0dab1ce1a7d9ec931836650c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295458
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78022}
2021-11-22 15:52:41 +00:00
Clemens Backes
0580829fb5 [codegen] Avoid unused fields in safepoint table
Many safepoint tables do not contain any deoptimization info and/or no
callee-saved registers. Do not emit empty fields for all entries in this
case.
This often shrinks the size of the encoded safepoint table by more than
50%.

Drive-by cleanups:
- Rename fields of the safepoint table entries to clarify their meaning
("tagged slots" instead of "bits", "tagged register indexes" instead of
 "register bits").
- Include the PC in the decoded {SafepointEntry} to make it the single
source of truth.

R=jkummerow@chromium.org

Bug: v8:12401
Change-Id: If5c24a688a434842ed3b6427f5f1f3ea9232173a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289173
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78021}
2021-11-22 15:44:18 +00:00
Andreas Haas
9a13c49fd4 [wasm] Add trace event for Liftoff compilation after caching
With dynamic tiering, not all functions get compiled with TurboFan,
and not all functions can therefore get cached. With this metric we
want to keep track of the time needed to compile missing functions with
Liftoff.

R=jkummerow@chromium.org

Bug: v8:12281
Change-Id: I1f2de3e1f6b004477985df5d2116f69371528c3f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289178
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78020}
2021-11-22 14:34:41 +00:00
Nico Hartmann
226995aebf Revert "Reland "[fastcall] Enable float support on arm64 simulator""
This reverts commit d7c3f1cd8a.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Android%20Arm64%20-%20debug%20builder/22043/overview

Original change's description:
> Reland "[fastcall] Enable float support on arm64 simulator"
>
> This is a reland of b9ddcbc86f
>
> The original CL was reverted due to an MSAN issue, that is fixed by
> moving the signature mapping onto the Isolate (instead of having
> per-thread storage, which got invalid on multithreaded compilation).
>
> This CL also contains fixes for the Bazel config and for a data race
> when obtaining the PerIsolateSimulatorData.
>
> Original change's description:
> > [fastcall] Enable float support on arm64 simulator
> >
> > This CL adds support for handling calls to C functions with arbitrary
> > signatures on the arm64 simulator. It adds infrastructure for
> > encoding the signature data from CallDescriptor and FunctionInfo
> > classes into a compact representation, stored in the simulator and
> > called EncodedCSignature.
> >
> > Design doc:
> > https://docs.google.com/document/d/1ZxOF3GSyNmtU0C0YJvrsydPJj35W_tTJZymeXwfDxoI/edit
> >
> > This CL is a follow up on the native support added in
> > https://chromium-review.googlesource.com/c/v8/v8/+/3182232
> > and is partially based on the previous attempt:
> > https://chromium-review.googlesource.com/c/v8/v8/+/2343072
> >
> > Bug: chromium:1052746
> > Change-Id: I0991b47bd644b2fc2244c5eb923b085261f04765
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3060486
> > Commit-Queue: Maya Lekova <mslekova@chromium.org>
> > Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#77744}
>
> Bug: chromium:1052746, chromium:1267854
> Change-Id: I89bbd01e33fb1080543d98bcfd4c2d17b5c76861
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3270541
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Commit-Queue: Maya Lekova <mslekova@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#78018}

Bug: chromium:1052746, chromium:1267854
Change-Id: Ia8f10d085d13990b331f306957f95ecf3e003cfd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295453
Owners-Override: Nico Hartmann <nicohartmann@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78019}
2021-11-22 14:14:48 +00:00
Maya Lekova
d7c3f1cd8a Reland "[fastcall] Enable float support on arm64 simulator"
This is a reland of b9ddcbc86f

The original CL was reverted due to an MSAN issue, that is fixed by
moving the signature mapping onto the Isolate (instead of having
per-thread storage, which got invalid on multithreaded compilation).

This CL also contains fixes for the Bazel config and for a data race
when obtaining the PerIsolateSimulatorData.

Original change's description:
> [fastcall] Enable float support on arm64 simulator
>
> This CL adds support for handling calls to C functions with arbitrary
> signatures on the arm64 simulator. It adds infrastructure for
> encoding the signature data from CallDescriptor and FunctionInfo
> classes into a compact representation, stored in the simulator and
> called EncodedCSignature.
>
> Design doc:
> https://docs.google.com/document/d/1ZxOF3GSyNmtU0C0YJvrsydPJj35W_tTJZymeXwfDxoI/edit
>
> This CL is a follow up on the native support added in
> https://chromium-review.googlesource.com/c/v8/v8/+/3182232
> and is partially based on the previous attempt:
> https://chromium-review.googlesource.com/c/v8/v8/+/2343072
>
> Bug: chromium:1052746
> Change-Id: I0991b47bd644b2fc2244c5eb923b085261f04765
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3060486
> Commit-Queue: Maya Lekova <mslekova@chromium.org>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#77744}

Bug: chromium:1052746, chromium:1267854
Change-Id: I89bbd01e33fb1080543d98bcfd4c2d17b5c76861
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3270541
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78018}
2021-11-22 13:59:37 +00:00
Leszek Swirski
e518a2b203 [debugger] Throw exception if var x fails in debug eval
There are cases where DeclareEvalVar can fail to create a variable, in
particular when the declaration scope is not extensible. Throw an error
in such cases.

Fixed: chromium:1145119
Change-Id: I6260f570570c4d7801231bdb5f6724f3734444fd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295348
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78017}
2021-11-22 13:35:29 +00:00
Marja Hölttä
b65810bd21 [web snapshot] Fix the case with several exported objects
Bug: v8:11525
Change-Id: I4e4ba332611e3feedc70b32c39f4270cdb0e11cd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295446
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78016}
2021-11-22 13:08:21 +00:00
Omer Katz
084de665de heap: Introduce Isolate::RequestGarbageCollectionForTesting with stack state
Once CppHeap moves away from EmbedderHeapTracer, it can no longer be
returned by Isolate::GetEmbedderHeapTracer. Blink currently uses
GetEmbedderHeapTracer to trigger GCs. This CL introduces a variant of
Isolate::RequestGarbageCollectionForTesting to replace that.

Bug: v8:12407
Change-Id: I099989f55291a0daab7d2051072dedddef58dd40
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3293413
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78015}
2021-11-22 12:32:48 +00:00
Dominik Inführ
6a2cf92302 [snapshot] Pass GlobalSafepointScope to Snapshot::Create
Instead of just DCHECKing that we are in a safepoint in
Snapshot::Create, pass the GlobalSafepointScope as argument.

Bug: v8:11708, v8:12377
Change-Id: Ia856c27b92223bf3a96fe6946b86e4625f3a1e0f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3295342
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78014}
2021-11-22 10:58:32 +00:00
Dominik Inführ
2c88cec4cf Reland "[heap] Support multiple clients in shared GC"
This is a reland of 90a9d6cb13

The original CL got reverted because of two different issues:

* The DCHECK failure on AllowGarbageCollection::IsAllowed() got fixed
  in https://crrev.com/c/3289625.
* The crash with the incremental marking job were because of a nested
  GC started from a SafepointScope. This CL adds IgnoreLocalGCRequests
  scopes to SafepointScopes in src/heap.

In addition this CL prevents shared GCs during isolate deserialization
by locking the clients_mutex_ until the isolate is fully deserialized.
The original GC used a DisallowSafepoints scope to prevent shared GCs
from interrupting isolate deserialization.

Original change's description:
> [heap] Support multiple clients in shared GC
>
> Add support for safepointing multiple isolates as described in the
> design doc (link is below). A safepoint across multiple isolates is
> considered a global safepoint to distinguish it from regular safepoints.
>
> The basic idea behind the implementation is that we reach a
> safepoint for each client. What's new is that now also main threads
> need to participate in the safepointing protocol and need to give up
> control in time. The slow paths of Park(), Unpark() and Safepoint() on
> the main thread need to be adjusted for this reason as well.
>
> This CL introduces GlobalSafepoint and GlobalSafepointScope to mirror
> IsolateSafepoint and IsolateSafepointScope.
>
> This CL adds the type IgnoreLocalGCRequests, it is used to prevent
> Park() and Unpark() from honoring the request from background threads
> to perform a local GC. This is used heap-internally to not have GCs
> (or even nested GCs) in certain locations. E.g. when initiating a
> safepoint to perform a GC we don't want a "recursive" GC to occur.
>
> Design doc: https://docs.google.com/document/d/1y6C9zAACEr0sBYMIYk3YpXosnkF3Ak4CEuWJu1-3zXs/edit?usp=sharing
>
> Bug: v8:11708
> Change-Id: I5aca8f5f24873279271a53be3bb093fc92a1a1eb
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3009224
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#77812}

Bug: v8:11708, v8:12375, v8:12377
Change-Id: I9d1af6fbc06a3a8b6f216ec5e9027665ad071809
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3283067
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78013}
2021-11-22 08:40:57 +00:00
Omer Katz
529c48f16d cppgc: Allow finalizing incremental GC when unsupported
Starting an incremental GC when it is not supported is not allowed but
trying to finalize one when it might be unknown whether it's supported
or not should be legal.
In such cases, finalization would immediately bail out since there is no
active gc.

Bug: chromium:1272076
Change-Id: If5aaaa130dc55474d3fc3afcd7039880a2c11333
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3293411
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78010}
2021-11-20 09:51:46 +00:00
Frank Tang
bd4fa32c87 [intl] Clean up
Remove two flags for feature shipped in m95
--harmony_intl_displaynames_v2
--harmony_intl_more_timezone

Bug: v8:11637, v8:11661
Change-Id: I9432865722664f64c64b5bf7fde5e05e6b324b20
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3292518
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78005}
2021-11-20 03:53:26 +00:00
Ng Zhi An
a9b74cff05 [wasm-relaxed-simd][arm64] Implement relaxed min max
Bug: v8:12284
Change-Id: Iaa2b98029b46e5d22fac19bf2db5abd56f82670b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3272641
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78004}
2021-11-20 00:52:36 +00:00
Ng Zhi An
835ff2bcf5 [wasm][api] Add WasmModuleObject::Compile api function
This is a partial revert of https://crrev.com/c/2033171 to bring back
WasmModuleObject::Compile, that compiles Wasm bytes into a Wasm module.

Also adding a simple test to make sure the compile works.

There are some users, e.g. Cloudflare, Halide, see bug for more details.

Bug: v8:10461
Change-Id: I199abea108311025decad793d2232a08bba05d38
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3292088
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78003}
2021-11-19 22:25:15 +00:00
Milad Fa
41f99df7b2 PPC/S390 [sim]: refactor vsel on simulator
PPC and S390 implement vsel slightly differently which
is also reflected on the simulator.

Change-Id: Iec5e49bfae09d8bf15149e5ab149b82971271b24
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3293409
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#78002}
2021-11-19 21:33:05 +00:00
Junliang Yan
75d7a95c88 s390x: [baseline] implement interface descriptors
Change-Id: I318a97a67242527c3a0f7a1dcd74b5503e5dcc55
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289836
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#78001}
2021-11-19 20:41:56 +00:00
Ng Zhi An
f47eec071e [ic] Fix -Wshadow by making InlineCacheState an enum class
Bug: v8:12244,v8:12245
Change-Id: Ie2b1801d7535e142774a1d912b992a203b1b8ecc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3284005
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78000}
2021-11-19 18:52:15 +00:00
Igor Sheludko
4dab3a31f7 [heap] Add instrumentation to GcSafeFindCodeForInnerPointer
... in order to ease issues debugging.

Bug: chromium:1241665
Change-Id: I3b51d3eaaa9c03cfadbdadc4e91dee35617f4b33
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3293090
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77999}
2021-11-19 18:04:14 +00:00
Samuel Groß
a32d2dda80 Hold the mutex throughout BoundedPageAllocator::ReleasePages
Previously, an allocation from a separate thread could grab the
just-released region and make it accessible before the regions
permissions are changed to kNoAccess at the end of ReleasePages.

Bug: v8:12414
Change-Id: I98c8f8e3df76d4a44c357ddab107cfeff20049b8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3293083
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77997}
2021-11-19 16:26:43 +00:00
Dominik Inführ
7e62e2aa60 [heap] Fix DCHECK failure in Heap::StartIncrementalMarking
When starting incremental marking from an allocation observer, the
DCHECK for AllowGarbageCollection::IsAllowed() fails. We need to
explicitly allow this here in order to use SafepointScope.

Bug: chromium:1271659, v8:11708, v8:12413
Change-Id: I8607a82faed50f8dfffce1e495fb5e715a47bc1b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3293086
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Auto-Submit: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77996}
2021-11-19 14:21:53 +00:00
Ray Wang
7ae0b77628 [interpreter] Stop jump-table optimizing switch stms when spread overflows
Bug: v8:12389
Change-Id: I53c728ab0c8ba38c7dd96c7e1089f771ba44b9f0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289227
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77995}
2021-11-19 12:39:28 +00:00
Victor Gomes
46db3f20f1 [baseline] Predictable \/ SingleThreaded -> No Concurrent SP
Bug: v8:12054
Change-Id: I756c0a0d05860e2de748842157f4fa54726e94da
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289177
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77994}
2021-11-19 12:00:36 +00:00
Patrick Thier
160a9f92aa Remove std::iterator uses
std: :iterator is deprecated C++17. Use base::iterator instead.
Change-Id: I682dc3b1547120e067a64eea4f71ffe4ee55ad16
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289168
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Auto-Submit: Patrick Thier <pthier@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77992}
2021-11-19 10:17:20 +00:00
Ng Zhi An
b6253099af Reland "heap: Fix compaction aborting all pages"
This reverts commit 2f17c06963.

Reason for revert: related to --concurrent_sparkplug and not to this

Original change's description:
> Revert "heap: Fix compaction aborting all pages"
>
> This reverts commit 18236dcbea.
>
> Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20TSAN%20-%20no-concurrent-marking/6576/overview
>
> Original change's description:
> > heap: Fix compaction aborting all pages
> >
> > In such a case, we must post-process all aborted pages. The early
> > bailout assumed that not pages are aborted before trying compaction.
> >
> > Bug: chromium:1271229
> > Change-Id: I4c5998b9d1c7974f7d1d25a6729f42d5690a5759
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289171
> > Reviewed-by: Hannes Payer <hpayer@chromium.org>
> > Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> > Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#77987}
>
> Bug: chromium:1271229
> Change-Id: Ia4b8687a0f3742bf0c894989f68c249b6c87c446
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3291900
> Auto-Submit: Zhi An Ng <zhin@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
> Owners-Override: Deepti Gandluri <gdeepti@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#77988}

Bug: chromium:1271229
Change-Id: Iba76a1ab11f1a52b845305f0aee4710af1406a91
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3292087
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77991}
2021-11-19 08:54:43 +00:00
Milad Fa
500defa505 PPC [liftoff]: Avoid overwriting offset register during fp load
Change-Id: I2abc916894b84aad5794e4a69979ca8683644806
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289933
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77990}
2021-11-19 00:05:10 +00:00
Deepti Gandluri
31e20c034e Revert "[baseline] Enable Concurrent Sparkplug on future"
This reverts commit 19bbd0f7f4.

Reason for revert: Fails on future bot - https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20TSAN%20-%20no-concurrent-marking/6576/overview

Original change's description:
> [baseline] Enable Concurrent Sparkplug on future
>
> Bug: v8:12054
> Change-Id: I7bbd22067a9e98038a08ce5cb4b0ef494aadd651
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289252
> Commit-Queue: Victor Gomes <victorgomes@chromium.org>
> Commit-Queue: Milad Fa <mfarazma@redhat.com>
> Auto-Submit: Victor Gomes <victorgomes@chromium.org>
> Reviewed-by: Milad Fa <mfarazma@redhat.com>
> Cr-Commit-Position: refs/heads/main@{#77986}

Bug: v8:12054
Change-Id: I97a511b00a79a606ac9abb6d15b707c75706deee
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3292095
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77989}
2021-11-18 23:04:20 +00:00
Zhi An Ng
2f17c06963 Revert "heap: Fix compaction aborting all pages"
This reverts commit 18236dcbea.

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

Original change's description:
> heap: Fix compaction aborting all pages
>
> In such a case, we must post-process all aborted pages. The early
> bailout assumed that not pages are aborted before trying compaction.
>
> Bug: chromium:1271229
> Change-Id: I4c5998b9d1c7974f7d1d25a6729f42d5690a5759
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289171
> Reviewed-by: Hannes Payer <hpayer@chromium.org>
> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#77987}

Bug: chromium:1271229
Change-Id: Ia4b8687a0f3742bf0c894989f68c249b6c87c446
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3291900
Auto-Submit: Zhi An Ng <zhin@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Owners-Override: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77988}
2021-11-18 21:17:30 +00:00
Michael Lippautz
18236dcbea heap: Fix compaction aborting all pages
In such a case, we must post-process all aborted pages. The early
bailout assumed that not pages are aborted before trying compaction.

Bug: chromium:1271229
Change-Id: I4c5998b9d1c7974f7d1d25a6729f42d5690a5759
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289171
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77987}
2021-11-18 20:15:20 +00:00
Victor Gomes
19bbd0f7f4 [baseline] Enable Concurrent Sparkplug on future
Bug: v8:12054
Change-Id: I7bbd22067a9e98038a08ce5cb4b0ef494aadd651
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289252
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77986}
2021-11-18 18:33:40 +00:00
Clemens Backes
55d2c08c3c [codegen] Rename deoptimization info in safepoints
The entries contain more than just deoptimization info. Thus rename them
to "entries" and use "EntryBuilder" instead of "DeoptimizationInfo".

Drive-by: Remove the redundant {emitted_} field, just check if
{offset_} was initialized.

R=jkummerow@chromium.org

Bug: v8:12401
Change-Id: Ifedc265dc27dd6817b731d9e24a1d8654edc99de
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3291310
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77985}
2021-11-18 17:31:30 +00:00
Junliang Yan
a302ee47b7 s390x: [baseline] Add baseline entry in builtins
Change-Id: Ibd3ba4cd1edc174fdfaa826b8a6f7731f4627365
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289932
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77984}
2021-11-18 17:12:46 +00:00
Clemens Backes
1c43ad5005 [codegen] Verify safepoint entries
Verify certain properties when emitting safepoint tables:
- entries are ordered by PC,
- trampoline PCs are also in order,
- all trampoline PCs come after all regular PCs, and
- an entry with a deopt index also has a trampoline PC set.

Drive-by: Slightly simplify logic in {UpdateDeoptimizationInfo}.
Drive-by 2: Inline IsIdenticalExceptForPc into the only caller, and
further simplify the logic there.

R=jkummerow@chromium.org

Bug: v8:12401
Change-Id: I8ea41b1628dceb914191f23165c8dccb79f9204c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289162
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77983}
2021-11-18 17:03:50 +00:00
Michael Lippautz
6fcbc0d2de cppgc: Fix Heap destruction finishing a GC
We should not assume that the embedder can run with concurrent marking
even though we just finalize the GC at this point.

Bug: chromium:1271371
Change-Id: I3d3a45e4283dcae9c6fdd1a467158254914868c3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289169
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77982}
2021-11-18 16:57:21 +00:00
Victor Gomes
74da8260c0 [baseline] Enable concurrent sparkplug on future
Bug: v8:12054
Change-Id: I492ceb377eb0e38f249f76e9f2a5cb554781652c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3291321
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77980}
2021-11-18 16:14:52 +00:00
Clemens Backes
7814343b75 [codegen] Use kNoDeoptIndex consistently
This removes the redundant {Safepoint::kNoDeoptimizationIndex}
definition, and uses {SafepointEntry::kNoDeoptIndex} consistently.

R=jkummerow@chromium.org

Bug: v8:12401
Change-Id: I4e12862d96a2b97245f8dde62243013425e53ff1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289159
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77979}
2021-11-18 16:12:50 +00:00
Milad Fa
e8b76952a4 PPC: add lhbrx to the dissembler
Change-Id: Ie61638fbc61b5a84dc9ba396e4df7193a2ebd6a7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3291547
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77978}
2021-11-18 16:00:31 +00:00
Dominik Inführ
fa8345df52 [heap] SafepointScope needs GCs to be allowed
A SafepointScope might need to block for a shared GC initiated from
another client isolate. This means that anytime we create a
SafepointScope a shared GC may run. This CL adds a DCHECK to ensure
AllowGarbageCollected::IsAllowed() holds for each SafepointScope.

So far this DCHECK was only run in the less likely event that a
SafepointScope actually runs a shared GC. Which is technically good
enough but it is easy to miss use cases of SafepointScope where this
does not hold.

Bug: v8:11708, v8:12377
Change-Id: I30cc33c05ebe4835430e1d699a86079810523858
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289625
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77976}
2021-11-18 15:41:50 +00:00
Clemens Backes
581b7c886c [codegen][cleanup] Switch safepoint fields to int
Many callers already pass an int, so there is no point in storing as an
uint32_t internally. The style guide also recommends int as the general
data type for integers, even if it's statically known that only positive
values will occur.

R=jkummerow@chromium.org

Bug: v8:12401
Change-Id: I6067139f514895f925d1c536112b4cb5c2c24a36
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289157
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77975}
2021-11-18 15:30:40 +00:00
Jakob Gruber
7805c33c46 Compact DependentCode on growth
Refactor s.t. we now compact the DependentCode weak fixed array both
when adding new entries and when marked for deopts.

Bug: v8:12397
Change-Id: I842f3369644e88cc0b98a1f1371259c920cc8bbf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3291320
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77973}
2021-11-18 14:57:23 +00:00
Manos Koukoutos
5dad97b0a5 [wasm] Use vector for states in Int64Lowering
Using a map to store node states in Int64Lowering has proven slow.
Therefore, we change the data structure to a vector indexed by node ids.

Bug: v8:12166, chromium:1271179
Change-Id: I13b78091fe1a6a13c26afd706d3839b0c04390f4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3291308
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77971}
2021-11-18 14:16:50 +00:00
Kim-Anh Tran
026c972dd7 [debugger] Explicitly encode 'other' as reason for breaks and pauses
This CL explicitly encodes the 'other' reason for breaking for:
* regular breakpoints
* triggered pause events.

The reason for explicitly encoding the reason is that we may otherwise
not know why we pause when we handle it. This knowledge is needed
in order to fully support instrumentation breakpoints, e.g. if we do
not know that we paused on a triggered pause, and this happens to
overlap with an instrumentation, we would previously only report
'instrumentation' as a reason which would be wrong.

Bug: chromium:1229541
Change-Id: I93c08f965a491f6d34f280157b182a78d5b3cf07
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289638
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77970}
2021-11-18 14:03:50 +00:00
Jakob Gruber
f6f829b49f [compiler,code] Refactor code dependencies
Prior to this CL we regularly generated high counts of code
dependencies, and installation was not the most efficient.

This CL 1) implements early dependency deduplication and
2) simplifies the way dependencies are persisted on the heap
through DependentCode.

Re 1): we dedupe twice, once based on the CompilationDependency
contents, and again once we know the final target object.

Re 2): Instead of a linked list of weak fixed arrays per
dependency group, store deps in a flat array together with a
bitset of their dependency groups.

See also:
https://docs.google.com/document/d/1B34S1s3Iv6hbquZ93RugD0b-ZKfHEptJ8Fk_YyOvjDk/edit

Bug: v8:12195,v8:12397
Change-Id: I9ab47f6d87b10558194b5de30a36b1122f7e362a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3283074
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77969}
2021-11-18 13:22:57 +00:00
Victor Gomes
44ba2adb40 [heap][arm] Call AddCodeMemoryChunk off-thread
When compiling code off-thread in the large code space,
we need to register the chunk in the isolate using
AddCodeMemoryChunk.

In the main thread, this is done when AllocateRaw calls
NotifyOldGenerationExpansion.

Bug: chromium:1269315, v8:12054
Change-Id: I46ea5c9cdcd063708292dd49aac6d39091e11ba4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289151
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77968}
2021-11-18 13:17:56 +00:00
Patrick Thier
3e40f8f091 Add check for class constructor to CallFunction
Raise an exception if CallFunction is invoked with a class constructor.
The check was initially removed in [1] but there are cases where we
could end in CallFunction with class constructors from optimized code.

[1] https://crrev.com/c/3186434

Bug: chromium:1271384
Change-Id: I0d700c4b1d117334c1c4c14719e24cd1f2c5e3a2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3291313
Commit-Queue: Patrick Thier <pthier@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77967}
2021-11-18 12:44:10 +00:00
Tobias Tebbi
622dc9b7c2 [turbofan] fix type assertion for OtherUndetectable type
Undetectables are always callable in V8, so the previous type check
didn't make sense.

Bug: chromium:1267230
Change-Id: Idb557bb05ee4c3b332d1fe61b40557122660261a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3291303
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77966}
2021-11-18 11:48:26 +00:00
Manos Koukoutos
95c1647a45 [wasm] Update permitted calls in unrolled loops
We prevent unrolling of loops with indirect calls. We expand the set of
permitted wasm builtins in unrolled loops.

Bug: v8:11298
Change-Id: I70b8ff3b16d9b0d3a4ea2d103f8ffb74083fd2a9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289152
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77965}
2021-11-18 11:39:06 +00:00
Paolo Severini
9c8741567d [wasm][turbofan] Disable inlining of JS->Wasm calls by default
Bug: chromium:1271456
Change-Id: Ie1a5e62b941a8ba3da9b75cfe28a194b214df15e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3290583
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77964}
2021-11-18 10:38:26 +00:00
Marja Hölttä
f6c15e1f22 [web snapshots] Fix error reporting
We have 4 different cases:
1) Explicit web snapshots (--web-snapshot) & errors in the snapshot
2) Explicit web snapshots & errors in the embedded script
3) Auto-detected web snapshots (--experimental-web-snapshots) & errors
in the snapshot
4) Auto-detected web snapshots & errors in the embedded script

Before this CL: cases 2 & 4 resulted in a DCHECK failing and the error
in case 3 wasn't reported correctly.

This CL implements consistent error reporting for all of them.

Bug: v8:11525
Change-Id: If2e5039d9769b9cad2175dfd5c4f91edf61111ae
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3277877
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77963}
2021-11-18 10:25:38 +00:00
Patrick Thier
c0756abf29 [turbofan] Extend Type system BitsetType to 64 bit.
Extend BitsetType of TF's type system from 32 to 64 bit.
At the moment all 32 bits are used, so we can't add any new types.
This CL only adds support for > 32 types to C++. The bitset is also
mirrored in Torque. In the Torque definition, we just expose an
unstructured uint32 for the higher bits of the bitfield, because Toruqe
can't deal with 64 bit types on 32 bit platforms (yet) and we also can't
have multiple 1-bit bitfields within a single class (yet).

Bug: v8:12392, chromium:1262750
Change-Id: If571491443e86e4e47eb88d3f15eca485344d12d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3281922
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77962}
2021-11-18 10:02:56 +00:00
Shu-yu Guo
bb0f74d336 [heap] Support AllocationType::kSharedOld in LocalHeap and LocalFactory
This is in anticipation for sharing internalized and
in-place-internalizable strings across Isolates. When such strings are
shared, background compilation threads need to be able to allocate
strings in the shared old space.

Bug: v8:12007
Change-Id: I93179c9674cc16e5a6125049d20e61495bc1f3a9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3283615
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77959}
2021-11-18 01:34:08 +00:00
Ng Zhi An
9151e2bcc7 [wasm-relaxed-simd][arm64] Implement relaxed lane select
We move the mask to be the first input of the node in wasm-compiler.cc,
this matches the order for S128Select, which makes code-gen for
arm/arm64 simpler (directly lower to BSL with no more shuffle of
inputs). This requires tweaking of input indices in the instruction
selector for ia32/x64, but no change in codegen.

Bug: v8:12284
Change-Id: I1f6f1a9fe0869509be77f77b6f54a0c636a0f92d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3272640
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77958}
2021-11-18 00:07:47 +00:00
jiepan
7187ae4750 [x64] Implement 256-bit assembler for v(p)blendv*
Bug: v8:12228
Change-Id: I9f7bb60fb2647f44c41c8c9e35a534ecd60c426a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289150
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Jie Pan <jie.pan@intel.com>
Cr-Commit-Position: refs/heads/main@{#77957}
2021-11-18 00:01:37 +00:00
Ng Zhi An
9fc11f9163 [cleanup] Rename RelocInfo::NONE to RelocInfo::NO_INFO to fix -Wshadow
NONE clashes with the PropertyAttributes::NONE, which is defined in
v8::internal namespace. PropertyAttributes have too many call sites
and depend on using the enums as masks, making it hard to convert
to an enum class. So we are changing the name instead.

Bug: v8:12244
Change-Id: Iec0be12c626549cca137aceeaee0e30fafab8b05
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3284003
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77956}
2021-11-17 19:11:40 +00:00
Ng Zhi An
7610dca4af [ia32] Introduce vinstr helper that takes a VectorLength
fma_instr is now no longer required

Change-Id: Iab47aa6afcc53c78acf15c7ab71f6b9ba45263c8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3286003
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77955}
2021-11-17 18:36:41 +00:00
Ng Zhi An
b2dee3510f [cleanup] Make IcCheckType an enum class
Fixes -Wshadow warnings for ELEMENT.

Bug: v8:12244,v8:12245
Change-Id: Ic3dfa96b44fc18f0db10752639a54aeca324667c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3276928
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77954}
2021-11-17 16:41:00 +00:00
Michael Lippautz
048092586b heap: Fix monolith build
Fix monolith build complaning about used implicit copy ctor when copy
operator is explicitly defined.

Bug: v8:12402
Change-Id: Iec30882af1c825c277a2e538400c85348daa6301
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289624
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/main@{#77951}
2021-11-17 15:25:41 +00:00
Clemens Backes
3be28afbb9 [wasm] Include source URL in tracing
For streaming compilation, include the source URL in tracing, to
help identifying problems with caching.

R=ahaas@chromium.org

Change-Id: Iefda71890024a4fc9ec933c34c5870ba697bbff9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289148
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77950}
2021-11-17 14:10:02 +00:00
Milad Fa
ae569cf877 PPC/s390: Update comments about argument count in interface descriptors
Port 2e955523d1

Original Commit Message:

    Comments in interface-descriptors stated that the argument count is
    without the receiver, which is no longer true (see [1]).

    [1] https://crrev.com/c/3140608

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

Change-Id: I1bbce6672f19a3e508676e4b23cf9910542cbb21
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3285407
Reviewed-by: Patrick Thier <pthier@chromium.org>
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77949}
2021-11-17 14:01:02 +00:00
Michael Lippautz
62a0841b9a cppgc: Gracefully finish running GC on ~Heap
Change-Id: I38cd955d3e41861d955c529ec56890b45effccf0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3284897
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77948}
2021-11-17 13:37:32 +00:00
Tobias Tebbi
6181ce59fc [builtins] add Torque fast-path for String.prototype.localeCompare
This fast path works for ASCII-only strings and is similar to the
existing fast-path in C++. Important differences:
- The locale check is done at Turbofan optimization time instead of
  at runtime
- Use tables of size 256 instead of 128 to save a bounds-check when
  handling one-byte strings.
- It first performs an equality check that's optimized for detecting
  inequality quickly by comparing the strings from both ends. If the
  equality check succeeds, we are done. Otherwise chances are high
  that the strings differ according to collation level L1 already.
  Therefore, we first do an L1 check and perform the L3 check
  only when L1 didn't find a difference. This is based on the assumption
  that few strings are identical except for different capitalization.
- Use the Torque version of string flattening instead of the runtime
  version.

Bug: v8:12196
Change-Id: I2d043c1138846783f6d567b736d34063ba9301e5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3268465
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77946}
2021-11-17 12:55:13 +00:00
Leszek Swirski
85ab0ad778 Reland "[runtime] Reset clobbered argument in DefineClass"
This is a reland of 9b5f398554

Reland fixes:
 * Store a Handle instead of a raw pointer in the scope, to make sure
   the saved object stays alive.

Original change's description:
> [runtime] Reset clobbered argument in DefineClass
>
> The caller of DefineClass may not expect its arguments to be mutated, so
> add an arguments mutation scope which resets the argument clobbered by
> DefineClass.
>
> Bug: chromium:1268738
> Change-Id: I03e9cd82535ca1f83353012a92e80f822566e64e
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3283077
> Auto-Submit: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#77921}

Bug: chromium:1268738
Change-Id: I934ba2063bf2b0e66a3c42f274419ddd178e4b54
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289146
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77945}
2021-11-17 12:03:32 +00:00
Jakob Kummerow
05813641db [wasm-gc] Enable speculative inlining when GC is enabled
This makes --experimental-wasm-gc imply --wasm-speculative-inlining,
which in turn implies --wasm-inlining and --wasm-dynamic-tiering as
prerequisites.
The former implication is weak, i.e. can be overridden on the command
line.

Bug: v8:7748
Change-Id: Iedc7c9916947f26e17bdd29dbf3b413dbaa05e6c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3275571
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77944}
2021-11-17 12:00:32 +00:00
Manos Koukoutos
f6edda0987 [wasm] Run Int64Lowering on inlined code
On 32-bit architectures, we need to run Int64Lowering on the inlinee
code to make it compatible with the caller code.
Since Int64Lowering now runs while a GraphReducer is active, only one of
them can use node marks to store node states. Therefore, we move the
Int64Lowering node states to an internal map.

Bug: v8:12166
Change-Id: I53b85442d503e71fa533e06568f4b9db572a4401
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3283072
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77941}
2021-11-17 11:08:32 +00:00
Kim-Anh Tran
f74ea020d5 [bytecode-generator] Move source code position for classes
Move the source code position for classes to the point where the block
context has already been created. Previously, there would be a mismatch
between the context and the scope when using the ScopeIterator.

We paused at a point where, according to the source position, we already
are in a class scope, but according to the bytecode (context), we would
not yet have created the block context for the class.


Also-by: leszeks@chromium.org, jarin@chromium.org
Fixed: chromium:1259878
Change-Id: I58b84f4dcfa8c4f51e16812c7a8caa21da99f262
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3284887
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77940}
2021-11-17 09:40:32 +00:00
Andreas Haas
83c3489d3d [wasm] Cleanup Callback removal
The changes were requested in https://crrev.com/c/3264288 after the CL
landed.

R=clemensb@chromium.org

Bug: v8:12289
Change-Id: I863c7253ffb28ac878f5f91f24d6d1f0236da9a4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3285405
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77939}
2021-11-17 08:53:24 +00:00
Lu Yahan
436e236c41 [riscv64][wasm] Add f64x2 neg/mul/lt/le for wasm
And refactoring simd instr in code-generator
Bug: v8:11976

Change-Id: If5292e9e205374280ec5c86a481649078e348a80
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3274593
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#77936}
2021-11-17 03:01:27 +00:00
Ng Zhi An
c846b290c8 [heap] Change MarkingTreatmentMode to an enum class
This fixes a -Wshadow warning with an inline enum in regexp-compiler.cc.

Bug: v8:12244,v8:12245
Change-Id: I8b53a94a1945addb958b230abe01b10d4533edae
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3285732
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77935}
2021-11-17 00:01:12 +00:00
Ng Zhi An
04527796fa [ia32][x64][cleanup] Clean up disassembly of fma instructions
Declare more macro lists to split up W0 and W1, then disassemble using
the macro lists.

Change-Id: I4a73c24ea63c5a7b7489b81ee5ec7026c1765091
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3270598
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77934}
2021-11-16 19:36:39 +00:00
Ng Zhi An
2a12753c2b [ia32][wasm-relaxed-simd] Implement qfma qfms
Implement f32x4.qfma, f32x4.qfms, f64x2.qfma, f64x2.qfms.

These were already implement in macro-assembler-x64, so move the
implementation to shared-macro-assembler.

x64 has a macro list in fma-instr, copy this to ia32, and then use this
macro list to define existing vfma{ss,sd} instructions in
assembler-ia32.

Disassembly support is intentionally omitted in this patch, I will add
this in a follow-up. The currently disassembly in x64 is quite verbose
and I would like to make use of macro-list but it requires breaking up
the macro list into smaller parts, so I will do that refactoring for
both ia32 and x64 in the follow-up.

Bug: v8:12284
Change-Id: I3654ea108a123467506c5837072b6b63ecbc74da
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3255664
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77932}
2021-11-16 18:56:19 +00:00
Ng Zhi An
ef8e3e45c9 [cleanup][codegen] Fix -Wshadow warnings
These helper macros declare the same variable (asm_code_comment),
when used in 2 scopes (one inside another), we get a shadow variable.
In all the current usages, we always have a ASM_CODE_COMMENT in
the outer scope (which adds a comment with the function name),
and in the inner scope uses a string. It is sufficient to fix these
cases by giving the first case (function name) a different variable
name.

Bug: v8:12244,v8:12245
Change-Id: Ib23d9796f10937f27ce29913c0fa648501edbda8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3283620
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77930}
2021-11-16 18:14:36 +00:00
Ng Zhi An
10b36d8c2f [cleanup][objects] Make FunctionKind an enum class
Bug: v8:12244,v8:12245
Change-Id: Id74afa611b2b8556ef86c715497b6daddc8ea7a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3276931
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77928}
2021-11-16 16:18:28 +00:00
Ng Zhi An
224f22153d [diagnostics] Remove redundant DisallowGarbageCollection
And fixes a -Wshadow warning too.

Bug: v8:12244,v8:12245
Change-Id: I940600c21c81fd757794dc934eaf6e918d058bc8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3283621
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77927}
2021-11-16 16:12:58 +00:00
Ng Zhi An
9b13ecd57f [cleanup] Make an enum class CodeReference::Kind
Bug: v8:12244,v8:12245
Change-Id: I5b412b18df312eeb46a9af954acfa65fb403929e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3284007
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77926}
2021-11-16 16:05:11 +00:00
Camillo Bruni
afb49bae49 [flags] Improve flag to verify and create snapshot checksums
- Rename --skip-snapshot-checksum to --verify-snapshot-checksum to
  avoid double negations in most of the code
- Conditionally create and verify checksums in SerializedCodeData
- Remove unused Deserializer::GetChecksum

Bug: chromium:1270752
Change-Id: I8360e0dd5f25dac68bf68909155771b302184a4b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3284883
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77925}
2021-11-16 15:06:37 +00:00
Nico Hartmann
6ffcdddbc2 Revert "[runtime] Reset clobbered argument in DefineClass"
This reverts commit 9b5f398554.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/39804/overview

Original change's description:
> [runtime] Reset clobbered argument in DefineClass
>
> The caller of DefineClass may not expect its arguments to be mutated, so
> add an arguments mutation scope which resets the argument clobbered by
> DefineClass.
>
> Bug: chromium:1268738
> Change-Id: I03e9cd82535ca1f83353012a92e80f822566e64e
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3283077
> Auto-Submit: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#77921}

Bug: chromium:1268738
Change-Id: I878bd78f8ed265c18cd01e3105a69c8a8f876208
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3284886
Owners-Override: Nico Hartmann <nicohartmann@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77924}
2021-11-16 13:58:29 +00:00
Leszek Swirski
f5d6ace664 [interpreter] Fix register printing for short Star
Register printing under --trace-ignition used register operands to
decide which register to print. But, for short Star bytecodes (Star1,
Star2, etc) the register is implicit in the bytecode. Add support for
these.

Change-Id: I788ffd729e251f2c8795b5660ac773329502bb5e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3283071
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/main@{#77922}
2021-11-16 13:34:24 +00:00
Leszek Swirski
9b5f398554 [runtime] Reset clobbered argument in DefineClass
The caller of DefineClass may not expect its arguments to be mutated, so
add an arguments mutation scope which resets the argument clobbered by
DefineClass.

Bug: chromium:1268738
Change-Id: I03e9cd82535ca1f83353012a92e80f822566e64e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3283077
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77921}
2021-11-16 13:22:04 +00:00
Igor Sheludko
df5efab1ed [ext-code-space] Fix code range allocation logic
Previously the code range could be allocated close but still outside
of the "short builtins call" region which would enforce copying of
builtins blob into the code range.
This CL ensures that the calculated hint address takes the required
base alignment into account and thus allocates the core range inside
of preferred region (see Isolate::GetShortBuiltinsCallRegion()).

Bug: v8:11880
Change-Id: I3cbd6a81501efd420063b963a8c4b5c328ae0785
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3283065
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77919}
2021-11-16 09:19:24 +00:00
Igor Sheludko
579c3b0ff7 [heap][cleanup] Rename kWordAligned to kTaggedAligned
Also introduce USE_ALLOCATION_ALIGNMENT_BOOL constant which is true
only for those configurations that require aligned allocations and
use it for statically falling back to unaligned allocations on those
configurations that do not require aligned allocations.

This is a prerequisite for introducing the real kWordAligned mode for
kSystemPointerSize aligned allocations.

Bug: v8:8875
Change-Id: I155d12435f344324bc1bf19da88ee823c8f2ca6c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3283064
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77918}
2021-11-16 09:14:24 +00:00
Lu Yahan
55cd86486a [riscv64] Move template into non-namespace scope
Fix node build failed


Change-Id: I3f465bcdaa17b0f1a6c497e9ab5ef9e50cbe5017
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3281721
Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#77917}
2021-11-16 08:31:55 +00:00
Milad Fa
85a85cf092 AIX: workaround the aix FP glibc bug
Due to a bug on AIX, some of the glibc FP functions do not
preserve the sign bit when a negative input is passed by
value and the output is rounded to 0:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97086

This CL continue the fixes previously added here:
https://crrev.com/c/2468618

Change-Id: I2afa1f67ac1d29ec0606de6d6ebcf05be0664b8d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3282308
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77915}
2021-11-16 03:23:24 +00:00
Ng Zhi An
6c6a602451 [regexp] Fix -Wshadow warnings
Bug: v8:12244,v8:12245
Change-Id: I38c9a767bd17f76bbf269ad79adc6798d94753a2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3273529
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77914}
2021-11-15 22:33:43 +00:00
Ng Zhi An
1033ab21a0 [objects] Fix -Wshadow warnings
Bug: v8:12244,v8:12245
Change-Id: I1cf8425c213b1ba83df53c4b362bf4d3d7f22de8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3276923
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77913}
2021-11-15 22:09:23 +00:00
Ng Zhi An
fb4b1efd1c [heap] Fix -Wshadow warnings
Bug: v8:12244,v8:12245
Change-Id: I5eb07a60881db655ea70dc83189ed1a0447f0bea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3278688
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77912}
2021-11-15 22:00:04 +00:00
Ng Zhi An
c25070c2a1 [cleanup] Fix some -Wshadow warnings
Bug: v8:12244,v8:12245
Change-Id: Icfdf2666220ac06c01b6220b4ac99b9ad00818dc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3278687
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77911}
2021-11-15 19:48:29 +00:00
Ng Zhi An
6577c5e9e2 [builtins][date] Fix -Wshadow warnings
Bug: v8:12244,v8:12245
Change-Id: I5fdc754432c7f619f4a32f92eb2da81beb23e8ce
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3278689
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77910}
2021-11-15 19:46:43 +00:00
Frank Tang
8bcb3f57b5 Reland "[cleanup] Remove harmony-intl-dateformat-day-period"
This is a reland of 5e041b8269

Original change's description:
> [cleanup] Remove harmony-intl-dateformat-day-period
>
> harmony-intl-dateformat-day-period is shipped in M92
>
> Bug: v8:12109
> Change-Id: I7d24463c0cc353c4baf52326159beb04592b81b5
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3099087
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#76468}

Bug: v8:12109
Change-Id: Iff4a9c706d0b0092f077d67e4e840292bd8024a9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3276921
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77909}
2021-11-15 19:38:18 +00:00
Milad Fa
c8b918f6f1 PPC/S390: Argument Count Consistency
Port: 255aaed95b

Original Commit Message:

   The receiver is now always included in the actual argument
   count and the formal parameter count.
   kDontAdaptArgumentsSentinel is changed from UINT16_MAX to 0
   to preserve the maximum allowed declared parameters.
   The build flag activating the changes is not set for any
   architecture yet.

Bug: v8:11112
Change-Id: Ib106775014a886da80684dcb83ed704bb898a244
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3271635
Reviewed-by: Junliang Yan <junyan@redhat.com>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77907}
2021-11-15 19:32:33 +00:00
Ng Zhi An
bb9766450d [objects] Make PropertyKind an enum class to fix -Wshadow
Bug: v8:12244,v8:12245
Change-Id: I3029cfb8e9afdcb5e53aa406359aa7246c23ea40
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3274021
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77906}
2021-11-15 19:05:14 +00:00
Dominik Inführ
ac48648715 [heap] Handle new_space() in Heap LAB methods
Let Heap::MakeHeapIterable() and Heap::FreeLinearAllocationAreas() also
handle the new space to be more uniform between spaces. Also removes
Heap::EnsureFillerObjectAtTop() in favor of
NewSpace::MakeLinearAllocationAreaIterable().

Bug: v8:10315
Change-Id: I7d28c1e95e433c4bc5a4a1a1f3aa8d71c43b8887
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3281926
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77905}
2021-11-15 17:28:13 +00:00
Samuel Groß
33381ffdbf Allow customizing the RegionAllocator's split and merge operations
This change allows clients of the RegionAllocator to provide callbacks
that are invoked when regions are split or merged.
This will later be needed on Windows when a RegionAllocator is used to
manage a placeholder mapping as these need to be split and merged (using
the VirtualFree API) as well.


Bug: chromium:1218005
Change-Id: I228b41bdb43c4a9ef0db04de9b121dea6b5f12f9
Cq-Include-Trybots: luci.v8.try:v8_linux64_heap_sandbox_dbg_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3264287
Commit-Queue: Samuel Groß <saelo@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77903}
2021-11-15 13:59:14 +00:00
Liu Yu
5ee6b7a701 [loong][mips][regexp] Fix stack growth for global regexps
Port commit 3e3a027da1

Beside, some registers are changed to callee-saved, and the previous
related save and restore operations are removed.

Bug: v8:11382

Change-Id: Ic3161f8173771c1b7c190c77cbaf2534f52ec422
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3281673
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Auto-Submit: Liu yu <liuyu@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#77902}
2021-11-15 12:48:04 +00:00
Dominik Inführ
5f20156341 [heap] Sweep code pages only on the main thread
Code pages need to be swept on the main thread for now. Originally this
was done to prevent RWX on code pages, but there might be more other
smaller issues like the linked bug. Most likely this restriction isn't
a problem for concurrent SP at the moment, so stick with this
invariant for now.

Bug: chromium:1269558, v8:12054
Change-Id: Icf7a7ce9714b9ef07b1a5070f0b0dd963b6d3011
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3279682
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77901}
2021-11-15 12:45:13 +00:00
Dominik Inführ
490a9ead23 [heap] Add methods for freeing all LABs
This CL adds Heap::FreeLinearAllocationAreas to free all local
allocation buffers (LABs). We use this to give up LABs for a local GC.
The second method Heap::FreeSharedLinearAllocationAreas is used to free
all LABs in the shared heap for shared GCs and in the future also on
isolate shutdown.

Bug: v8:10315
Change-Id: Ie5cbb68c95fae027055aeaf4458473b04b15b18c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3279681
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77900}
2021-11-15 12:31:43 +00:00
Manos Koukoutos
e8db01aff7 [wasm] Revisit removed Store node inputs in escape analysis
The stored value might be an allocation that can be removed once the
Store node is removed. We need to revisit this node manually because
inputs in a node removed with ReplaceWithValue are not revisited
automatically.

Bug: v8:11510
Change-Id: I57cb8955a3e2f7143474ad7ced9d946e6d1cc18e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3277880
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77899}
2021-11-15 12:18:25 +00:00
Camillo Bruni
a42e067ec0 [snapshot] Add SnapshotDecompress RCS scope
We do have snapshot decompression trace events, let's also add a
runtime call stats scope for easy comparison.

Bug: chromium:1269494, chromium:1270039
Change-Id: If467cc38f37a0ea9d84e501b4984bf72736c8fa4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3279962
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77898}
2021-11-15 11:44:45 +00:00
Leszek Swirski
6b2fa4c12b [compiler] Post compile tasks from ignition instead of the parser
Posting compile tasks from the parser has several issues:

  1. We don't know how many functions there will be total, so we can't
     yet allocate shared_function_infos array on the Script
  2. Without this array, inner function compiles can't look up their own
     inner functions during bytecode finalization, so we can't run that
     finalization before script parse completes
  3. Scope analysis can't have run yet, so we can only post top-level
     function tasks and if we allocate SharedFunctionInfos early they
     are forced into a bit of a limbo state without an outer ScopeInfo.

Instead, we can post compile tasks during bytecode generation. Then, the
script parse is guaranteed to have completed, so we'll have a
shared_function_infos array and we will have allocated ScopeInfos
already. This also opens the door for posting tasks for compiling more
inner functions than just top-level, as well as generating better code
for functions/methods that reference same-script top-level
let/const/class.

Bug: chromium:1267680
Change-Id: Ie1a3a3c6f1b264c4ef28cd4763bfc6dc08f45d4d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3277884
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77894}
2021-11-15 10:17:19 +00:00
Dominik Inführ
195f6e11a6 [heap] Handle paged spaces in Heap::MakeHeapIterable
Complete implementation of Heap::MakeHeapIterable() by also making the
LABs of paged spaces iterable. This method is the one to use when
the heap and/or a particular space shall be iterable.

Bug: v8:12338
Change-Id: Id859cf1a05df21a54939c504c59d7b1ccd659c9b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3277888
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77891}
2021-11-15 08:47:18 +00:00
Andreas Haas
0e6eb3e219 [wasm] Allow dynamic tiering to release CompilationEventCallbacks
With eager compilation, CompilationEventCallbacks get released when all
compilation units in the compilation state are finished. This is
possible because no future compilation event could get triggered after
that. With dynamic tiering, though, the {FinishedCompilationChunk} event
can trigger repeatedly, even after all compilation units finish at some
point in time, as dynamic tiering can create new CompilationUnits. As
a temporary fix, CompilationEventCallbacks don't get released when
dynamic tiering is enabled.

This CL fixes this issue by turning the callback from an std::function
into a class, and adding a second function to the class which indicates
whether the callback can be released when all compilation units in the
compilation state are finished. Thereby all callbacks can be deallocated
except the ones like the code caching callback which waits for the
{FinishedCompilationChunk} events.

R=jkummerow@chromium.org

Bug: v8:12289
Change-Id: I0f73f4bd2dffe644c9a26c274cb52ac6fa49ab67
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3264288
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77890}
2021-11-15 08:34:49 +00:00
Manos Koukoutos
b927dc158c [wasm][turbofan] Store real signature on call nodes for inlining
In each wasm CallDescriptor, we store the signature of the call based on
the real parameters passed to the call. This signature is more precise
than the formal function signature. We use this signature in inlining
to enable more optimizations.

Changes:
- Add wasm_sig_ field to CallDescriptor.
- Construct the real signature in {DoCall} and {DoReturnCall} in
  graph-builder-interface, and pass it to all call-related functions in
  WasmGraphBuilder.
- Update {ReplaceTypeInCallDescriptorWith} to use ValueType over
  MachineType. Construct the updated function signature.
- In wasm-inlining, kill the Call node after inlining.
- Add two tests.

Bug: v8:11510
Change-Id: Ica711b6b4d83945ecb7201be26577eab7db3c060
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3270539
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77889}
2021-11-15 08:13:19 +00:00
JianxiaoLuIntel
725f92cb36 [d8] Fix unused shared_create_params in d8
Change-Id: I2c05683f2172cc4a37189382ad886f523d51e823
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3273814
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Auto-Submit: Jianxiao Lu <jianxiao.lu@intel.com>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77888}
2021-11-15 07:32:58 +00:00
Jakob Kummerow
4976642bbd [wasm] Switch dynamic tiering to budget-based approach
FLAG_wasm_dynamic_tiering is still off by default. When enabled,
it now uses the technique previously behind --new-wasm-dynamic-tiering.

Bug: v8:12281
Change-Id: I365c2c066e62418cd6abc7830f95d1fe0f950e33
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3275570
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77883}
2021-11-12 23:52:12 +00:00
Igor Sheludko
79f617b009 [runtime][api] Fix tracking of entered contexts
The entered contexts stack must be in sync with the flags stack.

Bug: chromium:1269225
Change-Id: Ibb522286b47866d5f13aaec1a0a02914c13a5545
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3279680
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77882}
2021-11-12 21:15:06 +00:00
Shu-yu Guo
d3f1fcaab0 [heap] Skip values in marking barrier if heap sharedness mismatches
When incrementally marking a non-shared heap, shared values should not
be marked. Similarly, non-shared values should not be marked when
incrementally marking a shared heap.

Bug: v8:11708
Change-Id: Iecd799e7e3060e5fb3897b8be0c4e8158d9ff57f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3278673
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77881}
2021-11-12 19:55:07 +00:00
Ng Zhi An
19d158b50b [deoptimizer] Fix -Wshadow
Bug: v8:12244,v8:12245
Change-Id: I4a57fbd187ffebb1c1f170865641caef7b193926
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3274017
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77880}
2021-11-12 19:41:07 +00:00
Junliang Yan
9b243c9a82 s390x: [baseline] port Generate_BaselineOutOfLinePrologue
Change-Id: I8cd279059800567a81d8586944c8ed4c0ef9fa92
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3279101
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77879}
2021-11-12 19:13:38 +00:00
Ng Zhi An
e9c531b744 [builtins] Fix -Wshadow warnings
Bug: v8:12244,v8:12245
Change-Id: I02e08e79a7b3a07531bfac753beff13a866247e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3269170
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77878}
2021-11-12 17:52:46 +00:00
Igor Sheludko
ad4b160eaf [runtime] Ensure JSMessageObject has source positions
Under certain conditions GC could flush bytecode array from
SharedFunctionInfos. This CL ensures that the bytecode array is always
available for reconstructing source positions.

Bug: chromium:1265570
Change-Id: I2ce7eb04201f69121687ab0aaa2af42adb2caae0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3275569
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77877}
2021-11-12 17:43:31 +00:00
Thibaud Michaud
f4d265b03f [wasm] Make ActiveContinuation a root
Switching stack affects all instances, therefore make the active
continuation a root object instead of an instance field.

Bug: v8:12191
Change-Id: Ia521bf4e7c3cbca035f916e47804c2f75bbd8f18
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3268296
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77876}
2021-11-12 17:24:06 +00:00
Ng Zhi An
18311df345 [codegen][compiler] Rename ATOM to INTEL_ATOM to avoid shadow
This shadows ATOM used in js-regxp.

Making this an enum class requires changing a lot of different places.

Atom is an Intel brand name, so INTEL_ATOM kinda make sense.

Bug: v8:12244,v8:12245
Change-Id: I80be342488328cde5aaca36f900375d2fb381253
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3276926
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77875}
2021-11-12 17:11:31 +00:00
Milad Fa
0bb4006648 PPC: Optimize count of trailing zeros on P8 and below
Change-Id: Iff669f6272e2a95d5150108d5a3a77e903afbeb9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3275568
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77874}
2021-11-12 16:54:06 +00:00
Victor Gomes
42036e7e7e [heap] Adds DCHECK in UnprotectAndRegisterMemoryChunk
UnprotectAndRegisterMemoryChunk should only be called if we have
CodePageCollectionMemoryModificationScope or
CodeSpaceMemoryModificationScope open.

This also fixes cctests that create code objects without a
code modification scope.

Bug: v8:12054
Change-Id: Id931f1f8120050b2bb76ef3d5701b9a32e52ff37
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3277882
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77873}
2021-11-12 16:27:56 +00:00
Leszek Swirski
8685bd0cd4 [parser] Pass LocalIsolate to ParseOnBackground
Unify parse post-processing between main-thread and background-thread
parsing, now that we have LocalIsolate and can Internalize on background
threads.

As part of this, simplify the LocalIsolate parking pattern to explicitly
park during ParseOnBackground, rather than being implicitly parked when
ParseOnBackground is called. This reduces the amound of scoping needed
in the BackgroundCompileTask::Run method.

Change-Id: Ifdb128b763129bda78bd1bae89dac1c62f872350
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3277876
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77872}
2021-11-12 16:13:07 +00:00
Victor Gomes
47afc6fd01 [heap] Unprotect code space lab before MakeIterable
When closing a concurrent allocator, for instance when closing a
LocalHeap, we need to make the LAB of the code space iterable.
We add then a CodePageMemoryModificationScope to allow
code space modification.

Bug: v8:12054
Change-Id: I438d7c1a50694930b7558dec2dd552bec22b7552
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3277887
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77871}
2021-11-12 16:02:57 +00:00
Dominik Inführ
9e9c61b6f2 [objects] Use atomic for JSGlobalObject::native_context_unchecked
Speculative fix for a data race involving memory measurement. For memory
measurement we use JSGlobalObject::native_context_unchecked in
NativeContextInferrer::InferForJSObject when trying to infer the
NativeContext for a JS object from a concurrent marking thread. This
load can race e.g. with the context deserializer running on the main
thread. Fix this race by making the load relaxed atomic.

Bug: chromium:1269681
Change-Id: Id04a92572d7d722594b2f8465e579b7231e54e29
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3277885
Auto-Submit: 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@{#77870}
2021-11-12 15:39:29 +00:00
Leszek Swirski
8e98695ca9 [compiler-dispatcher] Add locking around SFI->Job map
Due to streaming, the SFI enqueueing can happen concurrently with with
main-thread finalising, so we need to add locks around accesses to the
SFI->Job map.

Bug: v8:12370
Change-Id: I60281a954ef10f7fcde559b9529077a6b9a82c31
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3277874
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77869}
2021-11-12 11:51:25 +00:00
Frank Tang
b9a48232b7 [Intl] Update ICU to 70-1 on v8
Diary  https://docs.google.com/document/d/1NqMw7DAVFCZRx67auC7sgOvrikHvCYuaB87JUf21yG8/edit#
eedbaf76..3e05d9da

chromium roll in https://chromium-review.googlesource.com/c/chromium/src/+/3224333

Bug: chromium:1260116
Change-Id: Ie1922a129310106985f3bf1bffd9101fce6bb73a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3237532
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77868}
2021-11-12 11:35:09 +00:00
Michael Lippautz
a57311ca65 cppgc: Fix DCHECK on destroying a large page
The DCHECK ensures that a page that is going to be destroyed is not
anymore part of the vector of pages of a space. This DCHECK runs while
a potential concurrent sweeper task may add a page for a live object
to the vector, resulting in a broken iteration. Use the pages lock to
fix this.

Bug: chromium:1268969
Change-Id: Ice87026957b3e6b5d36cf28293f7aa6901e96ba2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3277132
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77867}
2021-11-12 11:34:05 +00:00
Yujie Wang
fa76b5c99d [riscv64] Add packing and unpacking instructions for WebAssembly SIMD
- Add Wasm SIMD packing instruction:
  `LiftoffAssembler::emit_i8x16_{s,u}convert_i16x8`

- Add Wasm SIMD unpacking instructions:
  `LiftoffAssembler::emit_i64x2_{s,u}convert_i32x4_{low,high}`
  `LiftoffAssembler::emit_i32x4_{s,u}convert_i16x8_{low,high}`
  `LiftoffAssembler::emit_i64x2_{s,u}convert_i32x4_{low,high}`

- Add RVV instrucions: `vzext_vf{2,4,8}` and `vsext_vf{2,4,8}`

- Fixed simulator for `vslidedown_vi`

Bug: v8:11976
Change-Id: Idd383bc566589ce183f4fcef2201d2ccfe03519f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3273812
Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
Reviewed-by: Yahan Lu <yahan@iscas.ac.cn>
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#77865}
2021-11-12 08:00:05 +00:00
Lu Yahan
87d302e153 [riscv64] Fix a Int64Mul error in instruction selection.
Port 9a900169f8

The second parameter of Int64Mul may be a 64-bit immediate value,
treating it as a 32-bit value will lose the upper 32 bits.

Bug: v8:12373

Change-Id: Ib824db839219307ba390a6dc3c697bedb792046f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3275135
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#77862}
2021-11-12 03:05:51 +00:00