Commit Graph

66349 Commits

Author SHA1 Message Date
Zhi An Ng
a66bb00024 [wasm-simd][x64] Optimize blend and palignr shuffles for AVX
For pblendw and palignr, if AVX is supported, we can use the 3-operand
AVX instruction, this can save us a move.

Bug: v8:11270
Change-Id: Ifd837e29c76886a3008bc63c17d4a68bc6aae364
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2596578
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71857}
2020-12-22 02:29:09 +00:00
Zhi An Ng
b145152db2 [wasm-simd][x64] Optimize some integer widen_high ops
Optimize:
- i32x4.widen_high_i16x8_s
- i32x4.widen_high_i16x8_u
- i16x8.widen_high_i8x16_s
- i16x8.widen_high_i8x16_u

These optimizations were suggested in http://b/175364869.

The main change is to move away from palignr, which has a dependency on
dst, and also the AVX version is 2 bytes longer than the punpckhqdq.

For the signed and unsigned variants, we have slightly different
optimizations. Unsigned variants can use an punpckh* instruction with a
zero-ed scratch register, that effectively zero-extends. Signed variants
use the movhlps instruction to move high half to low half of dst, then
use packed signed extension instructions.

The common fallback for these instructions is to use pshufd, which does
not have a dependency on dst, but is 1 byte longer than the punpckh*
instructions.

FIXED=b/175364869

Change-Id: If28da2aaa8f6e39a58e63b01cc9a81bbbb294606
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2591853
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71856}
2020-12-22 02:04:09 +00:00
Deepti Gandluri
8c48059844 [wasm-simd] Add a flag to allow SSSE3 SIMD codegen
Bug: v8:11154
Change-Id: Idc1ae98c2f4c0b2924f34c76b56f230cb091c16e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2600360
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71855}
2020-12-22 01:59:29 +00:00
Junliang Yan
7f35fe4786 s390x: rename LoadP operation
Change-Id: I036bad7eba4bcf0ba80f7cec6f3d58a674e22b12
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2599937
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71854}
2020-12-21 18:52:39 +00:00
Sami Kyostila
4dfaf7c4b1 tracing: Add the new v8.wasm.turbofan category to the list of builtin categories
We also change pipeline-statistics.cc to use a combination of turbofan-
related categories since that more accurately reflects the emitted events.

TBR=bmeurer@chromium.org

Bug: chromium:1084929
Change-Id: I85dcd89ab3e4cd95df3ae9791d158b4ab6c00829
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2599749
Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Auto-Submit: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71853}
2020-12-21 17:13:08 +00:00
Sathya Gunasekaran
1af49b8508 [runtime] Remove unnecessary instance types
LAST_FUNCTION_TYPE, FIRST_FUNCTION_TYPE are no longer necessary.

TBR: tebbi@chromium.org
Bug: v8:11256
Change-Id: I37b1396eca8f89a287e04f2ef6b642dad248ae67
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2599745
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71852}
2020-12-21 14:50:58 +00:00
Junliang Yan
20703d7f99 s390x: rename Cmp operations
Change-Id: Idb8948c3ff9209a6a41d0793cd2f5c1557b417df
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2598697
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71851}
2020-12-21 14:06:53 +00:00
Camillo Bruni
94bf7d9f79 [d8] Throw in d8.log.getAndStop() if log file does not exist
This prevents CF from crashing and assuming it's a security issue
for flaky bots.

Bug: chromium:1152525
Change-Id: Ie782e55705e3bdbf2742ccd711f6544a71235b33
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2599748
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71850}
2020-12-21 14:05:48 +00:00
Camillo Bruni
c84213ef0f [tools] System-analyzer improvements
- Fix landing page
- Introduce and use SelectRelatedEvent for centralising the logic of
  finding and showing related LogEntries. It also clears the selection
  of all list panels if there are no related entries.
- Add "select related" button to the script-panel to show events only
  from the currently selected script
- Add selection type tabs for the map-panel
- Fix transition colors for map-transitions view
- Introduce separate map-transition view for the currently selected Map

Bug: v8:10644
Change-Id: I4199a8332bab2518d98078712ed5ce9a8f1dc19e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2599555
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71849}
2020-12-21 13:26:08 +00:00
Junliang Yan
d5651560e7 s390x: fix mul operation
Change-Id: I8cdf2d79d0b0340c924360bf25e3ce0167ed8ee4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2595724
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71848}
2020-12-21 13:24:38 +00:00
LiuYu
a90b1ce537 [wasm-simd][mips] Prototype extended multiply
Port: 4ad68f1c83

Bug: v8:11008

Change-Id: I0aa384612b529babf9e526fca83c8c69f58b6f3b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2592828
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Auto-Submit: Liu yu <liuyu@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#71847}
2020-12-21 10:07:18 +00:00
v8-ci-autoroll-builder
050f6a8d43 Update V8 DEPS.
Rolling v8/build: d6efe53..34da458

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

Change-Id: Ie358cbfd3f3a9204427cdf4f7f030d3a49113259
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2599325
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@{#71846}
2020-12-21 03:34:57 +00:00
Zhi An Ng
8e9ad4f861 [x64][ia32][wasm-simd] Optimize v128.bitselect
Couple of optimizations for v128.bitselect on both ia32 and x64.

1. Remove an extra movaps when AVX is supported, since we have 3-operand
instructions
2. Tweak the algorithm from:
     xor(and(xor(src1, src2), mask) src2)

   To:
     or(and(src1, mask), andnot(src2, mask))
   It is easier to read and understand, and also eliminate a dependency
   chain (on kScratchDoubleReg) in the older algorithm.
3. Use integer forms of the logical ops. Older processors have higher
throughput on these, compared to the floating point ops. However, the
integer forms are 1 byte longer, so on SSE, we stick to the floating
point ops.

For AVX, this reduces instruction count from 9948 to 9868.

Change-Id: Idd5d26b99a76255dbfa63e2c304e6af3760c4ec6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2591859
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71845}
2020-12-21 02:17:27 +00:00
v8-ci-autoroll-builder
3e6f5fe1da Update V8 DEPS.
Rolling v8/build: 6ae4be1..d6efe53

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

Change-Id: I70dfc2899b0e47318254ada04b398e6212aebdcf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2599105
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@{#71844}
2020-12-20 03:42:37 +00:00
LiuYu
39abe9f608 [mips][Turboprop] Move dynamic check maps immediate args to deopt exit.
Port: 7bdb0fbb81

Bug: v8:10582

Change-Id: I2a2227ddc45b86f7ad496b524514db96f423b185
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2598463
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@{#71843}
2020-12-19 10:21:56 +00:00
v8-ci-autoroll-builder
391941911d Update V8 DEPS.
Rolling v8/build: 68fec68..6ae4be1

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

Change-Id: Iedfb1d8a959bfa8a52939d7b3617bafdf4043051
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2598675
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@{#71842}
2020-12-19 03:37:36 +00:00
Junliang Yan
4fb1b50535 s390x: rename Mul/Div/Mod operations
Change-Id: Icf959a6e3ac66a5e907379ee9fec25223517af51
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2598696
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71841}
2020-12-18 22:43:05 +00:00
LiuYu
afa4291648 [mips][wasm-gc] Liftoff support part 3: arrays
Port: 3dffdf037b

Besides, port another CL which is needed by this one.
Port: 8656a594ab

Bug: v8:7748

Change-Id: Ie0a8030794d69b3ea372e722230e82dceaf5fece
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2597960
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#71840}
2020-12-18 10:36:55 +00:00
v8-ci-autoroll-builder
e00850ca47 Update V8 DEPS.
Rolling v8/build: d50897f..68fec68

Rolling v8/third_party/aemu-linux-x64: j06MN21Z7_ISpAwWL3mLbbrGDGsSKnxGaEYTCDtE-RIC..qMq36BPvKEIxjpVFBefO08HoyM51jARe3EuX0vcgzWsC

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/92c7710..8d43e58

Rolling v8/tools/clang: 36810de..d324a17

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

Change-Id: I1cbe60a0ca4e62e21489d5cc4fc416858dad1e28
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2598011
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@{#71839}
2020-12-18 03:55:04 +00:00
Milad Fa
ac5d9ffd83 PPC: Add POWER9 to ppc cpu features
Features supported on P8 should also be enabled on P9.

Change-Id: Iae96471e5b66a801f28e3e1069d0d522ec901d93
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2596998
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71838}
2020-12-17 22:37:54 +00:00
Milad Fa
87e0ceb685 PPC: FormatFPRegister might have VSX inputs as source or destination
Change-Id: I2fb08d891112f8d88896a116622688ce6ea83a10
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2595312
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71837}
2020-12-17 22:36:44 +00:00
Clemens Backes
6dfa47b6b4 [test][cleanup] Rename WASM_*_GLOBAL to WASM_GLOBAL_*
The opcodes were renamed long ago, but the macros were still using the
old syntax.

This CL was created using the following script (for WASM_GET_GLOBAL and
WASM_SET_GLOBAL):
ag -l WASM_GET_GLOBAL | xargs -L 1 sed -i 's/\bWASM_GET_GLOBAL\b/WASM_GLOBAL_GET/g'

R=ahaas@chromium.org

Bug: v8:11074
Change-Id: I3a9bd64f6e09ce97dae6d4132c224350dc079c0f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2597576
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71836}
2020-12-17 21:26:54 +00:00
Clemens Backes
91b102c763 [test][cleanup] Rename WASM_*_LOCAL to WASM_LOCAL_*
The opcodes were renamed long ago, but the macros were still using the
old syntax.

This CL was created using the following command (for WASM_GET_LOCAL,
    WASM_SET_LOCAL, and WASM_TEE_LOCAL):
ag -l WASM_GET_LOCAL | xargs -L 1 sed -i 's/\bWASM_SET_LOCAL\b/WASM_LOCAL_SET/g'

R=ahaas@chromium.org

Bug: v8:11074
Change-Id: I0018bea185030be29344e66e59706fed183cc2f1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2595446
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71835}
2020-12-17 21:19:14 +00:00
Milad Fa
a8f877bf9f S390: [wasm-simd] Implement extended multiply
PPC will be implemented separately.

Change-Id: I358f5a73275a40f8083e9c07b7028d162969f836
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2597578
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71834}
2020-12-17 19:32:34 +00:00
Nico Hartmann
d1226086c6 [TurboFan] Templatize GetBytecodeArray
This CL changes SharedFunctionInfo::GetBytecodeArray to a function
template, which is specialized for Isolate and LocalIsolate arguments.
This allows main thread only uses to avoid taking a lock.

Bug: v8:7790, chromium:1154603
Change-Id: I3462c4e36b66073e09393c01c765dd8a018a98f0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2595307
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71833}
2020-12-17 16:46:53 +00:00
Tobias Tebbi
22fedb0e26 [torque] avoid GetStringData dispatch repetition
Change-Id: I31d2a19153fa17e6e78d3da93352da886addf089
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2581960
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71832}
2020-12-17 16:06:33 +00:00
Seth Brenith
a14107f73d [torque] Add lint rules for redundant clauses
This change adds two simple lint rules to prevent including 'generates'
or 'constexpr' clauses in cases where they have no impact on behavior.

Bug: v8:7793
Change-Id: Ib1d8fde39ca26735ff9cb7892f01e464619c2090
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2590515
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#71831}
2020-12-17 16:03:43 +00:00
Andreas Haas
eafc0eee95 [wasm] Create new tracing category for TurboFan events
The TurboFan events, like time in register allocation, are only
interesting in special cases, but create lots of events. Therefore it is
good to put these events into their own tracing category.

Bug: chromium:1084929
Change-Id: I971badc1ff58f99bd57b2ddfc93b625b356d6a2d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2595436
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71830}
2020-12-17 15:31:03 +00:00
Mike Stanton
139f23501d [api] Its sufficient for the holder in api call to be a JSReceier
Bug: chromium:1158124
Change-Id: Ic23f4b2ffb9436771afcc0090f2179b48851c39d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2596336
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71829}
2020-12-17 15:25:33 +00:00
Clemens Backes
c5b567042b [tasks] Cleanup OperationsBarrier
The class disallows copy construction, but still allows copy assignment.
This is fixed in this CL.

Drive-by: Fix punctuation.
Drive-by 2: Fix indentation in code example.

R=etiennep@chromium.org

Bug: v8:11074
Change-Id: I09e993a69d72e262d7b220200ef94b36d346548e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2584246
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71828}
2020-12-17 14:56:33 +00:00
Patrick Thier
1314d2b859 [interpreter] Use LdaSmi when possible.
When we know a value passed to BytecodeArrayBuilder::LoadLiteral(double)
can be encoded as a Smi, we create LdaSmi instead of LdaConstant.

Driven by a forgotten Smi::FromInt() in BytecodeGenerator, also fixed in
this CL.

Bug: v8:11278
Change-Id: I4a1ad48e2c9aff8391113812e34dae838a1a38d3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2595437
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71827}
2020-12-17 14:51:13 +00:00
Sathya Gunasekaran
cce533bac9 [runtime] Use range checks for function instance type checks
This allows the JSFunctionOrBoundFunction instance type range to no
longer be stuck at the last of the JSObject instance type range. This
will be useful in the future where we extend the function instance
types and include them in fast protector cell checks.

Bug: v8:11256
Change-Id: I955991576b3cca76b10f76c87748016fe527e3d0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2595275
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71826}
2020-12-17 14:02:03 +00:00
Nico Hartmann
de50785ed5 Revert "Faster JS-to-Wasm calls"
This reverts commit 860fcb1bd2.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux%20-%20arm%20-%20sim%20-%20lite/13831/overview

Original change's description:
> Faster JS-to-Wasm calls
>
> This replaces https://chromium-review.googlesource.com/c/v8/v8/+/2376165/.
>
> Currently JS-to-Wasm calls go through a wrapper/trampoline, built on
> the basis of the signature of a Wasm function to call, and whose task
> is to:
> - set "thread_in_wasm_flag" to true
> - convert the arguments from tagged types into Wasm native types
> - calculate the address of the Wasm function to call and call it
> - convert back the result from Wasm native types into tagged types
> - reset "thread_in_wasm_flag" to false.
>
> This CL tries to improve the performance of JS-to-Wasm calls by
> inlining the code of the JS-to-Wasm wrappers in the call site.
>
> It introduces a new IR operand, JSWasmCall, which replaces JSCall for
> this kind of calls. A 'JSWasmCall' node is associated to
> WasmCallParameters, which contain information about the signature of
> the Wasm function to call.
>
> WasmWrapperGraphBuilder::BuildJSToWasmWrapper is modified to avoid generating code to convert the types for the arguments
> of the Wasm function, when the conversion is not necessary.
> The actual inlining of the graph generated for this wrapper happens in
> the simplified-lowering phase.
>
> A new builtin, JSToWasmLazyDeoptContinuation, is introduced to manage
> lazy deoptimizations that can happen if the Wasm function callee calls
> back some JS code that invalidates the compiled JS caller function.
>
> Bug: v8:11092
> Change-Id: I3174c1c1f59b39107b333d1929ecc0584486b8ad
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2557538
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
> Reviewed-by: Georg Neis (ooo until January 5) <neis@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Reviewed-by: Maya Lekova <mslekova@chromium.org>
> Reviewed-by: Andreas Haas <ahaas@chromium.org>
> Commit-Queue: Paolo Severini <paolosev@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#71824}

TBR=neis@chromium.org,ahaas@chromium.org,jgruber@chromium.org,tebbi@chromium.org,ishell@chromium.org,mslekova@chromium.org,nicohartmann@chromium.org,paolosev@microsoft.com

Change-Id: I214cbdee74c1a2aaad907ffc84662ed25631983e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:11092
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2595438
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71825}
2020-12-17 13:55:35 +00:00
Paolo Severini
860fcb1bd2 Faster JS-to-Wasm calls
This replaces https://chromium-review.googlesource.com/c/v8/v8/+/2376165/.

Currently JS-to-Wasm calls go through a wrapper/trampoline, built on
the basis of the signature of a Wasm function to call, and whose task
is to:
- set "thread_in_wasm_flag" to true
- convert the arguments from tagged types into Wasm native types
- calculate the address of the Wasm function to call and call it
- convert back the result from Wasm native types into tagged types
- reset "thread_in_wasm_flag" to false.

This CL tries to improve the performance of JS-to-Wasm calls by
inlining the code of the JS-to-Wasm wrappers in the call site.

It introduces a new IR operand, JSWasmCall, which replaces JSCall for
this kind of calls. A 'JSWasmCall' node is associated to
WasmCallParameters, which contain information about the signature of
the Wasm function to call.

WasmWrapperGraphBuilder::BuildJSToWasmWrapper is modified to avoid generating code to convert the types for the arguments
of the Wasm function, when the conversion is not necessary.
The actual inlining of the graph generated for this wrapper happens in
the simplified-lowering phase.

A new builtin, JSToWasmLazyDeoptContinuation, is introduced to manage
lazy deoptimizations that can happen if the Wasm function callee calls
back some JS code that invalidates the compiled JS caller function.

Bug: v8:11092
Change-Id: I3174c1c1f59b39107b333d1929ecc0584486b8ad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2557538
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Georg Neis (ooo until January 5) <neis@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Paolo Severini <paolosev@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#71824}
2020-12-17 10:57:53 +00:00
Jakob Kummerow
f475e99021 Reland "[wasm-gc] Liftoff support part 4: subtyping"
This is a reland of dc369749c7
Changes: relaxed --liftoff-only mode to still allow bailing
out due to missing CPU support.

Original change's description:
> [wasm-gc] Liftoff support part 4: subtyping
>
> This adds support for the following instructions:
> struct.new_default, rtt.sub, ref.test, ref.cast
>
> Bug: v8:7748
> Change-Id: I7423ddd7a83c80cb1e82c620780c27bec59ec762
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2593341
> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71805}

Bug: v8:7748
Change-Id: If31fcee5e7e173d7c2a6e1c624f4ff04cec7fe9c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2596338
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71823}
2020-12-17 10:02:43 +00:00
Clemens Backes
63b78f2b01 [wasm] Optimize bounds checking bounds
For bounds checking, we have a special path which avoids one conditional
branch. This path can actually be one value wider, which will avoid some
unneeded code if that case it hit. This will in particular be the case
for single-byte loads at offset 0 with a minimum memory size of 0.

R=jkummerow@chromium.org

Bug: v8:10949
Change-Id: Id16af8debc38c56c520183aec81a48249979ec96
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2595290
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71822}
2020-12-17 09:38:53 +00:00
Zhi An Ng
8f02ad408e [ia32][x64] Detect AVX2
- Add the appropriate cpuid checks to detect AVX2 in base/cpu
- Add FLAG_enable_avx2

AVX2 depends on AVX support, + a cpuid check with eax=7. This is similar
to chromium/src/base/cpu.cc check for AVX2.

Bug: v8:11258
Change-Id: Ia547c22e51b03fec823f5e48ebb055139632c942
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2589050
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@{#71821}
2020-12-17 05:44:54 +00:00
Zhi An Ng
46ce9b0554 [wasm-simd][x64] Optimize arch shuffle if AVX supported
AVX has 3-operands shuffle/unpack operations. We currently always
require that dst == src0 in all cases, which is not required if we have
AVX. For the arch shuffles that map to a single native instruction, add
support to check for AVX in the instruction-selector, to not require
same as first, and in the code-gen to support generating AVX.

The other arch shuffles are slightly more complicated, and can be
optimized in a future change.

Bug: v8:11270
Change-Id: I25b271aeff71fbe860d5bcc8abb17c36bcdab32c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2591858
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71820}
2020-12-17 05:13:04 +00:00
Zhi An Ng
3d83638c3c [wasm-simd] Remove ifdef guards for extended multiply
These instructions have been accepted into the proposal.

Bug: v8:11262
Change-Id: Iec0bb9b9b1b0f8ed76ed78e254c64b96981a5f2f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2589433
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71819}
2020-12-17 04:56:44 +00:00
Zhi An Ng
12e37399e8 [x64][wasm-simd] Only require unique registers for shuffles that use temps
An improvement to generic shuffle improvement
(https://crrev.com/c/2152853) required a temporary SIMD register to hold
the mask, rather than pushing it onto a stack. The temporary register
requires that we UseUniqueRegister on the inputs, to prevent aliasing,
as we will write to the temp. However, we only need this for the generic
shuffle. We accidentally over-constraint all other pattern matched
shuffles, since they don't use any temps.

On a ~2000 line function containing ~150 shuffles (not all of which are
generic shuffles), we get 16 less instruction in the native code, and
actually see a very small improvement in the overall benchmarks.

Bug: v8:11270
Change-Id: I09974f7615e4b8f5e2416ed17ca47cc7613fd6b1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2591857
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71818}
2020-12-17 04:31:24 +00:00
v8-ci-autoroll-builder
a8b215dab0 Update V8 DEPS.
Rolling v8/build: bd6da36..d50897f

Rolling v8/third_party/aemu-linux-x64: ijHjc7kfgeuh7rvjQtk93a5SuvO23dABp_CeotpPcMAC..j06MN21Z7_ISpAwWL3mLbbrGDGsSKnxGaEYTCDtE-RIC

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/f22b977..92c7710

Rolling v8/third_party/depot_tools: 867d99d..67e1228

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

Change-Id: I17ecc3f2e992a530c1d6cc61d0233836dd081179
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2596389
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@{#71817}
2020-12-17 04:14:24 +00:00
Zhi An Ng
8d5f1511a4 [wasm-simd][ia32] Pattern match 32x4 rotate
Same pattern matching and implementation as x64 here:
https://crrev.com/c/2589062.

Change-Id: I11f8df79ab9910af9c7a97e2382144703be5916d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2591851
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71816}
2020-12-17 03:51:14 +00:00
LiuYu
132d7bd426 [mips][wasm-gc] Liftoff support part 2
Port: 5e18ab5019

Bug: v8:7748
Change-Id: I1ac349cf80b6689971bd6c686c6795daf85c5637
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2594536
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#71815}
2020-12-17 03:38:24 +00:00
Zhi An Ng
53b9ee3765 [wasm-simd] Add extended multiply to fuzzer
Bug: v8:11262
Change-Id: Ic83cf2752ebaffb589ac72206c25005145b0b8c4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2589067
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71814}
2020-12-17 03:29:14 +00:00
Zhi An Ng
741e5a66de [wasm-simd][ia32][x64] More optimization for f32x4.extract_lane
We can have more optimizations for this instruction, they leave some
junk in the top lanes of dst, but that doesn't matter:

- when lane is 1: we use movshdup, this is 4 bytes long
- when lane is 2: use movhlps, this is 3 bytes long
- otherwise use shufps (4 bytes) or pshufd (5 bytes)

All of which are better than insertps (6 bytes).

Change-Id: I0e524431d1832e297e8c8bb418d42382d93fa691
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2591850
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71813}
2020-12-17 01:58:52 +00:00
Zhi An Ng
08c2c0059d [wasm-simd] Move extended multiply out of post-mvp
Bug: v8:11262
Change-Id: Iefe32dbf20e4c511a3f1d56ce7dc53c2bc2da112
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2589066
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71812}
2020-12-17 01:44:12 +00:00
Zhi An Ng
1f2cc01a1b [wasm-simd][x64] Use Movaps to get AVX version if supported
Use Movaps so that when AVX is supported we get vmovaps, this avoids
mixing SSE and AVX code.

Change-Id: Icbcefa42bd368bed1a30f5f790ea6c5cea564e26
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2591856
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71811}
2020-12-17 00:45:32 +00:00
Jakob Kummerow
362e4c0866 Revert "[wasm-gc] Liftoff support part 5: i31"
This reverts commit a3ce2f6da2.

Reason for revert: speculative revert due to waterfall unhappiness (looks like bot weirdness though?)

Original change's description:
> [wasm-gc] Liftoff support part 5: i31
>
> This implements support for i31.get_s and i31.get_u.
>
> Bug: v8:7748
> Change-Id: Icbfddbc2ff46b4eb6bf3edf7b3a794f9797361d4
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2595309
> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71808}

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

Change-Id: I5050f16fdaf355d178935f523a9bec516302d2a1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7748
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2596337
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71810}
2020-12-17 00:03:14 +00:00
Milad Fa
07f0b7a4c8 PPC/s390: Reland "[Turboprop] Move dynamic check maps immediate args to deopt exit."
Port 7bdb0fbb81

Original Commit Message:

    This is a reland of b2a611d815

    Original change's description:
    > [Turboprop] Move dynamic check maps immediate args to deopt exit.
    >
    > Rather than loading the immediate arguments required by the
    > dynamic check maps builtin into registers in the fast-path,
    > instead insert them into the instruction stream in the deopt
    > exit and have the builtin load them into registers itself.
    >
    > BUG=v8:10582
    >
    > Change-Id: I66716570b408501374eed8f5e6432df64c6deb7c
    > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2589736
    > Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
    > Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
    > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#71790}

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

Change-Id: I83fc0f3e3ebcf19ca4303e50aae94d7b353cd0ac
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2595708
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71809}
2020-12-16 23:44:12 +00:00
Jakob Kummerow
a3ce2f6da2 [wasm-gc] Liftoff support part 5: i31
This implements support for i31.get_s and i31.get_u.

Bug: v8:7748
Change-Id: Icbfddbc2ff46b4eb6bf3edf7b3a794f9797361d4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2595309
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71808}
2020-12-16 23:29:52 +00:00