Commit Graph

26487 Commits

Author SHA1 Message Date
Maya Lekova
7a62cceb72 [fastcall] Add CPU profiler support for fast calls
This CL introduces a new fast_api_call_target field on the isolate,
which is set by Turbofan before making the fast call. It then uses
the field when creating a stack sample and stores it in the existing
external_callback_entry used for regular API callbacks. The CL also
adds a cctest with simple usage scenario and introduces a minor
refactoring in test-api.cc.

Design doc:
https://docs.google.com/document/d/1r32qlPzGz0P7nieisJ5h2qfSnWOs40Cigt0LXPipejE/edit

Bug: chromium:1052746
Change-Id: I2dab1bc395ccab0c14088f7c354fb52b08df8d32
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2488683
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71254}
2020-11-18 12:29:22 +00:00
Nico Hartmann
63d883b033 Disable failing inspector test
NOTRY=true
TBR=szuend@chromium.org

Bug: v8:11176
Change-Id: If10560a5c36e22ef0cd9f3c7344b4dc30d3bcf02
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2546687
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71251}
2020-11-18 10:19:09 +00:00
Jakob Gruber
da888fed4b [stress_snapshot] Skip failing tests
To be unskipped once root cause is fixed.

Bug: v8:11166
Change-Id: I03c3ac9a7e715fce7683d230965bd92a410c8f91
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2546681
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71248}
2020-11-18 09:13:59 +00:00
Frank Tang
f6d2255a03 Reland "Add regression tests for 4 calendar bugs"
This is a reland of 915f729afb

Original change's description:
> Add regression tests for 4 calendar bugs
>
> These bugs was fixed by ICU68
>
> Bug: v8:10526, v8:10527, v8:10528, v8:10529
> Change-Id: I8d0dcb52d849f742e0a29314ac8a148370f60a1a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2527086
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71062}

Cq-Include-Trybots: luci.v8.try:v8_android_arm64_n5x_rel_ng
Bug: v8:10526
Bug: v8:10527
Bug: v8:10528
Bug: v8:10529
Change-Id: I8857fb8c104bb4bede8fe816574bfd46ccbcd082
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2536737
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71244}
2020-11-17 23:47:08 +00:00
Santiago Aboy Solanes
1c31ba7f95 [compiler] Don't acquire the lock in TryStringToDouble
In https://crrev.com/c/v8/v8/+/2536465 we added acquiring the lock in
WriteToFlat. Then, acquiring in TryStringToDouble not only is not
necessary but also has undefined behaviour.

This was causing timeouts and meant the tests were disabled in
https://crrev.com/c/v8/v8/+/2543398.

Bug: v8:7790, v8:11171
Change-Id: Iaab4e5079bac96786e536a2e4b766e93ea17e2c4
Fixes: v8:11171
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2544544
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71242}
2020-11-17 18:40:48 +00:00
Nico Hartmann
4d85a954a6 [cctest] Disable test-concurrent-string test
TBR=solanes@chromium.org

Bug: v8:11171
Change-Id: I8639f9becbb9fa8faa0a1823d58a83bf706d0fdd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2543398
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71235}
2020-11-17 15:11:27 +00:00
Milad Fa
4933ecc202 [wasm-gc] Fix kLongLength to account for larger page sizes
Change-Id: Ie09b35d2e2cd28996bb7ebaa54175c14a4f5cea8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2543162
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71234}
2020-11-17 14:22:22 +00:00
Manos Koukoutos
6774b89894 [wasm] Improvements in value type decoding
Changes:
- Fix read_value_type description.
- Make sure read_value_type always emits an error for an invalid type.
  Remove checks for errors at call sites.
- (Drive-by) Fix validation flags in DecodeLocals.

Change-Id: I82bd8a61f0e26f39506fc6e4ab4be331dfe24ad7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2526390
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71233}
2020-11-17 14:21:17 +00:00
Michael Achenbach
9235f25874 Revert "[heap] Introduce LocalIsolate for main thread"
This reverts commit e95e1b6234.

Reason for revert:
https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20arm%20-%20sim%20-%20debug/23064

Original change's description:
> [heap] Introduce LocalIsolate for main thread
>
> Add a LocalIsolate for the main thread to Isolate. This LocalIsolate is
> kept alive during the whole lifetime of the Isolate. The main thread
> LocalIsolate starts in the Running state in contrast to the background
> thread LocalIsolates (those start in Parked).
>
> Code paths in Turbofan that used to create a LocalIsolate on the main
> thread can now simply use the main thread LocalIsolate.
>
> LocalIsolate for the main thread will help in reducing differences
> between the main and background threads. The goal is that the main
> thread behaves more like a background thread.
>
> The main thread LocalIsolate should also make it simpler to share code
> between main thread and background threads by using LocalIsolate for
> both.
>
> Bug: v8:10315
> Change-Id: I7fd61d305a6fd7079e2319d75c291c1021e70018
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2509593
> Reviewed-by: Simon Zünd <szuend@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71226}

TBR=ulan@chromium.org,yangguo@chromium.org,neis@chromium.org,leszeks@chromium.org,szuend@chromium.org,dinfuehr@chromium.org

Change-Id: Ia70b4bfe3b8fa26bf8d6a7dc612a310b0ed54073
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10315
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2543937
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71228}
2020-11-17 12:30:13 +00:00
Vicky Kontoura
8b7a837b71 [wasm] Add cctest for indirect js-to-wasm calls
This CL adds a cctest to verify that the tiering strategy for the
js-to-wasm wrappers works for functions that are only indirectly
exported through exported tables.

Bug: v8:10982
Change-Id: I8eede14ab620dbadb75af42b78bfac88230a6dd3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2536644
Commit-Queue: Vicky Kontoura <vkont@google.com>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71227}
2020-11-17 11:59:46 +00:00
Dominik Inführ
e95e1b6234 [heap] Introduce LocalIsolate for main thread
Add a LocalIsolate for the main thread to Isolate. This LocalIsolate is
kept alive during the whole lifetime of the Isolate. The main thread
LocalIsolate starts in the Running state in contrast to the background
thread LocalIsolates (those start in Parked).

Code paths in Turbofan that used to create a LocalIsolate on the main
thread can now simply use the main thread LocalIsolate.

LocalIsolate for the main thread will help in reducing differences
between the main and background threads. The goal is that the main
thread behaves more like a background thread.

The main thread LocalIsolate should also make it simpler to share code
between main thread and background threads by using LocalIsolate for
both.

Bug: v8:10315
Change-Id: I7fd61d305a6fd7079e2319d75c291c1021e70018
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2509593
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71226}
2020-11-17 11:21:56 +00:00
Michael Lippautz
b0d990f932 api,heap: Add public version of CppHeap
Allows embedders to allocate C++ objects on the internal managed C++
heap.

Bug: chromium:1056170
Change-Id: Ibd81d0fc915478a81f14e8ab12a631e442790f04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2536642
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71225}
2020-11-17 11:15:05 +00:00
Jakob Gruber
3599cce1f5 [nci] Share smi feedback and enable related optimizations
This CL enables a first batch of feedback-based optimizations in NCI
code. Specifically, optimizations based on unary, binary, compare,
for-in-next, and for-in-prepare feedback are now enabled.

This has two main implications:

1. NCI code can now deopt. Deoptimized code is currently thrown away
permanently and cannot be reused. Now that shared/cached NCI code can
deopt, this leads to an interesting question of what should happen
with deoptimized NCI code. The answer in this CL is to remove the
cache entry (it may later be re-added).

2. Tiering up from NCI to TF still requires feedback; since NCI code,
starting with this CL, no longer collects full feedback, feedback must
be created in some other way. This is solved by sharing a
context-independent encoding of feedback across native contexts.

Feedback is shared through a new SerializedFeedback object type,
essentially a byte array of serialized feedback. Currently, only
smi-based feedback is shared, but map-based feedback will be added in
the future.

SerializedFeedback is kept in the NCI cache alongside NCI Code
objects.  It is created on NCI cache insertion, and deserialized upon
NCI cache hits.

Bug: v8:8888
Change-Id: Ic0d5fbea3aa4d3b0a165624dab9d0283b07dcee7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2531775
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71224}
2020-11-17 11:13:56 +00:00
Vicky Kontoura
b777c1f9d2 [wasm] [cleanup] Refactor cctest
This CL just refactors the `test-run-wasm-wrappers.cc` cctest.

Bug: v8:10982
Change-Id: Ib8881c97c0cf395766d9b27a68ee440850df5d59
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2534819
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Vicky Kontoura <vkont@google.com>
Cr-Commit-Position: refs/heads/master@{#71222}
2020-11-17 09:12:22 +00:00
John Xu
ba681fdb93 Replace libc functions with base wrappers
Bug: v8:10927
Change-Id: Icbdc0d7329ddd466e7d67a954246a35795b4dece
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2507310
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71220}
2020-11-17 08:50:41 +00:00
Zhi An Ng
9b4514222e [wasm-simd][scalar-lowering] Fix replacement for call nodes
all_true, any_true, bitmask, and extract_lane all replace a simd type
with single scalar, so we don't need to set nullptr for the extraneous
lane, and can set num_lanes to 1.

So for a call node with any of the above nodes as one of its value, we
were incorrectly replacing the extract lane node with 4 nodes - it
should only be 1 scalar node.

Drive by fix for LowerShift, it needs to check if the shift value node
has replacement (e.g. if it is an extract lane node).

Also we weren't setting the lowered type of a kPhi node. This can be a
problem if the output of a Phi node is used by a F32x4ExtractLane and
I32x4ExtractLane, which is possible (and type correct since both take
v128). This will require that the output be both a float and a int,
which is impossible. So fix it to Int32x4, and the uses of the phi nodes
will convert appropriately.

Added a test for the call node. Also tested this code by running one of
our benchmarks, which exercises the Phi logic.

Bug: v8:10507
Change-Id: I01a76b349ba9d0e157b64e737bdb4c70f96aa954
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2536952
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71218}
2020-11-17 02:38:57 +00:00
Zhi An Ng
d8c8efecc4 [wasm-simd] Enable lowering for select test
With more of scalar lowering implemented, this test can now run with
lowering. The only other tests that skip lowering are prototype
instructions.

Bug: v8:10507
Change-Id: Ia149956d2d406b6f76eb9155765474c23b89b894
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2507317
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Ben Smith <binji@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71215}
2020-11-17 01:50:11 +00:00
Zhi An Ng
bebe54828e [wasm-simd][scalar-lowering] Set lowered types for S128Select S128AndNot
S128Select and S128AndNot relies on the inputs being lowered to I32x4,
since they use Word32Xor, but it wasn't correctly specified. This means
that by default, their lowered type was set to be the output's lowered
type. If the result of these operations were used by F32x4ExtractLane,
then their lowered type will be set to Float32x4, so the inputs will be
lowered to Float32x4, and we get incorrect type of registers allocated.

Bug: v8:10507
Change-Id: I16dc7f2dcdaf2188997ff345a6b0fd22e10b7b36
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2536953
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71214}
2020-11-17 01:48:21 +00:00
Leszek Swirski
87c81250cc [test] Skip parallel compile tasks tests under off-thread
It is becoming difficult to continue supporting the compiler dispatcher
and background compile task unittests alongside the off-thread
finalization work, so disable those tests when that flag is enabled.

Bug: chromium:1011762
Change-Id: Iba9aaa29b08723afb90edc127609fef1d63ceed5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2539908
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71211}
2020-11-16 15:50:20 +00:00
Jakob Kummerow
7e533de10e [wasm-gc] Fix several bugs
- allow arrays to be allocated in LargeObjectSpace
- check requested array allocation length against maximum
- fix array element offsets for pointer-typed elements
- fix GC handling of arrays when there are forwarding pointers
- module builder: fix rtt.sub global initializer expressions
- debug printing: print "UNIMPLEMENTED" instead of crashing
- WasmGCTester: make some exceptions easier to diagnose

Bug: v8:7748, chromium:1141376
Change-Id: Ie0281658748f3dd5e5d90d85bab78f0ea2fc3865
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2534815
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71208}
2020-11-16 14:57:00 +00:00
Igor Sheludko
93d49c39d8 [runtime] Rename Name::Hash() to Name::EnsureHash()
... and use Name::hash() where the hash is expected to be computed.
In particular, when we are dealing with internalized strings or symbols.

Bug: v8:11074
Change-Id: Ida22f134fee0ddf2c9b962d1bcca6aa0b632af5f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2529451
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71200}
2020-11-16 10:48:15 +00:00
Georg Neis
c85ab364d6 [compiler] Disable some tests on NCI
Split globals.js into two parts, one being skipped on NCI due to
assertions about optimization status.

Change-Id: Ifc572526d9c6aed369802a65d12c4456cde65ce0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2539909
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71199}
2020-11-16 10:31:47 +00:00
Leszek Swirski
df8425622d [offthread] Add string access lock to GetChars
Add a requirement to String::GetChars that we either have a string
access lock, or a string access lock is not needed. This prevents us
from reading strings during internalization that may be in the middle
of being made external.

To avoid taking the lock too often when known to be unnecessary (e.g.
for strings that were only just created), there's now a static
SharedStringAccessGuardIfNeeded::NotNeeded(). This is hopefully ugly
enough that it's used sparingly.

One fix required for this is to enter the Isolate when tearing down
IsolateData in inspector tests -- this is so that the V8Inspector
instance being torn down will see the current Isolate and be able to
verify its thread id against the current thread.

Bug: chromium:1011762, chromium:1148680
Change-Id: Ic5d29c1b066ebae5a351c7b4bb116b9b1bf61889
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2536465
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71197}
2020-11-16 10:13:55 +00:00
Marja Hölttä
7ed989817a [super] Rewrite perf tests
- Add tests comparing super property access to normal property access
- Shift the work so that the framework takes less time and the thing
we're trying to measure takes more time.
- Optimize / disable the optimization for the target function, not the
whole test framework.
- Reduce the amount of boilerplate code in the tests.

Bug: v8:9237
Change-Id: Idde133298c9b8ffb3d49945ef9c67f5039634598
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2536635
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71196}
2020-11-16 08:36:24 +00:00
Frank Tang
3af12e4848 [Intl] Fix ASAN crash listformat w/ > 9 items
Fix the ASAN crahs when there are 9 or more items to be formatted by
ListFormat.

chromium DEPS rolled in
https://chromium-review.googlesource.com/c/chromium/src/+/2536432

This CL is mainly to add unit test to ensure it fix.

Cq-Include-Trybots: luci.v8.try:v8_linux64_asan_rel_ng,v8_mac64_asan_rel_ng,v8_win64_asan_rel_ng;luci.chromium.try:android-asan,win-asan,win-libfuzzer-asan-relBug: chromium:1146068
Change-Id: I4dfbd6ea0efe5b398196f95abc520bb93e16a7cd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2528476
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71192}
2020-11-14 05:42:45 +00:00
Frank Tang
570086544d roll icu to Fix debug assertion in ICU Locale::setKeywordValue
chromium DEPS rolled in
https://chromium-review.googlesource.com/c/chromium/src/+/2536432

This CL is mainly to add unit test to ensure it fix.

Bug: chromium:1146468
Change-Id: I30505d9133136122023d80ff85edbf0abe49c07e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2535790
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71190}
2020-11-14 03:19:17 +00:00
Ulan Degenbaev
a18a674bb8 [api] Introduce a single-threaded version of DefaultPlatform
The new platform can be used in combination with --single-threaded.
It disables background threads and thus avoids waiting on mutexes
and condition variables completely, which is useful for V8 embedders
that fork the V8 process after initialization.

As a bonus the new platform allows use to test --single-threaded and
has already uncovered an existing bug in parallel pointer updating code.

Change-Id: I3446fa027d2a077641cdaac0cd08062a1acae176
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2416501
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71187}
2020-11-13 17:20:58 +00:00
Igor Sheludko
f72a719688 [test] Cleanup field type tracking cctests
... by adding ChangeAlertMechanism enum instead of two bool values and
removing code duplication in tests.

Bug: v8:11074
Change-Id: I90f63bd1c9e858dc3b0a4f190c19f092437257cd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2536458
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71185}
2020-11-13 17:02:23 +00:00
Georg Neis
2869fdfb17 [runtime][compiler] Be less strict about PropertyCell changes
Don't deopt when a PropertyCell changes from readonly to writable.
Turbofan doesn't depend on readonly-ness unless the property is
also non-configurable, in which case such a change can't happen.

Change-Id: I3d1078a8adf1ec1b16d973dd71c4295d71003a8d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2531791
Commit-Queue: Georg Neis <neis@chromium.org>
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71184}
2020-11-13 16:29:03 +00:00
Georg Neis
aaab2aca0d [runtime] Use release/acquire for JSGlobalObject's global dictionary
Bug: v8:7790
Change-Id: I4b6ef907c66bdc0a327d211db2f86ebb75f969a7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2536638
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71183}
2020-11-13 16:12:39 +00:00
Frank Emrich
05f41a557a [dict-proto] CSA version of ordered hash table allocation
Previously, CodeStubAssembler::AllocateOrderedHashTable() would
allocate hash tables of the (statically known) minimum capacity in-
dicated by the concrete table type.
This CL adds AllocateOrderedHashTableWithCapacity, which is inspired by
AllocateNameDictionary. It takes a Node<IntPtrT> indicating the desired
capacity.

Bug: v8:7569
Change-Id: I4bf28f69286e52773319a1ae37d33b2f55175a84
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2503950
Commit-Queue: Frank Emrich <emrich@google.com>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71175}
2020-11-13 10:48:59 +00:00
Alfonso Castaño
9ec952d765 Introduce CSPViolation as pause reason (V8)
This CL adds the CSPViolation pause reason.
Such an enum will be used to enable breakpoints on Trusted Type violations.

Design doc: https://docs.google.com/document/d/1rlRtq_Ai0leS9sqlRvoOL5RNc1BR6Q1yAVvLLJFasMA/
Frontend CL: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2520827
Follow-up CL: https://chromium-review.googlesource.com/c/chromium/src/+/2517519

Bug: chromium:1142804
Change-Id: Iefdbb52115d0ba1810527773a8a2828e795fe533
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2519513
Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Alfonso Castaño <alcastano@google.com>
Cr-Commit-Position: refs/heads/master@{#71172}
2020-11-13 09:42:04 +00:00
Simon Zünd
0625c06610 [inspector] Check for null pointer after creating a stack trace
Currently, we assume that stack trace creation always succeeds while
filling in the `exceptionDetails` structure. Stack trace creation can
fail under some circumstances so this CL introduces a null check.

R=clemensb@chromium.org

Bug: chromium:1147552
Change-Id: I4055d5276bbb7bf178b648bfc7bd84a288626c09
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2532310
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71169}
2020-11-13 07:37:13 +00:00
Shu-yu Guo
5f18a2e6a7 [flags] Remove --harmony-private-methods
It's shipped since M84.

Bug: v8:8330
Change-Id: Ia643948c0de83fc9a8faf7307b7fd86a1e117dc1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2511034
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71166}
2020-11-12 23:21:53 +00:00
Daniel Clark
73f8a71003 Sort import assertions by code point order of the keys
Per https://tc39.es/proposal-import-assertions/#sec-assert-clause-to-assertions,
import assertions should be sorted by the import assertion [[Key]]s,
in order to prevent hosts from relying on a changing order of the
assertions to determine behavior.

Prior to this change, the assertions were being sorted by pointer. With
this CL, the keys are sorted using a code point ordering so that the
order of the assertions received by the host will be stable and
non-surprising.

This CL also switches the SourceTextModuleDescriptor's ModuleRequestMap,
RegularExportMap, and RegularImportMap to use the code point order
comparison rather than their former shortlex sort.  This change will not
be externally visible, but it seems best to make these consistent.

In order to avoid #including the fairly large ast-value-factory.h
into ast/modules.h, I changed ImportAssertions into a separate class
definition rather than keeping it as a typedef.  The alternative would
be to define a common AstRawStringComparer in ast-value-factory.h and
then #include ast-value-factory.h in both ast/modules.h and
parsing/parser.h so that the ImportAssertions typedef would have a
full, shared definition of the AstRawStringComparer type.

Bug: v8:10958
Change-Id: I29c9544aa0a4340c56e1ee631be6cabb2a2eb921
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2533038
Commit-Queue: Dan Clark <daniec@microsoft.com>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71165}
2020-11-12 20:03:03 +00:00
Ross McIlroy
9e4cd2bcd3 [csa][cleanup] TNodify To<Int32,Int64,IntPtr,Smi>Constant
BUG=v8:6949,v8:11074

Change-Id: Ia5a52dcf42559d97eb6fd4a24f4abd3c40226017
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2531792
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71160}
2020-11-12 16:12:19 +00:00
Marja Hölttä
cdcf3c3134 [super] Use a feedback-collecting builtin in JSGenericLowering
Bug: v8:9237
Change-Id: I1e308a5a325b01fcdc9236f13080653f3be6d328
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2527095
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71155}
2020-11-12 15:06:39 +00:00
Vicky Kontoura
eb0ef4d7c8 [wasm] Reverse count logic for the tiering of js-to-wasm wrappers
This CL reverses the count logic for the tiering strategy of the
js-to-wasm wrappers. The initial approach was that calls to each
function were counted up, until a threshold was reached and the function
would tier up. With this CL, each function is assigned a budget of calls
that can be handled through the generic wrapper. Calls are counted down
until the budget is exhausted, which will trigger the tier-up
for the function.

This approach comes with two advantages. Firstly, determining whether
a function's budget is exhausted is as simple as checking the flags set
from the decrement of the budget. Secondly, the code generated by the
generic wrapper does not depend on the specific value of the initial
budget.

Bug: v8:10982
Change-Id: I5e186c6cf836a9c197b41d0f7ad075b07c87a4da
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2532300
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Vicky Kontoura <vkont@google.com>
Cr-Commit-Position: refs/heads/master@{#71153}
2020-11-12 14:31:25 +00:00
Clemens Backes
83a2f390f1 [inspector][fuzzer] Suppress messages about uncaught exceptions
The fuzzer is expected to generate a lot of syntax and runtime errors,
and the respective messages just flood the fuzzer output. By always
putting a {TryCatch} scope around the execution, we prevent those
messages from being printed.
At the same time, inspector tests need to properly propagate uncaught
exceptions in the backend to the inspector, and fail on uncaught
exceptions in the frontend.

This CL allows for all these behaviours by extending the
{CatchExceptions} enum and the {TryCatch} logic in the task runner.

Drive-by: Use {base::OS::ExitProcess} instead of the explicit
{fflush} and {_exit}.

R=szuend@chromium.org

Bug: chromium:1142437
Change-Id: Ic2cb3b0de2399d25bd8c53090575308cb0e09ab0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2529135
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71152}
2020-11-12 13:45:21 +00:00
Igor Sheludko
15c9ff0758 [runtime] Remove --modify-field-representation-inplace flag
which was enabled a long ago and is not supposed to be disabled.

In addition this CL adds Representation::MightCauseMapDeprecation()
predicate and ensures it's consistent with the existing
MostGenericInPlaceChange() and CanBeInPlaceChangedTo().

Bug: v8:11104, v8:8865
Change-Id: Ia8046b76822c9b20fe3ce85de6b98570334aad21
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2527088
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71151}
2020-11-12 13:44:15 +00:00
Andreas Haas
286f03bdf6 [wasm] Update spec tests
R=ecmziegler@chromium.org

Change-Id: Ifead2feecc5786630ab442d125826688dc170e1b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2534477
Reviewed-by: Emanuel Ziegler <ecmziegler@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71148}
2020-11-12 13:08:55 +00:00
Santiago Aboy Solanes
0367cc898a [compiler] Create concurrency tests for Strings
Bug: v8:7790
Change-Id: I7a7ed66f66e723192a45a05e68e20c11b8262598
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2495460
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71142}
2020-11-12 11:09:05 +00:00
Jakob Gruber
e14e1e4c56 [nci] Fix DCHECK(function->is_compiled()) in CompileOptimized
For NCI compilation tasks, we don't actually install the generated
Code object on the function. In that case, we cannot make assertions
about function state.

Bug: v8:8888,chromium:1146013
Change-Id: Ia2342c52e565ccb1f6b5b09dda5e998b3fd3eb3a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2532297
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71140}
2020-11-12 07:56:49 +00:00
Liu Yu
6927e97694 [mips64] Skip some tests about CheckedFloat64ToInt64 like arm64
Port: b4e2a1e35a

Change-Id: I875a33fba10bd59942392c38500c2b80515aa9cf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2528897
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71139}
2020-11-12 07:10:29 +00:00
Shu-yu Guo
f1ae68351f [flags] Remove --harmony-promise-any
It's shipped since M85.

Bug: v8:9808
Change-Id: I0c2dcda601aad33d4acb379b242799f9b09e8930
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2510869
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71137}
2020-11-12 01:09:38 +00:00
Ulan Degenbaev
889b27b8da [heap] Add a simple implementation of Heap::IsPendingAllocation
The new predicate allows a background thread to check if the given
object was recently allocated and may potentially be unsafe to read
from the background thread.

The current implementation has relatively high overhead as it loads
two pointers per heap space. It will be optimized in the future.

Bug: v8:11148

Change-Id: I2a9dfb2c70de4b8214b8f8a35681a8bab1a63ca8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2532296
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71130}
2020-11-11 17:45:18 +00:00
Daniel Clark
26c66541c8 Code review follow-ups from: Plumb import assertions through SourceTextModuleDescriptor's ModuleRequestMap
Address a few bits of code review feedback that came in after landing
https://chromium-review.googlesource.com/c/v8/v8/+/2493060:

- Add ModuleRequest:kAssertionEntrySize and use in place of a numeric
  literal.
- Get rid of ModuleRequestLocation and separate module_request_positions
  FixedArray, and merge these into AstModuleRequest and
  v8::internal::ModuleRequest.

Change-Id: If6d628d29bfa6fbd9933c6cdaa706623128ccc5d
Bug: v8:10958
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2530478
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Dan Clark <daniec@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#71125}
2020-11-11 16:36:48 +00:00
Michael Lippautz
0d827da34d cppgc: Add more basic type traits
Adds traits for checking for Member,WeakMember, and UntracedMember
types.

This allows the embedder to specify its own traits and restrictions
around cppgc types.

Bug: chromium:1056170
Change-Id: Ibe60b774128f72f1398267edd81233c50fca6eb7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2532299
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71121}
2020-11-11 14:59:08 +00:00
Jakob Gruber
273df17d8e [nci] Check Isolate::concurrent_recompilation_enabled
... instead of FLAG_concurrent_recompilation. The
optimizing_compile_dispatcher may be nullptr despite the flag being
set.

Bug: v8:8888,chromium:1145988
Change-Id: Ia3a6b1a95dde2b8cdd43dd2beebf04c66f145f78
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2531781
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71116}
2020-11-11 13:18:18 +00:00
Igor Sheludko
47ddc5b180 [runtime] Deconfuse Name::Hash() from Name::hash_field()
This CL
* renames Name::hash_field field to raw_hash_field.
* all local variables that store raw_hash_field value are also renamed
  to raw_hash_field where possible.

Bug: chromium:1133527, v8:11074
Change-Id: I17313f386110b33a64f629cc2b9d4afd1e06c6c0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2471999
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71114}
2020-11-11 12:21:07 +00:00