Commit Graph

64635 Commits

Author SHA1 Message Date
Adam Klein
74794fb937 [wasm-simd] Rename shuffle & swizzle instructions to match spec
These instructions were changed from "s8x16" to "i8x16" prefixes in
https://github.com/WebAssembly/simd/pull/321.

This CL updates all V8 code, including arch-specific code, to match.

Bug: v8:10946, v8:10933
Change-Id: I26ef9ad77571f94501d42c1d65f57380fd507f3d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2432068
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70143}
2020-09-25 19:07:12 +00:00
Francis McCabe
2221f0909b Revert "cppgc: Provide jobs support through DefaultPlatform and TestPlatform"
This reverts commit 22c0fc8f2e.

Reason for revert: https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20gcc/8712?

Original change's description:
> cppgc: Provide jobs support through DefaultPlatform and TestPlatform
>
> This CL extends cppgc::DefaultPlatform and TestPlatform to emulate
> jobs using std::thread and v8::base::Thread respectively.
> Jobs using these platform do not yield unless the job as been
> cancelled. Additionally, the job priority is ignored.
>
> Bug: chromium:1056170
> Change-Id: I72db1eef410d2be3d3e5ea7d4ece9e5584a451f2
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2416378
> Commit-Queue: Omer Katz <omerkatz@chromium.org>
> Reviewed-by: Anton Bikineev <bikineev@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70139}

TBR=mlippautz@chromium.org,bikineev@chromium.org,omerkatz@chromium.org

Change-Id: Ic29235e3ab78a1b515a5b14b808e116a1ccffc0f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1056170
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2432087
Reviewed-by: Francis McCabe <fgm@chromium.org>
Commit-Queue: Francis McCabe <fgm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70142}
2020-09-25 17:51:10 +00:00
Santiago Aboy Solanes
7b8c532d8a [csa][cleanup] Remove non-TNodified int version of LoadObjectField
Bug: v8:9708, v8:6949
Change-Id: Ic219e0eb18648166a712493039f96e067ad47418
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2395555
Reviewed-by: Mythri Alle <mythria@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70141}
2020-09-25 17:49:18 +00:00
Victor Gomes
50348472b0 [cleanup] Class hierarchy in frame constants
- InterpretedFrames are just StandardFrames with 2 extra values.
- BuiltinExitFrames are ExitFrames with 4 extra expected arguments.

Change-Id: I2c4e4a24185bfa0f23ff63616c8ef66780506796
Bug: v8:10933
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2429948
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70140}
2020-09-25 17:48:13 +00:00
Omer Katz
22c0fc8f2e cppgc: Provide jobs support through DefaultPlatform and TestPlatform
This CL extends cppgc::DefaultPlatform and TestPlatform to emulate
jobs using std::thread and v8::base::Thread respectively.
Jobs using these platform do not yield unless the job as been
cancelled. Additionally, the job priority is ignored.

Bug: chromium:1056170
Change-Id: I72db1eef410d2be3d3e5ea7d4ece9e5584a451f2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2416378
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70139}
2020-09-25 17:47:08 +00:00
Etienne Pierre-Doray
4822d3b22a Revert "Reland "[Heap] ScavengerCollector use Jobs.""
This reverts commit 92f815a80d.

Reason for revert: broke tests; see https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20TSAN/33395?

Original change's description:
> Reland "[Heap] ScavengerCollector use Jobs."
>
> This is a reland of 9e8c54f830
> Safe to reland as-is with fix in AcquireTaskId
> https://chromium-review.googlesource.com/c/v8/v8/+/2401964
>
> Additional changes are made in the reland:
> -TRACE_GC is be split for background/foreground scope.
> -New IndexGenerator is used for dynamic work assignement.
>
> Original change's description:
> > [Heap] ScavengerCollector use Jobs.
> >
> > No yielding is necessary since the main thread Join()s.
> >
> > max concurrency is determined based on either
> > remaining_memory_chunks_ or global pool size
> > (copied_list_ + promotion_list_)
> >
> > Change-Id: Ie30fa86c44d3224b04df5d79569bce126ce7d96b
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2354390
> > Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
> > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#69746}
>
> Change-Id: Id9d7a5bf3b2337ae4cf1e76770f4b14ebb8ca256
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2399041
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70135}

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

Change-Id: I4823c642546b82a9a9c8955151cd8784e4b86bc8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2431551
Commit-Queue: Francis McCabe <fgm@chromium.org>
Reviewed-by: Francis McCabe <fgm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70138}
2020-09-25 17:06:41 +00:00
Tobias Tebbi
21b585165f Reland "[torque] refactor: use -tq only in filenames derived from .tq files"
This is a reland of 64caf2b0b2

Original change's description:
> [torque] refactor: use -tq only in filenames derived from .tq files
>
> This is to establish a naming rule for Torque-generated files:
> - If the file is called foo/bar-tq..., then it is derived from a
>   file foo/bar.tq
> - Otherwise it doesn't belong to a specific .tq file.
>
> So far, we attached -tq to all Torque-generated file names, where it
> sometimes corresponded to a .tq file name and sometimes not.
> It is not necessary to add -tq to file names to indicate that they are
> Torque-generated, since they are already in a directory called
> torque-generated, and we always refer to them as
> "torque-generated/filename", so there is no confusion even though some
> files now have the same name as a corresponding hand-written file, for
> example factory.cc.
>
> TBR: hpayer@chromium.org
> Bug: v8:7793
> Change-Id: Ie172babad1fc7422fd1059c48f5dafaa53e50c8b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2414218
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70060}

Bug: v8:7793
TBR: hpayer@chromium.org jgruber@chromium.org
Change-Id: I6c492bc64aee1ff167e7ef401825eca9097a7f38
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2431565
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70137}
2020-09-25 15:04:18 +00:00
Milad Fa
2089b45adb AIX: fix "function descriptors" typo
Change-Id: I92d4962354559990e346df7efae272ae1f74e528
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2431467
Reviewed-by: Junliang Yan <junyan@redhat.com>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#70136}
2020-09-25 14:55:48 +00:00
Etienne Pierre-doray
92f815a80d Reland "[Heap] ScavengerCollector use Jobs."
This is a reland of 9e8c54f830
Safe to reland as-is with fix in AcquireTaskId
https://chromium-review.googlesource.com/c/v8/v8/+/2401964

Additional changes are made in the reland:
-TRACE_GC is be split for background/foreground scope.
-New IndexGenerator is used for dynamic work assignement.

Original change's description:
> [Heap] ScavengerCollector use Jobs.
>
> No yielding is necessary since the main thread Join()s.
>
> max concurrency is determined based on either
> remaining_memory_chunks_ or global pool size
> (copied_list_ + promotion_list_)
>
> Change-Id: Ie30fa86c44d3224b04df5d79569bce126ce7d96b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2354390
> Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#69746}

Change-Id: Id9d7a5bf3b2337ae4cf1e76770f4b14ebb8ca256
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2399041
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70135}
2020-09-25 14:35:18 +00:00
Andreas Haas
22953ff8fe [wasm] Don't overwrite register in atomic.wait if it is still used
In atomic.wait we overwrote the register which stored the index,
without checking if it was still in use or not.

R=clemensb@chromium.org

Bug: v8:10898
Change-Id: Iab6e1a84c71887af81d307c4ca795109ce2fdfc2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2428928
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70134}
2020-09-25 14:02:08 +00:00
Mythri A
6a40157784 [builtins] Fix CallOrConstruct to load length only for fast arrays
CallOrConstructWithArrayLike and CallOrConstructWithSpread builtins
expect only Smi in the array length field. This is true when we
have fast elements kind, but for dictionary mode we can have HeapNumbers
This cl fixes by moving the loading of length fields after the check
on elements kind to avoid loading length fields on dictionary mode
JSArrays.

Change-Id: I838a260353efa25fb0357e6f03247d3075cebe3b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2431206
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70133}
2020-09-25 13:47:38 +00:00
Andreas Haas
4942b23247 [wasm] Use PrepareBuiltinCall for atomic.notify
R=clemensb@chromium.org

Bug: v8:10933
Change-Id: Ie2f1cdc1cad9e4e68ace0eedfd2456f5487b5107
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2428586
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70132}
2020-09-25 13:41:18 +00:00
Andreas Haas
0acb07c543 [wasm][liftoff] In PrepareBuiltinCall, spill slots before register moves
When stack slots are spilled after the register moves, some registers
may get overwritten, e.g. by constants.

R=clemensb@chromium.org

Change-Id: Ie94aff0fd63cd9c271b90df34895818594cee3b2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2429032
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70131}
2020-09-25 12:26:08 +00:00
Tobias Tebbi
e9bcaa91ea [flags] introduce --allow-overwriting-for-next-flag
Bug: v8:10942
Change-Id: Icbb1d8e054ee924a77f1fbeb9e48cde604ef69b1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2422001
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70130}
2020-09-25 11:03:18 +00:00
Bill Budge
c45c9bc295 [flags] Add a flag to independently enable/disable Atomics
- Adds a --harmony-atomics feature to gate Atomics. This allows us to
  independently add SharedArrayBuffer and Atomics on the global object
  of Contexts, which is necessary for migration to a COOP+COEP site
  isolation requirement.

Bug: chromium:923807
Change-Id: If80c12eb86dc0251a5e5fad62a6dd5ced3380b5b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2340322
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Ben Smith <binji@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70129}
2020-09-24 23:12:48 +00:00
Ng Zhi An
4157728312 [wasm-simd][scalar-lowering] Implement more replacement conversions
f32x4->16x8, 64x2->8x16, and 16x8->8x16.
This allows us to pass more spec tests.

Bug: v8:10507
Change-Id: I1810ce2d17f93529b2e69cf5c767cb7b480b4b49
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2429807
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70128}
2020-09-24 22:37:48 +00:00
Milad Fa
1474e595cf PPC/s390: fix NAN propagation on float/double min and max
Using the proper `add` operation assures the NAN value
is properly propagated to the result register.

Change-Id: Icb86193f85534604f2a4a583d177a6f319ca38c3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2429804
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#70127}
2020-09-24 21:03:18 +00:00
Dominik Inführ
e487a7daa2 [heap] Access wasted_memory() while holding lock
PagedSpace::RefillFreeList() needs to invoke wasted_memory()
while holding the lock. Otherwise this races with
PagedSpace::FreeLinearAllocationArea() which uses add_wasted_memory()
and already holds the lock.

Bug: v8:10315
Change-Id: I3a57191529cdd81d75833ec334a57f84a9a59194
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2428930
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70126}
2020-09-24 19:21:28 +00:00
Andreas Haas
4af3a33327 [wasm] Don't overwrite register in atomic.notify if it is still used
In atomic.notify we overwrote the register which stored the index,
without checking if it was still in use or not.

R=clemensb@chromium.org

Bug: v8:10898
Change-Id: I59ed7a2c1f1342ff4252e3c4d33822111caee82c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2426616
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70125}
2020-09-24 18:59:07 +00:00
evih
b728ad817e [wasm] Use proper load in the generic js-to-wasm wrapper
When loading from the exported function data without pointer
compression, wrong load was used before.

Bug: v8:10701, chromium:1130385
Change-Id: If66913bcd5284eeb6fb7b795357f1512682a062f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2426383
Commit-Queue: Eva Herencsárová <evih@google.com>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70124}
2020-09-24 18:46:08 +00:00
Junliang Yan
230da091d4 [wasm][ukm] relax the condition for Turbofan
On ppc64 and s390x, Liftoff is not implemented yet, so if a Liftoff
compilation unit finishes after all top-tier units (hence after the "top
tier finished" callback), it will still increase the turbofan counter.

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

Bug: chromium:1092417
Change-Id: I0b99061f26851288f1abb8fcc3a30ca92a55164e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2429564
Reviewed-by: Emanuel Ziegler <ecmziegler@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#70123}
2020-09-24 17:59:37 +00:00
Dominik Inführ
cc69503552 [test] Disable --stress-concurrent-allocation with TestSizeOfObjects
This test checks SizeOfObjects after GC, but there might be concurrent
allocations in-between.

Bug: v8:10315
Change-Id: Id904c8865e44ac5c3b486ff6f1316e536cf20e9f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2428864
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70122}
2020-09-24 16:50:47 +00:00
Clemens Backes
618a28883c [wasm][memory64] Fix types used for bounds checks
The memory offset is read as a u64 in the memory64 proposal, independent
of the actual type of the memory. The actual memory size of a module (at
runtime) can only be within intptr_t/uintptr_t range though. This
assumption was already used when constructing the TurboFan graph, but
the C++ types did not reflect it yet.

This CL fixes that:

1) Use uint64_t type for bounds checks (only within the method for now,
   callers still pass a uint32_t).
2) Use uintptr_t for storing the minimum and maximum possible memory
   size at runtime (in CompilationEnv); clamp memory sizes to values
   that can actually happen at runtime.

R=manoskouk@chromium.org

Bug: v8:10949
Change-Id: I6559f9a3abc2aa338eba4618479456f6efb5e772
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2426405
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70121}
2020-09-24 16:34:07 +00:00
Dominik Inführ
620c13b58a [test] Tests should only invoke NewSpace::Grow in safepoint
Make sure that tests grow the new space in a safepoint. This fixes
races with concurrent allocation.

Bug: v8:10315
Change-Id: I6fce6740bc3c9385f18bbbcde4b06ba881a03635
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2428946
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70120}
2020-09-24 16:14:10 +00:00
Santiago Aboy Solanes
d941d31cc8 [compiler] Read the FixedDoubleArray value from the Ref only once
When reading the FixedDoubleArray value and representation, we are
reading the same value but bitcasting it diffrently. In this vein, we
can read it only once and ask whether it is the hole or not.

Bug: v8:7790
Change-Id: I0d7b29ce037b9abb55c5a1332c7e6d06887905e1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2428587
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70119}
2020-09-24 15:12:47 +00:00
Manos Koukoutos
e241c6da39 [wasm-gc] Some cleanup and documentation
Changes:
- Add dedicated exception for call_ref invoking a WasmJSFunction.
- Small restructuring of read_value_type.
- Change HeapType::kLastSentinel to point to the last valid type,
  update is_valid().
- Remove redundant DCHECK from ValueType constructors.
- Rename a few section-related macros in module-decoder-unittest.cc,
  add a small test.
- Rename "Simd128" -> "s128" in error message.
- Write some documentation, mostly in value-type.h and wasm-subtyping.h.

Bug: v8:7748
Change-Id: I4fc4826fbdeac50e21ef524787c2024d7aa1b3b2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2424139
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70118}
2020-09-24 12:50:17 +00:00
Ulan Degenbaev
0b8c39162c [heap] Remove the unused Map parameter from the marking barrier
Change-Id: I5d82528cd07c263bfbedfdd3a090bcd4f67ef55d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2428593
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70117}
2020-09-24 12:46:27 +00:00
Camillo Bruni
78c42a1f8e [log] Support logging two-byte characters
Bug: chromium:1130673
Change-Id: I78ae388daa1c4c2b594981bdadd201c2dfb39eb0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2426618
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70116}
2020-09-24 12:34:07 +00:00
Dominik Inführ
d382dab9e5 [test] Only update FLAG_local_heaps if disabled
Avoid data race by only setting FLAG_local_heaps to true if not
already enabled.

Bug: v8:10315
Change-Id: Ib562b6d525448f5c088da39bf60928debd97db43
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2426610
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70115}
2020-09-24 12:18:17 +00:00
Clemens Backes
5f265c3379 [wasm] Remove --wasm-max-mem-pages-growth flag
This unifies {max_initial_mem_pages} and {max_maximum_mem_pages} into
{max_mem_pages}.
The {CompilationEnv} constructor was incorrectly using the former
instead of the latter anyway. This did not really matter though, since
they typically have the same value.
Also, there is not a single test that sets --wasm-max-mem-pages-growth.

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

Bug: v8:10949
Change-Id: Ib7ab9b4c239d50b72013087eda5a214829c90369
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2426619
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70114}
2020-09-24 12:17:07 +00:00
Emanuel Ziegler
b77c63c0a6 [wasm][ukm] Add tests for Wasm events (reland)
Ensure that events are triggered when a module is decoded, compiled,
instantiated and tiered-up.

This is a reland of Ib5883a338c3756c6f3488fbdd7b6861ecc2ba218.

R=clemensb@chromium.org
TBR=adamk@chromium.org

Bug: chromium:1092417
Change-Id: I803ae3db23a5f71f26e8ec118251eccdfc551353
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/+/2425056
Commit-Queue: Emanuel Ziegler <ecmziegler@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70113}
2020-09-24 12:05:27 +00:00
Marja Hölttä
24fbcf8847 Try 2: [super ic] Fix more receiver vs lookup start object vs holder confusion
The actual fix is in LoadIC::ComputeHandler (checking
lookup_start_object == holder instead of receiver == holder) + the
LookupIterator changes for preserving lookup_start_object.

The rest is renaming / refactoring.

Reland: not relying on the prototype validity cell after all

Previous version: https://chromium-review.googlesource.com/c/v8/v8/+/2414039

Bug: v8:9237, chromium:1127653
Change-Id: I1949442f8ddcecb776f0c5d2cf737cb75f80e313
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2428588
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70112}
2020-09-24 11:45:18 +00:00
Dominik Inführ
d17b83e5df [test] Fix WeakGlobalHandle test with --stress-concurrent-allocation
Use Global instead of Persistent such that GlobalHandle is reset at the
end of the function. Persistent doesn't reset in the destructor,
which means that the GC resets the GlobalHandle. With
--stress-concurrent-allocation this might not happen in the test
function itself but when the cctest framework itself works through
the event queue. At that point the Persistent isn't live anymore.

Bug: v8:10315
Change-Id: If77388ad5acb80538852beca0ab22a4ebaf0b5c1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2426612
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70111}
2020-09-24 10:13:57 +00:00
Clemens Backes
18da08757f [wasm][memory64] Start implementing the memory64 proposal
This is a first small step for implementing the memory64 proposal:
1. Add a feature flag.
2. Add the 0x04 and 0x05 limits flag for memory64.
3. Read memory limits as LEB-encoded u64 (instead of u32) if a memory64
   limit flag was read.
4. Unify {MaximumFlag} and {MemoryFlag}, which was used inconsistently
   before.
5. Add test for memory limits encoded with >5 bytes.
6. Move some macros from module-decoder-unittest.cc to wasm-macro-gen.h.

Note that still the same limits for the maximum number of pages applies
as before, i.e. you cannot specify a memory >4GB yet. But you can encode
that small number in >5 bytes.

R=manoskouk@chromium.org

Bug: v8:10949
Change-Id: I90a4f08426ae714a67440281785eb00cfc24a349
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2423712
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70110}
2020-09-24 09:38:08 +00:00
gengjiawen
717543bbf0 [zone]: fix build on msvc in wasm module
Fix: https://github.com/nodejs/node-v8/issues/172
Change-Id: Ibdbee76470ec8a4c20af7650dc5fac4602873430
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2414688
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70109}
2020-09-24 09:10:30 +00:00
Michael Achenbach
10b6b9781b Revert "Update V8 DEPS."
This reverts commit 00b540f224.

Reason for revert: https://crbug.com/v8/10955

Original change's description:
> Update V8 DEPS.
> 
> Rolling v8/build: c8dc0f5..cd7202b
> 
> Rolling v8/third_party/aemu-linux-x64: laU2vAii09mMfCaTLtA8O6UYjPdUXy0B-0zzOR0OPekC..e3-wbMXwDkejPE6v6BbVayEu9ikm4GVS2rHZkzAxpYgC
> 
> Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/0de9874..52c1ebb
> 
> Rolling v8/third_party/icu: 83b2ac6..aef20f0
> 
> TBR=machenbach@chromium.org,tmrts@chromium.org,v8-waterfall-sheriff@grotations.appspotmail.com
> 
> Change-Id: I52e67f8331c638d5f02b93e6db7fbeb81844a878
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2426480
> 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@{#70102}

TBR=machenbach@chromium.org,v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com,tmrts@chromium.org,v8-waterfall-sheriff@grotations.appspotmail.com

Bug: v8:10955
Change-Id: I62688e8a5605e1ef44fd91f995ae28238a862903
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2426622
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70108}
2020-09-24 09:09:27 +00:00
Marja Hölttä
8443390f71 Revert "[super ic] Fix more receiver vs lookup start object vs holder confusion"
This reverts commit ab7e6df074.

Reason for revert: Several fuzz bugs: chromium:1131469, chromium:1131525, chromium:1131779

Original change's description:
> [super ic] Fix more receiver vs lookup start object vs holder confusion
>
> The actual fix is in LoadIC::ComputeHandler (checking
> lookup_start_object == holder instead of receiver == holder) + the
> LookupIterator changes for preserving lookup_start_object.
>
> The rest is renaming / refactoring.
>
> Bug: v8:9237, chromium:1127653
> Change-Id: Ieef46fb46ababa79623951c48639429c5b552d2d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2414039
> Commit-Queue: Marja Hölttä <marja@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70045}

TBR=marja@chromium.org,ishell@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: v8:9237
Bug: chromium:1127653, chromium:1131469, chromium:1131525, chromium:1131779
Change-Id: I1bad5ba1dcfe9a0de8ce775feac2d3bfd7264c8c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2426620
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70107}
2020-09-24 09:07:25 +00:00
Jakob Gruber
5b42e3f334 [regexp] Assign proper flags to TextNode
This fixes a case in which we forgot to assign flags to TextNodes
created through

AddBmpCharacters
AddNonBmpSurrogatePairs
AddLoneLeadSurrogates
AddLoneTrailSurrogates

functions. If these initially had a flag (e.g. case-insensitive 'i')
set, that information was lost. This bug resulted in missing case
folding in no_i18n builds (perhaps other things as well that just
aren't covered by our test suite).

Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Bug: v8:10131,v8:10120
Change-Id: Icef4f0dbd47971a538e07bab2f1067c383fd59c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2423718
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70106}
2020-09-24 08:51:15 +00:00
Marja Hölttä
5d5b728b8a [logical assignment] Disallow foo() &&= 1 etc
Having the web compatibility hack (allowing foo() = 1) enabled for
logical assignment was unintentional.

Browser compatibility data:
https://docs.google.com/document/d/1cGorRZ73KvQqu57tT4ahCjSLncibFMUwlkaL-XIstzI/edit?usp=sharing

Bug: v8:10372, v8:10950
Change-Id: I87f6348b75ce72ee5bd5db143f789ceeee596070
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2423721
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70105}
2020-09-24 08:17:17 +00:00
Jakob Gruber
2c354c3634 Skip failing stress_sampling tests
Bug: v8:10915
Change-Id: I96fb546cea47d382b2ca160bbbf1fb270468e51b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2426617
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70104}
2020-09-24 08:10:17 +00:00
Jakob Gruber
a980adfcc4 [nci] Delay NCI compilation to second request
Benchmarks showed a large number of useless NCI compilation
tasks, i.e. code objects were generated and cached but never used.

Ideally, we'd only spawn an NCI task when the generated code will
be used in the future. To approximate this behavior, we now delay
task creation to the *second* time a function is optimized; the
thought being that a function that has been optimized twice is likely
to be optimized (= become hot) again in the future.

Bug: v8:8888
Change-Id: Ia37ae6a4c3861a611086964c20c313dda1974f14
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2414032
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70103}
2020-09-24 04:47:45 +00:00
v8-ci-autoroll-builder
00b540f224 Update V8 DEPS.
Rolling v8/build: c8dc0f5..cd7202b

Rolling v8/third_party/aemu-linux-x64: laU2vAii09mMfCaTLtA8O6UYjPdUXy0B-0zzOR0OPekC..e3-wbMXwDkejPE6v6BbVayEu9ikm4GVS2rHZkzAxpYgC

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/0de9874..52c1ebb

Rolling v8/third_party/icu: 83b2ac6..aef20f0

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

Change-Id: I52e67f8331c638d5f02b93e6db7fbeb81844a878
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2426480
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@{#70102}
2020-09-24 03:43:15 +00:00
Milad Fa
8164eca869 S390:[wasm-simd] fix I64x2Mul codegen on s390
Change-Id: I24627a0fafbafa370877a3794fe2d1e40f11f622
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2427384
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#70101}
2020-09-23 20:26:35 +00:00
Milad Fa
06a1a689a9 s390:[wasm-simd] fix unpack low/high on the simulator
Change-Id: I1c7715d5133bc9fb0711c8d9922e2ca31ed37042
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2426947
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#70100}
2020-09-23 18:26:45 +00:00
Gus Caplan
4263f8a5e8 parser: better error message for await+tla
Bug: v8:9344, v8:6513
Change-Id: I1854e483515e7da99192367b6764a0ec7c8b41d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2411687
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Gus Caplan <snek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70099}
2020-09-23 17:41:05 +00:00
Ng Zhi An
ac544ffaae [wasm-simd][arm64] Merge load splat opcodes
Load splat implementation is almost the same, except for the vector
format used for the output register. We encode this information in
MiscField (the size of each lane), and with some helper functions we can
easily reuse a single opcode for 4 load splats.

Bug: v8:10930
Change-Id: Ieed4dc7358821a0d1d7bab4add7a59d808c5aad8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2422354
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70098}
2020-09-23 16:49:04 +00:00
Ng Zhi An
32f85f7dbe [wasm-simd][scalar-lowering] Fix lowering for f64x2
Add lowering for F64x2 in S128Const and converting to and from f64x2.

Bug: v8:10507
Change-Id: Ic2c4f1f41d3dd804e012a943391a46b534864b51
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2424679
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70097}
2020-09-23 16:44:24 +00:00
Ng Zhi An
ebe43399b1 [wasm-simd] Surface V128 in inspector
For now, V128 values are converted to String16 (since they are not
serializable). It is shown as a list of 16 uint8_t (hex). This
description can be tweaked as necessary.

Some updates to ARM64 required to push/pop the full Q register.

Bug: v8:10347
Bug: chromium:1130474
Change-Id: I1bffbb49f47c06da3cd26d830addae0416a4441a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2422082
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70096}
2020-09-23 16:21:14 +00:00
Clemens Backes
f20230afd1 [profiler] Include the generic js-to-wasm builtin in profiles
This CL fixes two things:
1) It properly creates code entries for the generic js-to-wasm builtin
(others are left out because we don't want to include all builtins in
profiles).
2) It includes js-to-wasm frames in profiles. The generic js-to-wasm
builtin will map to that frame type in the future (see referenced
bug). js-to-wasm frames are currently included because they are wrongly
mapped to OPTIMIZED frames by the SafeStackTraceIterator.

R=petermarshall@chromium.org
CC=ahaas@chromium.org, evih@google.com

Bug: v8:10701
Change-Id: I26e3fa6901890e041feab7c001069e67a616c986
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2416495
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70095}
2020-09-23 15:21:34 +00:00
Camillo Bruni
5259691ccb [runtime] Module code cleanup
- Make Module::RecordErrorUsingPendingException and
  Module::RecordError static (There is no need for them to be
  "fast" instance methods with raw pointers)
- Share various debug print snippets
- Share status change code in SetStatusInternal
- Simplify several casts

Change-Id: I159dc3dd9104bf76858a2d5ad142a72a75640716
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2416490
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70094}
2020-09-23 14:00:01 +00:00