Commit Graph

67135 Commits

Author SHA1 Message Date
Ng Zhi An
fc8743da42 [wasm-simd][fuzzer] Add i8x16.popcnt to fuzzer
Also move it from post-mvp to mvp, since it is now in the proposal.

Bug: v8:11002
Change-Id: I711ee7a92e6937948c93e6028ef018188ea4c976
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2676937
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72643}
2021-02-10 23:25:45 +00:00
Milad Fa
efed403639 S390: [wasm-simd] Fix the simulator to correctly represent Simd lanes
Vector register lane numbers on IBM machines are reversed
compared to x64. For example, doing an I32x4 extract_lane with
lane number 0 on x64 will be equal to lane number 3 on IBM machines.
Vector registers are only used for compiling Wasm code at the moment.
Wasm is also little endian enforced. On s390 native, we manually do
a reverse byte whenever values are loaded/stored from memory to
a Simd register. On the simulator however, we do not reverse the bytes
and data is just copied as is from one memory location to another
location which represents a register. To keep the Wasm simulation
accurate, we need to make sure accessing a lane is correctly simulated
and as such we reverse the lane number on the getters and setters.
We need to be careful when getting/setting values on the Low
or High side of a simulated register. In the simulation, "Low" is
equal to the MSB and "High" is equal to the LSB on memory.

As a result, many of the "#ifdef V8_TARGET_BIG_ENDIAN" blocks on
Simd opcodes are not needed anymore as we are now simulating
native behaviour.

Change-Id: Idfa80cdef7382febb4311c75eb6d3e1d110141fa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2687756
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#72642}
2021-02-10 23:17:25 +00:00
Ng Zhi An
2367a71489 [wasm-simd][ia32][liftoff] Implement double precision conversions
Extract codegen into macro-assembler functions for reuse in Liftoff.

Some minor tweaks in I32x4TruncSatF64x2SZero and I32x4TruncSatF64x2UZero
to check dst and src overlap and move to scratch/dst accordingly. In
TurboFan we can set these restrictions in the instruction-selector, but
not in Liftoff. This doesn't make TurboFan codegen any worse, since
those restrictions are still in place.

Bug: v8:11265
Change-Id: I48f354c5ff86809bb3ddc38eca6dc8990b9b7d61
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2683208
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72641}
2021-02-10 23:13:28 +00:00
Zhi An Ng
8dd251b8e4 Revert "[wasm-simd][ia32] Implement i64x2 signed compares"
This reverts commit a16add806d.

Reason for revert: Broke Win32 debug https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Win32%20-%20debug/29653/overview

Original change's description:
> [wasm-simd][ia32] Implement i64x2 signed compares
>
> The code sequence is exactly the same as x64.
>
> Bug: v8:11415
> Change-Id: I53ed2723eda29c0a250cff514372a3d45b203476
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2683495
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Commit-Queue: Zhi An Ng <zhin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#72637}

TBR=bbudge@chromium.org,zhin@chromium.org

Change-Id: Idbfc8cd0fbbff607cff76953c53d0c149b87b573
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:11415
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2688074
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72640}
2021-02-10 22:15:16 +00:00
Andrew Comminos
6c0a4d7117 [cpu-profiler] Log code events for bytecode flushing
Since the finalizer-based CodeEntry deallocation tracking can't
intercept flushed bytecode, implement monitoring for this via code
events.

Bug: v8:11054
Change-Id: I9557b4777fe0d0963309bd8134c57928e0aa3e08
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2686907
Commit-Queue: Andrew Comminos <acomminos@fb.com>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72639}
2021-02-10 21:57:52 +00:00
Ng Zhi An
66964c519a [wasm-simd][x64][liftoff] Implement double precision conversions
Extract codegen into macro-assembler functions for reuse in Liftoff.

Some minor tweaks in I32x4TruncSatF64x2SZero and I32x4TruncSatF64x2UZero
to check dst and src overlap and move to scratch/dst accordingly. In
TurboFan we can set these restrictions in the instruction-selector, but
not in Liftoff. This doesn't make TurboFan codegen any worse, since
those restrictions are still in place.

Bug: v8:11265
Change-Id: Ib6b3ebeb5fed99eddd0700fb4aba91d4168c3213
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2683206
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72638}
2021-02-10 21:52:52 +00:00
Ng Zhi An
a16add806d [wasm-simd][ia32] Implement i64x2 signed compares
The code sequence is exactly the same as x64.

Bug: v8:11415
Change-Id: I53ed2723eda29c0a250cff514372a3d45b203476
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2683495
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72637}
2021-02-10 21:43:04 +00:00
Junliang Yan
2c055469d8 s390x: Add CountTrailingZerosU32/U64 to TFAssem
Change-Id: Idf653061a88beb348fa13e907932ca68f2d6d05b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2685366
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#72636}
2021-02-10 19:39:01 +00:00
Zhi An Ng
518ee01d39 Revert "Reland "[interpreter] Speed up the BytecodeArrayAccessor through direct memory access""
This reverts commit 60748ee2df.

Reason for revert: Broke Linux64 ASAN https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20ASAN/38792/overview.

There are 4 changes in that range causing the failure, I found that this change caused the failure by running locally `./tools/run-tests.py --outdir=out/repro mjsunit/wasm/gc-stress --variant turboprop_as_toptier --random-seed-stress-count 100`.

Original change's description:
> Reland "[interpreter] Speed up the BytecodeArrayAccessor through direct memory access"
>
> Tbr: ulan@chromium.org, neis@chromium.org, leszeks@chromium.org
> No-Presubmit: true
> Change-Id: I4ceb9e21ac7d78a87776b4be174772539d2da8d9
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2685173
> Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#72632}

TBR=ulan@chromium.org,neis@chromium.org,leszeks@chromium.org,verwaest@chromium.org

Change-Id: I441ddfda5d852b7a01f38a9e60edc56f40ae626a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2686266
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72635}
2021-02-10 18:33:35 +00:00
Ng Zhi An
f86983c602 [wasm-simd][arm][arm64[liftoff] Implement i8x16.popcnt
Bug: v8:11002
Change-Id: I914a7c24828bc53300dc905388741e6939686540
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2676922
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72634}
2021-02-10 17:53:51 +00:00
Georg Neis
dce6dced40 [compiler] Minor cleanup related to fast API calls
Change-Id: I3fdecbb23d2c1c1d4f9d5167096adb276c0a503b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2684359
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72633}
2021-02-10 17:42:51 +00:00
Toon Verwaest
60748ee2df Reland "[interpreter] Speed up the BytecodeArrayAccessor through direct memory access"
Tbr: ulan@chromium.org, neis@chromium.org, leszeks@chromium.org
No-Presubmit: true
Change-Id: I4ceb9e21ac7d78a87776b4be174772539d2da8d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2685173
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72632}
2021-02-10 17:06:52 +00:00
Mythri A
2a446a9058 Enable FLAG_feedback_allocation_on_bytecode_size
This flag enables feedback allocation heuristics to be based on the
function size. The threshold for feedback allocation is set to
4 * bytecode size to roughly mimic the allocation after 4 invocations.

Change-Id: Ia840cd526e3718d4267e01c688c6c6467e352d72
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2685175
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72631}
2021-02-10 17:03:51 +00:00
Michael Lippautz
76e8b811a1 cppgc: Allow multiple calls to InitializeProcess/ShutdownProcess
Model cppgc::InitializeProcess()/cppgc::ShutdownProcess() similar to
V8's InitializePlatform()/ShutdownPlatform() in that we allow the pair
to be called multiple times.

GCInfoTable will not be freed on ShutdownProcess though as the current
global design uses static indices to retrieve per-type metadata.

Drive-by: Remove stale ShutdownProcess() call.

Change-Id: Ia9b50325a964e85a72f3ef218e72bc386b69be51
Bug: chromium:1176416, chromium:1056170
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2685171
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72630}
2021-02-10 17:02:20 +00:00
Daniel Clark
f033e2a154 Fix top-level await crash from synthetic module being evaluated twice
With top-level await, when Evaluate is performed on an already-evaluated
synthetic module, Module::InnerEvaluate returns undefined.  This breaks
top-level await's assumption that the returned value is always a
promise.

In order to make SyntheticModule's behavior consistent with
SourceTextModule, the top_level_capability field is moved up to Module
and SyntheticModule::Evaluate places the promise returned from the
host's evaluation steps in that field.  Now SourceTextModule and
SyntheticModule can share the same code to handle the case where the
module is either kErrored or kEvaluated, so the code for this
is moved up to Module.

Thus, SyntheticModule is now guaranteed to return the
promise from the evaluation steps even on subsequent Evaluate() calls.

Unfortunately Node hasn't yet updated their EvaluationStepsCallback
to return a Promise, so we can't yet assume that the returned value
is a Promise without breaking Node.  So, this change also adds a clause
to check for this condition and create a new resolved Promise if one
was not provided by the callback steps.  This could eventually be
removed once Node's callback steps are updated for top-level await.

Change-Id: I2d6ae918abfeba9e3a757838502d4df92946edaa
Bug: v8:11398
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2673794
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dan Clark <daniec@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#72629}
2021-02-10 16:50:25 +00:00
Andreas Haas
4c9d7ff916 [api] Add API callback setter for the wasm exceptions origin trial
The implementation is similar to the callbacks that already exist for
the origin trial for WebAssembly simd.

Bug: v8:8091
Change-Id: I969b68c209ea62cf70dbaf317616300b782b5e14
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2672020
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72628}
2021-02-10 16:34:44 +00:00
Milad Fa
44116f70ad Reland "PPC/s390: [wasm-simd][liftoff] Implement i8x16.popcnt"
This is a reland of 21b3181adf

Original change's description:
> PPC/s390: [wasm-simd][liftoff] Implement i8x16.popcnt
>
> Port 00babf0718
>
> Original Commit Message:
>
>     Extract i8x16.popcnt implementation into a macro-assembler function, and
>     reuse it in Liftoff.
>
> R=zhin@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
> BUG=
> LOG=N
>
> Change-Id: Id0f14597a97f90424aa450b2527ea71da1b2e8ce
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2679273
> Reviewed-by: Junliang Yan <junyan@redhat.com>
> Commit-Queue: Junliang Yan <junyan@redhat.com>
> Cr-Commit-Position: refs/heads/master@{#72601}

Change-Id: I396a3f2ee85550df3a8fa92cd6357e7dc6f096a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2685364
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#72627}
2021-02-10 14:50:11 +00:00
Seth Brenith
a66f2b00cd Don't use floating-point values in basic block instrumentation
Previously in https://chromium-review.googlesource.com/c/v8/v8/+/2545573
I updated BasicBlockInstrumentor to use 64-bit floating-point values
rather than 32-bit integers, so that it could never overflow. However,
I've now learned that some builtins (particularly RecordWrite) are not
allowed to use floating-point registers, and so running with
basic block instrumentation enabled could produce incorrect results.
This change switches back to 32-bit integers, but adds saturation logic.

Bug: chromium:1170776
Change-Id: Icbd93919fb05f50d615ec479263142addbe15c9e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2685617
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#72626}
2021-02-10 14:15:20 +00:00
Nico Hartmann
ef89782a5b Revert "[interpreter] Speed up the BytecodeArrayAccessor through direct memory access"
This reverts commit f4bd6f6b0b.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20-%20pointer%20compression/13275/overview

Original change's description:
> [interpreter] Speed up the BytecodeArrayAccessor through direct memory access
>
> This speeds up the sparkplug compiler by >20%.
>
> Change-Id: I9dece7209b0ddf53d876df9aca4b2feede6259c5
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2682644
> Auto-Submit: Toon Verwaest <verwaest@chromium.org>
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#72624}

TBR=ulan@chromium.org,neis@chromium.org,leszeks@chromium.org,verwaest@chromium.org

Change-Id: Iac3832bd08a9075e3127886635ba96f7acfc49cf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2685169
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72625}
2021-02-10 14:01:22 +00:00
Toon Verwaest
f4bd6f6b0b [interpreter] Speed up the BytecodeArrayAccessor through direct memory access
This speeds up the sparkplug compiler by >20%.

Change-Id: I9dece7209b0ddf53d876df9aca4b2feede6259c5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2682644
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72624}
2021-02-10 13:35:40 +00:00
Michael Achenbach
880f2fac55 [test] Run tests on all Mac bots in the pool
Dropping the gpu:none dimension broadens the choice of Mac bots from
so far only 8-core VMs to also include 4-core and 12-core Mac Minis.

This CL adjusts the shard configs to account for adding
4-core Mac Minis to the choice.

We also skip a test that's slow only on 4-core bots.

No-Try: true
Bug: chromium:1174040,v8:11418
Change-Id: Ic0be0db197341b7b8f88eb30aa284c38b0e69609
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2685164
Auto-Submit: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72623}
2021-02-10 13:32:30 +00:00
Michael Achenbach
502eea66cf [test] Update shards for Android and align bots
Reorganize shards to account for recent timeouts on the Android
builder. Also ensure we test the same thing on trybots and CI.

No-Try: true
Bug: v8:11428
Change-Id: If245999e0d2e20ecb7f0ee640be5d98f1c90ff64
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2685165
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Auto-Submit: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72622}
2021-02-10 13:26:51 +00:00
Mythri A
31f34b613d [turboprop] Use existing optimized code if tiering up fails
If an attempt to tiering up fails (for ex: there is not enough space
to enqueue a job) then use the existing optimized code from a lower
tier. Currently we just install interpreter entry trampoline as the
function's code object. Though InterpreterEntryTrampoline checks for
any existing optimized code and installs it on the closure, just
returning it from here saves us these additional checks.

Bug: v8:9684
Change-Id: I62b4bc3b114bbbc9b0702cc9e831a3dfb4b37761
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2682645
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72621}
2021-02-10 09:46:57 +00:00
Manos Koukoutos
3b9dd2431a [wasm-gc] Enable rtt test in liftoff
By disengaging it from 'let' which is not implemented in liftoff yet.

Bug: v8:7748
Change-Id: I191695767bf8c6153f70d509dd13ff734fe75e01
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2676631
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72620}
2021-02-10 08:55:57 +00:00
Georg Neis
87df0b7ecc Revert "[compiler] Directly read PropertyCells"
This reverts commit 42cd9eb78d.

Reason for revert: Clusterfuzz issues, e.g.
https://bugs.chromium.org/p/chromium/issues/detail?id=1176318

Original change's description:
> [compiler] Directly read PropertyCells
>
> Main changes:
>
> - Introduce a new broker data kind kBackgroundSerialized for objects
>   that can be serialized in the background (when direct reads are on).
>   (I'm planning to remove kPossiblyBackgroundSerialized in a followup,
>   in favor of a dynamic choice of kSerialized or kBackgroundSerialized).
> - Make PropertyCell use that new kind.
> - Introduce a bottleneck in runtime code for changes to PropertyCells
>   and make sure that a certain protocol is followed that allows
>   concurrent reads from the background thread.
> - Improve interface of PropertyCell in various ways.
>
> Bug: v8:7790
> Change-Id: If3d7926c3b894808811348b4b2bed153f5c06897
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2661462
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
> Commit-Queue: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#72586}

TBR=ulan@chromium.org,neis@chromium.org,verwaest@chromium.org,nicohartmann@chromium.org

Change-Id: Id04145760c49fa379bc5a3fc16eba664025a9180
Bug: v8:7790
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2685125
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72619}
2021-02-10 08:47:07 +00:00
Dominik Inführ
d5416b9918 [codegen, heap] Improve TimeToSafepoint for concurrent compilation
TimeToSafepoint is the time needed for all background threads to enter
a safepoint after the GC was started on the main thread. This CL
improves that metric during concurrent compilation to bytecode by doing:

1) Park the LocalIsolate during
   InterpreterCompilationJob::ExecuteJobImpl. There are no concurrent
   heap accesses happening while generating bytecode for now. So instead
   of manually placing Safepoint() invocations in the code, simply park
   the local isolate.
2) Destroy the LocalIsolate before the ReleaseParser operation. I've
   seen this take around 2ms, which regressed TimeToSafepoint a lot.
3) Add explicit safepoints to concurrent allocations. This covers the
   rest of the code and from what I've seen so far this is good enough
   to keep TimeToSafepoint around a few microseconds.

I've still seen TimeToSafepoint events with 20-80 microseconds but those
were quite rare and always seemed to be related to Turbofan.

AsLocalIsolate() is necessary in generic code to convert both Isolate
and LocalIsolate to LocalIsolate.

Bug: v8:10315
Change-Id: Idaf9f04ffdf850d0ab0081ec372cc384a9fe7ef9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2663159
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72618}
2021-02-10 08:37:48 +00:00
Georg Neis
b5772192dd Revert "[compiler] Clean up ObjectDataKind"
This reverts commit 5cc7bfd04c.

Reason for revert: Need to revert dependency.

Original change's description:
> [compiler] Clean up ObjectDataKind
>
> In particular: remove PossiblyBackgroundSerializedHeapObject in favor of
> either SerializedHeapObject or BackgroundSerializedHeapObject, depending
> on the (existing) argument to the ObjectRef constructor.
>
> Bug: v8:7790
> Change-Id: I0a67872c377107799233742cc7774bea62811d0f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2681946
> Commit-Queue: Georg Neis <neis@chromium.org>
> Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
> Reviewed-by: Santiago Aboy Solanes <solanes@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#72591}

TBR=neis@chromium.org,solanes@chromium.org,nicohartmann@chromium.org

Change-Id: I48a96504c29851587529d7d12cb15e569aec196b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7790
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2685124
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72617}
2021-02-10 07:31:05 +00:00
Frank Tang
ddb7d3079c Fix Intl.DisplayNames language canoncalization
Bug: v8:11424
Change-Id: Ic9c9dc2609ee85f046f6bc5794004ededd32bee5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2684931
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72616}
2021-02-10 02:59:43 +00:00
Ng Zhi An
c9e36e782a [wasm-simd][ia32][liftoff] Implement i8x16.popcnt
Extract i8x16.popcnt implementation into a macro-assembler function, and
reuse it in Liftoff.

We need an additional temporary XMMRegister whose lifetimes overlap with
dst and src, so make sure to pin those 2 when getting an unused
XMMRegister.

Bug: v8:11002
Change-Id: I13400b139add6f12316b3f398a796e6bf5a1ea7f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2676921
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72615}
2021-02-10 02:39:53 +00:00
Ng Zhi An
9f37d0cd69 Reland "[wasm-simd][x64][liftoff] Implement i8x16.popcnt"
This is a reland of 00babf0718

No changes from original patch, previous CQ failures were likely
a Mac infra issue https://chromium-review.googlesource.com/c/2682521.

Original change's description:
> [wasm-simd][x64][liftoff] Implement i8x16.popcnt
>
> Extract i8x16.popcnt implementation into a macro-assembler function, and
> reuse it in Liftoff.
>
> Bug: v8:11002
> Change-Id: I86b2f5322c799d44f584cac28c70e0e393bf114f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2676280
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
> Commit-Queue: Zhi An Ng <zhin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#72565}

Bug: v8:11002
Change-Id: Ic8bcbdb3444865805d8d2af3669ccb4a05c4426d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2682507
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72614}
2021-02-10 01:14:19 +00:00
Shu-yu Guo
e8ad04c8d8 Reland "[regexp] Ship RegExp match indices"
This reverts commit 8b6fd1471b.

This adds --no-stress-flush-bytecode to the failing assertOptimized test as the flag changed the GC pattern and was deoptimizing code.

Original change's description:
> Revert "[regexp] Ship RegExp match indices"
>
> This reverts commit 72464122bd.
>
> Reason for revert:
> https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20gc%20stress/32046
>
> Original change's description:
> > [regexp] Ship RegExp match indices
> >
> > I2S:
> > https://groups.google.com/a/chromium.org/g/blink-dev/c/RR_dw_ZXtT0/m/xtgu5jjyAQAJ
> >
> > Bug: v8:9548
> > Change-Id: I8ccf2f4c38f9b9204ae47162303f21d2d44498e8
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2682508
> > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> > Auto-Submit: Shu-yu Guo <syg@chromium.org>
> > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#72571}
>
> TBR=jgruber@chromium.org,syg@chromium.org
>
> Change-Id: I1173389082928aa5c9895ca4fb360c7ab8ec073b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: v8:9548
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2681943
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#72576}

TBR=machenbach@chromium.org,jgruber@chromium.org,syg@chromium.org

# Not skipping CQ checks because this is a reland.

Bug: v8:9548
Change-Id: Ie18b16f347061602f35e3dea371c03d2ae136127
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2686098
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72613}
2021-02-10 00:36:15 +00:00
Ng Zhi An
3a23da2c4a [wasm-simd] Implement i64x2.abs in interpreter
Bug: v8:11416
Change-Id: I8148e0191d0632cad6f8b659be4ba58ef4f11d6b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2686307
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72612}
2021-02-09 23:58:51 +00:00
Ng Zhi An
0f514da6e9 [wasm-simd][x64][arm64] Implement i64x2 signed compares
This is a partial revert of https://crrev.com/c/2457669/.

This change is slightly longer (in code-generator-x64.cc) because we
also implement support when SSE4_2 is not supported (the reverted change
seems to assume SSE4_2, which is not always the case). This code
sequence is from https://github.com/WebAssembly/simd/pull/412.

Bug: v8:11415
Change-Id: I3eef415667b4142887cf1c449d27d19ba5bbd208
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2683219
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72611}
2021-02-09 23:50:11 +00:00
Milad Fa
0279d82cfd PPC: [wasm-simd] Retrieve the value of SupportsWasmSimd128() in builtin
Port 68105996e0

Original Commit Message:

    WasmCompileLazy needs to save the content of vector
    parameter registers. If Simd is not enabled or the hardware
    does not support Simd operations then we need to saves the value of
    Double registers instead, therefore we need a way to retrieve the
    value of "CpuFeatures::SupportsWasmSimd128()" in builtins
    during runtime.

R=mfarazma@redhat.com, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N

Change-Id: I523f1353c61942acaa97c11637342b5be3d39b9d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2684980
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#72610}
2021-02-09 23:10:54 +00:00
Michael Lippautz
5d67f90e0f cppgc-js: Avoid using marked bytes deadline during the atomic pause
Bug: chromium:1056170
Change-Id: I225f81235fe9d4f8fd26cc49446534e3f6c884ea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2684834
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72609}
2021-02-09 21:38:51 +00:00
Milad Fa
306463e8bb PPC/s390: [wasm-simd][arm] Implement i64x2.ne and i64x2 all_true
Port 257c303fe9

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

Change-Id: I47fd3af2d1382ec12fcf64ca6eee72d3d41050bb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2685120
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#72608}
2021-02-09 20:58:23 +00:00
Shu-yu Guo
bd82cdbd2a [parser] Disallow for (async of expr)
Implements https://github.com/tc39/ecma262/issues/2034

Currently the token sequence `for (async of` is ambiguous. It can be the
prefix for either `(async of => {};;);` or `for (async of foo);`. This
CL disallows the token sequence.

Note that `for await (async of` is still allowed, since there is no
C-style `for await (;;)`, and thus no ambiguity.

Bug: v8:11412
Change-Id: I3fede83a69420996baa2bc8b6c1cff000535d990
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2683221
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72607}
2021-02-09 20:56:21 +00:00
Ng Zhi An
36dedea6fb [wasm-simd] Move double precision conversions out of post-mvp
Bug: v8:11265
Change-Id: Ia51f2d177430e8659e745835fbdee57ad5ef5e07
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2683205
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72606}
2021-02-09 20:36:30 +00:00
Bill Budge
8cf4eec7d8 [codegen][frames] Generalize argument padding slot code
- Removes kPadArguments boolean.
- Changes ShouldPadArguments to ArgumentPaddingSlots to reflect
  that on some architectures more than 1 padding slot may be needed.
- Adds AddArgumentPaddingSlots and ShouldPadArguments convenience
  functions.

Bug: v8:9198

Change-Id: Iba87518e071a75fb951b490d3f75a87ca715cc23
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2679109
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72605}
2021-02-09 19:41:58 +00:00
Milad Fa
91c135c6d6 Revert "PPC/s390: [wasm-simd][liftoff] Implement i8x16.popcnt"
This reverts commit 21b3181adf.

Reason for revert: Original CL is reverted.

Original change's description:
> PPC/s390: [wasm-simd][liftoff] Implement i8x16.popcnt
>
> Port 00babf0718
>
> Original Commit Message:
>
>     Extract i8x16.popcnt implementation into a macro-assembler function, and
>     reuse it in Liftoff.
>
> R=​zhin@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
> BUG=
> LOG=N
>
> Change-Id: Id0f14597a97f90424aa450b2527ea71da1b2e8ce
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2679273
> Reviewed-by: Junliang Yan <junyan@redhat.com>
> Commit-Queue: Junliang Yan <junyan@redhat.com>
> Cr-Commit-Position: refs/heads/master@{#72601}

TBR=joransiu@ca.ibm.com,zhin@chromium.org,mfarazma@redhat.com,midawson@redhat.com,junyan@redhat.com

Change-Id: I54dd854e305d0fbbd475c0f756bc41acac74fa56
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2685060
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#72604}
2021-02-09 19:27:01 +00:00
Ng Zhi An
257c303fe9 [wasm-simd][arm] Implement i64x2.ne and i64x2 all_true
Bug: v8:11347,v8:11348,chromium:1174498
Change-Id: I9afaacefcab55a6d7eb48f6e9d1848b714f64eb6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2666147
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72603}
2021-02-09 18:56:14 +00:00
Ng Zhi An
483e30d02b [x64] Add missing SSE4_1 scope
pmovsxdq, pmovzxdq, and pcmpeqq requires SSE4.1.

Bug: v8:11215,v8:10972
Change-Id: I77e17378f819ce44ccc09a42f1d5778d7f6cf0e2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2683222
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72602}
2021-02-09 18:52:03 +00:00
Milad Fa
21b3181adf PPC/s390: [wasm-simd][liftoff] Implement i8x16.popcnt
Port 00babf0718

Original Commit Message:

    Extract i8x16.popcnt implementation into a macro-assembler function, and
    reuse it in Liftoff.

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

Change-Id: Id0f14597a97f90424aa450b2527ea71da1b2e8ce
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2679273
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#72601}
2021-02-09 18:10:56 +00:00
Milad Fa
9886c9f64b PPC/s390: [wasm-simd] Implement double precision conversion
Port 3b6eb33543

Original Commit Message:

    Prototype these 6 instructions on arm:

    - f64x2.convert_low_i32x4_s
    - f64x2.convert_low_i32x4_u
    - i32x4.trunc_sat_f64x2_s_zero
    - i32x4.trunc_sat_f64x2_u_zero
    - f32x4.demote_f64x2_zero
    - f64x2.promote_low_f32x4

    For all these instructions we rely on having Q registers that map to S
    registers, which means we can only use q0 to q7. We fix the src/dst
    to q0 arbitrarily.

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

Bug: v8:11265
Change-Id: Ibef0b05fe1066cd79ddcda12787441b09cc8ede2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2684360
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#72600}
2021-02-09 18:06:26 +00:00
Junliang Yan
fd43f1d586 s390x: [liftoff] implement Move/Spill/Fill
Change-Id: Ia314fc4a4e659b127597d85718dae7ddc01113c4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2684634
Commit-Queue: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#72599}
2021-02-09 17:17:26 +00:00
Brice Dobry
ffd9e82dd5 Add RISC-V backend
This very large changeset adds support for RISC-V.

Bug: v8:10991
Change-Id: Ic997c94cc12bba6881bc208e66526f423dd0679c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2571344
Commit-Queue: Brice Dobry <brice.dobry@futurewei.com>
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72598}
2021-02-09 17:06:36 +00:00
Dan Elphick
6beed8d544 [build] Remove V8_GN_HEADER hybrid mode
v8_generate_external_defines_header has been enabled for a couple of
weeks now with no problems, so this removes the hybrid state where
V8_GN_HEADER was defined on the command line along with the other
defines.

Bug: v8:11292, v8:11341
Change-Id: Ie78f00afe5d1cbca751101a7beb61a18c7d86d04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2681947
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Auto-Submit: Dan Elphick <delphick@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72597}
2021-02-09 16:58:16 +00:00
Nico Hartmann
44213b3e92 [Torque] Add @acquireRead and @releaseWrite annotations
This CL adds support for generating acquire/release accessors on class
fields. Adds first use of this new feature (@acquireRead and
@releaseWrite) on FunctionTemplateInfo::rare_data.

Bug: v8:7790, v8:11122
Change-Id: I98f533807ab784d8667fd43564fe84686d27830c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2679684
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Seth Brenith <seth.brenith@microsoft.com>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72596}
2021-02-09 16:54:16 +00:00
Frank Emrich
7119497d44 [dict-proto] make SwissNameDictionary::IsValidCapacity constexpr
This fixes a build problem in gcc, where the constexpr function
SwissNameDictionary::SizeFor uses the non-constxpr function
SwissNameDictionary::IsValidCapacity in a DCHECK.

Bug: v8:11388
Change-Id: Iaeb2b80bb72da3a9c895aa33977c160533019c35
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2684514
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Frank Emrich <emrich@google.com>
Cr-Commit-Position: refs/heads/master@{#72595}
2021-02-09 16:48:26 +00:00
Manos Koukoutos
54c160d949 [wasm-gc] SubtypeCheck for rtt without depth in Liftoff
Bug: v8:7748
Change-Id: Id84459c496f7e57b36c3acd13a91d39b7e9fb15f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2676630
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72594}
2021-02-09 16:19:34 +00:00