Commit Graph

29705 Commits

Author SHA1 Message Date
Clemens Backes
f1b6092c52 [liftoff] Move more options into LiftoffOptions
{LiftoffOptions} already contains many (optional) parameters for Liftoff
compilation, but not all of them.
This CL moves the function index and the {for_debugging} field also into
that struct, to further reduce the number of parameters to
{ExecuteLiftoffCompilation} and to improve readability by having a
factory-like initialization of the {LiftoffOptions} struct.
That struct is now also passed down to the LiftoffCompiler directly
instead of unpacking the fields again.

R=thibaudm@chromium.org

Bug: v8:12809
Change-Id: I8824a1908f214cbf4c21f113934fef3ece1bf88b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3513894
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80032}
2022-04-19 16:21:21 +00:00
Shu-yu Guo
a8b04431a8 Revert "[builtins] Remap builtins on Linux"
This reverts commit b1dd828707.

Reason for revert: Breaking fuschia build https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Fuchsia%20-%20builder/13592/overview

Original change's description:
> [builtins] Remap builtins on Linux
>
> This is a CL similar to
> https://chromium-review.googlesource.com/c/v8/v8/+/3553006, but on Linux
> rather than macOS. The goal is to allow builtins to use short builtin
> calls without paying a memory cost, by remapping rather than copying
> them.
>
> However, while macOS has a system call making this easier, on Linux we
> don't have one on most kernels. There is the recently-introduced
> mremap(MREMAP_DONTUNMMAP), which is available in 5.7, but only works on
> anonymous mappings until 5.13, which is too recent for most Android
> devices.
>
> Instead, we open() the file containing the builtins, and mmap() it at
> the desired location.
>
> Change-Id: I4524f349948b8f48c4536cf392a1cd179662a6cc
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3570426
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Jakob Linke <jgruber@chromium.org>
> Commit-Queue: Benoit Lize <lizeb@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#80022}

Change-Id: I0093fe84216f8c8fd1a8691c53817e578d92fa40
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3594009
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Owners-Override: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80028}
2022-04-19 15:27:28 +00:00
jameslahm
e2679ec79a [test] Migrate TEST(TryCatch...) in cctest/test-api to unittests.
- Add RunJSNoChecked to run the script which possibly throws.
- Add CompileRun to run the script outside TEST_F, e.g., in
FunctionTemplate and helpers etc.

Bug: v8:12781
Change-Id: Ibab2e19cf1f7c76f7a81a90fc5894e7e6bfb7cdf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3586770
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#80025}
2022-04-19 15:11:37 +00:00
Benoît Lizé
b1dd828707 [builtins] Remap builtins on Linux
This is a CL similar to
https://chromium-review.googlesource.com/c/v8/v8/+/3553006, but on Linux
rather than macOS. The goal is to allow builtins to use short builtin
calls without paying a memory cost, by remapping rather than copying
them.

However, while macOS has a system call making this easier, on Linux we
don't have one on most kernels. There is the recently-introduced
mremap(MREMAP_DONTUNMMAP), which is available in 5.7, but only works on
anonymous mappings until 5.13, which is too recent for most Android
devices.

Instead, we open() the file containing the builtins, and mmap() it at
the desired location.

Change-Id: I4524f349948b8f48c4536cf392a1cd179662a6cc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3570426
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Benoit Lize <lizeb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80022}
2022-04-19 13:35:07 +00:00
Yolanda Chen
c48ec6f7bb [x64] Implement 256-bit assembly for SSE2_UNOP instructions
The SSE2_UNOP instructions have various src and dst register types for
256-bit AVX. One of them, the ucomisd instruction does not support YMM.
Other two: vcvtpd2ps and vcvttpd2dq use XMM as dst register. We extend
the Operand type to Operand256 to represent m256 to distiguish with the
128-bit AVX instruction.

Since this is a small suite, we explicitly specify the operand type for
each instruction.

Bug: v8:12228
Change-Id: I07c8168bd49f75eb8e4df8d6adfcfb37c1d34fff
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3518423
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Yolanda Chen <yolanda.chen@intel.com>
Cr-Commit-Position: refs/heads/main@{#80020}
2022-04-19 13:01:50 +00:00
Camillo Bruni
4b0737d29d [log] Rename logging classes
i::Logger          => i::V8Log
i::PerfJitLogger   => i::LinuxPerfJitLogger
i::PerfBasicLogger => i::LinuxPerfBasicLogger

Note: V8Log is currently still managing instances of other loggers,
this functionality will be moved to a separate class in the future.

Bug: v8:12795, chromium:1316443
Change-Id: Id1b44e65abb7819eb6d6c718a1baa9ed61ad51aa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3593133
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80016}
2022-04-19 12:07:16 +00:00
Ilja Iskovs
9e55269b45 [wasm-simd][arm64] Use Bic(x, imm) for And(x, [Not](imm)) when possible
Immediate version of the Bitclear instruction can be used for logical
And with some immediates. It can also be used to implement
And(x, Not(imm)) in a single instruction. This patch gives ~0.5% runtime
improvement in one benchmark on Neoverse N1.

Change-Id: Ia926c6746f0c252f81626c6fca21c4dfb41679d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160667
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Martyn Capewell <martyn.capewell@arm.com>
Cr-Commit-Position: refs/heads/main@{#80015}
2022-04-19 10:09:37 +00:00
Simon Zünd
ad0677129b [inspector] Add disabled tests for 'Restart frame' 1/2
Doc: https://bit.ly/revive-restart-frame
Context: https://crrev.com/c/3582395 (whole feature)

This CL adds the first batch of inspector tests for the upcoming
"Restart frame" feature. Landing the tests upfront allows us to
better discuss the proposed API as well as think early about
corner cases we should test.

The tests check for the functionality of `Debugger.restartFrame`, as
well as the newly added parameter `canBeRestarted` in
the `Debugger.paused` event.

Bug: chromium:1303521
Change-Id: Ibda6d8b6110fce893e0844f8902fbd5d901ae01d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3585946
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80013}
2022-04-19 09:00:17 +00:00
Igor Sheludko
fe392704aa Reland "[rwx][mac] Introduce RwxMemoryWriteScope"
This is a reland of commit 4d8e1846a7
One of the Mac arm64 bots failed to link an exported thread_local
static variable (crbug/1316800).

Original change's description:
> [rwx][mac] Introduce RwxMemoryWriteScope
>
> ... as a single bottleneck that encapsulates the semantics and
> implementation of fast per-thread W^X permission switching supported
> by Apple Silicon (arm64 M1).
> On other architectures this class is a no-op.
>
> Bug: v8:12797
> Change-Id: Ica842ff9f843e20b7f61fd7e80591e7a1fd29771
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3586986
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79994}

Bug: v8:12797
Change-Id: Ifbd15c233bb343f11daa89b1328b5bf65c4806f4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3591332
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80011}
2022-04-19 08:48:47 +00:00
Jakob Linke
3b772a2397 Revert "[interpreter] Optimize strict equal boolean"
This reverts commit 62632c0805.

Reason for revert: Performance regressions crbug.com/1315724

Original change's description:
> [interpreter] Optimize strict equal boolean
>
> For strict equal boolean literal like "a===true"
> or "a===false", we could generate TestReferenceEqual
> rather than TestStrictEqual. And in `execution_result()->IsTest()`
> case, we could directly emit JumpIfTrue/JumpIfFalse.
>
> E.g.
> ```
> a === true
> ```
> Generated Bytecode From:
> ```
> LdaGlobal
> Star1
> LdaTrue
> TestEqualStrict
> ```
> To:
> ```
> LdaGlobal
> Star1
> LdaTrue
> TestReferenceEqual
> ```
>
> E.g.
> ```
> if (a === true)
> ```
> Generated Bytecode From:
> ```
> LdaGlobal
> Star1
> LdaTrue
> TestEqualStrict
> JumpIfFalse
> ```
> To
> ```
> LdaGlobal
> JumpIfTrue
> Jump
> ```
>
>
> Bug: v8:6403
> Change-Id: Ieaca147acd2d523ac0d2466e7861afb2d29a1310
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3568923
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Commit-Queue: 王澳 <wangao.james@bytedance.com>
> Cr-Commit-Position: refs/heads/main@{#79935}

Bug: v8:6403, chromium:1315724
Change-Id: I65c520590093724e838f738c795d229687efb9de
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3592752
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#80010}
2022-04-19 08:29:07 +00:00
Deepti Gandluri
e73757beaa Revert "[rwx][mac] Introduce RwxMemoryWriteScope"
This reverts commit 4d8e1846a7.

Reason for revert: Blocks V8 roll, crbug.com/1316800

Original change's description:
> [rwx][mac] Introduce RwxMemoryWriteScope
>
> ... as a single bottleneck that encapsulates the semantics and
> implementation of fast per-thread W^X permission switching supported
> by Apple Silicon (arm64 M1).
> On other architectures this class is a no-op.
>
> Bug: v8:12797
> Change-Id: Ica842ff9f843e20b7f61fd7e80591e7a1fd29771
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3586986
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79994}

Bug: v8:12797
Change-Id: I81792567839e72b4147d009c0845b0c0de003eb0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3590752
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Owners-Override: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80007}
2022-04-18 18:18:47 +00:00
Frank Tang
c9617b66fd [test262] Roll test262
d7c0a207..33a5433d

Bug: v8:7834
Change-Id: I2c10e4470bf02de864666fa7410ce472a42b8359
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3585357
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80006}
2022-04-18 18:10:46 +00:00
jameslahm
f2c4c598fb [error] Improve error message for array spread
... on non-iterable object. In CallPrinter::VisitAssignment,
when found_ is true, we could print node->target to show the
error node value, avoid printing twice for the assignment.

Bug: v8:10854
Change-Id: I5f295f46b5639b715f762935e675598d1d780f98
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3586763
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#79997}
2022-04-15 01:23:54 +00:00
Igor Sheludko
4d8e1846a7 [rwx][mac] Introduce RwxMemoryWriteScope
... as a single bottleneck that encapsulates the semantics and
implementation of fast per-thread W^X permission switching supported
by Apple Silicon (arm64 M1).
On other architectures this class is a no-op.

Bug: v8:12797
Change-Id: Ica842ff9f843e20b7f61fd7e80591e7a1fd29771
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3586986
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79994}
2022-04-14 15:20:40 +00:00
Clemens Backes
f6a559e2c0 [wasm] Make DynamicTiering a boolean enum
This makes usages less verbose, and is consistent with other existing
enums.
Also, we can use brace initialization to avoid boilerplate when creating
a DynamicTiering value.

Drive-by: Rename a 'kIncludeLiftoff' variable to 'include_liftoff'
because it is not a static constant.

R=jkummerow@chromium.org

Bug: v8:12281
Change-Id: Ie45fdb550241a8b9ca4e2a31b7c27500939fa247
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3585566
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79993}
2022-04-14 14:57:40 +00:00
Camillo Bruni
3608b831e9 [log] CodeEventDispatcher refactoring
- Rename CodeEventDispatcher to LogEventDispatcher
- Use std::vector instead of std::unordered_set, dispatching speed is
  more important than addition/removal of listeners
- Changing the LogEventDispatcher code to be more code-search friendly
- Use a raw pointer for the LogEventDispatcher instance on the isolate
  it's a single-owned entity

Bug: v8:12795
Change-Id: I139f05431519c18cba33d1506467be918f52658c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3582125
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79990}
2022-04-14 13:11:51 +00:00
Tobias Tebbi
52fd8054be [test] skip all Torque unittests on Mac Arm64
Change-Id: I0dbb0e800908d02a783393c3e329d306316b03c7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3585949
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79985}
2022-04-14 08:49:11 +00:00
Corentin Pescheloche
ac2275b81b [profiler] prevent duplicate id
With the switch to primitive ids make sure no profiler can be returned
with the same id.

Bug: chromium:1297283
Change-Id: I9cf944e9a472ea45679feb0f30137dba95a32ca6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3582786
Auto-Submit: Corentin Pescheloche <cpescheloche@fb.com>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79975}
2022-04-13 21:19:29 +00:00
Anton Bikineev
0d57754cbf cppgc: young-gen: Pack AgeTable knowing allocation granularity
This reduces card granularity from 4096 to 512 bytes with the goal to
improve write barrier filtering.

Bug: chromium:1029379
Change-Id: I22e2a9c61ef4c36c3db65404370213d0a8048e08
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3582393
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79960}
2022-04-13 14:58:17 +00:00
Marja Hölttä
682ba0efd3 [valueserializer] Implement a compatibility mode for deserializing broken data
For a while, we shipped a version which writes version 13 data with
JSArrayBufferView flags, and then fixed version 13 to not include the
flags.

This CL adds a compatibility mode for parsing the the version 13
data which includes the flags, since it still occurs in the wild.

Bug: chromium:1314833,chromium:1284506
Change-Id: I96cc432c8574a40b11ec0037394feb1853515760
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3583982
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79959}
2022-04-13 13:58:49 +00:00
Michael Lippautz
431da4644a [heap] Convert test-lab.cc -> lab-unittest.cc
Bug: v8:12781
Change-Id: I4cf23035a7679efdb4830335b75d8616abfbbe08
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3582385
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79958}
2022-04-13 13:30:59 +00:00
Nikolaos Papaspyrou
ae0480a01b heap: Inline GCTracer::Scope constructor and destructor
Tracer scopes are used in numerous places in src/heap to track time
spent during various phases of the garbage collection. Usually, they
are introduced with the TRACE_GC* family of macros, taking the scope
identifier as a parameter. At most call sites, the scope identifier is
known at compile time.

This CL inlines the constructor and destructor of GCTracer::Scope, in
order to enable the C++ compiler to properly optimize the introduction
of such scopes when the scope identifier is known at compile time,
using constant propagation. This is expected to have a performance
impact for short-lived and frequently used scopes, e.g., in incremental
marking and sweeping steps.

Change-Id: I6f1a2954a437de1fa6dab5e464c20c952d84ffd4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3581774
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79957}
2022-04-13 13:17:39 +00:00
Omer Katz
39f419f045 [heap] Move allocation logic to SpaceWithLinearArea
NewSpace and PagedSpace both inherit from SpaceWithLinearArena and
implement allocation logic on top of it. The parts of the allocation
path that deal specifically with the linear allocation area are
equivalent (only minor syntactic differences between them).

This CL refactors the allocation from a linear allocation area out of
NewSpace and PagedSpace and moves it to SpaceWithLinearArea. This
eliminates code duplication and keeps everything generally still working
the same.

This is done as part of an effort to create a stable NewSpace interface
to allow introducing an alternative paged new space.

Bug: v8:12612
Change-Id: Ie24345a2d51f6e67ebe8a1d67e586038f7aec8de
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3578547
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79955}
2022-04-13 10:48:00 +00:00
Nikolaos Papaspyrou
d609cd9829 heap: Fix reporting of incremental and background scopes
Method GCTracer::UpdateStatistics was responsible for copying
incremental and background scopes to the current event, before
reporting. It was called, however, at the end of the atomic pause and,
as a result, some of these scopes would be prematurely copied to the
current event (e.g., incremental and background sweeping scopes) and
misreported.

This CL fixes this by splitting the update of statistics and the
copying of incremental and background scopes. It introduces the
method GCTracer::FinalizeCurrentEvent which does the latter, which
is called from GCTracer::StopCycle. It also introduces methods for
correctly accessing and updating scopes, before the current event is
finalized, and eliminates the distinction between
GCTracer::AddScopeSample and GCTracer::AddScopeSampleBackground.

Bug: chromium:1154636
Change-Id: I2a6d9abb3daa2c48b2dce12dc2685cfc84130abf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576792
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79938}
2022-04-12 10:24:18 +00:00
jameslahm
a544b4967e [runtime] Fix arguments length DCHECK
... in Runtime::kCopyDataPropertiesWithExcludedPropertiesOnStack.

Bug: v8:11614
Change-Id: Ief6d62fff242d3d38c4e586c7252935d3527ddf1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3581534
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#79937}
2022-04-12 10:23:15 +00:00
jameslahm
62632c0805 [interpreter] Optimize strict equal boolean
For strict equal boolean literal like "a===true"
or "a===false", we could generate TestReferenceEqual
rather than TestStrictEqual. And in `execution_result()->IsTest()`
case, we could directly emit JumpIfTrue/JumpIfFalse.

E.g.
```
a === true
```
Generated Bytecode From:
```
LdaGlobal
Star1
LdaTrue
TestEqualStrict
```
To:
```
LdaGlobal
Star1
LdaTrue
TestReferenceEqual
```

E.g.
```
if (a === true)
```
Generated Bytecode From:
```
LdaGlobal
Star1
LdaTrue
TestEqualStrict
JumpIfFalse
```
To
```
LdaGlobal
JumpIfTrue
Jump
```


Bug: v8:6403
Change-Id: Ieaca147acd2d523ac0d2466e7861afb2d29a1310
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3568923
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#79935}
2022-04-12 08:58:28 +00:00
Joyee Cheung
4c29cf1b78 [heap] fix invocation of NearHeapLimitCallback
This patch makes sure that NearHeapLimitCallback can invoke
operations that trigger garbage collections. In addition
this adds code to make the tracers aware of NearHeapLimitCallback.

Bug: v8:12777
Change-Id: I959a23a3e0224ba536cb18b14933813e56fc5292
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3575468
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Cr-Commit-Position: refs/heads/main@{#79934}
2022-04-12 08:04:55 +00:00
Michael Lippautz
1b405b145f [heap] Don't publish marking barrier in final marking step
The barrier is published in the atomic pause following the final step.

Bug: v8:12775
Change-Id: Ia77e1d213cc02a086d7a557999481b633e6b4df4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3582039
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79928}
2022-04-11 18:56:15 +00:00
Maksim Sadym
a913a75b8c Add WebDriverBiDi serialization to CDP
1. Added `generateWebDriverValue` flag to `Runtime.evaluate` and `Runtime.callFunctionOn`.
2. Added `webDriverValue` field to `RemoteObject`, and set it in case of the `generateWebDriverValue` flag was set.
3. Added virtual method `bidiSerialize` to allow embedder-implemented serialization (like in https://crrev.com/c/3472491).
4. Implemented V8 serialization in a separate class `V8WebDriverSerializer`.
5. Hardcode `max_depth=1`.
6. Added tests.

Not implemented yet:
1. `objectId`.
2. Test of embedder-implemented serialization.

Tested automatically by:
```
python3 tools/run-tests.py --outdir out/foo inspector/runtime/add-web-driver-value
```

Naming to be discussed. Suggestions are very welcome.

Design doc: http://go/bidi-serialization

Change-Id: Ib35ed8ff58e40b3304423cc2139050136d844e2c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3472077
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Maksim Sadym <sadym@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79922}
2022-04-11 15:51:54 +00:00
Lu Yahan
b33075961b [wasm] flag_liftoff_only should disable wasm-dynamic-tiering in cctest
FlagScope can't automatically disable wasm-dynamic-tiering.

Bug: v8:7748

Change-Id: Ieb59e20b4cb4436277aa88b615bca07657a1212c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3578109
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79920}
2022-04-11 14:59:35 +00:00
Jakob Gruber
65885dab44 Reland "[osr] Enable concurrent OSR"
This is a reland of commit 6879c515d0

Original change's description:
> [osr] Enable concurrent OSR
>
> Fixed: v8:12161
> Change-Id: Ie6e83dd4f261fff2d1fa8613116e83ef6b61561f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576116
> Auto-Submit: Jakob Linke <jgruber@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79857}

Change-Id: I418a1166c5eff4156f0c4406f024fc1ba5746732
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3582038
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79915}
2022-04-11 13:09:35 +00:00
Clemens Backes
d3db97f8ce [codegen] Bring back path for non-sse4.1 and non-avx
The roundss / vroundss instruction is only available on AVX or SSE4_1
hardware. Thus bring back the old code path with much longer code for
such old hardware.

R=tebbi@chromium.org

Bug: chromium:1314363
Change-Id: I79a58627c8b406817330e9f9601234cea28182c1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3578642
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79914}
2022-04-11 12:53:04 +00:00
Nico Hartmann
3864c9610a [turbofan] Print an additional Turbolizer phase for SLVerifier
To make the existing mechanism for printing JSON for turbolizer able to
print types other than the ones stored in the nodes (so the verifier can
print its own types here), this CL restructures the printing mechanism
into a single non-private class that can be inherited to override
certain parts of the printing. In this CL only GetType is made virtual
to allow verifier to override it, but additional parts can be made
overridable whenever necessary.

Bug: v8:12619
Change-Id: Idf31f8cdb49eb6c3204c6abfbb74fc981330d6d2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571818
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79909}
2022-04-11 09:46:04 +00:00
Camillo Bruni
1b8d4e3adb [api] Remove FLAG_log_api
API logging has not been used in a while and we have valid alternatives:
- Runtime call stats
- Profiling
- Timer events

Together they make --log-api superfluous and we can remove it and reduce
the number of branches when calling into the V8 API.

Change-Id: Ie10f70b61ebdb82166270e7630ebcf20a27c4902
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3574549
Reviewed-by: Marja Hölttä <marja@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79904}
2022-04-11 06:24:44 +00:00
jameslahm
14718889ee [error] Improve error message for static methods
This CL changes frame message from `Function.${staticMethodName}`
to `${className}.${staticMethodName}` for stack trace in class
static methods.

Bug: v8:12778
Change-Id: Ie2b9471066a6ba38265412f4af471789bd375c98
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3575759
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#79898}
2022-04-09 01:56:02 +00:00
Anton Bikineev
8b1fb3abda cppgc: young-gen: Enable concurrent sweeping for minor GCs
Similar to full GCs, the GC defers metric reporting until sweeping is
finished.

Bug: chromium:1029379
Change-Id: Ib06adb3be691c1ad2bd530eb77fc01cc22537338
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576130
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Nikolaos Papaspyrou <nikolaos@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79891}
2022-04-08 14:40:15 +00:00
Leszek Swirski
fef7720fd3 Revert "[osr] Enable concurrent OSR"
This reverts commit 6879c515d0.

Reason for revert: Speculative revert for roll failures
https://ci.chromium.org/ui/p/chromium/builders/try/win_optional_gpu_tests_rel/80674/overview

Original change's description:
> [osr] Enable concurrent OSR
>
> Fixed: v8:12161
> Change-Id: Ie6e83dd4f261fff2d1fa8613116e83ef6b61561f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576116
> Auto-Submit: Jakob Linke <jgruber@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79857}

Change-Id: I05bd9594e8ce3db71acb31cf4c626c066158ceaa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3579163
Owners-Override: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#79890}
2022-04-08 14:33:06 +00:00
Thibaud Michaud
04b8124b34 [wasm] Clean up type size computation
Rename element_size_bytes() to value_kind_size(), and add
the uncompressed version: value_kind_full_size().

R=clemensb@chromium.org

Change-Id: I956142937fd1134ecbdaaa617c402ed8fff2cf17
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3568477
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79884}
2022-04-08 12:46:45 +00:00
Michael Lippautz
ec09a8236c heap: Convert embedder tracing tests to unittests
test-embedder-tracing.cc -> embedder-tracing-unittest.cc

In addition
- Add heap helpers
- CHECK -> EXPECT macros

Bug: v8:12781
Change-Id: Ibd17a4e6d527c963170af54c57f6abc51cb08808
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576127
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79883}
2022-04-08 12:43:55 +00:00
Benedikt Meurer
088de5d391 [inspector] Speed up inspection of large BigInts.
For large BigInts, computing the decimal representation can take a
very long time, so send them as hexadecimal strings instead. Also
make sure to abbreviate the RemoteObject description for bigints
appropriately always.

Also-By: jarin@chromium.org
Fixed: chromium:1068663
Change-Id: I2f7e4e1cbd2f66ce45be307fb787e101d9a8e2a7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3578653
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79872}
2022-04-08 09:30:55 +00:00
Manos Koukoutos
b09d550605 [wasm-gc] Enable runtime subtyping checks for functions
Bug: v8:7748
Change-Id: Ic65c09726994fddf73979b5f25b98f7ce4c5d6ef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3574556
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79870}
2022-04-08 08:19:16 +00:00
Jakob Gruber
6879c515d0 [osr] Enable concurrent OSR
Fixed: v8:12161
Change-Id: Ie6e83dd4f261fff2d1fa8613116e83ef6b61561f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576116
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79857}
2022-04-07 13:24:24 +00:00
Clemens Backes
08e514a894 [codegen][x64] Improve code for float to int64
This improves the code generated for float to int64 conversions on x64.
Instead of explicitly checking the input for specific values and
executing conditional jumps, just convert the integer back to a float
and check if this results in the rounded input. The "success value" is
then materialized via vmov + and instead of via branches.

old:
   7  c4e1fb2cd9           vcvttsd2siq rbx,xmm1
   c  ba01000000           movl rdx,0x1
  11  49ba000000000000e0c3 REX.W movq r10,0xc3e0000000000000
  1b  c441f96efa           vmovq xmm15,r10
  20  c5792ef9             vucomisd xmm15,xmm1
  24  7a08                 jpe 0x3599421714ee  <+0x2e>
  26  7408                 jz 0x3599421714f0  <+0x30>
  28  4883fb01             REX.W cmpq rbx,0x1
  2c  7102                 jno 0x3599421714f0  <+0x30>
  2e  33d2                 xorl rdx,rdx

new:
   7  c463010bf90b         vroundsd xmm15,xmm15,xmm1,0xb
   d  c4e1fb2cd9           vcvttsd2siq rbx,xmm1
  12  c4e1832ac3           vcvtqsi2sd xmm0,xmm15,rbx
  17  c4c17bc2c700         vcmpss xmm0,xmm0,xmm15, (eq)
  1d  c4e1f97ec2           vmovq rdx,xmm0
  22  83e201               andl rdx,0x1

A follow-up step would be to replace the explicitly materialized success
value by a direct jump to the code handling the error case, but that
requires more rewrite in TurboFan.

R=tebbi@chromium.org

Bug: v8:10005
Change-Id: Iaedc3f395fb3a8c11c936faa8c6e55c2dfe86cd9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3560434
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79854}
2022-04-07 12:38:44 +00:00
Benedikt Meurer
a90f1748d2 [inspector] De-flake inspector/debugger/get-possible-breakpoints.js.
Since the inspector does not longer hold on strongly to Script objects
after they were collected by V8, this test was relying on the GC to not
collect the scripts too eagerly in case where nothing else holds on to
the script. So explicitly adding a global object property assignment
here in those cases to ensure that the Script is kept alive.

Fixed: chromium:1314212, v8:12699
Bug: chromium:1246884, chromium:1295659
Change-Id: Ia16fcf841aeb29bf131fc6fa066f120d342f94b2
Doc: https://bit.ly/v8-inspector-script-caching
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576117
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79852}
2022-04-07 12:13:34 +00:00
Leszek Swirski
63af265fd9 [test] Fix missing GC in SingleThreadedDefaultPlatformTest
Bug: v8:12781
Change-Id: I7dfddd886571a16a180bffb8f9fc7a946d5667bc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576113
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79851}
2022-04-07 12:03:25 +00:00
jameslahm
8306599e9b [d8] Add unicode filename support on windows
This is a follow up CL for https://crrev.com/c/3538284.
Tests credited to https://crrev.com/c/3468352.

- Add unicode filename path test.
- Convert ansi encoded filename argv to utf8 encoded on windows. Because
the ansi encoded filename argv may lose some information for unicode
filename, and we need to use GetCommandLineW to get the actual unicode
filename argument. And we convert it to utf8 encoded to be consistent
with subsequent processing.
- Use REPLACEMENT CHARACTER to replace the characters which cannot be
encoded with sys.stdout.encoding in progress.py.

This CL should be **reverted** if new unicode filenames cause problems.

Bug: v8:12541
Change-Id: Ic5c5ae342b3a5b11c3119452af03c9165d429ed7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3568926
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#79850}
2022-04-07 11:40:34 +00:00
Leszek Swirski
3509f2da24 [sandbox] Fix sandbox initialisation in cppgc unittests
Bug: v8:12781
Change-Id: I0df1c8a17482f13d210f7d2424a15e15c71108c0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576115
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Samuel Groß <saelo@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79849}
2022-04-07 11:16:04 +00:00
Clemens Backes
0a1bf43d19 [test] Remove flag that causes contradictions
Some test variants and fuzzers set their own GC interval, so the flag
specified in the regression test causes flag contradictions.
The test failure was flaky anyway, so this change is only a slight
reduction in reproducability, and the test will still be used as seed
for the fuzzers.

R=machenbach@chromium.org

Bug: chromium:1313475
Change-Id: I7c7084ab34fe46d691b841921d42a487cc8a1cad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576114
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79845}
2022-04-07 10:30:04 +00:00
Clemens Backes
9f128f4e9f [base] Remove base::fold and base::all
They can be replaced by std::conjunction and c++17 folding expressions.

R=tebbi@chromium.org

Bug: v8:12425
Change-Id: I109ac904245aab431f11752eff5129fd4361de8a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3570428
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79843}
2022-04-07 09:13:49 +00:00
Georgia Kouveli
16b5fc3c57 [arm64] Remove template argument of PushCPURegList and friends
Callee saved registers do not include the LR anymore, so we can
now remove the last place where we pass a non-default template
argument to PushCPURegList/PopCPURegList (in the code generator).
This makes the template argument redundant, so we can remove the
template altogether.

Change-Id: I07f0c0a10840817df8a5afc1dc74330e290ce5bf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571816
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Georgia Kouveli <georgia.kouveli@arm.com>
Cr-Commit-Position: refs/heads/main@{#79842}
2022-04-07 09:12:45 +00:00