Commit Graph

74143 Commits

Author SHA1 Message Date
Al Muthanna Athamina
95a85701fd Allow V8 to run all unittests presubmit
Search for all files with testing naming convention and run that on v8_presubmit.
Also modify all PRESUBMIT files in the tools directory to include any test file
with the appropriate naming convention.

Bug: chromium:1306474
Change-Id: I61c1b7c71badbbc3b99705289588aa8280824d66
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532266
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79651}
2022-03-29 11:14:09 +00:00
Camillo Bruni
58836f7327 [api] Add warning comment about changing FatalProcessOutOfMemory
The signature of FatalProcessOutOfMemory is used extracting V8 specific
crash information from chrome minidumps.

Change-Id: I625a9ca1f1628c6ddd34cf794cc4205b012ef23e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532267
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79650}
2022-03-29 11:03:41 +00:00
Leszek Swirski
4fd61de7c1 [maglev] Fix over application return stack cleanup
Under over-application (passing more arguments into a function than its
formal parameter count), we need to use the passed argc to clean up the
stack, rather than the formal parameter count. Fix Maglev's Return node
code to do the appropriate check and dynamic sized return.

Bug: v8:7700
Change-Id: I36037d29e14323b336974d4b75b75f5702ce8a28
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3555767
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79649}
2022-03-29 10:39:28 +00:00
jameslahm
9641ce6438 [compiler] Optimize String#includes
This CL adds the reduction for String#includes
and merges the reduction of String#indexOf and
String#includes in JSCallReducer.

This CL does two things:
- Add StringIndexOfIncludesVariant to distinguish
String#indexOf and String#includes.
- Add ReduceStringPrototypeIndexOfIncludes to reduce
for String#indexOf and String#includes.

Bug: v8:12732
Change-Id: Ied75485cf1511956e97ef986fc34a711aae3d1ce
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3552279
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79648}
2022-03-29 10:24:08 +00:00
Thibaud Michaud
1e948174dc [wasm][liftoff] Fix stack move width for full pointers
R=jkummerow@chromium.org

Bug: chromium:1307946
Change-Id: I5827f6ce3e854b440c027f8f4862f5a43b088e01
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3553111
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79647}
2022-03-29 09:47:38 +00:00
Marja Hölttä
8c94b7ec7b [rab/gsab] Fix the rab gsab TA initial map
Bug: v8:11111,chromium:1307310
Change-Id: I41175d759e71d2016880eae1cd42e420ee9cc229
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3540262
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79646}
2022-03-29 07:31:41 +00:00
Arthur Eubanks
133acba828 Remove set but otherwise unused variables
Recent Clang versions have enhanced -Wunused-but-set-variable which now
warns about these.

Bug: chromium:1309955
Change-Id: Id99e3eee60bf2c789e15251f65a192a6bf51f252
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3554603
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79645}
2022-03-29 06:39:17 +00:00
Adam Klein
7e28b58cd7 Revert "Enable PAC and BTI for runtime generated code."
This reverts commit c482a66bd7.

Reason for revert: causes crashes in ChromeOS/MSAN builds:
https://crbug.com/1310642

Original change's description:
> Enable PAC and BTI for runtime generated code.
>
> This patch enables PAC and BTI for runtime generated code when PAC
> is enabled. Additional BTI landing pads will resolve to NOOP when
> running on non BTI device and will not cause functional problems.
>
> Change-Id: I3993481df2c3c47e3e81bfb76a8c355f642cd572
> Bug: chromium:919548, v8:10026
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3548457
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Andre Kempe <andre.kempe@arm.com>
> Cr-Commit-Position: refs/heads/main@{#79630}

Bug: chromium:919548, v8:10026, chromium:1310642
Change-Id: I564efa5327ae038a7b5fb69b416300afebe2cd74
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3556706
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79644}
2022-03-29 00:06:37 +00:00
legendecas
f4eb545e9a [ShadowRealm] Remove unused pending_exception
Fix GCC compilation complaints.

Bug: v8:11989
Change-Id: I547e61342be090cc31825d8fe49463a79a39495f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3553789
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79643}
2022-03-28 23:44:17 +00:00
Junliang Yan
11052db34f ppc64: [baseline] implement JumpIf functions
Change-Id: Idd2c979db120be1e35260786a3f9534d950294b4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3555538
Reviewed-by: Milad Farazmand <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#79642}
2022-03-28 20:57:06 +00:00
Junliang Yan
23ee49ada0 ppc64: [baseline] implement Tail/CallBuiltin
Change-Id: Ife52b4279aa17e73316a77c5b4ef6f03bef763b7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3555886
Reviewed-by: Milad Farazmand <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#79641}
2022-03-28 15:58:55 +00:00
henrika
ede0a4abee Ensures that Builtin events are sent to JIT-code event handlers
Generates callbacks for already existent code by using the
kJitCodeEventEnumExisting option instead of kJitCodeEventDefault.

When working on V8 system instrumentation on Windows, it was found in
https://bugs.chromium.org/p/v8/issues/detail?id=11043#c41 that several
parts of the JS stack was missing.

One missing part is all calls to Builtin methods
(example: Builtin:JSEntryTrampoline) and this change ensures that
events with name "Builtin" are also included in the generated JIT code
events.

Bug: v8:11043
Change-Id: Iaa99e18d799266a7224f848130c4eaf36e8c77fb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3550590
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Henrik Andreasson <henrika@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79640}
2022-03-28 14:15:25 +00:00
Milad Fa
7c6ce251e6 AIX: Update code alignment to 64-bytes
Code alignment was updated to 64-bytes on ppc:
https://crrev.com/c/3528993

This change is required to maintain the same alignment on AIX.

Change-Id: I8cc33c9abad1ceeac050fde30700d315ef549d7f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3552087
Reviewed-by: Vasili Skurydzin <vasili.skurydzin@ibm.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#79639}
2022-03-28 12:42:06 +00:00
Dominik Inführ
a847182056 [heap] Initialize pages with placement-new
Define ctors for BasicMemoryChunk, ReadOnlyPage, MemoryChunk, Page and
LargePage. We can use those with placement-new to initialize pages. We
now initialize chunks at once either for ReadOnlyPage, Page or
LargePage. Previously initialization happened in multiple locations
starting with BasicMemoryChunk::Initialize.

Adding ctors to these classes should improve debugging, since debug
info for classes without ctors was removed with the compiler flag
`-fuse-ctor-homing`.

Change-Id: Ib842bb9b1e93a6576cad8299b7c5dbfe299baa33
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3545092
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79638}
2022-03-28 09:18:55 +00:00
jameslahm
bd7f4823c1 [error] Improve GetExport error message
According to https://tc39.es/ecma262/#sec-InnerModuleLinking
step 10 and https://tc39.es/ecma262/#sec-source-text-module-record-initialize-environment
step 8-25, variables must be declared in Link. And according
to https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-get-p-receiver,
accessing the exported variable with the hole value should
throw uninitialized error.

Bug: v8:12729
Change-Id: I6fd2fcc580f7bafca986448b37adb8ba8f077929
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3552281
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79637}
2022-03-28 09:03:45 +00:00
Danylo Boiko
959dd7d58d [turbolizer] Shortcuts for bidirectional phase switching.
Bidirectional phase switching by shortcuts "n", "b".
Improved selection of nodes when they are splitting or raising to a common ancestor.
Fixed minor inconsistencies in some variable names with the project style.
Added name and email to the AUTHORS file for first-time contribution.

Change-Id: I0c903dbf81c3d1d75503004ce412a81aace06a61
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537008
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79636}
2022-03-28 08:13:32 +00:00
Frank Tang
8b663818fc [Temporal] Add Temporal.Calendar.prototype.year
Spec Text:
https://tc39.es/proposal-temporal/#sec-temporal.calendar.prototype.year

Note- this is only the non-intl version. intl version in
https://tc39.es/proposal-temporal/#sup-temporal.calendar.prototype.year
will be implemented in later cl.

Bug: v8:11544
Change-Id: Ifadcdb4efe00a9954d5ac4c1154420c4903f28d5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3531553
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79635}
2022-03-26 23:18:06 +00:00
Frank Tang
cdafded496 [Temporal] Add Calendar.prototype.daysInYear
Spec Text:
https://tc39.es/proposal-temporal/#sec-temporal.calendar.prototype.daysinyear

Note- this is only the non-intl version. intl version in
https://tc39.es/proposal-temporal/#sup-temporal.calendar.prototype.daysinyear
will be implemented in later cl.

Bug: v8:11544
Change-Id: I627fcf82641659c4697395057ee664a37f237228
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3531557
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79634}
2022-03-26 22:16:54 +00:00
Frank Tang
c232d789c7 [Temporal] Add Duration.prototype.(abs|negated)
Also add AO: CreateNegatedTemporalDuration

Spec Text:
https://tc39.es/proposal-temporal/#sec-temporal.duration.prototype.abs
https://tc39.es/proposal-temporal/#sec-temporal.duration.prototype.negated
https://tc39.es/proposal-temporal/#sec-temporal-createnegatedtemporalduration

Bug: v8:11544
Change-Id: Ie522a7446f40c946c30f2e90c5f6c7fbc96c41eb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3380101
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79633}
2022-03-26 22:15:14 +00:00
jameslahm
89ed081c17 [runtime] Add async-stack-trace support for Promise.allSettled
... with zero cost.

Bug: v8:9357
Change-Id: I66985c3fd3e7b4efa354eb564c641562cf55ab49
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3518909
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79632}
2022-03-26 12:04:24 +00:00
Tobias Tebbi
cfa4581e69 Revert "[maglev] Remove input_count from Node constructors"
This reverts commit 2ee36e4cf5.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20UBSan/20570/overview

Original change's description:
> [maglev] Remove input_count from Node constructors
>
> Change the NodeBase bitfield to be out-of-line, and initialised by
> NodeBase::Allocate. This means that we don't have to thread the
> input_count through the Derived constructor just to pass it back into
> the NodeBase constructor, and so we can remove those arguments (plus the
> opcode ones while we're at it).
>
> Bug: v8:7700
> Change-Id: I0c96db8cdd05ef106b3cfeb31c5e0d4770d13cc9
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3553103
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79627}

Bug: v8:7700
Change-Id: Ice38908e85f2980dbbe66c61fab17326b3d0be41
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3553005
Owners-Override: Tobias Tebbi <tebbi@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79631}
2022-03-25 17:26:24 +00:00
André Kempe
c482a66bd7 Enable PAC and BTI for runtime generated code.
This patch enables PAC and BTI for runtime generated code when PAC
is enabled. Additional BTI landing pads will resolve to NOOP when
running on non BTI device and will not cause functional problems.

Change-Id: I3993481df2c3c47e3e81bfb76a8c355f642cd572
Bug: chromium:919548, v8:10026
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3548457
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Andre Kempe <andre.kempe@arm.com>
Cr-Commit-Position: refs/heads/main@{#79630}
2022-03-25 16:28:53 +00:00
Tobias Tebbi
e71ce3093d Revert "[heap] Only start incremental marking when V8 is not in GC VM state."
This reverts commit f124b28d46.

Reason for revert: https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket/8818719400214419665/+/u/Check_-_stress_concurrent_allocation__flakes_/flush-baseline-code

Original change's description:
> [heap] Only start incremental marking when V8 is not in GC VM state.
>
> Bug: v8:12503
> Change-Id: Icda291d9770c46c7fee3c70dd4df97f320b1956a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3398113
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Hannes Payer <hpayer@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79623}

Bug: v8:12503
Change-Id: I067b308cfc4511d89144d2bb65a1dba24db62179
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3553104
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Owners-Override: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79629}
2022-03-25 16:07:53 +00:00
legendecas
0a0ad98a5a [ShadowRealm] WrappedFunction properties
Implement WrappedFunction properties name/length.

Bug: v8:11989
Change-Id: I050af5814537552ef6c2077802ffc726f2e08fa3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3507201
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Chengzhong Wu <legendecas@gmail.com>
Cr-Commit-Position: refs/heads/main@{#79628}
2022-03-25 16:00:33 +00:00
Leszek Swirski
2ee36e4cf5 [maglev] Remove input_count from Node constructors
Change the NodeBase bitfield to be out-of-line, and initialised by
NodeBase::Allocate. This means that we don't have to thread the
input_count through the Derived constructor just to pass it back into
the NodeBase constructor, and so we can remove those arguments (plus the
opcode ones while we're at it).

Bug: v8:7700
Change-Id: I0c96db8cdd05ef106b3cfeb31c5e0d4770d13cc9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3553103
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79627}
2022-03-25 15:47:24 +00:00
Tobias Tebbi
1d96641ff7 Revert "Reland "Reland "[baseline] Enable concurrent sparkplug"""
This reverts commit 6819f75daf.

Reason for revert: https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket/8818719400214419665/+/u/Check_-_minor_mc/loop-unrolling

Original change's description:
> Reland "Reland "[baseline] Enable concurrent sparkplug""
>
> This reverts commit 5d6a16fb64.
>
> Reason for revert: it was a flake
>
> Original change's description:
> > Revert "Reland "[baseline] Enable concurrent sparkplug""
> >
> > This reverts commit fee91f9afa.
> >
> > Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Mac64/44699/overview
> >
> > Original change's description:
> > > Reland "[baseline] Enable concurrent sparkplug"
> > >
> > > Issue that cause the revert was fixed: v8:12713
> > > https://bugs.chromium.org/p/v8/issues/detail?id=12713
> > >
> > > This is a reland of commit f01a609814
> > >
> > > Original change's description:
> > > > [baseline] Enable concurrent sparkplug
> > > >
> > > > Bug: v8:12054
> > > > Change-Id: I1b0ee1a9541a75412b882b259e421aa6e88317da
> > > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3259658
> > > > Auto-Submit: Victor Gomes <victorgomes@chromium.org>
> > > > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> > > > Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> > > > Cr-Commit-Position: refs/heads/main@{#79485}
> > >
> > > Bug: v8:12054
> > > Change-Id: Iafba22e3fa3b38eddb226db6cd5afdb7e3e6b435
> > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3528992
> > > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> > > Commit-Queue: Victor Gomes <victorgomes@chromium.org>
> > > Cr-Commit-Position: refs/heads/main@{#79618}
> >
> > Bug: v8:12054
> > Change-Id: I3ba60433fdbb5617900c83d022e4dd6f830695f9
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3550271
> > Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
> > Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> > Owners-Override: Tobias Tebbi <tebbi@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@{#79619}
>
> Bug: v8:12054
> Change-Id: Ia0fe1df00f5e715ceda46fbcdc48aed0f0190362
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3550272
> Owners-Override: Tobias Tebbi <tebbi@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Reviewed-by: Victor Gomes <victorgomes@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79622}

Bug: v8:12054
Change-Id: I5e75f0467d5617bb6e81d7d0031f298c09194685
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3553107
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Tobias Tebbi <tebbi@google.com>
Owners-Override: Tobias Tebbi <tebbi@google.com>
Cr-Commit-Position: refs/heads/main@{#79626}
2022-03-25 15:16:54 +00:00
Igor Sheludko
a2cae2180a [runtime] Fix handling of interceptors, pt.2
Stores to undeclared global in strict mode should throw ReferenceError.

Bug: chromium:1309225
Change-Id: Iac7c55da2ff9c16e488b4fc66408c5300469873e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3553099
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79625}
2022-03-25 13:34:31 +00:00
Michael Achenbach
b086206161 Reland "[tools] Clean up py2 code"
This is a reland of commit 1289704aae

Mac-arm64 problem fixed by:
https://crrev.com/c/3550199

Original change's description:
> [tools] Clean up py2 code
>
> Bug: chromium:1292013
> Change-Id: Ic2c3a197005a2136bb0eda4cbb36d8eb57f42a7c
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3523047
> Reviewed-by: Liviu Rau <liviurau@chromium.org>
> Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79507}

Bug: chromium:1292013
Change-Id: Iadf0ccf94c82012088b76a866296c8e008dff02f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3550274
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79624}
2022-03-25 12:14:26 +00:00
Hannes Payer
f124b28d46 [heap] Only start incremental marking when V8 is not in GC VM state.
Bug: v8:12503
Change-Id: Icda291d9770c46c7fee3c70dd4df97f320b1956a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3398113
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79623}
2022-03-25 11:53:23 +00:00
Tobias Tebbi
6819f75daf Reland "Reland "[baseline] Enable concurrent sparkplug""
This reverts commit 5d6a16fb64.

Reason for revert: it was a flake

Original change's description:
> Revert "Reland "[baseline] Enable concurrent sparkplug""
>
> This reverts commit fee91f9afa.
>
> Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Mac64/44699/overview
>
> Original change's description:
> > Reland "[baseline] Enable concurrent sparkplug"
> >
> > Issue that cause the revert was fixed: v8:12713
> > https://bugs.chromium.org/p/v8/issues/detail?id=12713
> >
> > This is a reland of commit f01a609814
> >
> > Original change's description:
> > > [baseline] Enable concurrent sparkplug
> > >
> > > Bug: v8:12054
> > > Change-Id: I1b0ee1a9541a75412b882b259e421aa6e88317da
> > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3259658
> > > Auto-Submit: Victor Gomes <victorgomes@chromium.org>
> > > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> > > Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> > > Cr-Commit-Position: refs/heads/main@{#79485}
> >
> > Bug: v8:12054
> > Change-Id: Iafba22e3fa3b38eddb226db6cd5afdb7e3e6b435
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3528992
> > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> > Commit-Queue: Victor Gomes <victorgomes@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#79618}
>
> Bug: v8:12054
> Change-Id: I3ba60433fdbb5617900c83d022e4dd6f830695f9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3550271
> Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Owners-Override: Tobias Tebbi <tebbi@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@{#79619}

Bug: v8:12054
Change-Id: Ia0fe1df00f5e715ceda46fbcdc48aed0f0190362
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3550272
Owners-Override: Tobias Tebbi <tebbi@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79622}
2022-03-25 11:32:43 +00:00
jameslahm
c05be62fa2 [compiler] Optimize String.prototype.startsWith
We could optimize String#startsWith in JSCallReducer for
three conditions:
- If search_element is definitely not a string, we make no change.
- If search_element is definitely a string and its length is less
or equal than max inline matching sequence threshold, we could
inline the entire matching sequence.
- Else we try to inline, and have a runtime deopt if search_element
is not a string.

Bug: v8:8400
Change-Id: I505090b91d35fbc2c91cdf985717c68135cba807
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3517936
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79621}
2022-03-25 11:01:05 +00:00
Anton Bikineev
be85909666 cppgc: young-gen: Fix MSVC build
Bug: chromium:1029379
Change-Id: Ia1de91ab0ffc63912ce26349d095881a7a141ff8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3550269
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79620}
2022-03-25 10:49:46 +00:00
Tobias Tebbi
5d6a16fb64 Revert "Reland "[baseline] Enable concurrent sparkplug""
This reverts commit fee91f9afa.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Mac64/44699/overview

Original change's description:
> Reland "[baseline] Enable concurrent sparkplug"
>
> Issue that cause the revert was fixed: v8:12713
> https://bugs.chromium.org/p/v8/issues/detail?id=12713
>
> This is a reland of commit f01a609814
>
> Original change's description:
> > [baseline] Enable concurrent sparkplug
> >
> > Bug: v8:12054
> > Change-Id: I1b0ee1a9541a75412b882b259e421aa6e88317da
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3259658
> > Auto-Submit: Victor Gomes <victorgomes@chromium.org>
> > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> > Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#79485}
>
> Bug: v8:12054
> Change-Id: Iafba22e3fa3b38eddb226db6cd5afdb7e3e6b435
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3528992
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Commit-Queue: Victor Gomes <victorgomes@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79618}

Bug: v8:12054
Change-Id: I3ba60433fdbb5617900c83d022e4dd6f830695f9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3550271
Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Owners-Override: Tobias Tebbi <tebbi@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@{#79619}
2022-03-25 10:45:13 +00:00
Victor Gomes
fee91f9afa Reland "[baseline] Enable concurrent sparkplug"
Issue that cause the revert was fixed: v8:12713
https://bugs.chromium.org/p/v8/issues/detail?id=12713

This is a reland of commit f01a609814

Original change's description:
> [baseline] Enable concurrent sparkplug
>
> Bug: v8:12054
> Change-Id: I1b0ee1a9541a75412b882b259e421aa6e88317da
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3259658
> Auto-Submit: Victor Gomes <victorgomes@chromium.org>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79485}

Bug: v8:12054
Change-Id: Iafba22e3fa3b38eddb226db6cd5afdb7e3e6b435
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3528992
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79618}
2022-03-25 09:54:13 +00:00
Lu Yahan
8bfffd6a61 [riscv64] Use macros to control the compilation of RVV
Change-Id: Iac021f8666058042f5c26cf07d0f3810a1d451fc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3528374
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Yahan Lu <yahan@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#79617}
2022-03-25 09:00:44 +00:00
Darshan Sen
ee29e41953 [compiler] Prevent extra copies of RpoNumber
This fixes the following compiler warning:

```
src/compiler/backend/mid-tier-register-allocator.cc:2046:26: warning: loop variable 'succ' of type 'const
      v8::internal::compiler::RpoNumber' creates a copy from type 'const v8::internal::compiler::RpoNumber'
      [-Wrange-loop-analysis]
    for (const RpoNumber succ : block->successors()) {
                         ^
src/compiler/backend/mid-tier-register-allocator.cc:2046:10: note: use reference type 'const
      v8::internal::compiler::RpoNumber &' to prevent copying
    for (const RpoNumber succ : block->successors()) {
         ^~~~~~~~~~~~~~~~~~~~~~
                         &
```

Signed-off-by: Darshan Sen <raisinten@gmail.com>
Change-Id: I41a9b6aa1ee16bf140f326410ae864b425509c2d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3538285
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79616}
2022-03-25 08:41:34 +00:00
Andrey Kosyakov
567fc46265 Convert inspector_protocol/roll.py to python3
Bug: v8:1306483
Change-Id: I2f1baf1374e82418c117f9126db2388b84ef46ef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3530110
Reviewed-by: Almothana Athamneh <almuthanna@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79615}
2022-03-24 18:07:17 +00:00
Marja Hölttä
c6b68cbfbd [super IC] Turn off super ICs
They make assumptions which don't hold for API handlers.

Bug: v8:9237,chromium:1308360
Change-Id: I9f122c4e75a24d83ef3653cbf7a223ed522e4d13
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3548899
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79614}
2022-03-24 17:59:52 +00:00
Igor Sheludko
0981e91a4f [runtime] Fix handling of interceptors
Bug: chromium:1309225
Change-Id: Ifd62639a2aa18b633e7cf36632677ee16c977afd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3548458
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79613}
2022-03-24 17:50:12 +00:00
Milad Fa
d7966ecda2 PPC: Introduce Power10 prefixed instructions
P10 comes with prefixed instruction (2 x 4-byte instructions)
which allow for using larger immediate values. `paddi` has
been added in this CL which uses a 34-bit immediate.

Prefixed instructions cannot cross 64-byte boundaries, i.e we cannot
have the first 4-bytes on one side and the second 4-bytes emitted on
the other side of the boundary. Therefore we need to align generated
code to 64 bytes and emit a nop whenever the boundary is being crossed
midway (check emit_prefix).

Change-Id: I90e9953089214e15eeef0d70147ea5943fe05f45
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3528993
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#79612}
2022-03-24 17:25:42 +00:00
Darius M
02fc37d37c [compiler] Better code generation for branches on binops
Commit 0719ace66e improves the code
generated for comparisons by avoiding the materalization of the
comparison bit.

Now, this commit aims at doing this same improvement for binary
operations. Since binary operations set the ZF flag, there is no
reason to insert a "== 0" comparison.

Note that this commit might increase register pressure, which might
actually reduce performance. It's hard to anticipate, so we'll land
it, and revert it if it's actually bad for performance.


Bug: v8:12484
Change-Id: I963f0c4afdd59b35b4bac468e47d987836433163
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3545165
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79611}
2022-03-24 17:04:52 +00:00
Shu-yu Guo
bcf43eb780 [string] Add additional ThinString test
Add a test for the case where SlicedStrings of ThinStrings are looked up
in the string table, testing the path that the original string's length
differs from the actual string's length.

Bug: chromium:1309767
Change-Id: I909c64397bf28ec33c3324d94882fbfe81ac4109
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3549837
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79610}
2022-03-24 16:46:12 +00:00
Victor Gomes
c7ce7c7c17 [maglev] Remove succeed check in concurrent dispatcher
Maglev compilation can currently fail, e.g with unsupported bytecodes.

Bug: v8:7700
Change-Id: I837d69a5f9c27d4dc6fa9d03369f045fb5175d61
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541921
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79609}
2022-03-24 15:12:23 +00:00
Nico Hartmann
fa374fc934 [turbofan] Fix a rare false positive in SLVerifier
Bug: chromium:1309769, v8:12619
Change-Id: I880c7326f2ec91f1aa985d6b7ed67f8f5afc074b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3548897
Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79608}
2022-03-24 15:04:23 +00:00
Leszek Swirski
0ca0b849c6 [maglev] Move Checkpoints out of the IR
Change Checkpoints from IR Nodes to just normal Zone objects, pointed to
by the deopting Node. Also merge Checkpoint and DeoptimizationInfo --
this has the side effect that multiple Nodes that share a checkpoint
will point to the exact same deopt call.

Bug: v8:7700
Change-Id: Ib36aa13afe3af6a0a22d2cfe80a13fef4bea1227
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3545179
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79607}
2022-03-24 14:43:02 +00:00
Anton Bikineev
f8e0b4c6f2 cppgc: Always keep ObjectStartBitmap in consistent state
Currently, OSB can not be safely accessed if sweeping is in progress.
This can, however, be easily lifted with atomic stores.

Having the consistent bitmap is needed for the generational barrier for
source objects (to retrieve the source object beginning).

Bug: chromium:1029379
Change-Id: I5fb8db579f881ddf240ce68ad51fa8264ee645dc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3545071
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79606}
2022-03-24 14:39:24 +00:00
Marja Hölttä
0129218b08 [rab/gsab] Disable a test in stress-snapshot mode
It's hitting unimplemented code paths.

Bug: v8:11111, v8:12731
Change-Id: Icbffced6cbe207426363daa5f3b9ff5677b58b6c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3548816
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79605}
2022-03-24 13:35:42 +00:00
Marja Hölttä
96c5daaea6 Revert "[super IC] Fix receiver vs lookup start object confusion"
This reverts commit 9c3d4b3556.

Reason for revert: This is not the right fix (see bug).

Original change's description:
> [super IC] Fix receiver vs lookup start object confusion
>
> Bug: v8:9237,chromium:1308360
> Change-Id: I11e3c14a6cecb9d88a834711fb6252191494d5f7
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3545172
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Commit-Queue: Marja Hölttä <marja@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79571}

Bug: v8:9237,chromium:1308360
Change-Id: I0efa6ab561482ffc323b63500acfeb80598f3e7c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3548896
Auto-Submit: Marja Hölttä <marja@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79604}
2022-03-24 13:23:42 +00:00
Joyee Cheung
4ee68d81b9 [ic] fix handling of existing properties in Define{Keyed|Named}OwnIC
- When the property being defined with DefineKeyedOwnIC or
  DefineNamedOwnIC already exists, we should use the slow path to
  check if the operation is allowed in case the property is
  non-configurable or Object.preventExtensions() has been called on
  the property.
- Since KeyedStoreIC:Store() reuses StoreIC::Store() when the key is a
  name, we should use Runtime::DefineObjectOwnProperty() for
  DefineKeyedOwnIC too.
- When dealing with public fields, Runtime::DefineObjectOwnProperty()
  should use JSReceiver::CreateDataProperty() instead of
  Object::SetProperty() for the specified semantics. This patch also
  adds JSReceiver::AddPrivateField() for it and StoreIC::Store to
  define private fields without triggering traps or checking
  extensibility.
- To emit a more specific error message when redefining properties
  on non-extensible objects, Object::AddDataProperty() now also takes
  a EnforceDefineSemantics enum to distinguish between set and define.
- Drive-by: fix JSReceiver::CheckIfCanDefine() which should check for
  extensibility even if the configurability check passes.

Bug: chromium:1259950, v8:9888
Change-Id: Ib1bc851ffd4b9c3a0e98cac96dafe743c08ee37e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3517934
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Cr-Commit-Position: refs/heads/main@{#79603}
2022-03-24 12:36:42 +00:00
Leszek Swirski
7b3ede331e [maglev] Remove diff encoding of checkpoints
Remove StoreToFrame and the general diff encoding for checkpoints, and
instead make all Checkpoints immediately copy the live part of the
interpreter frame state.

This means that we don't need to recreate the frame state during graph
processing, and we don't have to copy the checkpoint's state for storing
in the deferred DeoptimizationInfo.

In theory the diff encoding was meant to save zone memory for unused
checkpoints, and for checkpoints that don't differ much from each other.
However,

  a) We expect to do most checkpoint elimination during graph building,
     so the assumption that many checkpoints will be unused seems less
     probable, and

  b) We need to copy the checkpoint's frame state for emitting deopts,
     so we don't actually end up avoiding doing the copies.

So, we can simplify things by removing this complexity.

Bug: v8:7700
Change-Id: Iff9743fabbf7a017cccf0ece76a797c571764ea6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3545178
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79602}
2022-03-24 12:33:43 +00:00