Commit Graph

53490 Commits

Author SHA1 Message Date
Stephan Herhut
f25656aee2 [wasm] Avoid zero extension after truncate
In wasm code, we sometimes see the pattern

<some 64 bit expression>
i32.wrap/i64
i32.load

where we generate an instruction to extend the 32 bit offset into a zero
extended 64 bit value for the actual load. However, the preceeding
truncate already yields a zero extended 32 bit value, so the extra
instruction is not needed. Even more, it might get in the way of
munching more computation into the final load.

This change adds information about the zero extending behavior to
the existing optimization that avoids the zero extension.

Bug: chromium:853685
Change-Id: Iab9179379923ecb88651df6091b3d9408341cf4c
Reviewed-on: https://chromium-review.googlesource.com/c/1421839
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Stephan Herhut <herhut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58998}
2019-01-22 15:42:04 +00:00
Clemens Hammacher
8a6d311830 [isolate] Remove dead declaration and dead definition
{Isolate::per_isolate_thread_data_key()} is not even defined, and
{Isolate::isolate_key()} is unused.

R=mstarzinger@chromium.org

Bug: v8:8562
Change-Id: I490989510865903c702158e33621c9990052c2a8
Reviewed-on: https://chromium-review.googlesource.com/c/1425907
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58997}
2019-01-22 15:26:32 +00:00
Ross McIlroy
162402f9c5 [Compile] Move decision of whether an IIFE is oneshot into parser.
The decision as to whether to optimize an IIFE as oneshot depends on
whether it's outer scope is the script scope. During lazy compile, we
might have discarded scopes which don't need a context between the IIFE
and the script scope, which means we might treat an IIFE as oneshot,
even though initial eager compile treated it as non-oneshot. Both
bytecode flushing and lazy source positions rely on us generating the
same bytecode during lazy compile as eager compile, so we move the
decision into the parser where it happens once and is then stored in
the SFI for any future lazy compiles.

BUG=v8:8395,v8:8510

Change-Id: I88f1e74ad95d47a2636c393ceb1318d7d610055d
Reviewed-on: https://chromium-review.googlesource.com/c/1421841
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58996}
2019-01-22 15:19:39 +00:00
Michael Starzinger
7d4ece425f [wasm] Implement {StackEffect} for exception opcodes.
This adds missing cases for exception handling opcodes to the stack
effect helper {WasmDecoder::StackEffect}. It is a first step towards
adding exception handling support to the {WasmInterpreter}.

R=clemensh@chromium.org
BUG=v8:8091

Change-Id: Idacf440a894e5c71a180502c1d2f10fa15c8f5fa
Reviewed-on: https://chromium-review.googlesource.com/c/1425911
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58995}
2019-01-22 15:15:19 +00:00
Sergiy Belozorov
71cb4777e7 Update V8 DEPS.
Rolling v8/build: 402bc6d..4b7e3ce

Rolling v8/third_party/googletest/src: 879ac09..9518a57

This also ports:
https://crrev.com/c/1410527

TBR=machenbach@chromium.org,hablich@chromium.org,sergiyb@chromium.org

Bug: chromium:922379
Change-Id: I3982ace35bb762e7f5c85ba9468739aedd3bcd78
Reviewed-on: https://chromium-review.googlesource.com/c/1424659
Reviewed-by: Sergiy Belozorov <sergiyb@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58994}
2019-01-22 14:49:04 +00:00
Michael Lippautz
1fc43aa889 [global-handles] Remove parallelization for minor MC
Reworking and adding a node type would require also adding
parallelization support for minor mc. Since this is unused and not
benchmarked right now, just remove it.

Bug: chromium:923361
Change-Id: Iaf67a743d76d2b37ffff9961b510bfd8a1bd15ff
Reviewed-on: https://chromium-review.googlesource.com/c/1425900
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58993}
2019-01-22 14:48:02 +00:00
Michael Lippautz
62938a980e Reland "[global-handles] Restructure GC post processing"
This reverts commit 5043ab2670.

Tbr: ulan@chromium.org
Bug: chromium:923361
Change-Id: I3a2cf2c29fe4dc424def8dc086856ed3301f2fc2
Reviewed-on: https://chromium-review.googlesource.com/c/1425904
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58992}
2019-01-22 14:38:02 +00:00
Toon Verwaest
d5143f3f37 [parser] Change how we detect let as lexical declaration
Change-Id: I907ace62da903dd57cb86b608c0f96ac49623976
Reviewed-on: https://chromium-review.googlesource.com/c/1426130
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58991}
2019-01-22 14:31:52 +00:00
Toon Verwaest
e5b773888e [parser] Simplify PreParser::ExpressionFromIdentifier
Change-Id: I2abd9ef9591a5e65dcb3fd0231c8d7467296b576
Reviewed-on: https://chromium-review.googlesource.com/c/1426127
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58990}
2019-01-22 14:16:32 +00:00
Sigurd Schneider
d7ad2e583b Remove unnecessary includes
This saves about 80,000 LoC after preprocessor expansion.

Bug: v8:8562
Change-Id: I67b20edb73b801ddcc2937b84468241e3076535f
Reviewed-on: https://chromium-review.googlesource.com/c/1425906
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58989}
2019-01-22 14:11:20 +00:00
peterwmwong
f2227a2bce [builtins] Port TypedArray ConstructByArrayLike to Torque
This is part of an effort to improve the performance of TA#subarray.

Bug: v8:7161
Change-Id: I6f4b0f01e498d48e0fce11fbf7dcd7a0ad1ae748
Reviewed-on: https://chromium-review.googlesource.com/c/1425002
Commit-Queue: Peter Wong <peter.wm.wong@gmail.com>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58988}
2019-01-22 13:44:52 +00:00
Tobias Tebbi
c5154eeada [build][torque] remove workarounds for clang bug
Now that https://bugs.llvm.org/show_bug.cgi?id=40118 has been fixed and
rolled into V8, we can remove the workarounds for this Clang bug.

This also effectively reverts
https://chromium-review.googlesource.com/c/v8/v8/+/1280222

Bug: chromium:893437
Change-Id: Ia0d6d8ebdafafbc380b1b7a7809ef16effe50d71
Reviewed-on: https://chromium-review.googlesource.com/c/1425519
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58987}
2019-01-22 13:38:46 +00:00
Tobias Tebbi
0cd74947b6 [turbofan] fix Turbolizer output by running FinalizeCode only once
Change-Id: I0517ac0c9b8d83809fa51a2828f91211c97f6ffc
Reviewed-on: https://chromium-review.googlesource.com/c/1424956
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58986}
2019-01-22 13:37:43 +00:00
Michael Lippautz
5043ab2670 Revert "[global-handles] Restructure GC post processing"
This reverts commit 2b77aaf47c.

Reason for revert: https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux64%20-%20cfi/18836

Original change's description:
> [global-handles] Restructure GC post processing
> 
> Bug: chromium:923361
> Change-Id: I97a0314b6d5af543e0574f27892c73637739844d
> Reviewed-on: https://chromium-review.googlesource.com/c/1426124
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58984}

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

Change-Id: I8220c60573cf7f4a1ced99bcd18628933c45f41e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:923361
Reviewed-on: https://chromium-review.googlesource.com/c/1425901
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58985}
2019-01-22 12:56:41 +00:00
Michael Lippautz
2b77aaf47c [global-handles] Restructure GC post processing
Bug: chromium:923361
Change-Id: I97a0314b6d5af543e0574f27892c73637739844d
Reviewed-on: https://chromium-review.googlesource.com/c/1426124
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58984}
2019-01-22 12:18:30 +00:00
Dan Elphick
7f12e75ad8 [parsing] Never marks script scopes as sloppy eval
This prevents the bytecode generator generating loads that look for
extensions in the global context, which can never succeed and means
that lazy and eager bytecode compilation will match.

Bug: v8:8510
Change-Id: I51dca62b5d1ee34f8dea82260cf27295ddf427d9
Reviewed-on: https://chromium-review.googlesource.com/c/1425520
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58983}
2019-01-22 11:54:42 +00:00
Ulan Degenbaev
3f25e56f58 [heap] Activate the memory reducer on smaller heaps
Currently the memory reducer is activated only after the first mark-
compact GC, which triggered after the old generation reaches 8 MB.

That threshold is too large for mobile. This patch adds a heuristic
to activate the memory reducer if the old generation expands by more
than 1 MB after the bootstrap.

Change-Id: Ic38bc6e2fe8887677f764246c45e38d237e49a94
Reviewed-on: https://chromium-review.googlesource.com/c/1425898
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58982}
2019-01-22 11:14:32 +00:00
Peter Marshall
decfb42aeb [logger] Untangle log.h includes
Everything was including log.h through heap-inl.h, so remove that
include by moving the one user into heap.cc, and then fix all the
include errors.

This reduces the log.h include ball from ~550 to ~100.

Change-Id: I6d09bc2f365b48645fcfdc695a68ea12539a745d
Reviewed-on: https://chromium-review.googlesource.com/c/1424198
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58981}
2019-01-22 10:56:52 +00:00
Daniel Clifford
8c17e1142a Revert "[torque] Implement safe initialization of classes through hidden structs"
This reverts commit d11a0648af.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [torque] Implement safe initialization of classes through hidden structs
> 
> Initialization of classes now happens atomically at the end of the
> class constructor only once all of the values for the class' fields
> have been fully computed. This makes Torque constructors completely
> GC safe, e.g. hardened against allocations or exceptions in
> constructors.
> 
> As part of this change, make the 'this' parameter for method calls
> explicit rather than implicit.
> 
> Drive by: add validation to check for duplicate field declarations
> 
> Bug: v8:7793
> Change-Id: I8b5e85980d6a103ef9fc3262b76f6514f36ebf88
> Reviewed-on: https://chromium-review.googlesource.com/c/1411252
> Commit-Queue: Daniel Clifford <danno@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58979}

TBR=danno@chromium.org,tebbi@chromium.org

Change-Id: Id6c46c175f53c5a77db1e6ca242586fba34cd02e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7793
Reviewed-on: https://chromium-review.googlesource.com/c/1426121
Reviewed-by: Daniel Clifford <danno@chromium.org>
Commit-Queue: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58980}
2019-01-22 10:29:08 +00:00
Daniel Clifford
d11a0648af [torque] Implement safe initialization of classes through hidden structs
Initialization of classes now happens atomically at the end of the
class constructor only once all of the values for the class' fields
have been fully computed. This makes Torque constructors completely
GC safe, e.g. hardened against allocations or exceptions in
constructors.

As part of this change, make the 'this' parameter for method calls
explicit rather than implicit.

Drive by: add validation to check for duplicate field declarations

Bug: v8:7793
Change-Id: I8b5e85980d6a103ef9fc3262b76f6514f36ebf88
Reviewed-on: https://chromium-review.googlesource.com/c/1411252
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58979}
2019-01-22 10:03:11 +00:00
Georg Neis
f6549bafe9 [turbofan] Implement serializer support for CreateClosure
This includes generalizing the notion of hints to allow for
unallocated functions, represented by a pair of SFI and FeedbackVector.

Bug: v8:7790
Change-Id: I7887665e1981b2039ecd626b82aebd5b5b64263c
Reviewed-on: https://chromium-review.googlesource.com/c/1424946
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58978}
2019-01-22 10:02:06 +00:00
Georg Neis
63db761542 [turbofan] Prepare broker and serializer for CreateClosure support
When inlining based on CreateClosure, we don't have a JSFunction but
only the SharedFunctionInfo and FeedbackVector.

Bug: v8:7790
Change-Id: I7a3cf50710273c7175e43e969d2364cff11c3d93
Reviewed-on: https://chromium-review.googlesource.com/c/1421357
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58977}
2019-01-22 09:19:12 +00:00
Mathias Bynens
effb7ad728 [esnext] Add more hashbang syntax tests
BUG=v8:8523

Change-Id: Id913493bcf0d43da8f4f7cd33921e24d4d94b901
Reviewed-on: https://chromium-review.googlesource.com/c/1425521
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#58976}
2019-01-21 22:38:06 +00:00
Michael Lippautz
0781f42b67 [global-handles] Deprecate unused methods
Bug: chromium:923361
Change-Id: I520b2778b8a2fe3fcd52570f3a91758bc949f374
Reviewed-on: https://chromium-review.googlesource.com/c/1425897
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58975}
2019-01-21 19:50:04 +00:00
Ulan Degenbaev
1c1c2e515e [heap] Make --trace-gc-verbose imply --trace-gc
Change-Id: I428149f7e9b462bf75187ae0e10115a663579e43
Reviewed-on: https://chromium-review.googlesource.com/c/1425522
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58974}
2019-01-21 18:08:44 +00:00
Camillo Bruni
c3722aa5e8 [parser] Fix storing has_data bit for inner function preparse data
Drive-by-fix:
- improve PreparseData::Print

Bug: chromium:923705
Change-Id: I0b0b9baf1c2cc68dccd987007081e0d5c0969c4a
Reviewed-on: https://chromium-review.googlesource.com/c/1425201
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58973}
2019-01-21 18:04:34 +00:00
Camillo Bruni
e1b82b2de6 [parser] Use Varint encoding for Uint32 preparse data items
Many values stored in the preparse data for the skippable functions
fit in one byte most of the time. The varint encoding uses a single
continue bit per byte to tell whether there is a following byte.

Change-Id: Ia0a622ba42a338fc91eea1e0c1a72d2582d9f867
Reviewed-on: https://chromium-review.googlesource.com/c/1400842
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58972}
2019-01-21 17:08:59 +00:00
Tobias Tebbi
752882fd3d [torque] add "struct" keyword to VS Code plugin
TBR: szuend@chromium.org

Change-Id: Ifef721eecab79dbcfb306dd241b3476fc1b6ec56
Reviewed-on: https://chromium-review.googlesource.com/c/1424952
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58971}
2019-01-21 16:42:33 +00:00
Clemens Hammacher
6962334df8 [platform] Allow to memory-map empty files
This current fails, since {mmap} fails with EINVAL for empty mappings.
The destructor already has special handling for a {nullptr} mapping, so
we can just use {nullptr} for empty files. We get a similar error on
windows, and can fix it the same way.

On order to make presubmit checks happy, we have to skip copyright
checking and checking for terminating newlines for empty files.

R=mlippautz@chromium.org

Change-Id: I2b73da7ff6df72d8bdd40df1fff6422e0a46881e
Reviewed-on: https://chromium-review.googlesource.com/c/1424861
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58970}
2019-01-21 16:02:47 +00:00
Michael Starzinger
6091e27027 [wasm] Simplify safepoint-table encoding.
This removes the unused "argument count" field from the safepoint table
as the field was unused by now and always contained the value zero.

Also note that associating a callee's argument count with the call-site
is not compatible with tail-call support. When tail-calling a function
with a different number of arguments, the information associated with
the call-site becomes stale. The number of arguments is a property of
the callee, not of the call-site in the caller. For this reason the
field in question is not usable to support reference types in function
arguments (at least when tail-calls are also supported).

R=ahaas@chromium.org

Change-Id: If667d729267f2dd2642b755c54235cc08ca9b141
Reviewed-on: https://chromium-review.googlesource.com/c/1402548
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58969}
2019-01-21 15:58:22 +00:00
Toon Verwaest
dd59ff29a5 [parser] Move MakeNonSimpleParameter to DeclarationScope
Walk the VariableMap instead of the ast.

Change-Id: I03ee9145230bcbfe04c5e31dc8d8b3a98a00a4be
Reviewed-on: https://chromium-review.googlesource.com/c/1424865
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58968}
2019-01-21 15:18:57 +00:00
Maya Lekova
337c773069 [turbofan] Add handling of Construct to the serializer
This CL adds handling for Construct bytecode to the serializer
for backgorund compilation, similar to the hanling of Call* bytecodes.

Design doc:
https://docs.google.com/document/d/1vCQYhtFPqXafSMweSnGD8l0TKEIB6cPV5UGMHJtpy8k/edit?ts=5bf7d341

Bug: v8:7790
Change-Id: If518ba44fff18c1b30fdf5c764bdb9e77886af78
Reviewed-on: https://chromium-review.googlesource.com/c/1424947
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58967}
2019-01-21 15:13:40 +00:00
Clemens Hammacher
2e161cfd5b [wasm] Make WireBytesStorage keep wire bytes alive
The purpose of the {WireBytesStorage} (typically held in a shared_ptr
itself) is to keep the actual wire bytes alive. Thus implement it this
way for the {NativeModuleWireBytesStorage}.

R=mstarzinger@chromium.org

Bug: v8:8689
Change-Id: I8f171b4fa8b80b517badb1b1d3228503a32830dd
Reviewed-on: https://chromium-review.googlesource.com/c/1421362
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58966}
2019-01-21 14:36:46 +00:00
Toon Verwaest
0dc02e7c00 [parser] Move locals limit check from PatternRewriter to VariableDeclarationParsingScope
Change-Id: Id9955037b2de03d151e038f57f922429d85f06b3
Reviewed-on: https://chromium-review.googlesource.com/c/1425197
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58965}
2019-01-21 13:59:56 +00:00
Ross McIlroy
332122a2b7 [Counters] Only create TLS key for WorkerThreadRuntimeCallStats if used.
BUG=chromium:919394

Change-Id: I99d0b557f8d52c87c4422cd971a43211e5d5e849
Reviewed-on: https://chromium-review.googlesource.com/c/1425198
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58964}
2019-01-21 13:53:56 +00:00
Michael Lippautz
42e0bf22c5 [global-handles] Update declarations
The change is just a refactoring without functional changes.

Bug: chromium:923361
Change-Id: Ie633c56122ff72658f0238dc40db698350a7b8e7
Reviewed-on: https://chromium-review.googlesource.com/c/1421363
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58963}
2019-01-21 13:45:12 +00:00
Leszek Swirski
b51ee85c0f Revert "[scanner] Micro-optimize AdvanceUntil"
This reverts commit bfc9eb2e8c.

Reason for revert: Micro-benchmark regressions (crbug.com/923823)

Original change's description:
> [scanner] Micro-optimize AdvanceUntil
> 
> Replace std::find_if in AdvanceUntil with a manual loop, which can
> then return early, skipping the branch comparing to buffer_end_.
> 
> Change-Id: If49ed3667877751fcb0103a742750f03e5bd50db
> Reviewed-on: https://chromium-review.googlesource.com/c/1411351
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58846}

TBR=leszeks@chromium.org,verwaest@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: 923823

Change-Id: I2475e18fb1d52d47b32b34e261c6f1aa46b3c1ce
Reviewed-on: https://chromium-review.googlesource.com/c/1425200
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58962}
2019-01-21 13:29:37 +00:00
Clemens Hammacher
ce2bfb8e2f [Liftoff][arm] Avoid use of temp registers
The temp registers might be needed by the assembler, so avoid using them
in LiftoffAssembler. Use Liftoff cache registers instead. This might
introduce additional spills if all registers are in use, but this is
unlikely.

This also simplifies the logic to ensure non-aliasing of certain
registers.

R=ahaas@chromium.org

Bug: chromium:922933, v8:6600
Change-Id: Ie929d9de0b6f4f41c6117d820b6a367dd0a342f7
Reviewed-on: https://chromium-review.googlesource.com/c/1424862
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58961}
2019-01-21 13:09:13 +00:00
Toon Verwaest
0d37b80d05 [parser] Track names in VariableDeclarationParsingScope
This allows us to stop tracking variables_ in the preparser.

This currently makes us track slightly more variables than neccessary in the
case `for (var ...` since `var ... of` needs to check conflicts with out simple
catch variables. We should probably track the names through a ScopedPtrList
instead of a ZonePtrList anyway. Then it won't matter anymore.

Change-Id: I64e3f9ab13af8269456439cf15b0bc4d5b9e5380
Reviewed-on: https://chromium-review.googlesource.com/c/1421360
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58960}
2019-01-21 13:05:22 +00:00
Clemens Hammacher
6c2e35b90b Reland "[wasm] Split compilation in three stages"
This is a reland of 4e1d7c87b9.
Failure on arm and arm64 is fixed by https://crrev.com/c/1411885.

Original change's description:
> [wasm] Split compilation in three stages
>
> In order to refactor ownership between objects in wasm compilation, the
> compilation (executed by background tasks) is split in three stages:
> getting a compilation unit (while holding a mutex), executing the work
> (without any mutex and without keeping the NativeModule alive), and
> submitting the work (with a mutex again).
>
> This CL prepares this design by splitting compilation from submission.
> Both steps are still executed right after each other. This will be
> changed in a follow-up CL.
>
> R=titzer@chromium.org
> CC=mstarzinger@chromium.org
>
> Bug: v8:8689
> Change-Id: I2f92aee8e2f2d45470d8c63314ed026341630902
> Reviewed-on: https://chromium-review.googlesource.com/c/1414920
> Reviewed-by: Ben Titzer <titzer@chromium.org>
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58929}

TBR=titzer@chromium.org

Bug: v8:8689
Change-Id: I58ff07d0e0ac8df0f6ee23c416f992954f4673d2
Reviewed-on: https://chromium-review.googlesource.com/c/1422748
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58959}
2019-01-21 12:51:06 +00:00
Clemens Hammacher
ac8115044e Prepare disassembling unpublished wasm code
This extends the CodeReference class to be able to hold a pointer to
a CodeDesc struct which represents finished but unpublished wasm
code.
For readability, it refactors the implementation of the dispatch for
the different CodeReference kinds.

R=mstarzinger@chromium.org

Bug: v8:8689
Change-Id: Idd031dffaa9d80740c073b6cca0fc3561c5df0c1
Reviewed-on: https://chromium-review.googlesource.com/c/1411885
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58958}
2019-01-21 12:19:13 +00:00
Peter Marshall
7da7c0bdb7 [logger] Start cleaning up Logger class
- Use unique ptrs for owned objects
- Remove friendship with CpuProfiler and replace with public API
- Remove unused method LogFailure()
- Remove StopProfiler() which was only used by LogFailure() (removed)
  and one test, which can use StopProfilerThread() instead
- Remove 'paused' state which was only used by the above
- Remove 'engage' state. There is no reason we need this as along as
  users keep track of Engage/Disengage calls

Drive-by cleanup:
- Remove import of log.h from profile-generator.h
- Remove unnecessary includes of log.h

Change-Id: Ifc4ca156bef038c40953f8361ffea17788e3a59b
Reviewed-on: https://chromium-review.googlesource.com/c/1424338
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58957}
2019-01-21 11:53:32 +00:00
Clemens Hammacher
f77299e1f5 [Liftoff] Fix DCHECK error
Fix fixes a minor DCHECK error, which fired because usually only
LiftoffRegisters of the same type should be compared against each
other. In the RegisterReuseMap we store both register pairs and single
registers, hence check for pair vs non-pair comparisons explicitly.

R=ahaas@chromium.org

Bug: v8:6600, chromium:922670
Change-Id: I18beb61b6b1906cc42bcf6e7dfdd5eb803e874d7
Reviewed-on: https://chromium-review.googlesource.com/c/1421921
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58956}
2019-01-21 11:52:17 +00:00
Peter Marshall
1f1bd71dd0 [cpu-profiler] Remove registration and sampling depth from Sampler
Simplify the internal state of Sampler a bit. There are basically two
users of Sampler - the CpuSampler used by the CpuProfiler and the
Ticker used by log.cc. Ticker calls Start/Stop to manage the Sampler
lifetime, but CpuProfiler does not. This leads to much confusion and
overlap of functionality.

Fix that here by removing the distinction between active, registered
and isProfiling states. These are now all the same thing and are
represented by IsActive(). The state is set to active when Start is
called, and set inactive when Stop is called. Both users of Sampler
now call Start and Stop at appropriate times.

The concept of profiling depth was not used - each Sampler would
only ever have a sampling depth of 1. We still need to call
SignalHandler::IncreaseSamplerCount(), so we do that in Start
and the corresponding DecreaseSamplerCount() in Stop.

Change-Id: I16a9435d26169a7dd00b1c7876e66af45f12e4b0
Reviewed-on: https://chromium-review.googlesource.com/c/1424337
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58955}
2019-01-21 11:45:12 +00:00
Toon Verwaest
c45850cd1e [parser] Declare variables through ExpressionScope
Use variable tracking from ExpressionScopes rather than the PatternRewriter and
PreParserExpression::variables_ to declare variables.

We only figure out that variables are non-simple parameters once we see the
first non-simple parameter. This still uses the pattern rewriter to make
variables non-simple (kLet instead of kVar).

Change-Id: I4a4ee4852d667c26806bb24896722cfea3e093f2
Reviewed-on: https://chromium-review.googlesource.com/c/1417630
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58954}
2019-01-21 11:37:32 +00:00
Camillo Bruni
c45a2eff0b [heap] Allow PreparseData in large object space
Since the PreparseData now directly contains the byte data inline it can
grow very large as well.

Bug: chromium:923264
Change-Id: I456d5bcbfb40587b283584f726d9e084061fd30f
Reviewed-on: https://chromium-review.googlesource.com/c/1421321
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58953}
2019-01-21 11:18:02 +00:00
Simon Zünd
bf17cd2150 [array] Add stack overflow check for Array#flat
This CL adds a stack check to the TFS builtin "FlattenIntoArray" as it
is called recursively and can cause a SEGV with a large enough
"depth" argument.

R=jgruber@chromium.org

Bug: v8:8708
Change-Id: I833506531bcff1c4703b9a21678028cf0e63638d
Reviewed-on: https://chromium-review.googlesource.com/c/1424858
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58952}
2019-01-21 10:39:45 +00:00
Tamer Tas
a8784a400b [testrunner] remove infra_staging tests for stable behavior
With and without infra_staging flag testrunner behaves the same for old
features. This CL removes duplicate tests testing the same behavior.

R=machenbach@chromium.org
CC=yangguo@chromium.org,sergiyb@chromium.org

No-Try: true
Bug: v8:8174
Change-Id: Icf7bea15b2343b90697016d050fa0d918a99997d
Reviewed-on: https://chromium-review.googlesource.com/c/1424859
Reviewed-by: Sergiy Belozorov <sergiyb@chromium.org>
Commit-Queue: Tamer Tas <tmrts@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58951}
2019-01-21 10:38:40 +00:00
Peter Marshall
ba56557793 [cpu-profiler] Cleanup and use std atomics in Sampler
There's no reason to use our self-baked atomics anymore. Also

- Changes two boolean values to use a boolean instead of an int
- Uses a unique ptr for data_
- Removes has_processing_thread_ which is not used
- Moves most initialization inline into the class
- Removes SetUp/TearDown which weren't needed

Change-Id: I8f50133636961502d56351abd2fb17196603a01a
Reviewed-on: https://chromium-review.googlesource.com/c/1422918
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58950}
2019-01-21 10:35:11 +00:00
Toon Verwaest
b4e7d11178 [parser] Reparsing arrow function head upon failure can overflow the stack
Bug: chromium:923723
Change-Id: Ic397642c2e803b2ada95fa87ece31032eb104782
Reviewed-on: https://chromium-review.googlesource.com/c/1424857
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58949}
2019-01-21 10:12:10 +00:00