Commit Graph

64960 Commits

Author SHA1 Message Date
Etienne Pierre-doray
69388737c5 Reland "[wasm] Use NumOutstandingCompilations() in BackgroundCompileJob:GetMaxConcurrency()"
This is a reland of 84eec6e920

Original change's description:
> [wasm] Use NumOutstandingCompilations() in BackgroundCompileJob:GetMaxConcurrency()
>
> This simplifies current_compile_job_ since ScheduleCompileJobForNewUnits
> is only called on the main thread.
>
> From pinpoint:
> v8:wasm:sync_instantiate:wall_time: 19.1% improvement
> v8-gc-incremental-step: 20.5% improvement
> https://pinpoint-dot-chromeperf.appspot.com/job/152920d8520000
>
> Change-Id: Id560080937f5439cf3321ce9306c7cae49e74798
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2442383
> Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70386}

Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_rel_ng
Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_isolates_rel_ng
Change-Id: Ic989b64f130a00ce52228cdd2f57f4c1ade354f2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2458147
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70418}
2020-10-09 09:00:52 +00:00
Ulan Degenbaev
11513893c5 [test] Remove fragile assertion in test-spaces/SizeOfInitialHeap
The assertion states that compilation of an empty script does not add
new pages. This doesn't not necessarily hold if the existing pages are
almost full.

Bug: v8:10988
Change-Id: I71735e6736fb94e1ccde7f6430a2c4b0d48c43f3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2461728
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70417}
2020-10-09 08:43:42 +00:00
Etienne Pierre-doray
b2925688c3 Reland "Reland "[Heap]: Marking use Jobs.""
This is a reland of 4848de2ab2
Issue 1136405: non empty ephemeron list after FinishConcurrentMarking
Fix: COMPLETE_TASKS_FOR_TESTING Join()s instead of Cancel()
Issue: Failing TSAN failures
Fix: Safe to reland after
https://chromium-review.googlesource.com/c/v8/v8/+/2461726

Original change's description:
> Reland "[Heap]: Marking use Jobs."
>
> This is a reland of 4a2b2b2e56
>
> Original change's description:
> > [Heap]: Marking use Jobs.
> >
> > StopRequest is removed in favor of:
> > COMPLETE_TASKS_FOR_TESTING -> JoinForTesting()
> > PREEMPT_TASKS -> Pause()
> > COMPLETE_ONGOING_TASKS now has the same behavior as PREEMPT_TASKS
> > - we should avoid waiting on the main thread as much as possible.
> >
> > Change-Id: Icceeb4f0c0fda2ed234b2f26fe308b11410fcfb7
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2376166
> > Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
> > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#70037}
>
> Change-Id: I386f619501ad07997278543868bc889a60afcc8b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2423938
> Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70387}

Bug: chromium:1136405
Change-Id: I511c3d1747ef79ed6e7066c9a5bba052f9d4cd37
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2458246
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70416}
2020-10-09 02:16:21 +00:00
Ng Zhi An
fdc22f58f5 [wasm-simd][scalar-lowering] Lower floating-point rounding ops
Missed this earlier when it was merged into the proposal.

f32x4 and f64x2 ceil, floor, trunc, nearestint. Also enable cctests.

Bug: v8:10507,v8:10906
Change-Id: I2de00e615cd63d81303649774db2a2ab800f6f72
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2461451
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70415}
2020-10-08 23:24:01 +00:00
Anton Bikineev
d21c89bb4a cppgc: Support compile-time typename computation
Bug: chromium:1056170
Change-Id: If4d4d08b4a50312b7a3cd1d11bb2cccc2272c96b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2461733
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70414}
2020-10-08 20:58:52 +00:00
Omer Katz
0b96f711cb cppgc: Provide TraceTraitBase that users can inherit from
The TraceTrait for JSMember is currently missing GetTraceDescriptor.
We missed it because we don't have proper tests for JSMember, but it
would fail to build if it was ever actually traced.

Bug: chromium:1056170
Change-Id: I45fd2c7c666e791f866813f762b488958f65f3cf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2460815
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70413}
2020-10-08 19:22:21 +00:00
Omer Katz
65bec1aa79 cppgc: Use libplatform as default platform
Bug: chromium:1056170
Change-Id: I4214978f31ae754e4940dfca4182ada202d17c01
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2456688
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70412}
2020-10-08 18:16:52 +00:00
Leszek Swirski
c212d10da0 [serializer] Introduce HandleScopes for object contents
Create a HandleScope when serializing an object's contents, to reduce
the number of live handles during serialization. There's only a couple
of cases where these handles have to outlive the serialized contents,
and for these cases we introduce GlobalHandleVector or similar manual
strong root mechanisms.

In particular, backrefs don't actually need to exist as a handle vector
(the object addresses are already referred to by the reference map's
IdentityMap), except for DCHECKs, so this becomes a DEBUG-only global
handle vector.

To support this manual strong-rooting, the HotObjectList is split up
into a strong-rooted find-only class in Serializer, and a Handle
vector in Deserializer.

Bug: chromium:1075999
Change-Id: I586eeeb543e3f6c934c168961b068f2c34e72456
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2449980
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70411}
2020-10-08 18:03:51 +00:00
Camillo Bruni
4ddb034776 [d8] Avoid printing unhandled rejected Promises in Shell::RunMain
This simplification helps with correctness fuzzers where Promises
created during error printing are flakily handled.

We might skip over certain rejected Promises that were created after
finishing running the script. This seems to be a reasonable compromise
in helping debugging scripts with unhandled rejections in d8.

Bug: chromium:1126309
Change-Id: Ia87c80cfd390bf8c6a724dc2f0e9e5fd1599e332
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2460814
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70410}
2020-10-08 16:55:51 +00:00
Maya Lekova
e78f4c7e6d [turbofan] Optimize stack slot usage for fast API calls
With this CL, fast API calls reuse the same stack slot they are
using for the {fallback} parameter. This relies on the fact that
the fast calls are non-reentrant, due to their inability to call
into JavaScript.

Bug: chromium:1052746
Change-Id: I2c56fcbe425023244a566bb39439e8e04072f316
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2461729
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70409}
2020-10-08 16:45:21 +00:00
Clemens Backes
c4a7bd8698 [wasm] Add a fast path for LEB decoding
It turns out that most LEBs are rather small (especially when used for
locals). This CL adds a fast path for single-byte LEBs which is supposed
to be inlined into callers. The more expensive slow path is then
explicitly outlined to avoid excessive binary size growth.

R=thibaudm@chromium.org

Change-Id: I0dcdf597b9be3055acc2b878b6bee3fa21839758
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2449974
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70408}
2020-10-08 15:55:31 +00:00
Ulan Degenbaev
dae268e404 [test] Fix platform lifetime in test-wasm-metrics
Currently MockPlatform has shorter lifetime than the isolate that uses
it. This leads to use-after-free races in concurrent tasks that fetch
the mock platform just before it is freed.

This CL ensures that MockPlatform is valid throughout the whole
lifetime of the isolate

Change-Id: Ib94dc7674b9f94833be3372de68209ec38577ca1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2461726
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Emanuel Ziegler <ecmziegler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70407}
2020-10-08 15:26:51 +00:00
Georg Neis
e5ea75ba76 [compiler] Never serialize ScopeInfo
Bug: v8:7790
Change-Id: I1ffb2289f613a03d0246db2d66c3caaf0e4d6d2a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2448796
Auto-Submit: Georg Neis <neis@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70406}
2020-10-08 14:58:41 +00:00
Sylvain Defresne
92e6d33170 build: Remove no-op calls to set_sources_assignment_filter
Chromiun no longer use set_sources_assignment_filter() anywhere in the
build, so these are no longer needed.

Bug: chromium:1018739
Change-Id: I7b33612d925563ebca0d93a7d3c9183d7305b7b0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2456988
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70405}
2020-10-08 14:44:01 +00:00
Clemens Backes
5bf16197ec [wasm] Simplify LEB decoding
Remove one "mode" of LEB decoding by eliminating the {AdvancePCFlag},
and doing the PC advance in the caller instead.
The returned length is now always zero in case of an error, thus remove
the respective checks from the unit tests. The returned length does not
really matter if we ran into an error.

R=thibaudm@chromium.org

Change-Id: Ibfd94dd981cefa2fc24c7af560c85afd1c826f2c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2449972
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70404}
2020-10-08 13:58:01 +00:00
Peter Marshall
637d1fc00b Make the StartProfilingAfterOsr profiler test more robust
1. Set profiling interval to 100us to get 10x the samples
2. Guarantee we spend at least 1ms per iteration, instead of only
bailing out if we spend more than 1ms. This gives us enough samples on
release mode.
3. Increase the time spent profiling optimized code

Bug: v8:10996
Change-Id: I1348ebce48fe998e79b5847f3e3d037148302dcc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2460823
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70403}
2020-10-08 13:20:01 +00:00
Michael Achenbach
373a9a8cfc [test] Switch to flattened json output
This flattens the json output to one result record as a dict. In
the past several records with different arch/mode combinations
could be run, but this is deprecated since several releases.

We also drop storing the arch/mode information in the record as it
isn't used on the infra side for anything.

This was prepared on the infra side by:
https://crrev.com/c/2453562

Bug: chromium:1132088
Change-Id: I944514dc00a671e7671bcdbcaa3a72407476d7ad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2456987
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70402}
2020-10-08 13:05:11 +00:00
Clemens Backes
0ce4c51ce7 [wasm] Last fixes for boolean validation
Found some more direct calls to {Decoder::error} which should be wrapped
in {DecodeError} to do some less work in boolean validation mode.

R=thibaudm@chromium.org

Bug: v8:10969
Change-Id: I5f7b5553a0c0cc2123904380625d50f25ea1ffc2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2456686
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70401}
2020-10-08 12:54:21 +00:00
Michael Lippautz
f50c64bdfe cppgc: Add naming infrastructure
Adds NameProvider to allow specifying names of objects. The
corresponding internal NameTrait is registered with the GCInfo object.

Use name infrastructure to provide a hint on encountering an unmarked
object in the marking verifier.

Bug: chromium:1056170
Change-Id: I95bb290660f5905500f861bd5cc85148a1b47184
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2454087
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70400}
2020-10-08 12:25:21 +00:00
Leszek Swirski
be2f7d64de [snapshot] Print allocation stats for memory tests
Since we're not reserving memory anymore, we don't log reserved memory
when profiling serialization. So, instead log the allocation counts used
by OutputStatistics as a pseudo-reserved size.

Bug: v8:10998
Bug: chromium:1075999
Change-Id: I64dc6086b14c0e720ef8d0c1ea99a6f8ccabcf9c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2460808
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70399}
2020-10-08 11:25:51 +00:00
Shu-yu Guo
c97feb94ee [top-level-await] Make Module::IsGraphAsync const
Bug: v8:9344
Change-Id: Id91afc60989afd45c4c0d00696afb4c81489f0ee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2458146
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70398}
2020-10-08 10:09:28 +00:00
Dominik Inführ
ee3df92b90 [heap] Fix DCHECK in NewSpace::Grow
NewSpace::Grow isn't in a safepoint when FLAG_local_heaps is disabled.

Bug: chromium:1136292
Change-Id: I18c4d42b73450d11ce9b685276b239481a4c5c83
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2459372
Auto-Submit: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70397}
2020-10-08 07:50:57 +00:00
Jakob Gruber
f56bfe8520 Revert "[heap] Turn on RO_SPACE sharing for pointer compression"
This reverts commit bbecd8d5b3.

Reason for revert: https://bugs.chromium.org/p/v8/issues/detail?id=10999

Original change's description:
> [heap] Turn on RO_SPACE sharing for pointer compression
>
> Makes the read-only space sharing the default even with pointer
> compression if on Linux, Android or Chrome OS.
>
> This won't have any immediate impact on Chrome since the platform page
> allocator in chrome does not yet support allocation and remapping of
> shared pages.
>
> Bug: v8:10454
> Change-Id: I3bc57080827efe38095a4bb1d02a53518727056a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2454077
> Auto-Submit: Dan Elphick <delphick@chromium.org>
> Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70383}

TBR=rmcilroy@chromium.org,delphick@chromium.org

Change-Id: I0e96f6b901adeb5569a545eb24b15fb8d45bf544
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10454
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2460806
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70396}
2020-10-08 07:43:09 +00:00
Ng Zhi An
9f0b3413b1 [wasm-simd][arm64] prototype i64x2 widen i32x4
Prototype these 4 instructions:

- i64x2.widen_low_i32x4_s
- i64x2.widen_high_i32x4_s
- i64x2.widen_low_i32x4_u
- i64x2.widen_high_i32x4_u

Bug: v8:10972
Change-Id: I3cc3bfdd6dfd0f0bab1dfef63399ed9fa68bd2d2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2441369
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70395}
2020-10-08 00:09:40 +00:00
Ng Zhi An
23b5d936cd [wasm-simd] No need to mask immediates for i8x16.shuffle
The immediates would have been checked by the validation, so we can skip
masking them.

Bug: v8:10696
Change-Id: I18e4746b1eb08a2436311a633341be0c88f52139
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2453456
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70394}
2020-10-08 00:05:10 +00:00
Ng Zhi An
b87db51790 [wasm-simd][scalar-lowering] Implement the rest of SimdType conversions
This fills out all possible combinations of SimdType conversions. The
implementation is not the best, it uses existing conversions instead of
creating new specific ones, but is sufficient, since we don't prioritize
performance for lowering.

I added if/else clauses to the existing implementation, so that the diff
is easier to read. I will put up a follow-up to convert it into switch
statements.

Bug: chromium:1134898,v8:10507
Change-Id: I5fcb3597882b0ea3084fdc79eb1dab9b8629044b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2453462
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70393}
2020-10-07 23:43:00 +00:00
Ng Zhi An
e30c50f3bf [x64] Refactor pinsrb family of instructions
The existing macro assembler define Pinsrb, which expects 3 arguments:

- XMMRegister dst
- Register/Operand src
- uint8_t imm

which overwrites dst with src at lane specified by imm.

That means we cannot use the AVX version, which has 4 arguments, and
does not overwrite dst.

This refactoring defines the 4 argument AVX version instead, and if AVX
is not supported, fall back to the SSE version, and ensure that the
value is copied over into dst first.

For convenience, we define an overload with 3 arguments that duplicates
dst, this replicates the SSE behavior, so that not all callers have to
be updated.

Bug: v8:10975, v8:10933
Change-Id: I6f9b9d37fa08d3f5cff4f040ae7d5e1f0cf36455
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2444096
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70392}
2020-10-07 23:25:30 +00:00
Ng Zhi An
f996d50d62 [wasm-simd] Fix lowering of load transform
Load transform nodes can be effect inputs, so we need to update the node
in place. Otherwise, if a load transform node is both an value and an
effect input, only the value input will be updated with replacements,
the effect input will still be the unlowered load transform node.
This is because DefaultLowering only lowers value inputs.

This is consistent with normal loads in the scalar lowering,
and also how int64 does it.

Bug: v8:10984,v8:10507
Change-Id: I04b0f0b1cff95e39589de979ecae6cb4b085a3cf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2453861
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70391}
2020-10-07 23:07:10 +00:00
Shu-yu Guo
3499b8567a [top-level-await] Implement v8::Module::IsGraphAsync()
This is a predicate checking if any module in a module graph is [[Async]], i.e.
contains a top-level await. It is needed for ServiceWorker integration, as
ServiceWorkers disallows top-level await in its modules to prevent stalling
during registration.

https://github.com/w3c/ServiceWorker/pull/1444

Bug: v8:9344
Change-Id: Id84489bc73717b4c9950059c8ff6def9297499d0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2451212
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70390}
2020-10-07 17:34:30 +00:00
Shu-yu Guo
cb0d2f44cf Revert "Reland "[Heap]: Marking use Jobs.""
This reverts commit 4848de2ab2.

Reason for revert: TSAN failure https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20TSAN%20-%20stress-incremental-marking/287

Original change's description:
> Reland "[Heap]: Marking use Jobs."
>
> This is a reland of 4a2b2b2e56
>
> Original change's description:
> > [Heap]: Marking use Jobs.
> > 
> > StopRequest is removed in favor of:
> > COMPLETE_TASKS_FOR_TESTING -> JoinForTesting()
> > PREEMPT_TASKS -> Pause()
> > COMPLETE_ONGOING_TASKS now has the same behavior as PREEMPT_TASKS
> > - we should avoid waiting on the main thread as much as possible.
> > 
> > Change-Id: Icceeb4f0c0fda2ed234b2f26fe308b11410fcfb7
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2376166
> > Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
> > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#70037}
>
> Change-Id: I386f619501ad07997278543868bc889a60afcc8b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2423938
> Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70387}

TBR=ulan@chromium.org,etiennep@chromium.org

Change-Id: I76021037fb91df304ef3f180cc0eb2143e58bc5c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2457428
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70389}
2020-10-07 17:30:33 +00:00
Clemens Backes
399504d251 Revert "[wasm] Use NumOutstandingCompilations() in BackgroundCompileJob:GetMaxConcurrency()"
This reverts commit 84eec6e920.

Reason for revert: TSan issues (lock order inversion): https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20TSAN%20-%20isolates/11658

Original change's description:
> [wasm] Use NumOutstandingCompilations() in BackgroundCompileJob:GetMaxConcurrency()
>
> This simplifies current_compile_job_ since ScheduleCompileJobForNewUnits
> is only called on the main thread.
>
> From pinpoint:
> v8:wasm:sync_instantiate:wall_time: 19.1% improvement
> v8-gc-incremental-step: 20.5% improvement
> https://pinpoint-dot-chromeperf.appspot.com/job/152920d8520000
>
> Change-Id: Id560080937f5439cf3321ce9306c7cae49e74798
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2442383
> Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70386}

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

Change-Id: Iaa7df7fbfc56fcc7bf8400671f13210a1984885f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2456768
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70388}
2020-10-07 16:12:02 +00:00
Etienne Pierre-doray
4848de2ab2 Reland "[Heap]: Marking use Jobs."
This is a reland of 4a2b2b2e56

Original change's description:
> [Heap]: Marking use Jobs.
> 
> StopRequest is removed in favor of:
> COMPLETE_TASKS_FOR_TESTING -> JoinForTesting()
> PREEMPT_TASKS -> Pause()
> COMPLETE_ONGOING_TASKS now has the same behavior as PREEMPT_TASKS
> - we should avoid waiting on the main thread as much as possible.
> 
> Change-Id: Icceeb4f0c0fda2ed234b2f26fe308b11410fcfb7
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2376166
> Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70037}

Change-Id: I386f619501ad07997278543868bc889a60afcc8b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2423938
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70387}
2020-10-07 15:29:50 +00:00
Etienne Pierre-doray
84eec6e920 [wasm] Use NumOutstandingCompilations() in BackgroundCompileJob:GetMaxConcurrency()
This simplifies current_compile_job_ since ScheduleCompileJobForNewUnits
is only called on the main thread.

From pinpoint:
v8:wasm:sync_instantiate:wall_time: 19.1% improvement
v8-gc-incremental-step: 20.5% improvement
https://pinpoint-dot-chromeperf.appspot.com/job/152920d8520000

Change-Id: Id560080937f5439cf3321ce9306c7cae49e74798
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2442383
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70386}
2020-10-07 15:20:40 +00:00
Victor Gomes
18ac6024ea [tests] Run TestReturnMultipleValuesLargeFrame just once
Change-Id: I850fa9a5449b204c8b9a626c449e587b039a61f5
Bug: chromium:1133701
Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_rel_ng
Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2454086
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70385}
2020-10-07 14:55:30 +00:00
Santiago Aboy Solanes
af00c2618a [compiler] Use StringToDouble without allocation
We had a way to do string to double without allocation that we were
using on StringData. Reuse that on StringRef for Strings that can
access the heap.

BUg: v8:7790
Change-Id: I30e6dace3fbf05eb8672ff1bad46f6c6d6fe1d6d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2450013
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70384}
2020-10-07 14:33:20 +00:00
Dan Elphick
bbecd8d5b3 [heap] Turn on RO_SPACE sharing for pointer compression
Makes the read-only space sharing the default even with pointer
compression if on Linux, Android or Chrome OS.

This won't have any immediate impact on Chrome since the platform page
allocator in chrome does not yet support allocation and remapping of
shared pages.

Bug: v8:10454
Change-Id: I3bc57080827efe38095a4bb1d02a53518727056a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2454077
Auto-Submit: Dan Elphick <delphick@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70383}
2020-10-07 14:06:10 +00:00
Milad Fa
14f17729e9 [snapshot] Use a function symbol only on x64 or ia32
Change-Id: I14bac71f1b80de6e92b729b369aa4871f9af5bb2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2453453
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70382}
2020-10-07 13:15:19 +00:00
Sami Kyostila
1b1eda0876 tracing: Update proto library build rule and roll Perfetto
This patch removes use of the deprecated sources_assignment_filter GN
feature from gni/proto_library.gni, since the extra descriptor files are
no longer being generated.

We also roll Perfetto to match the version used in Chrome and update
test expectations accordingly.

Bug: v8:10995
Change-Id: I65cb3b79feb6e5a7e5c8d99fdb8bf999a6048539
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2454079
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Auto-Submit: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70381}
2020-10-07 12:49:09 +00:00
Camillo Bruni
f3c7792985 [mjsunit][tools] Sync module files for tests
- Update file list in andrdoid-sync.sh
- Update testcase.py module resources regexp to handle more import cases

Bug: v8:10668
Change-Id: I801464336b9a149ca1393d120c3332e5dc1f6345
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2442612
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70380}
2020-10-07 12:45:19 +00:00
Jakob Kummerow
4e077ff044 [mac] Set MAP_JIT only when necessary
This is a "minimal" change to achieve the required goal: seeing that
there is only one place where we need to indicate that memory should
be reserved with MAP_JIT, we can add a value to the Permissions enum
instead of adding a second, orthogonal parameter.
That way we avoid changing public API functions, which makes this CL
easier to undo once we have platform-independent w^x in Wasm.

Bug: chromium:1117591
Change-Id: I6333d69ab29d5900c689f08dcc892a5f1c1159b8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2435365
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70379}
2020-10-07 12:21:09 +00:00
Victor Gomes
9d3c26f409 [compiler,x64] Fix AssembleReturn for multiple returns
Change-Id: I9d226483a7f8cd82ef42eba56d9a069b16d622fc
Bug: chromium:1133701
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2449978
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70378}
2020-10-07 12:08:59 +00:00
Santiago Aboy Solanes
111cbd9846 [compiler] Move instance_descriptors synchronized setter to private
In a previous CL (crrev.com/c/v8/v8/+/2424130/17/src/objects/map.h) I
moved it to public to use the parent macro. Move it back to private
since it does not need to be public.

Bug: v8:7790
Change-Id: I5fd78a8fcef2bd454585b6dc428c1b1d2bb62422
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2454715
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70377}
2020-10-07 11:42:39 +00:00
Jakob Gruber
7c4cc5ed38 Revert "[nci] Prepare JSForInPrepare and JSForInNext for feedback input"
This reverts commit 16cd5995f9.

Reason for revert: Can't be landed without also implementing generic lowering, see https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20-%20fyi/18261.

Original change's description:
> [nci] Prepare JSForInPrepare and JSForInNext for feedback input
>
> These two operators are still missing feedback collection in generic
> lowering (reminder: all operations that collect FB in the interpreter
> must also collect FB in generic lowering).
>
> This CL prepares for that by adding the feedback vector as an input,
> and additionally adds node wrappers to improve useability.
>
> The actual collection logic will be added in a following CL.
>
> Bug: v8:8888
> Change-Id: I04627eedb2dc237dc4e417091c44d2a95bd98f5f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2454712
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70372}

TBR=jgruber@chromium.org,leszeks@chromium.org,tebbi@chromium.org

Change-Id: Ibff2bf44eb04bebd982b019b4539275db75c611a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8888
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2454078
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70376}
2020-10-07 10:44:41 +00:00
Omer Katz
4cb4a2293c cppgc, jobs: Update job priority
This CL aligns the library implementation with the blink implementation:
(*) Concurrent marking increases job priority if no concurrent progress
    is made in the last 50% of the expected marking duration.
(*) Concurrent sweeping increases job priority when calling
    FinishIfRunning (the library equivalent of blink's CompleteSweep).

Bug: chromium:1056170
Change-Id: Ice275cb90a7dd76bf4125f4338d9d80e5f576c58
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2431572
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70375}
2020-10-07 10:10:09 +00:00
Ross McIlroy
4a60191149 [TurboProp] Add support for deferred block spills in fast reg alloc
Adds support for avoiding spills in non-deferred blocks by instead
restricting the spill ranges to deferred blocks if the virtual
register is only spilled in deferred blocks.

It does this by tracking registers that reach the exit point of deferred
blocks and spilling them them pre-emptively in the deferred block while
treating them as committed from the point of view of the non-deferred
blocks. We also now track whether virtual registers need to be spilled
at their SSA definition point (where they are output by an instruction),
or can instead be spilled at the entry to deferred blocks for use as
spill slots within those deferred blocks. In both cases, the tracking
of these deferred spills is kept as a pending operation until the
allocator confirms that adding these spills will avoid spills in the
non-deferred pathways, to avoid adding unnecessary extra spills in
deferred blocks.

BUG=v8:9684

Change-Id: Ib151e795567f0e4e7f95538415a8cc117d235b64
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2440603
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70374}
2020-10-07 10:08:29 +00:00
Jakob Gruber
a19cf8e213 [nci] Fix a DCHECK failure related to OSR
This removes a DCHECK that is no longer valid now that NCI jobs can
also be spawned by OSR requests.

Bug: v8:8888
Change-Id: I84eed41b510cc9c3ab1b35abfda0b6bec88752dd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2454714
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70373}
2020-10-07 10:06:19 +00:00
Jakob Gruber
16cd5995f9 [nci] Prepare JSForInPrepare and JSForInNext for feedback input
These two operators are still missing feedback collection in generic
lowering (reminder: all operations that collect FB in the interpreter
must also collect FB in generic lowering).

This CL prepares for that by adding the feedback vector as an input,
and additionally adds node wrappers to improve useability.

The actual collection logic will be added in a following CL.

Bug: v8:8888
Change-Id: I04627eedb2dc237dc4e417091c44d2a95bd98f5f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2454712
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70372}
2020-10-07 10:04:09 +00:00
Michael Lippautz
12776afce9 heap: Fix metric around corner case of fast marking
Bug: v8:10956
Change-Id: Iab17e3f0163aa81cfb978d72e0f0cd9b15c14743
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2454716
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70371}
2020-10-07 09:57:29 +00:00
Martin Bidlingmaier
f3a666d694 [regexp] Handle interrupts in experimental interpreter
No surprises; very much based on interrupt handling in the irregexp
interpreter.

Cq-Include-Trybots: luci.v8.try:v8_linux64_fyi_rel_ng
Bug: v8:10765
Change-Id: I2353cac4639a494362b8dfdf9507985fb6298c0e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2452710
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Martin Bidlingmaier <mbid@google.com>
Cr-Commit-Position: refs/heads/master@{#70370}
2020-10-07 09:45:09 +00:00
Camillo Bruni
7be8692e91 [runtime][module] Change Module::Reset order
Allocating in the right spot leaves the Module in an invalid state.
Do allocations before resetting a module.

Drive-by-fix: make module verification check failures easier to debug.

Bug: v8:10985
Change-Id: I6fc32c96441958755bfb32b3004e1bb616dc7d98
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2452533
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70369}
2020-10-07 09:38:40 +00:00