Commit Graph

66194 Commits

Author SHA1 Message Date
Thibaud Michaud
e33c13c2a2 [wasm][eh] Revert to catch with tag immediate
First step towards the new exception handling proposal:
https://github.com/WebAssembly/exception-handling/issues/125

This is essentially a revert of:
"[wasm] Switch to new 'catch' and 'br_on_exn' proposal."

The changes are:
- "catch" instruction takes a tag immediate,
- "rethrow" instruction takes a label immediate,
- Add "catch_all" instruction,
- Remove "br_on_exn" instruction,
- Do not push exceptions on the stack, only the encoded values

R=clemensb@chromium.org
CC=​aheejin@chromium.org

Bug: v8:8091
Change-Id: Iea4d8d5a5d3ad50693f645e93c13e8de117aa884
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2484514
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71602}
2020-12-03 18:55:31 +00:00
Sathya Gunasekaran
1096cbf26c [tools] Mark raytrace as slow everywhere
No-Try: true
Bug: v8:11222
Change-Id: I64e30e95101d0c8a318c7081b8c94f97fdb8538c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2571127
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Auto-Submit: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71601}
2020-12-03 17:05:14 +00:00
Leszek Swirski
a6f465d4d5 [compiler] Remove disallow scopes
TurboFan creates DisallowHeapAccess scopes, to prevent heap access in
the concurrent parts of the compiler. Then, for parts of the compiler
that do want to access the heap, it either creates Allow* scopes (which
should be avoided since they "punch a hole" in the Disallow* scopes), or
relies on a weakening of Handle::IsDereferenceAllowed which allows
handles owned by a LocalHeap to be dereferenced even if there is a
DisallowHeapDereference scope.

This patch:

  a) Strengthens the implicit requirements around handle dereferencing
     to require a running heap on this thread (either main-thread heap
     or an un-parked, un-safepointed LocalHeap).
  b) Removes the overly strict Disallow scopes in TurboFan, relying
     instead on implicit requirements for allocation/handle
     dereferencing in off-thread code.
  c) Cleans up the "should_disallow_heap_access" predicate to be more
     explicit about what should be disallowed (e.g. property accesses
     can't be computed concurrently)

Change-Id: Icb56b7764913ac17e2db197a70bb189af88a6978
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2554617
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71600}
2020-12-03 16:42:24 +00:00
Daniel Clark
9bccbee460 [modules] Allow Module::GetModuleRequests() to be called on a SyntheticModule
I'd implemented Module::GetModuleRequests() such that it can only be
called on a SourceTextModuleRecord, forgetting that one of the APIs
it replaces, Module::GetModuleRequestsLength(), could be called on a
synthetic module.  The old behavior allowed embedders to write code that
iterates over a module's requests without needing to handle synthetic
modules as a special case.  GetModuleRequestsLength() would just return
0 for all synthetic modules and the code to process the requests
would be skipped seamlessly for them.

With the new GetModuleRequests() API, this would no longer be possible,
and embedders would explicitly need to check IsSyntheticModule()
before calling it.  Thus, to reach parity with the old API, this change
allows embedders to call GetModuleRequests() on a synthetic module,
which will always result in an empty FixedArray.

Bug: v8:10958
Change-Id: I6024261fe46d18fa7acc83b0ec8f69d6af21b28d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2570146
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Dan Clark <daniec@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#71599}
2020-12-03 16:24:34 +00:00
Dominik Inführ
13e6a31843 [test] Skip or mark tests as slow with TSAN
These tests are pretty slow with both TSAN and
--stress-incremental-marking enabled.

* Skip octane/raytrace for the variant stress when TSAN is enabled.
* Test wasm/shared-memory-worker-stress is slow with TSAN.

Change-Id: Ia4b8ce2986d04e6ef2fc7d28991cd5ce7faf31e5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2571129
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71598}
2020-12-03 16:18:24 +00:00
Junliang Yan
e131069b5b [liftoff] s390x: implement f32/f64 min/max
Change-Id: I611f5c7a41bc6d050ca36d1c011d47795bfc5abc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2570033
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71597}
2020-12-03 15:08:04 +00:00
Junliang Yan
edb6a55c79 s390x: cleanup and unify vfmin/vfmax simulation
Change-Id: Ia2b9861e720cb2d2ce1d0d88867f31467798278d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569771
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71596}
2020-12-03 13:39:04 +00:00
Manos Koukoutos
c186b0be6d [wasm-gc] Fix interaction between AnalyzeLoopAssignment and 'let'
AnalyzeLoopAssignment did not take into account that 'let' shifts local
indexes.

Drive-by: Use gTest infrastructure in AnalyzeLoopAssignment tests
(EXPECT_*) instead of CHECKs.

Bug: v8:9495
Change-Id: Ic0ddb5edfde48acf172f4cac9bdcd0312b6121a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567955
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71595}
2020-12-03 12:34:53 +00:00
Zhi An Ng
92cd58ba83 [cleanup][compiler-dispatcher] Remove uses of DISALLOW_COPY_AND_ASSIGN
Bug: v8:11074
Change-Id: I50476740e2e6c78aff6db859db1db86f25ce897b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569561
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71594}
2020-12-03 12:25:08 +00:00
Zhi An Ng
f120fc1d4a [cleanup] Remove remaining uses of DISALLOW_COPY_AND_ASSIGN
Bug: v8:11074
Change-Id: I108a847e12df2438cc73e4f7a31ba4148f07cdc0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569562
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71593}
2020-12-03 12:24:03 +00:00
Dominik Inführ
dec7565f36 Reland "[heap] Remove SWEEPING phase in incremental marking"
This is a reland of 2afb00c0e8

Original change's description:
> [heap] Remove SWEEPING phase in incremental marking
>
> The SWEEPING phase in incremental marking was used to finish sweeping
> of the last GC cycle concurrently before starting incremental marking.
> This avoids potentially long pauses when starting incremental marking.
> However this shouldn't be necessary in most cases where sweeping is
> already finished when starting the next cycle. The implementation also
> didn't cleanly separate the GC cycles.
>
> In case the sweeping phase is necessary for pause times, we can
> introduce a "CompleteSweep" phase which runs right before starting
> incremental marking.
>
> Change-Id: Iaff8c06d5691e584894f57941f181d0424051eec
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567707
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71555}

Change-Id: I173bdeaf342d4c0590453f7d9eeb8ab5cfddc73c
Bug: v8:11220, v8:11221
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2571111
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71592}
2020-12-03 12:15:53 +00:00
Andreas Haas
5ee2bee3ba [turbofan] Adjust spill slot range for multi-value return
Safepoint maps record all spill slots that contain a tagged value. The
introduction of multi-value return changed the stack frame layout though
and the calculation of spill slots has not been adjusted accordingly.
This CL adjusts the creation of safepoints now to work for multi-value
returns as well.

R=neis@chromium.org

Bug: v8:11206
Change-Id: Id623dbc28b976dcf625ac78738e03e642fafbb36
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569762
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71591}
2020-12-03 10:44:23 +00:00
Sathya Gunasekaran
fbc7de74db [tools] Mark raytrace as slow for stress_incremental_marking variant
Bug: v8:11222
Change-Id: I18a5c58315e37443de1a328ff4d254116c67fcfd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569772
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71590}
2020-12-03 09:02:03 +00:00
Philip Pfaffe
8ca19603a2 [wasm debug] Cache name tables for the wasm debug proxy.
Also construct the `JSMap`s used to store these names lazily and
only on-demand, and construct them directly instead of first doing
a `std::vector<Handle<String>>` and using that to construct the
`JSMap`. The latter resulted in a gigantic root set of 150k+ handles,
which wasn't well received by the GC.

Bug: chromium:1154154
Fixed: chromium:1154564
Also-By: bmeurer@chromium.org
Change-Id: I92e8931f15eda133e2a62b5cc53fbe1f2dafcead
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2568275
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71589}
2020-12-03 08:24:53 +00:00
Liu Yu
220b4a3b08 [mips32][wasm-simd] Support returning Simd128 on caller's stack
Port: 360c9294a8

Change-Id: I9a0d0dd3d70ad6dd5aa94aa2d8f200111a9f5c3d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2570828
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/master@{#71588}
2020-12-03 07:51:13 +00:00
Zhi An Ng
bef5c470c5 [arm] Consolidate some NEON unary instructions
EncodeNeonUnaryOp and EncodeNeonSizedOp are essentially the same, they
are both helpers to encode instructions in the encoding group "Advanced
SIMD two registers misc". Consolidate them into a single helper.

Bug: v8:11074
Change-Id: I8b0c21bfbce51de72b41cbd3d34cf4fed9ce8819
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567535
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71587}
2020-12-03 07:44:53 +00:00
Zhi An Ng
d64759c3a8 Revert "Reland "[wasm-simd][arm] Prototype i8x16.popcnt""
This reverts commit d0f7c6a8fa.

Reason for revert: Causing flaky tests https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Mac64%20-%20debug/31929/overview

Original change's description:
> Reland "[wasm-simd][arm] Prototype i8x16.popcnt"
>
> This is a reland of e2aa734aef
>
> The original change was speculatively reverted in
> https://crrev.com/c/2568925 but seems unrelated to the flakey
> test failures (which are on x64).
>
> Original change's description:
> > [wasm-simd][arm] Prototype i8x16.popcnt
> >
> > Bug: v8:11002
> > Change-Id: Ib97e51ed52249a1af7a4b879396b70a016991719
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567534
> > Commit-Queue: Zhi An Ng <zhin@chromium.org>
> > Reviewed-by: Bill Budge <bbudge@chromium.org>
> > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#71552}
>
> Bug: v8:11002
> Change-Id: I714918e2640d27d29953f940e3bedeb9ea2f8a08
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567243
> Commit-Queue: Zhi An Ng <zhin@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71585}

TBR=bbudge@chromium.org,jkummerow@chromium.org,v8-arm-ports@googlegroups.com,zhin@chromium.org

Change-Id: Ib8454a4c20937495c2b83b7ceb3ad594b1b9e7e5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:11002
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569559
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71586}
2020-12-03 05:19:25 +00:00
Zhi An Ng
d0f7c6a8fa Reland "[wasm-simd][arm] Prototype i8x16.popcnt"
This is a reland of e2aa734aef

The original change was speculatively reverted in
https://crrev.com/c/2568925 but seems unrelated to the flakey
test failures (which are on x64).

Original change's description:
> [wasm-simd][arm] Prototype i8x16.popcnt
>
> Bug: v8:11002
> Change-Id: Ib97e51ed52249a1af7a4b879396b70a016991719
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567534
> Commit-Queue: Zhi An Ng <zhin@chromium.org>
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71552}

Bug: v8:11002
Change-Id: I714918e2640d27d29953f940e3bedeb9ea2f8a08
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567243
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71585}
2020-12-03 04:26:23 +00:00
Zhi An Ng
a0f105c8bb [wasm-simd][x64] Add missing CpuFeatureScope to some instructions
It doesn't seem to be a problem at all, I think we already have SSE4_1
scope enabled somewhere.

Change-Id: I501166a4e45214832e85df8a2594dabe6976bfd3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567191
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71584}
2020-12-03 04:08:03 +00:00
Liu Yu
6e9c60e638 [mips][cleanup][TurboProp] Unify DynamicMapChecks names.
Port commit 7730fd94a2

Bug: v8:10582

Change-Id: I2597bbbbe06ba16dba042ee512119822305a5f70
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2570433
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#71583}
2020-12-03 04:06:42 +00:00
Manos Koukoutos
e2f858a887 [wasm-gc] Fix br_on_null behavior in unreachable code
br_on_null should push a value on the stack, even in unreachable code.


Bug: v8:9495
Change-Id: Ic227c2f889b863a267a7ff5f33e539b43e66b42f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567966
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71582}
2020-12-03 03:52:33 +00:00
Zhi An Ng
818ba36e31 [ia32] Consolidate anytrue instruction codes
These instructions have the same implementation in code-generator.

Bug: v8:11217
Change-Id: I06fa7eaf6360aa8f142ee1d0b36832be3a518b7b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2568920
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71581}
2020-12-03 03:47:12 +00:00
Zhi An Ng
f629163418 [wasm-simd][x64] Small optimization for i64x2.splat
Movddup can take a memory operand, so we can save a move from gp reg to
xmm reg in that case. No problem with unaligned memory since we are
loading 64 bits (not 128 bits).

Also drive-by comment on i32x4.splat, it uses pshufd, which can also take
a memory operand (saving a mov), but we need aligned memory for that
first.

Bug: v8:9198
Change-Id: I55969888db1debb6ed4d193f767589d0da598386
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567538
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71580}
2020-12-03 03:40:23 +00:00
v8-ci-autoroll-builder
51abbb8d29 Update V8 DEPS.
Rolling v8/build: 6ca160d..cb1a537

Rolling v8/third_party/aemu-linux-x64: DQxYsB8PVOoG7iQxYf01AM0DSgvbu3DKEyrTvcT79zAC..h_lfZjWg21ZL3JBJXSabJsKCnyhbzTyNAISwoJCfLCAC

Rolling v8/third_party/depot_tools: 80cea4f..4640dfb

TBR=machenbach@chromium.org,tmrts@chromium.org,v8-waterfall-sheriff@grotations.appspotmail.com

Change-Id: I58bf8af05b8da06afc1f2d57935edbd6769ba343
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2570432
Reviewed-by: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#71579}
2020-12-03 03:33:32 +00:00
Junliang Yan
93148da701 s390x: simply ByteReverse using templates
Change-Id: I8ec751f578e2d7a790852670690797f19aba74e4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2570220
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71578}
2020-12-03 00:15:20 +00:00
Junliang Yan
736e7144c3 s390x: Unify VectorReg access on simulator
Cleanup Memcpy and use get/set_simd_register_by_lane

Change-Id: Icbdd838e075d93d75064bd8e47eb95c02f1da9d4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2568589
Commit-Queue: Junliang Yan <junyan@redhat.com>
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71577}
2020-12-02 22:33:50 +00:00
Junliang Yan
6cbc71984d s390x: unify FP register access on simulator
Change-Id: Ia92e1e85aa19abb8cc0f756e5334a539cf604287
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2570135
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71576}
2020-12-02 21:30:11 +00:00
Milad Fa
4aeb4a34b3 PPC: [was-simd] Fix Vector pack behaviour.
Due to the lane numbering difference between Intel and IBM machines,
we need to switch the input registers when doing a vector pack.

Change-Id: Id01d6292cb2a65b78dccdf3bab1d5ff010e1d018
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569996
Reviewed-by: Junliang Yan <junyan@redhat.com>
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71575}
2020-12-02 20:03:30 +00:00
Milad Fa
073d0690d1 PPC/s390: [cleanup][TurboProp] Unify DynamicMapChecks names.
Port 7730fd94a2

Original Commit Message:

    Unifies various operators for dynamic map checks with the naming
    scheme of DynamicCheckMaps (to be similar to CheckMaps.

R=rmcilroy@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=v8:10582
LOG=N

Change-Id: I0c7665eb5ec3cd0b0b8217af3ec8e9e18a3d3055
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569593
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71574}
2020-12-02 18:38:50 +00:00
Santiago Aboy Solanes
3a6f75ac94 [objects] Remove MakeExternal case for uncached internal strings
Concurrently accessing internal external uncached strings is not
thread-safe. We are removing a case where we can make such a string
through MakeExternal.

Bug: v8:7790
Change-Id: I958062c15cf40ccc330600bb572de98620866e54
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565511
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71573}
2020-12-02 18:15:20 +00:00
Manos Koukoutos
0396b732e7 [wasm-gc] read_heap_type should check if index is in module bounds
read_heap_type did not have knowledge of the module for which the heap
type was being decoded. As a result, callers of read_heap_type (or
read_value_type, which in turn calls read_heap_type) had to check after
the fact that a decoded indexed type (ref, ref null, or rtt) references
a type index within the module's bounds. This was not done consistently,
and was missing (at least) in DecodeLocals.
To avoid such problems in the future, this CL refactors read_heap_type
to accept a module and check the decoded index against it.

Changes:
- Add WasmModule argument to read_heap_type. Do so accordingly to all
  its transitive callers (read_value_type, immediate arguments,
  DecodeLocalDecls, DecodeValue/HeapType in unittests).
- Add index check to read_heap_type and emit an error for an
  out-of-bounds index.
- Remove all other now-redundant index validations. Replace them with
  decoder->ok() if needed (since read_heap_type will now emit an error).
- Fix error message in Validate for BlockTypeImmediate.
- In DecodeLocalDecls in unittests, pass an empty module to
  DecodeLocalDecls in the main code.
- Add a unit test with an invalid index in local type declarations.

Bug: v8:9495
Change-Id: I4ed1204847db80f78b6ae85fa40d300cd2456295
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569757
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71572}
2020-12-02 16:52:51 +00:00
Milad Fa
2bc979aa0a PPC/s390: [Turboprop] Move deoptimizations for dynamic map checks into builtin.
Port b6643320b9

Original Commit Message:

    In order to reduce the codegen size of dynamic map checks, add the
    ability to have an eager with resume deopt point, which can call
    a given builitin to perform a more detailed check than can be done
    in codegen, and then either deoptimizes itself (as if the calling
    code had performed an eager deopt) or resumes execution in the
    calling code after the check.

    In addition, support for adding extra arguments to a
    deoptimization continuation is added to enable us to pass the
    necessary arguments to the DynamicMapChecks builtin.

    Finally, a trampoline is added to the DynamicMapChecks which saves
    the registers that might be clobbered by that builtin, to avoid
    having to save them in the generated code. This trampoline also
    performs the deoptimization based on the result of the
    DynamicMapChecks builtin.

    In order to ensure both the trampoline and DynamicMapChecks
    builtin have the same call interface, and to limit the number
    of registers that need saving in the trampoline, the
    DynamicMapChecks builtin is moved to be a CSA builtin with a
    custom CallInterfaceDescriptor, that calls an exported Torque
    macro that implements the actual functionality.

    All told, this changes the codegen for a monomorphic dynamic
    map check from:
        movl rbx,<expected_map>
        cmpl [<object>-0x1],rbx
        jnz <deferred_call>
       resume_point:
        ...
       deferred_call:
        <spill registers>
        movl rax,<slot>
        movq rbx,<object>
        movq rcx,<handler>
        movq r10,<DynamicMapChecks>
        call r10
        cmpq rax,0x0
        jz <restore_regs>
        cmpq rax,0x1
        jz <deopt_point_1>
        cmpq rax,0x2
        jz <deopt_point_2>
        int3l
       restore_regs:
        <restore_regs>
        jmp <resume_point>
        ...
       deopt_point_1:
        call Deoptimization_Eager
       deopt_point_2:
        call Deoptimization_Bailout

        movl rcx,<expected_map>
        movq rdx,<handler>
        cmpl [<object>-0x1],rcx
        jnz <deopt_point>
       resume_point:
        ...
       deopt_point:
        call DynamicMapChecksTrampoline
        jmp <resume_point>

R=rmcilroy@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=v8:10582
LOG=N

Change-Id: I0739c1b40ed06bb22b73ebe1833ea648b540882a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569359
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71571}
2020-12-02 16:41:20 +00:00
Dominik Inführ
0f8fe4e536 Revert "[heap] Remove SWEEPING phase in incremental marking"
This reverts commit 2afb00c0e8.

Reason for revert: Some tests started to timeout.

Original change's description:
> [heap] Remove SWEEPING phase in incremental marking
>
> The SWEEPING phase in incremental marking was used to finish sweeping
> of the last GC cycle concurrently before starting incremental marking.
> This avoids potentially long pauses when starting incremental marking.
> However this shouldn't be necessary in most cases where sweeping is
> already finished when starting the next cycle. The implementation also
> didn't cleanly separate the GC cycles.
>
> In case the sweeping phase is necessary for pause times, we can
> introduce a "CompleteSweep" phase which runs right before starting
> incremental marking.
>
> Change-Id: Iaff8c06d5691e584894f57941f181d0424051eec
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567707
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71555}

TBR=ulan@chromium.org,dinfuehr@chromium.org

Change-Id: I9adea60c21ff7cdfa7bbac3e6a4a240640fa5ea9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569766
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71570}
2020-12-02 16:01:41 +00:00
Maya Lekova
78e9a3a7fc Revert "Reland "[heap] Add epoch to GC tracing events""
This reverts commit 3238162da7.

Reason for revert: Speculative revert for https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64/40411/overview, causing SEGV_ACCERR on test/mjsunit/harmony/promise-any-overflow-2.js and other failures in minor_mc variant

Original change's description:
> Reland "[heap] Add epoch to GC tracing events"
>
> This is a reland of be52501d52
>
> Fix data race by not emitting the epoch for sweeper background jobs
> at them moment.
>
> Original change's description:
> > [heap] Add epoch to GC tracing events
> >
> > This CL adds the TRACE_GC_EPOCH macro, which adds the epoch as attribute
> > to the trace event. Use TRACE_GC_EPOCH for top-level events, nested
> > events can get the information from its parent.
> >
> > V8's GC needs an epoch for young and full collections, since scavenges
> > also occur during incremental marking. The epoch is also process-wide,
> > so different isolates do not reuse the same id.
> >
> > Change-Id: I8889bccce51e008374b4796445a50062bd87a45d
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565247
> > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#71521}
>
> Change-Id: Ib8f4bfdc01c459955eb6db63bb6e24a8aa068f09
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567702
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71567}

TBR=ulan@chromium.org,dinfuehr@chromium.org

Change-Id: I29a131f798c3536d16e4b4c44c0fcb8b35dd0051
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569764
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71569}
2020-12-02 15:28:41 +00:00
Zhi An Ng
8a91429ec5 [cleanup][codegen] Remove uses of DISALLOW_COPY_AND_ASSIGN
Bug: v8:11074
Change-Id: Ifdd52d501a1d55a2fe176f0995f8c0e7f71ca1fd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569131
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71568}
2020-12-02 14:45:50 +00:00
Dominik Inführ
3238162da7 Reland "[heap] Add epoch to GC tracing events"
This is a reland of be52501d52

Fix data race by not emitting the epoch for sweeper background jobs
at them moment.

Original change's description:
> [heap] Add epoch to GC tracing events
>
> This CL adds the TRACE_GC_EPOCH macro, which adds the epoch as attribute
> to the trace event. Use TRACE_GC_EPOCH for top-level events, nested
> events can get the information from its parent.
>
> V8's GC needs an epoch for young and full collections, since scavenges
> also occur during incremental marking. The epoch is also process-wide,
> so different isolates do not reuse the same id.
>
> Change-Id: I8889bccce51e008374b4796445a50062bd87a45d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565247
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71521}

Change-Id: Ib8f4bfdc01c459955eb6db63bb6e24a8aa068f09
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567702
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71567}
2020-12-02 14:28:20 +00:00
Manos Koukoutos
56362efc7f [wasm][bug] Update num_locals_ earlier in DecodeLocals
If DecodeLocals exits early, num_locals_ is left in an inconsistent
state. This CL fixes this issue by updating num_locals_ as the
local_types_ are updated.

Bug: chromium:1154439
Change-Id: I02328a050df8b2827a42f59443e994f535d3c826
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567954
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71566}
2020-12-02 13:57:49 +00:00
Camillo Bruni
02ab03b9e8 [tools][runtime] Fix --trace-maps
- Don't print normalize transition for cached maps
- Avoid printing two transitions in Map::CopyReplaceDescriptor
- Harden processor.mjs existing existing broken logs by skipping double
  entries and avoiding mutliple edges to the same target map

Bug: v8:10644
Change-Id: I561a0f888c8835a40a289baa50d65ff69e368bad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565123
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71565}
2020-12-02 13:25:49 +00:00
Clemens Backes
6316601006 [liftoff][arm] Release temp registers after use
The {ParallelRegisterMove} at the end of {AtomicLoad} might need a
temporary scratch register for spilling values to the stack. Make sure
that one is available by giving up the scratch register used for the
address of the atomic access.

R=ahaas@chromium.org

Bug: chromium:1153442
Change-Id: I267c43e2193662c420f96f6683ebd4bbb0e1bca3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2566759
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71564}
2020-12-02 11:54:34 +00:00
Clemens Backes
a9bb380c7e [wasm][cleanup] Rename an "offset" parameter
From reading the code it was totally unclear what the purpose of the
"offset" parameter at ProcessCodeSectionHeader and CheckFunctionsCount
is. Actually, it's just there for setting an error position. Thus this
CL renames the field, and a related local variable to make the use more
clear.

Drive-by: Remove a confusing and unnecessary Decoder::Reset call.

R=ahaas@chromium.org

Change-Id: Iccde5ccb3b9e7e52976c47724157c184fd345ec4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567709
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71563}
2020-12-02 11:53:29 +00:00
Georg Neis
03202a3861 [csa] Expand comment on Reference struct
Change-Id: Iec5bf3e3fa238e4dce4ec89840cfd6c39a6726a9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2568273
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71562}
2020-12-02 11:14:59 +00:00
Mythri A
58477dc3ff [runtime-profiler] Cleanup MarkCandidatesForOptimization* functions
MarkCandidatesForOptimizationFromBytecode/
MarkCandidatesForOptimizationFromCode are called when bytecode budget
interrupt occurs from interpreted / optimized code. The logic in these
two functions is very similar. This cl merges this logic into one
function.

This cl also removes FLAG_frame_count which specifies the
number of frames we need to look at for tiering up on a bytecode
budget interrupt. The default value is set to 1 and in its current
form it isn't very useful.

Bug: v8:9684
Change-Id: I9f56034f2857672921673b9b68b3615765c0ccfe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565514
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71561}
2020-12-02 11:07:09 +00:00
Liu Yu
059c5fa45a [mips][Turboprop] Move deoptimizations for dynamic map checks into builtin.
Port: b6643320b9

Bug: v8:10582

Change-Id: I3efdd840a4f3f2eeb6156f8b446478311a2ccd26
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2568569
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/master@{#71560}
2020-12-02 10:41:49 +00:00
Ross McIlroy
7730fd94a2 [cleanup][TurboProp] Unify DynamicMapChecks names.
Unifies various operators for dynamic map checks with the naming
scheme of DynamicCheckMaps (to be similar to CheckMaps.

BUG=v8:10582

Change-Id: I8ac842f55fe31cdc7b84968d077017a86ddf4442
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567952
Auto-Submit: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71559}
2020-12-02 10:29:49 +00:00
Camillo Bruni
b178c52aed [tools] System-analyzer: support filtering timelines by types
Bug: v8:10644
Change-Id: I727f844f3796f37e92c8855e02d519abeee73dc1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2566760
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71558}
2020-12-02 10:17:39 +00:00
Clemens Backes
d7859a0ae3 Revert "Reland [wasm] Reduce job priority once baseline compilation finishes"
This reverts commit 83d289b87f.

Reason for revert: lock order inversion, see https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20TSAN%20-%20isolates/12584/overview

Original change's description:
> Reland [wasm] Reduce job priority once baseline compilation finishes
>
> ReduceCompilationPriority takes a lock now.
>
> Original message:
> This Cl changes the priority of baseline compilation from kUserVisible
> to kUserBlocking. Once baseline compilation finishes, the priority is
> reduced to kUserVisible. The reason for using kUserBlocking is that
> thereby TurboFan compilation cannot block Liftoff compilation anymore.
> Additionally, kUserBlocking is quite appropriate, as the initial
> compilation does block a whole section of a web app from execution.
>
> R=​clemensb@chromium.org
>
> Bug: v8:11088
> Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_rel_ng
> Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_isolates_rel_ng
> Change-Id: I6e1bcc809148198a4b4f88bfd4f2e62b1b061439
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2563675
> Commit-Queue: Andreas Haas <ahaas@chromium.org>
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71546}

TBR=ahaas@chromium.org,clemensb@chromium.org

Change-Id: I62e4e3d0663dbd181b14f77f0c1586d5e503f324
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:11088
Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_rel_ng
Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_isolates_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567953
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71557}
2020-12-02 09:46:30 +00:00
Camillo Bruni
c899ad5e5e [tools][log] Add support for disassembled code
- Add FLAG_log_code_disassemble
- Add code-disassamble log entries for Code and BytecodeArray
- Add basic code-panel to system-analyzer

Bug: v8:10644
Change-Id: I1abb339a42b55df01265d63d0f0d8c1ac2e041dc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565517
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71556}
2020-12-02 08:37:39 +00:00
Dominik Inführ
2afb00c0e8 [heap] Remove SWEEPING phase in incremental marking
The SWEEPING phase in incremental marking was used to finish sweeping
of the last GC cycle concurrently before starting incremental marking.
This avoids potentially long pauses when starting incremental marking.
However this shouldn't be necessary in most cases where sweeping is
already finished when starting the next cycle. The implementation also
didn't cleanly separate the GC cycles.

In case the sweeping phase is necessary for pause times, we can
introduce a "CompleteSweep" phase which runs right before starting
incremental marking.

Change-Id: Iaff8c06d5691e584894f57941f181d0424051eec
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567707
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71555}
2020-12-02 08:26:19 +00:00
Sathya Gunasekaran
f10ef12aa3 Revert "[wasm-simd][arm] Prototype i8x16.popcnt"
This reverts commit e2aa734aef.

Reason for revert:  speculative revert for https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Mac64%20-%20debug/31901/blamelist

Original change's description:
> [wasm-simd][arm] Prototype i8x16.popcnt
>
> Bug: v8:11002
> Change-Id: Ib97e51ed52249a1af7a4b879396b70a016991719
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567534
> Commit-Queue: Zhi An Ng <zhin@chromium.org>
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71552}

TBR=bbudge@chromium.org,jkummerow@chromium.org,v8-arm-ports@googlegroups.com,zhin@chromium.org

Change-Id: Id1ae2dbaae52d45eb81ba8636178236ca8e9f7e0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:11002
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2568925
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71554}
2020-12-02 07:53:20 +00:00
Jakob Gruber
ab4a540c06 Revert "[nci] Share smi feedback and enable related optimizations"
This reverts commit 3599cce1f5.

Originally landed in
https://chromium-review.googlesource.com/c/v8/v8/+/2531775

Work on NCI is suspended, remove unused complexity. We may want to share
native-context-independent feedback in the future, but probably through other
means.

Bug: v8:8888
Change-Id: I23dfb67f6f01b4891af87bc42a9e62f99d0bf044
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567701
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71553}
2020-12-02 05:52:29 +00:00