Commit Graph

61745 Commits

Author SHA1 Message Date
Darius M
de04959f17 [compiler] Remove delayed string constants
StringConstantXXX were introduced when we switched to concurrent
compilation, as a way to build strings in Turbofan in a background
thread, without having to actually allocate them on the main heap
from the background. See https://crrev.com/c/1221807.

Now that we have local heaps, we can actually allocate strings from
the background, making StringConstantXXX useless.

Moreover, we would fold constant string concatenations into
ConsString, which sounds a bit dubious for performance. Now, small
constant string concatenations will be folded into SeqStrings, while
larger ones will remain ConsString, just to avoid the quadratic
worst-case.

Change-Id: I0479d16aa5691c9d774187c4cc0d03ff4fe2b4f9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3811291
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82381}
2022-08-11 07:41:53 +00:00
jameslahm
a784ec8ae7 Reland "[maglev] Support LdaModuleVariable and StaModuleVariable"
This is a reland of commit 532ca59910

Fix interger overflow when result_location is invalid in
MaglevCompiler::InReturnValues.

Original change's description:
> [maglev] Support LdaModuleVariable and StaModuleVariable
>
> Bug: v8:7700
> Change-Id: I036ac71324e0c1c96a4da4aacdb5a6718726db31
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3821203
> Reviewed-by: Victor Gomes <victorgomes@chromium.org>
> Commit-Queue: 王澳 <wangao.james@bytedance.com>
> Cr-Commit-Position: refs/heads/main@{#82347}

Bug: v8:7700
Change-Id: I24f56691eefd1c6cb695fedd3b5c14264bb17943
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3824942
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82379}
2022-08-11 06:57:23 +00:00
Jakob Linke
4be7742f56 [compiler] Extend Maglev tiering tracing
Add tracing for ML compilation begin and end events.

Drive-by: Slight refactors of related tracing functions for other tiers.

Bug: v8:7700
Change-Id: I8d7633c63642fc6d4418c71d87955cf3bcf1d496
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3825779
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82378}
2022-08-11 06:55:42 +00:00
Simon Zünd
dc84c235a1 [debug] Simplify debug scope search
The CL https://crrev.com/c/3807594 changed the scope retrieval search
to a DFS over the scope tree. This makes it no longer necessary to
special case for the `DefaultBaseConstructor` scope so we can delete
that code.

A separate follow-up will prune the DFS slightly but not as much as
we tried to initially.

R=kimanh@chromium.org

Bug: chromium:1348186
Change-Id: Ia54bd5e301aaeb195953b1384077cd30b6b6ef59
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3825777
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82377}
2022-08-11 06:50:53 +00:00
Jakob Linke
c927137d78 [maglev] Abort compilation when deps fail to install
.. and allow recompilation attempts in the future. This roughly matches
Turbofan behavior, which also aborts and may later recompile.

Deps can fail e.g. when the heap state changes concurrently during the
compilation process.

Bug: v8:7700
Change-Id: I517adcca7ec5a7dff14b7ca7dba766e74564bd01
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3825778
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82376}
2022-08-11 06:48:28 +00:00
Dominik Inführ
c5d4812196 [heap] Add shared barrier to RecordWrite builtin
This CL adds the shared barrier to the RecordWrite builtin which is
used in generated code for builtins, interpreted and optimized code.

The out-of-line part of the barrier now checks whether either the
POINTERS_TO_HERE_ARE_INTERESTING or the IN_SHARED_HEAP bit is set in
the value object's page flags.

Outside of marking the RecordWrite builtin now needs to check whether
to insert into the generational or shared remembered set. Inserting
into the shared remembered set will always call into C++ code.

During marking the RecordWrite builtin now also needs to check whether
this store created an old-to-shared pointer.

Bug: v8:11708
Change-Id: Iaca4c3c0650aece4326936d7d63754a23cd0a028
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3779679
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82375}
2022-08-11 06:39:42 +00:00
jiepan
e9c1884e81 [turbofan][x64] Use leaq for Int64Mul if possiable
Change-Id: Ic81be39ed0666c708f9129bef1e75268afc7faf1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3807123
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Jie Pan <jie.pan@intel.com>
Cr-Commit-Position: refs/heads/main@{#82374}
2022-08-11 06:36:12 +00:00
Jakob Linke
68c158ab20 [compiler] Refactor Finalize* signatures
.. to match behavior. According to the old signatures, the functions
returned bool (they actually returned CompilationJob::Status). This only
worked because return values are unused. Change to void return type
instead.

Drive-by: Code reuse in FinalizeMaglevCompilationJob.

Bug: v8:7700
Change-Id: I45f75121c230063dec96a5197cc9fdc3b64aae6f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3822683
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82373}
2022-08-11 06:23:25 +00:00
Shu-yu Guo
b6d4d9be9c Reland^2 "[shared-struct] Add Atomics.Condition"
This is a reland of commit b1020a4345

Changes since revert:
- Fixed global safepoint interrupts in
https://chromium-review.googlesource.com/c/v8/v8/+/3820913

Original change's description:
> Reland "[shared-struct] Add Atomics.Condition"
>
> This is a reland of commit e2066ff6bf
>
> Changes since revert:
> - Rebased against c991852491, which
>   uses the external pointer table for the WaiterQueueNode stored
>   in the state field when compressing pointers. This relaxes
>   the alignment requirement of the state field to be 4-bytes when
>   compressing pointers.
> - Moved the state field into the JSSynchronizationPrimitive base
>   class, since alignment and padding can now be made simpler.
>
> Original change's description:
> > [shared-struct] Add Atomics.Condition
> >
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3630350
> > Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> > Reviewed-by: Adam Klein <adamk@chromium.org>
>
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3763787
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>

Bug: v8:12547
Change-Id: Ibc6de74c7853e4ea766ff2c70f92339ba69f2675
Cq-Include-Trybots: luci.v8.try:v8_linux_arm64_rel_ng,v8_linux64_tsan_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820901
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82368}
2022-08-11 00:12:22 +00:00
Frank Tang
267889f6c2 [Temporal] Fix bug in ScanCalendarDateTimeTimeRequired
Split from cl/3822342
Should advance the length of the TimeZone

Spec Text:
https://tc39.es/proposal-temporal/#prod-CalendarDateTimeTimeRequired

Bug: v8:11544
Change-Id: Ic16a16ac41c29cb04136030b2f2c8b78022f8241
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3824879
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82367}
2022-08-10 23:44:12 +00:00
Shu-yu Guo
2e87bf5ac8 [heap] Set interrupt when requesting global safepoints
Bug: v8:11708
Change-Id: Iac70ab6701e691b2975856be69892daadd814f70
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820913
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82366}
2022-08-10 23:17:24 +00:00
Omer Katz
7a2612691c [heap] Revise page iterations
mark-compact.cc: Iterate over all new space pages.
heap-layout-tracer.cc: Iterate over the paged new space.

Bug: v8:12612
Change-Id: I4d8dfc48632908a80793a77c211020452c675ecf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3823134
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@{#82365}
2022-08-10 22:43:22 +00:00
Shu-yu Guo
0dc6e03727 [compiler] Park main thread while awaiting compile tasks
Currently a deadlock can result on heap teardown during the shared heap
verification which performs a global safepoint. The heap teardown awaits
compile tasks, while the compile helper thread is waiting on a
global safepoint.

Bug: v8:11708
Change-Id: I8328a4b142cb9045bfaf592ac4f4dd259ba0d397
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820354
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82364}
2022-08-10 21:43:52 +00:00
Frank Tang
3f0c44148d [Temporal] Fix ToRelativeTemporalObject
Change to use Handle<Object> instead of Handle<String>
for calendar and offset_string.

Spec text:
https://tc39.es/proposal-temporal/#sec-temporal-torelativetemporalobject

Bug: v8:11544
Change-Id: Ia9051f176e0e91a362b0c6b9edf6fea5a53ddcf2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3808256
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82363}
2022-08-10 21:30:22 +00:00
Milad Fa
d4e3fa9a32 PPC/s390: [masm] Move tiering logic to macro-assembler
Port ca33c73e7c

Original Commit Message:

    .. since these functions will also be used by Maglev codegen.

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

Change-Id: Icccc06b76cd61902900b0deecbfe1fbe46202235
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3822670
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#82362}
2022-08-10 20:47:21 +00:00
Camillo
e9bd3c64c1 Reland "[d8] Dump stack trace on d8 tests timeouts on posix systems"
This is a reland of commit 5592bad963

- Disable timeout signal handler with --fuzzing
- Properly initialize sigaction object

Original change's description:
> [d8] Dump stack trace on d8 tests timeouts on posix systems
>
> - Add a SIGTERM handler in d8 that dupms the stack trace
> - Send SIGTERM before SIGKILL in the test runner
>
> Bug: v8:13115
> Change-Id: I75285f33caabab61ff6ae83c1fbc6faf45cf595a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3791906
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Commit-Queue: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82173}

Bug: v8:13115
Change-Id: I115cc3f671ebe11ba204e75a6fc358ca3477e950
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820221
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82361}
2022-08-10 20:46:15 +00:00
Shu-yu Guo
b0929a9350 Revert "[base] Add new API to protect data memory"
This reverts commit 9d36b2dd0d.

Reason for revert: Win64 crashes
https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Win64%20-%20debug/43496/overview

Original change's description:
> [base] Add new API to protect data memory
>
> This adds a new {base::OS::SetDataReadOnly} method, which is similar to
> {SetPermissions(kRead)}, but using another system call on Windows such
> that it works on pages in the data segment.
> {VirtualAlloc} will fail if called on a page of the data section,
> whereas {VirtualProtect} succeeds. For the general {SetPermissions}
> API we still want to use {VirtualAlloc} though, as it also changes the "committed" state of the pages.
>
> Note that we do not add a platform API for this, as the memory was
> never allocated through the platform. We just directly protect it in
> V8.
>
> R=​mlippautz@chromium.org
>
> Bug: v8:12887
> Change-Id: If83bf6e5c500cc5cf08c76d04dfac5e2b4d35a2d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820482
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82349}

Bug: v8:12887
Change-Id: I86fffa60d6766dcdaf44f57f18266fec22eb9016
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3824409
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82360}
2022-08-10 20:45:12 +00:00
Jakob Linke
d55c644e95 [maglev] Fix leaks related to destructors and zone allocation
The zone-allocated objects, the destructor is never called. Such
objects must therefore never contain members that themselves have
non-trivial destructors, e.g. std containers.

Fix occurrences of this antipattern in Maglev.

Bug: v8:7700
Change-Id: I6892cf5203bb6e842397fd4292918b18134f97cc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3822672
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82358}
2022-08-10 16:59:21 +00:00
Omer Katz
4e88cc71eb [heap] Revise new space verification
PagedNewSpace requires a different way of iterating over new space.
This is because we can no longer assume that everything before top is
allocated and everything after is free.

Bug: v8:12612
Change-Id: Iedd36a6d3dc5019553f58f1ba9f5d06529a7ce9c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3823129
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82357}
2022-08-10 16:58:19 +00:00
Adam Klein
e928d863f5 Revert "[maglev] Support LdaModuleVariable and StaModuleVariable"
This reverts commit 532ca59910.

Reason for revert: UBSan failures (integer overflow):
https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20UBSan/22615/overview

Original change's description:
> [maglev] Support LdaModuleVariable and StaModuleVariable
>
> Bug: v8:7700
> Change-Id: I036ac71324e0c1c96a4da4aacdb5a6718726db31
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3821203
> Reviewed-by: Victor Gomes <victorgomes@chromium.org>
> Commit-Queue: 王澳 <wangao.james@bytedance.com>
> Cr-Commit-Position: refs/heads/main@{#82347}

Bug: v8:7700
Change-Id: Iedbcb80a2ec41f299105bb814650ec4eff30db0d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3824718
Auto-Submit: Adam Klein <adamk@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@{#82356}
2022-08-10 16:55:24 +00:00
jameslahm
cd6705d138 [maglev] Support CopyDataPropertiesWithExcludedPropertiesOnStack
... intrinsic.

This CL also adds stack arguments support in CallBuiltin.

Bug: v8:7700
Change-Id: I59d900414585f724c48f1557ba606f5b61cfb6da
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3813073
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#82355}
2022-08-10 14:47:44 +00:00
Omer Katz
6d5f9030a7 [heap] Some small PagedNewSpace fixes
Bug: v8:12612
Change-Id: Ibd20ba65e81b86239e254b945c4c6c9c6137b714
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3822687
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82354}
2022-08-10 14:37:34 +00:00
Lu Yahan
4ae65adedd [riscv][masm][cleanup] Refactor call related assembler options
Port commit 00746406cf

Change-Id: I9bd985b882ca2e39b24131bd6e0609920b826398
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3823859
Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#82353}
2022-08-10 14:35:43 +00:00
ishell@chromium.org
8daad0ea86 [ext-code-space] Support disassembly of CodeT objects
... which will be necessary once builtins become Code-less.

Bug: v8:11880
Change-Id: If48739c3a058e6baf3c2e062d8eaace062c27592
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3822686
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82352}
2022-08-10 14:06:06 +00:00
Jakob Linke
0bc4b452af [maglev] Implement Maglev-to-Turbofan tiering
ML-TF tiering remains very similar to Ignition-TF tiering:

- When the interrupt budget is exhausted, enter the TieringManager
  which potentially decides to tier up and sets the appropriate
  TieringState on the FeedbackVector.
- The prologue on ML function entry recognizes the TieringState (and
  also available cached TF code) and starts compilation and/or jumps
  into optimized code.

TODOs:

- ML-to-TF OSR is not yet supported.
- ML code is no longer cached on the FeedbackVector.
- Tracing is rudimentary.
- The generated function-entry prologue is fairly large and must be
  either minimized or extracted into a builtin.
- Tiering involving Sparkplug is not entirely robust yet (Sparkplug
  code may be installed with unexpected timing).

Bug: v8:7700
Change-Id: I86b0692477f51b9967f318a4093bc874344120b3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3629149
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82351}
2022-08-10 14:00:53 +00:00
Camillo
012fa89948 [runtime] Improve builtins PGO logging
- Add explicit --turbo-profiling-output and --turbo-profiling-input
- Rename --turbo-profiling-log-file to --turbo-profiling-input
- No longer log PGO data to v8.log
- Add runtime %GetAndResetTurboProfilingData helper function for
  more controlled logging within chrome
- Rewrite generate.py script to use more python3

Bug: v8:10470
Change-Id: Ib817b5c3793a0a7ae77103075ea2d6f6d0282150
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820381
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82350}
2022-08-10 13:55:54 +00:00
Clemens Backes
9d36b2dd0d [base] Add new API to protect data memory
This adds a new {base::OS::SetDataReadOnly} method, which is similar to
{SetPermissions(kRead)}, but using another system call on Windows such
that it works on pages in the data segment.
{VirtualAlloc} will fail if called on a page of the data section,
whereas {VirtualProtect} succeeds. For the general {SetPermissions}
API we still want to use {VirtualAlloc} though, as it also changes the "committed" state of the pages.

Note that we do not add a platform API for this, as the memory was
never allocated through the platform. We just directly protect it in
V8.

R=mlippautz@chromium.org

Bug: v8:12887
Change-Id: If83bf6e5c500cc5cf08c76d04dfac5e2b4d35a2d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820482
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82349}
2022-08-10 13:41:54 +00:00
Clemens Backes
e5ffe90f5a [wasm] Switch back to boolean enums
This reverts https://crrev.com/c/3778717, and also switches "Promise"
to a boolean enum.
The underlying clang crash is fixed, see linked issue.

R=thibaudm@chromium.org

Bug: chromium:1344641
Change-Id: I7fac50eb4f1155aca1c101f01892df78cdde46e2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3823128
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82348}
2022-08-10 13:40:34 +00:00
jameslahm
532ca59910 [maglev] Support LdaModuleVariable and StaModuleVariable
Bug: v8:7700
Change-Id: I036ac71324e0c1c96a4da4aacdb5a6718726db31
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3821203
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#82347}
2022-08-10 13:24:14 +00:00
jameslahm
fc4483e740 [maglev] Support LdaGlobalInsideTypeof
Bug: v8:7700
Change-Id: I92596898718a57ea9d8fbd002306aa45a8e9a549
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3821206
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#82346}
2022-08-10 13:18:24 +00:00
jameslahm
96a42ce526 [web snapshot] Support BigInt
Bug: v8:11525
Change-Id: I69c08f3cc4ee6b391e462a5d49de750f34bbc8cf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3815487
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#82345}
2022-08-10 13:15:15 +00:00
Milad Fa
45a74f3a51 PPC/s390: [codegen] Optimize out calls to TurboAssembler::Assert*
Port c3ca815877

Original Commit Message:

    In release builds, FLAG_debug_code is statically false. Without LTO,
    this information is not available to callers of the various Assert
    functions though.
    This CL defines the methods as empty if V8_ENABLE_DEBUG_CODE is not set.
    This removes some calls from non-LTO builds, and might even slightly
    improve LTO builds if we enable more optimizations earlier in the
    pipeline.

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

Change-Id: I5c82eed38db6a2f49e833410554231bc61518b18
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820068
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#82344}
2022-08-10 12:53:34 +00:00
Dominik Inführ
01aed57e68 [heap] Add IncrementalMarking::AdvanceOnTask as new bottleneck
Introduce common bottleneck for all incremental marking step
invocations from a task context. This will later be used to move
code out of IncrementalMarking::Step.

Bug: v8:11708
Change-Id: Iba2dc2402083f8b4152ded56eaf0e13d473442a8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3822682
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82343}
2022-08-10 12:03:03 +00:00
Michael Lippautz
65d43890f3 Reland "[handles] Remove precise on-stack representation of global handles"
This is a reland of commit 6953b5550e

The reland fixes tests that retrieved the stack start from a
non-inlined frame's fp. This does not work in certain configurations
as the resulting marker is too low to consider the first local
variables in subsequent calls.

The fix uses an inline frame address for the tests to get an upper
bound of stack addresses to consider.

Original change's description:
> [handles] Remove precise on-stack representation of global handles
>
> Since https://crrev.com/c/3806439 on-stack traced handles are marked
> conservatively when being used in combination with CppHeap.
>
> This change removes the precise on-stack representation of the
> internal traced nodes as they nodes would anyways be marked
> conservatively. The effects are:
> - cheaper representation (just a single node space);
> - uniform handling: no checks to distinguish on-stack vs on-heap;
> - no brittleness around cleaning on-stack handles when the event loop
>  is empty;
>
> Change-Id: Id859623bfed77a66bdd064ea8065536264515eae
> Bug: v8:13141
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3812039
> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82306}

Bug: v8:13141
Change-Id: I53ece36220e99d02be6df18f83c18450e5d5037b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820585
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82342}
2022-08-10 11:59:24 +00:00
Clemens Backes
ea62649739 [wasm] Speed up WasmStringConcat builtin
Tail call the StringAdd_CheckNone builtin. This also avoids the need to
create a frame.

X64 code before:
     0  55                   push rbp
     1  4889e5               REX.W movq rbp,rsp
     4  6a20                 push 0x20
     6  488b5500             REX.W movq rdx,[rbp+0x0]
     a  488b52f0             REX.W movq rdx,[rdx-0x10]
     e  8bb2c7000000         movl rsi,[rdx+0xc7]
    14  4903f6               REX.W addq rsi,r14
    17  e8a402f3ff           call 0x7f2effeb5a80 (StringAdd_CheckNone)
    1c  488be5               REX.W movq rsp,rbp
    1f  5d                   pop rbp
    20  c3                   retl

X64 code after:
     0  488bd5               REX.W movq rdx,rbp
     3  488b52f0             REX.W movq rdx,[rdx-0x10]
     7  8bb2c7000000         movl rsi,[rdx+0xc7]
     d  4903f6               REX.W addq rsi,r14
    10  e9ab02f3ff           jmp 0x7fed7feb5a80 (StringAdd_CheckNone)

R=jkummerow@chromium.org

Bug: v8:12868
Change-Id: Ie722fb57abcd649d2586aad2c4aca55ff218fe43
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3823127
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82340}
2022-08-10 11:51:27 +00:00
Andreas Haas
b14e3cd4d7 Reland "[wasm] Enable lazy compilation on --future"
This is a reland of commit b67385d22f

The fix landed in https://chromium-review.googlesource.com/c/v8/v8/+/3819643

Original change's description:
> [wasm] Enable lazy compilation on --future
>
> This should increase test coverage of lazy compilation.
>
> R=clemensb@chromium.org
>
> Bug: v8:12852
> Change-Id: I205f4b642576add07db5851126370becdad52fb8
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3784597
> Commit-Queue: Andreas Haas <ahaas@chromium.org>
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82291}

Bug: v8:12852
Change-Id: I97c0aa7962b79e04dd778520e4c3108e20b83c10
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3819641
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82339}
2022-08-10 11:50:24 +00:00
Matthias Liedtke
d43ff4d938 [wasm-gc] Remove obsolete function handling from ToJS wrapper code
Bug: v8:7748
Change-Id: I90c24cbddee7744fba779a0c25f5e4dd860137a5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3823125
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82338}
2022-08-10 11:42:24 +00:00
Victor Gomes
8faef5af7f [maglev] Support Switch without fallthrough
Bug: v8:7700
Change-Id: I7dfc1e87b57455cc5b4622a67ac7c27df216c195
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3823126
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82336}
2022-08-10 11:22:23 +00:00
Darius M
de02b4c50a Reland "Move some string allocation functions from Factory to FactoryBase"
The original CL triggered a fail in a test that was actually broken.
This broken test has now been disabled.

Original CL description:

> In a subsequent CL, I'll need to do String allocations in Turbofan (in
> the background), where only a LocalFactory is available. By moving
> those string allocation functions to FactoryBase, they will also be
> available in the LocalFactory.
>
> Change-Id: I066bbd4b5016645de183633ef237986e0ae50f5d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3811581
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82262}

Change-Id: I89108038bd7b3d1e99ad16837fd730b7703d3c9b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3816669
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82335}
2022-08-10 11:20:34 +00:00
Victor Gomes
e5339351f4 [maglev] Print control nodes while tracing the graph builder
Since targets might not yet exist, we skip them.

Bug: v8:7700
Change-Id: I6ae8a4fd7cbba3ead1f1a13865841d631796090d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3823121
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82332}
2022-08-10 10:34:33 +00:00
Teodor Dutu
f97f7d79fc [ptr-compr-8gb] Align Turbofan allocations to 8 bytes
In order to support a larger heap cage (8GB, 16GB), the cage offset
will take up more than 32 bits. As a consequence, for 8GB cages, the
least significant bit of the cage offset will overlap with the most
significant bit of the tagged offset. To avoid this, allocations need
to be aligned to 8 bytes to free up one bit from the offset.

All changes are deactivated behind the build flag
`v8_enable_pointer_compression_8gb`. Allocation folding is not yet
supported.

Bug: v8:13070
Change-Id: I602c71232e98eac4e2701b0922704a7adc31a662
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3817741
Commit-Queue: Teo Dutu <teodutu@google.com>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82331}
2022-08-10 10:12:14 +00:00
ishell@chromium.org
00746406cf [masm][cleanup] Refactor call related assembler options
... which affect how builtin calls are generated.

This CL replaces the following boolean options
 - builtin_calls_as_table_load,
 - inline_offheap_trampolines,
 - short_builtin_calls,
 - use_pc_relative_calls_and_jumps,

with an enum BuiltinCallJumpMode and a boolean option
use_pc_relative_calls_and_jumps_for_mksnapshot.

Bug: v8:11880, v8:11527
Change-Id: Ia842b1d126c99dbe83e5b4f6118dcd44082ed168
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820063
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82330}
2022-08-10 09:28:34 +00:00
Omer Katz
54f9aeacbd heap: Propagate missing atomic access mode for object end
Bug: chromium:1351511
Change-Id: I4ff4babda6082ba7fe11d8c1d4201679ce1d8af8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3822681
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82328}
2022-08-10 08:35:03 +00:00
Hao Xu
63b37c0ed5 Reland "[ptr-compr][x64][compiler] Support load map in compressed
form"

This is a reland of commit 6ca3adb94c

Fix build failed with V8_MAP_PACKING.

Original change's description:
> [ptr-compr][x64][compiler] Support load map in compressed form
>
> ...to allow pointer decompression at use-site.
>
> Bug: v8:13056, v8:7703
> Change-Id: If369286814c76340a945cc2a9fd863888a813080
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3811737
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Hao A Xu <hao.a.xu@intel.com>
> Cr-Commit-Position: refs/heads/main@{#82242}

Bug: v8:13056, v8:7703
Change-Id: Ic753558058f70f6ee7850019aac9235b87d0e56a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3815779
Commit-Queue: Hao A Xu <hao.a.xu@intel.com>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82322}
2022-08-10 02:57:00 +00:00
Dominik Inführ
de5dbbe553 [heap] Remove IncrementalMarking::StartBlackAllocationForTesting
Black allocation is already enabled when starting incremental marking.

Bug: v8:12775
Change-Id: I492c3ab89a3a3251ab005d2f3fc4ee46f28f5615
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820067
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82321}
2022-08-09 20:03:13 +00:00
Adam Klein
32f4b26816 Revert "Reland "[turbofan] Support Phi nodes in SL Verifier""
This reverts commit 97d1ab6c59.

Reason for revert: simplified lowering verifier crashes on GPU bots:
https://ci.chromium.org/ui/p/v8/builders/ci/Linux%20V8%20FYI%20Release%20(NVIDIA)/20848/overview

Original change's description:
> Reland "[turbofan] Support Phi nodes in SL Verifier"
>
> This reverts commit 82a876b0cd.
>
> Bug: v8:13086, v8:12619
> Change-Id: Idcc42f36b642fefb3ed706214e7385cccc89effc
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3779687
> Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
> Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82285}

Bug: v8:13086, v8:12619
Change-Id: I7a2fb19eb752403337d45de0a7ca02a5d8842766
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820904
Auto-Submit: Adam Klein <adamk@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#82320}
2022-08-09 19:21:23 +00:00
Dominik Inführ
e4eba1952e [heap] Reorganize IncrementalMarking::TryMarkingComplete()
This CL tries to improve readability of TryMarkingComplete() by
splitting it up into multiple smaller methods.

It also removes StepResult::kWaitingForFinalization since this was
only used in one test which could easily be rewritten to not need this
value. This makes CombineStepResult() and Step()s return value simpler
to understand.

Bug: v8:12775
Change-Id: I981bc7b736246ab53058d1e61e3c67db0d1130b7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3816668
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82319}
2022-08-09 18:14:13 +00:00
Milad Fa
036384d01a PPC: [codegen] Change a few DCHECKs to V8_ASSUMEs
Port e5524920a6

Original Commit Message:

    This might or might not give clang-tidy a hint that the reported case
    (see issue) cannot happen. It might also generate slightly better code
    by giving hints to the compiler.
    Note that V8_ASSUME is actually a DCHECK in DEBUG builds, so we do not
    loose any checks here.

    Some DCHECKs were removed because they are redundant
    (RegisterBase::code() assumes to be only called on valid registers).

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

Change-Id: I653d398eb4b6b10fa769de62a9900edda95dd5db
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820583
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#82318}
2022-08-09 17:53:12 +00:00
Milad Fa
30d6b245ea PPC/s390: [ext-code-space] Add InterpreterEntryTrampolineForProfiling builtin
Port 1067c6accc

Original Commit Message:

    ... - a code range size agnostic version of InterpreterEntryTrampoline
    builtin. The new builtin is fully compatible with the default version
    and used as a template for creating interpreter entry trampoline
    Code objects when --interpreted-frames-native-stack is enabled.

    This CL introduces a new assembler option "position_independent_code"
    which affects the way builtin calls are generated.
    This mode is enabled only for InterpreterEntryTrampolineForProfiling.

    Motivation:

    * InterpreterEntryTrampoline uses RelocInfo::CODE_TARGET for calling
      other builtins which requires the code range to be small enough to
      allow PC-relative jumps/calls between Code objects. This is the
      reason why --interpreted-frames-native-stack was not supported on
      arm and might not work on arm64 because the code range is bigger
      than the max PC-relative distance for call/jump instructions.
      The new builtin calls other builtins via builtins entry table which
      makes the code fully relocatable and usable for any code range size.

    * RelocInfo::CODE_TARGET requires a target code to be materialized
      as a Code object which contradicts the Code-less builtins goal.

    * The --interpreted-frames-native-stack is rarely used in the wild but
      we have to pay the price of deserializing InterpreterEntryTrampoline
      builtin as a Code object which consumes address space in the code
      range and thus limits the number of V8 isolates that can be created
      because of code range exhaustion. Now the pointer compression cage
      becomes the limiting factor instead of the code range.

    * We can remove complicated logic of Factory::CopyCode() and respective
      support on GC side.

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

Change-Id: I2ed5edbffc5c33717f4becf8370369f7a4d000fb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3816765
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#82317}
2022-08-09 17:51:33 +00:00
Michael Lippautz
9e2b4aee1a [heap] Remove dead code
Change-Id: I18190e902929d5b513b0a897faaddb8750f9b27a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820066
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82316}
2022-08-09 17:25:03 +00:00