Commit Graph

64170 Commits

Author SHA1 Message Date
Jeremy Roman
018e370041 [api] Correct comment on deprecated v8::String::IsExternal.
Bug: v8:10641
Change-Id: I9248c6877ead34e622b94cd32959b6570f824e15
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2390442
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69678}
2020-09-02 15:18:48 +00:00
HyeockJinKim
02a42939e7 Fixed bytecode generation of spread operation
During spread operation, after VisitForAccumulatorValue,
set the position of the current expression again

Bug: chromium:929844
Change-Id: I6e9ca87587789f9cb21e939d4405414c8170b232
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2379531
Commit-Queue: HyeockJin Kim <kherootz@gmail.com>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69677}
2020-09-02 14:30:48 +00:00
Zeynep Cankara
78b04f24d0 [tools][system-analyzer] Unify map-processor and ic-processor
This CL unifies the map-processor and ic-processor into a
single log processing pipeline. Unified processing pipeline
prevents doing 2 pass over the data.

Bug: v8:10644

Change-Id: Ic0221a9bb32901f43202390b98fded4830a50f70
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2385496
Commit-Queue: Zeynep Cankara <zcankara@google.com>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69676}
2020-09-02 13:59:18 +00:00
Jakob Gruber
d4cf7d1f6a Fix various typos (and add one DCHECK)
A random grab-bag of trivial fixes I came across while working on
another CL.

Bug: v8:8888
Change-Id: I6e46e1fe5a547854d8afbac19f7e049f1661c406
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2388113
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69675}
2020-09-02 13:56:20 +00:00
Camillo Bruni
9d413c635d [api] Deprecate misleading v8::String::IsExernal method
v8::String::IsExternal is confusing since it only checks for external
two byte strings. The goal is to reintroduce String::IsExternal which
checks for one and two byte external strings after removing the old,
misleading api method.

- Add String::IsExternalTwoByte
- Deprecate String::IsExternal for now since it is misleading


Bug: v8:10641
Change-Id: I8989de7576c823846e0536fc1898e769b6d68c87
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2284495
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69674}
2020-09-02 13:35:20 +00:00
Zeynep Cankara
a73ffca3a4 [tools][system-analyzer] Find Unique IC/Map types and improve Map panel
This CL enables showing map details of the selected map coming from
FocusEvent. It also improves UI experience of selecting a map from
map transitions, highlighting selected map.

Additionally, stores information about unique map/IC events in model
for the timeline-track legend.

Bug: v8:10644
Change-Id: Ieb8a2ac0bf1af282d55bce18130192d7178538da
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2387564
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Zeynep Cankara <zcankara@google.com>
Cr-Commit-Position: refs/heads/master@{#69673}
2020-09-02 13:07:40 +00:00
Ulan Degenbaev
473b388197 Skip no-op stores when enforcing flag implications
The d8 shell modifies compiler flags in PrepareStressRun after isolate
was already set up and has run some JS code. Updating these flags
forces recomputation of implications for all flags.

This causes no-op stores to some unrelated flags that are accessed
from background threads leading to benign data races.

Bug: v8:10315
Change-Id: I568445d4382ae392970deccbf9588c98e46a4a4e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2390140
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69672}
2020-09-02 12:55:50 +00:00
Marja Hölttä
7dc8d1f380 [IC] Clarify receiver vs holder some more
This is a follow up for
https://chromium-review.googlesource.com/c/v8/v8/+/2362918 .

The "slow" path in HandleLoadICSmiHandlerLoadNamedCase was using
only "receiver", even though it should've considered both "receiver"
and "holder".

Bug: v8:9237
Change-Id: I5d7ba1f72e8bf55f9533f648054abf5d25c85533
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2387576
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69671}
2020-09-02 12:40:10 +00:00
Michael Lippautz
1083a6e2ca cppgc: Fix MarkingVerifier for in-construction objects
- Avoid invoking Trace() for in-construction objects as the method may
  access uninitialized fields, e.g., fields that have bogus state with
  zeroed memory like std::list.
- Conservatively scan in-construction objects for pointers.
- Verify that stack scan indeed finds all in-construction objects that
  are present on the heap and vice versa.

Bug: chromium:1056170
Change-Id: I2c68da2b8072f715b5a0dcdb1202d5f874c6c6e9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2388106
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69670}
2020-09-02 11:54:20 +00:00
Zeynep Cankara
fec33d84cd [tools][system-analyzer] Implement drag-handlers to timeline panel
This CL adds drag handlers to the timeline panel
to filter events based on the selected portion
of the timeline tracks.

Bug: v8:10644
Change-Id: Ic8a38493eacb62844b3fed5a027f8b1367f2bb59
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2346275
Commit-Queue: Zeynep Cankara <zcankara@google.com>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69669}
2020-09-02 11:33:40 +00:00
Martin Bidlingmaier
943f78a4ec [regexp] Fix usage of {Is,Mark}PcProcessed in NfaInterpreter
Previously we checked whether a thread's pc IsPcProcessed before pushing
to the stack of (postponed) active_threads_.  This commit moves the
IsPcProcessed check and corresponding MarkPcProcessed call to when the
thread is actually processed, i.e. when it is popped from the
active_threads_ stack again.

This fixes two issues:
- Consider what used to happen in the following scenario:
1. An active thread t is postponed (e.g. because it is a fork) and
 pushed on active_threads_.  IsPcProcessed(t.pc) is false, so t is
 not discarded and does actually end up on active_threads_.
2. Some other thread s is executed, and at some point s.pc == t.pc,
 i.e. t.pc is marked as processed.
3. t is popped from active_threads_ for processing.

In 3 we don't want to continue execution of t: After all, its pc is
already marked as processed.  But because previously we only checked
for IsPcProcessed in step 1 before pushing to active_threads_, we used
to continue execution in 3.  I don't think this is a correctness
issue, but possibly a performance problem.  In any case, this commit
moves the IsPcProcessed check from 1 to 3 and so fixes this.
- After flushing blocked_threads_, we push them to active_threads_
again.  While doing so, we used to mark these thread's pcs as processed.
This meant that sometimes a (fork of a) high priority thread was
cancelled by the IsPcProcessed check even though its pc was only
marked as processed by a thread with lower priority during flushing.
We need it to be the other way round:  The low priority thread should
be cancelled after its pc is processed by a thread with higher
priority.
With this commit we don't MarkPcProcessed during flushing, it's
postponed to when we're actually processing.  This was a correctness
issue, and there's a new corresponding test case.


Bug: v8:10765
Change-Id: Ie12682cf3f8a04222d907edd8a3ad25baa69465a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2388112
Commit-Queue: Martin Bidlingmaier <mbid@google.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69668}
2020-09-02 11:32:35 +00:00
Andreas Haas
aaff9d37a0 [test] Disable wasm-js/limits for sanitizers
The test is slow and checks the limits of the WebAssembly
implementation. Sanitizers are slower and therefore sometimes run into
timeouts. Therefore we just disable the test for sanitizers.

R=leszeks@chromium.org

Change-Id: I4a0cb994dfc34097849f0dd8528dc158883fbc8a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2389980
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69667}
2020-09-02 11:31:30 +00:00
Ulan Degenbaev
1d53ad7ecc [heap] Allow background threads to expand the heap on tear down
Garbage collection requests from background threads are ignored if
the heap is tearing down. This fixes CanExpandOldGenerationBackground
to check for that case.

Bug: v8:10315
Change-Id: I79b6a4446bf3c9037dbca54849c87f022be76b49
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2387964
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69666}
2020-09-02 10:47:30 +00:00
Michael Achenbach
b22aa7865a [test] Make test compatible with numfuzz
The test is incompatible with --noenable-sse4-1, which is randomly
added by numfuzz (and possibly other fuzzers).

The "Flags" from the test files are always passed last and are often
used to neuter incompatible flags.

Bug: v8:10863
Change-Id: I8fd11b4d38586f25f5af63ab8ef83873dc250557
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2389982
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69665}
2020-09-02 10:28:20 +00:00
Cong Zuo
67206a6ce9 [runtime] Fix PrintRegisters should not output to default stdout
PrintRegisters() should print output to `os` argument for unification,
and in case of the function would be used by other files.

Bug: v8:10821
Change-Id: Ia825c4deaf89ec454b7c293367cfa362acd4cccc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2371543
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69664}
2020-09-02 10:05:22 +00:00
Victor Gomes
a2fd94f014 [execution] Add argument count to the standard frame
This adds the argument count (as intptr) to the standard frame.
StandardFrames are now in the same shape as OptimizedFrames.

The argument count in the stack will be used to tear down the arguments when we remove the arguments adaptor frame.

Change-Id: If9cc2946321bc1bb0abb776521e2d5b683ab0532
Bug: v8:10201
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2312783
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69663}
2020-09-02 09:27:30 +00:00
Leszek Swirski
88619ce5cd [serializer] Fix missing changes to bytecode value encoding
https://crrev.com/c/2369172 had a few remaining comments that
accidentally weren't addressed in the final submitted patch.

Tbr: jgruber@chromium.org
Change-Id: If0cff18f5078f17a6f70d27c71090dcc64f23ddd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2388114
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69662}
2020-09-02 08:55:40 +00:00
Michael Lippautz
42d2cd757d cppgc: Typo and signature fix
Change-Id: I4e2a0ddbeba68a4cc136bb6d56383b0a7e4f1dff
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2388107
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69661}
2020-09-02 07:34:20 +00:00
v8-ci-autoroll-builder
120f0b4c37 Update V8 DEPS.
Rolling v8/build: 482dd77..6d55754

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/1eb42f5..156bfc1

Rolling v8/third_party/requests: https://chromium.googlesource.com/external/github.com/kennethreitz/requests/+log/refs/ta..bfb93d4

Rolling v8/third_party/zlib: d53accf..59187e1

Rolling v8/tools/clang: fcef86e..03bacc3

TBR=machenbach@chromium.org,tmrts@chromium.org,v8-waterfall-sheriff@grotations.appspotmail.com

Change-Id: Iceea7cbadbbe4e8a480517051425d1a44d76066d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2388173
Reviewed-by: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#69660}
2020-09-02 03:55:00 +00:00
Ng Zhi An
1f9103e5a9 [wasm-simd][arm] Fix i64x2.neg
We were using vqsub incorrectly (which saturates), we need vsub
(wraparound).

Found this issue while running spec test simd_i64x2_arith.js.

Bug: v8:10835
Change-Id: Ic9d45d69e64fa5ff9ddad5de4690f3dd32d1384e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2389100
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69659}
2020-09-01 22:47:21 +00:00
Seth Brenith
3017f895f1 Revert "[regalloc] Run SpillPlacer on any value defined in a loop"
This reverts commit 7f05467914.

Reason for revert: regressions on Emscripten/Fannkuch and
JetStream/richards

Original change's description:
> [regalloc] Run SpillPlacer on any value defined in a loop
> 
> I previously wrote a comment that said "We haven't seen any indication
> of performance improvements from seeking optimal spilling positions
> except on loop-top phi values". That statement is no longer true, now
> that I've looked a little harder. In the latest version of the Mono
> interpreter, we can improve performance by 2.5% by enabling SpillPlacer
> for any value defined within a loop.
> 
> Bug: v8:10606
> Change-Id: I25e06458c87ad4ffcefe52be3042032e05a47b35
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2381557
> Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#69646}

TBR=rmcilroy@chromium.org,seth.brenith@microsoft.com,thibaudm@chromium.org

Change-Id: Ic3e74485f42bafedfe1890c0be32a29c3455afe5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10606, chromium:1124028
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2388745
Reviewed-by: Seth Brenith <seth.brenith@microsoft.com>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#69658}
2020-09-01 21:54:46 +00:00
Ng Zhi An
d77e016e98 [wasm-simd][liftoff][ia32][x64] Fix swizzle
Swizzle codegen was incorrect when mask == dst, which can happen since
we did not pin dst. We can simplify this by using scratch register for
mask.

This bug was encountered while trying to run the spec test simd-lane.js.

Bug: v8:10835
Change-Id: Ie9c8f383bb6f336f9b74955fb7a9aee0e6774bf2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2388743
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69657}
2020-09-01 21:53:42 +00:00
Bill Budge
b7704fb184 [wasm][simd] Revert changes to F32x4 Min/Max
- Restores the old inline code sequence, since the branching version
  doesn't set the NaN high bit.

Bug: v8:10862
Change-Id: Iad8ee47b678cc1c6c04222dd83b2fa588ea9136c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2387557
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69656}
2020-09-01 21:42:29 +00:00
Arno Renevier
d022b74c4e [builtins] Use fast path for JSArray source in TypedArray.from()
For TypedArray, a fast path is used when using the builtin iterator, and
next method has not been overriden. If we use that fast path for JSArray
too, the method will be about 200x times faster on a large array.

This patch also fixes a bug when a typed array is modified during the
mapper execution. In that case, the modification should not be taken
into account.

Bug: v8:10802

Change-Id: I74e2cbcd6a654def318585b4e08745037584669a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2358749
Commit-Queue: Arnaud Renevier <arenevier@fb.com>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69655}
2020-09-01 20:53:19 +00:00
Michael Achenbach
463ccd0eeb [test] Bump shards on slow builder
NOTRY=true
TBR=leszeks@chromium.org

Change-Id: I5abb432e42168484aabf04600e8e2cf6e3511630
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2388105
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69654}
2020-09-01 19:36:59 +00:00
Michael Lippautz
aa4b47b978 cppgc: Fix GCInvoker task handle
The handle was always created empty which resulted in a DCHECK crash
in debug builds and in never-cancelled tasks in release builds.

Bug: chromium:1056170
Change-Id: I798ce65c37738bbe9c60b44b692ff04536f6d830
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2388101
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69653}
2020-09-01 19:15:09 +00:00
Ng Zhi An
47b60053d2 Extra flag check for sse4_1
Fuzzers use a slight variant of the sse4_1 flag, see
https://source.chromium.org/chromium/chromium/src/+/master:v8/tools/testrunner/testproc/fuzzer.py;l=26;drc=9491d5eaa4e764721b5269e75af68f181bef09cf.

Bug: v8:10863
Change-Id: Ifc467644f00a4f10776794c12a227f13774f48ca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2387555
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69652}
2020-09-01 19:05:59 +00:00
Ng Zhi An
c771a480d8 [wasm-simd] Add some more NaNs to test array
There were some +/- infs hidden in that list of NaNs (and those were
repeated too). Add a NaN with top bit of payload unset. This will help
catch cases where we did not canonicalize results properly.

Bug: v8:10862
Change-Id: I05e3e0b2351430abf3eaa859a0d828f43b44cfb6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2386483
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69651}
2020-09-01 18:52:19 +00:00
Z Nguyen-Huu
e61b224e17 remove ID field from StackTraceFrame
Marked GetStackFrameId V8_DEPRECATED

Bug: v8:10566
Change-Id: I2e225eae7d0375cff7b9f79e4c38802265940219
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2352475
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69650}
2020-09-01 17:15:29 +00:00
Gus Caplan
d4d0cf3262 [api] add reflection apis for v8::Data
Allows reflection of v8::Data types, such as being able to check if a
value is a v8::Module. This is useful for libraries which wrap the V8
API, such as rusty_v8.

Change-Id: I4841c5f7f60885b20e1504c8562e278844ff7ec3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2382719
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Gus Caplan <snek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69649}
2020-09-01 16:31:59 +00:00
Andreas Haas
10e2311f8a [test] Enable --wasm-tier-up when test does serialization
With a recent change, we require WebAssembly code to be tiered up to
serialize it, see https://crrev.com/c/2349290. In that CL tests were
adjusted to set the --wasm-tier-up flag when serialization was involved.
However, the test adjusted in this CL was missing, because this test
used the kExprRefNull instruction, which caused a bailout to TurboFan
anyways. With recent changes, Liftoff can compile kExprRefNull now,
and therefore causes problems.

R=thibaudm@chromium.org

Bug: v8:10852
Change-Id: I9b89f37c22f17cbf046110f3ee1c98bfea73e009
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2387574
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69648}
2020-09-01 15:35:09 +00:00
Peter Marshall
ca6675ed95 [cpu-profiler] Add stats to track missing or unnattributed frames
This adds a global counter for the various reasons we might fail to
attribute a tick.

The counters are cleared and printed when Profile::Print() is called,
which we call in our tests, so flaky test output will now contain these
stats along with the printed profile tree.

Drive-by cleanup some print functions and make them const.

Change-Id: Ia3a27405f5b5346adfdbb32afc7e414857969cc5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1550406
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69647}
2020-09-01 15:14:49 +00:00
Seth Brenith
7f05467914 [regalloc] Run SpillPlacer on any value defined in a loop
I previously wrote a comment that said "We haven't seen any indication
of performance improvements from seeking optimal spilling positions
except on loop-top phi values". That statement is no longer true, now
that I've looked a little harder. In the latest version of the Mono
interpreter, we can improve performance by 2.5% by enabling SpillPlacer
for any value defined within a loop.

Bug: v8:10606
Change-Id: I25e06458c87ad4ffcefe52be3042032e05a47b35
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2381557
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#69646}
2020-09-01 15:02:09 +00:00
evih
42fcb2c25f [wasm] Use generic js-to-wasm wrapper for n int32 param case
The generic wrapper can be used for Wasm functions with int32 parameters
and no return values.

Changed the GC scanning for the generic wrapper.

Added tests for cases when all the parameters of the Wasm function fit
into registers and when some of the parameters are on the top of the
stack.

Change-Id: I511fd04d2a4a2bdc4a6f72d72e2867a03b256f6f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2381459
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Eva Herencsárová <evih@google.com>
Cr-Commit-Position: refs/heads/master@{#69645}
2020-09-01 12:31:09 +00:00
Jake Hughes
1a5ef0816b [heap] Add conservative stack scanning
When enabled with the v8_enable_conservative_stack_scanning flag, a
snapshot of the call stack upon entry to GC is used to determine part of
the root-set. When the collector walks the stack, it looks at each value
and determines whether it could be a potential on-heap object pointer.

This is very experimental. For conservative stack scanning to work,
direct handles must be implemented.

Bug: v8:10614
Change-Id: Id4209cfbe76ef02239c903fabcb7f677b32fc977
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2375201
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69644}
2020-09-01 12:21:29 +00:00
Andreas Haas
024f2c4b80 [wasm][fuzzer] Enable trap handlers only once
The fuzzer function is called multiple times with libfuzzer. Trap
handlers, however, should only be initialized once. With this CL we add
a flag to initialize trap handlers only once.

R=clemensb@chromium.org

Bug: chromium:1122590
Change-Id: Ib51a50cfe9dad5e3133de3085ad147f5a069b1bd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2384769
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69643}
2020-09-01 12:03:59 +00:00
Leszek Swirski
1a4efddb9a [serializer] Clean up value encoding in bytecodes
Unify the encoding/decoding of values into a ranged bytecode with a
single templated class that takes the bytecode, minimum, and maximum,
and provides Encode and Decode methods.

This class also handles range checks on both the input and output,
which (along with a few other byte cases) allows us to get rid of the
PutSection method.

Change-Id: Icb2cd409607ce7b650226eb8dca80c0e363a8acc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2369172
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69642}
2020-09-01 11:36:24 +00:00
Leszek Swirski
e7278a2858 [DEPS] Add third_party/requests to deps
This fixes the Android Arm perf build after https://crrev.com/c/2365216

TBR=machenbach@chromium.org

Fix: v8:10867
Change-Id: Ic67c0d8b6334179356a6662a352039e445f92389
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2387572
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69641}
2020-09-01 11:35:19 +00:00
Junliang Yan
081a86fd3d ppc: implement reverse js arg
Change-Id: Ica6b886ca0b16ab6eb86f3a90c598a0801230648
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2385918
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69640}
2020-09-01 10:41:09 +00:00
Clemens Backes
2d0b17d5b2 [wasm] Do not contribute to concurrent recompilation
If multiple recompilations are triggered at the same time, we cannot
contribute to compilation, because this would bump the number of workers
above the maximum expected concurrency.

This is a quick fix, a better (but more involved) fix would be to make
the number of queues grow dynamically.

R=thibaudm@chromium.org

Bug: chromium:1123471

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: I30e4b2a057098ad7267ae942e5845b0cefe60e0b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2387561
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69639}
2020-09-01 10:23:48 +00:00
Peter Marshall
3243506267 Revert "[cpu-profiler] Ensure sampled thread has Isolate lock under Windows"
This reverts commit dfb3f7daa5.

Reason for revert: Breaks LSAN & ASAN flakily: https://bugs.chromium.org/p/v8/issues/detail?id=10861

Original change's description:
> [cpu-profiler] Ensure sampled thread has Isolate lock under Windows
> 
> While the sampler checked if the sampled thread had the Isolate locked
> (if locks are being used) under Linux, the check was not done under
> Windows (or Fuchsia) which meant that in a multi-threading application
> under Windows, thread locking was not checked making it prone to seg
> faults and the like as the profiler would be extracting info from a
> heap in motion. The fix was to move the lock check into CpuSampler
> and Ticker (--prof) so all OSes would do the correct check.
> 
> The basic concept is that on all operating systems a CpuProfiler, and
> so its corresponding CpuCampler, the profiler is tied to a thread.
> This is not based on first principles or anything, it's simply the
> way it works in V8, though it is a useful conceit as it makes
> visualization and interpretation of profile data much easier.
> 
> To collect a sample on a thread associated with a profiler the thread
> must be stopped for obvious reasons -- walking the stack of a running
> thread is a formula for disaster. The mechanism for stopping a thread
> is OS-specific and is done in sample.cc. There are currently three
> basic approaches, one for Linux/Unix variants, one for Windows and one
> for Fuchsia. The approaches vary as to which thread actually collects
> the sample -- under Linux the sample is actually collected on the
> (interrupted) sampled thread whereas under Fuchsia/Windows it's on
> a separate thread.
> 
> However, in a multi-threaded environment (where Locker is used), it's
> not sufficient for the sampled thread to be stopped. Because the stack
> walk involves looking in the Isolate heap, no other thread can be
> messing with the heap while the sample is collected. The only ways to
> ensure this would be to either stop all threads whenever collecting a
> sample, or to ensure that the thread being sampled holds the Isolate
> lock so prevents other threads from messing with the heap. While there
> might be something to be said for the "stop all threads" approach, the
> current approach in V8 is to only stop the sampled thread so, if in a
> multi-threaded environment, the profiler must check if the thread being
> sampled holds the Isolate lock.
> 
> Since this check must be done, independent of which thread the sample
> is being collected on (since it varies from OS to OS), the approach is
> to save the thread id of the thread to be profiled/sampled when the
> CpuSampler is instantiated (on all OSes it is instantiated on the
> sampled thread) and then check that thread id against the Isolate lock
> holder thread id before collecting a sample. If it matches, we know
> sample.cc has stop the sampled thread, one way or another, and we know
> that no other thread can mess with the heap (since the stopped thread
> holds the Isolate lock) so it's safe to walk the stack and collect data
> from the heap so the sample can be taken. It it doesn't match, we can't
> safely collect the sample so we don't.
> 
> Bug: v8:10850
> Change-Id: Iab2493130b9328430d7e5f5d3cf90ad6d10b1892
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2377108
> Reviewed-by: Peter Marshall <petermarshall@chromium.org>
> Commit-Queue: Peter Marshall <petermarshall@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#69623}

TBR=akodat@rocketsoftware.com,petermarshall@chromium.org,petermarshall@google.com

Change-Id: Ib6b6dc4ce109d5aa4e504fa7c9769f5cd95ddd0c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10850
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2387570
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69638}
2020-09-01 10:21:41 +00:00
Martin Bidlingmaier
e2aa1a89dd [regexp] Split experimental regexp code into multiple files
Bug: v8:10765
Change-Id: I49e425d861d900ab66b6f7801cddec8a7175ac03
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2385462
Commit-Queue: Martin Bidlingmaier <mbid@google.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69637}
2020-09-01 10:15:38 +00:00
Leszek Swirski
7c912ffac1 [serializer] Serialize map before object
Change the serialization protocol to ensure that maps are serialized
before objects using them. This ensures that as soon as we allocate
space for an object, we can immediately write the object's map into that
allocation. In the future, this will allow us to make deserialized
object visible to the GC.

Specifically, this forces map serialization to happen after emitting
a kNewObject for an object, but before allocating the space for it. We
have to serialize the map after kNewObject because otherwise the map
itself would be written into the "current" slot, into which the object
is supposed to be deserialized.

Objects whose maps are currently being deserialized are considered
"pending" -- started, but not yet allocated. The map might point to a
pending object (e.g. if an object's constructor points to the object).
This is solved by introducing a new concept of forward references, where
the field referring to the pending object is serialized as a "pending
forward reference" which is "resolved" once the object is allocated.

It might also point to itself, in the case of the meta map -- this is
simply solved by introducing a new bytecode for the meta map; this
cannot be a pending forward reference because the meta map is not yet
allocated, so its map slot cannot be registered as pending.

Finally, we may need to go to a new chunk after serializing the map; so
after the map serialization, we peek to see if there's a next chunk
bytecode before the object allocation.

Bug: v8:10815
Change-Id: Ifa8f25bdaf3b15b5d990a1d2e7be677c2fa80013
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2362953
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69636}
2020-09-01 10:12:38 +00:00
Leszek Swirski
b39de69a36 [serializer] Clean up deserializer case macros
Rewrite the deserializer case macros to look, to formatters, more like
a single case value, and clean up some of the repetition to be more
explicit, e.g. replace

  SIXTEEN_CASES(kFoo)
    impl()

with

  case CASE_REPEAT(kFoo, 16):
    impl()

This should help with auto-formatting issues when modifying the big
deserializer switch statement.

As a drive-by, also clean up the per-space case macros to use a
function rather than a macro for specifying the bytecode, and add
helpers for encoding fixed raw data size in the bytecode (similar to
the existing helper for fixed repeat counts).

Change-Id: I885ba79afef03b95ad64cd78bdfba5dffc82be1e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2367853
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@{#69635}
2020-09-01 10:09:49 +00:00
Santiago Aboy Solanes
5d471ee6df [unwinder] Clean up existing tests
Mostly a cleanup for x64.

Also enable two tests for Arm and Arm64 since they do not make use of
JSEntry frames.

Bug: v8:10833
Change-Id: Id6adadf582bdca0076460842ffe4ec856ca99393
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2381455
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69634}
2020-09-01 09:46:29 +00:00
Clemens Backes
0ab923b8c0 [API] Add missing include for <atomic>
{std::atomic} is being used in the header without including the <atomic>
header. It was reported on the v8-users list that this causes compile
errors on Windows.

R=ulan@chromium.org

Change-Id: I1de19c301ce47787628416bf0e744d0dd7507fa3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2387562
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69633}
2020-09-01 07:46:09 +00:00
Frank Tang
c1a198333b Reland "[Intl] Ship Intl.Segmenter"
This is a reland of c6d3516ffb

Original change's description:
> [Intl] Ship Intl.Segmenter
> 
> Spec: https://tc39.es/proposal-intl-segmenter/
> ECMA402 site: https://github.com/tc39/proposal-intl-segmenter
> I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/MJ1OpvkcA8s/m/mYNxpwqSCAAJ
> I2I: https://groups.google.com/a/chromium.org/g/blink-dev/c/muRQBwyzzPw/m/rB_2I9t0CQAJ
> Design Doc: https://docs.google.com/document/d/1xugLpLmgRFnNXK8ztariTAbD2IXueDw1T3VNuuZCz8k/edit
> CPS: https://www.chromestatus.com/feature/6099397733515264
> Test262 Tests: https://github.com/tc39/test262/tree/main/test/intl402/Segmenter
> v8 tests: https://source.chromium.org/chromium/chromium/src/+/master:v8/test/intl/segmenter/?q=test%2Fintl%2Fsegmenter&ss=chromium
> 
> Approved by API Owners: yoav@yoav.ws / chrishtr@chromium.org / bratell.d@gmail.com
> 
> Bug: v8:6891
> Change-Id: I64775ed63557a9e1af77560abd42349742bc4c03
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2376967
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#69593}

Bug: v8:6891
Change-Id: I0908c859ce4c7875860f5839a2548b55daea3c89
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2380440
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69632}
2020-09-01 07:08:18 +00:00
v8-ci-autoroll-builder
296e80d722 Update V8 DEPS.
Rolling v8/build: 2dbf41f..482dd77

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/77fb6d1..1eb42f5

Rolling v8/third_party/depot_tools: c73782c..ed15af5

Rolling v8/tools/clang: 89d15db..fcef86e

TBR=machenbach@chromium.org,tmrts@chromium.org,v8-waterfall-sheriff@grotations.appspotmail.com

Change-Id: Id3cf39f4f058d8cd46c93c6ccc5edf6c345f7d0d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2386623
Reviewed-by: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#69631}
2020-09-01 03:34:08 +00:00
Omer Katz
aa923b1c85 cppgc: Update heap growing heuristics for incremental gc
Heap growing estimates when to start  incremental gc such that it
will finish when we are expecting to finalize (i.e. when an atomic
gc would be triggered).
There is also a minimum ratio between limit for atomic gc and limit
for incremental gc, to guarantee that incremental gc get's some time to
run even with the application rarely allocates.

This is a continuation of:
https://chromium-review.googlesource.com/c/v8/v8/+/2377691

Bug: chromium:1056170
Change-Id: I8c87e98d60b6f8b5748558771a236f15385f7858
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2381454
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69630}
2020-08-31 21:56:03 +00:00
Milad Farazmand
db837d580f PPC/s390: [wasm-simd][mips] Skip test on arch without SIMD
Port 524fa743da

Original Commit Message:

    This regression test does not work on MIPS without SIMD since the scalar
    lowering is not complete yet. Skip it for now.

R=zhin@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: I0338593de3160dc0864c066e607b6030956e3efa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2386141
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#69629}
2020-08-31 20:28:15 +00:00