Commit Graph

54363 Commits

Author SHA1 Message Date
Benedikt Meurer
066e2a2d79 [turbofan] Properly thread through the feedback for HeapObject checks.
We somehow forgot to thread through the VectorSlotPair for the CALL_IC
based speculation feedback to CheckedTaggedToTaggedPointer. This was
showing for example with `String#concat()` where we ended up with an
endless deoptimization loop if the parameter was a Smi.

Bug: v8:8913
Change-Id: I84d90403f6fada9b435d4eb71c689edc3c34dc86
Reviewed-on: https://chromium-review.googlesource.com/c/1488770
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59871}
2019-02-26 14:19:49 +00:00
tzik
334510a994 Use handler's context on Promise resolution
V8 used to use the microtask context when it runs EnqueueJob
step 2.
> Let job settings be some appropriate environment settings object.
https://html.spec.whatwg.org/multipage/webappapis.html#enqueuejob(queuename,-job,-arguments)

However, it's being updated to use the handler's context.
https://github.com/whatwg/html/issues/1426#issuecomment-340071080

Change-Id: I24840a28ef2c903539fe4ace74ae59da290f5109
Reviewed-on: https://chromium-review.googlesource.com/c/1465902
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59870}
2019-02-26 14:11:29 +00:00
Yang Guo
399a6f53ce Disallow JS during GC
R=mlippautz@chromium.org

Change-Id: Ic1d2fce007ddcb72f56ad257032e434c575a3f8d
Reviewed-on: https://chromium-review.googlesource.com/c/1456104
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59869}
2019-02-26 13:22:34 +00:00
Allan Sandfeld Jensen
385aa80aff Correct removal of redundant moves
The logic for removing while iterating is non-standard and
a left over from a previous index based loop. This patch
replaces it with a standard erase based version.

This fixes a runtime crash with MSVC that invalidates the
iterator and then asserts. This also makes the code safe
in case the last move can be redundant.

Change-Id: Ie6990e0d65a3b83a4b7da3e2e89ed4e60a6cd215
Reviewed-on: https://chromium-review.googlesource.com/c/1488762
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59868}
2019-02-26 13:21:28 +00:00
Igor Sheludko
561aaa3066 [cleanup] Fix signature of RawMachineAssembler::Comment()
Bug: v8:8834
Change-Id: I4d57b15f2d5058511a2c474897a52cac236a6a00
Reviewed-on: https://chromium-review.googlesource.com/c/1488767
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59867}
2019-02-26 13:16:38 +00:00
Toon Verwaest
acfe59212a [preparser] Split GetSymbol into GetSymbol and GetIdentifier
GetSymbol previously always internalized the underlying string, even if the
preparser does not need it. The most common case where this isn't needed is
property name parsing. This seems to speed up preparsing quite a bit.

For future reference: Property names in object literals still are needed due to
various checks (e.g., get 'constructor', duplicate __proto__, ...); as well as
cover grammar parsing (property names can turn into variable references). If we
turn all strings that the preparser needs to identify back into contextual
keywords we may be able to avoid the former.

Change-Id: I549e4600053de3136ca08d4915cc04db36d66a89
Reviewed-on: https://chromium-review.googlesource.com/c/1488764
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59866}
2019-02-26 13:09:48 +00:00
Simon Zünd
b95550e82b [torque] Add NameExpression to get SourcePositions for identifiers
This CL introduces a new expression that can replace "std::string"
fields in other expressions. The main goal is to get SourcePositions
for identifiers to make them available in the language server.

The CL introduces a separate symbol "name", that allows to
incrementellay replace strings with name expression where needed. As
an example, variable delcarations now use a NameExpression for the
variable name.

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

Bug: v8:7793
Change-Id: I5b88bbaeac597b8e9760d2e01880e5e599ebf802
Reviewed-on: https://chromium-review.googlesource.com/c/1488752
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59865}
2019-02-26 12:48:58 +00:00
Igor Sheludko
cfdf421852 [cleanup] Remove ExternalReference::fixed_typed_array_base_data_offset
... which always contains constant value.

Bug: v8:8834
Change-Id: I27af24d07371b112d48eaab4d3a782a74af5fb20
Reviewed-on: https://chromium-review.googlesource.com/c/1487611
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59864}
2019-02-26 12:47:48 +00:00
Georg Neis
6070e74d8c [turbofan] Preprocess feedback for ElementAccessInfo computation.
When --concurrent_inlining is on, precompute (during serialization)
the list of receiver maps and the transition matrix of element
accesses.

Bug: v8:7790
Change-Id: I257eaea630f33831ab6600851ccdf297e17e35ca
Reviewed-on: https://chromium-review.googlesource.com/c/1475769
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59863}
2019-02-26 12:37:47 +00:00
Jaroslav Sevcik
0686bf7ba3 Reduce scope of optimizing compiler dispatcher's output queue guard
... as suggested by the bug's reporter.

Bug: chromium:935358
Change-Id: Iab9d207e4f55a395d0496ef5d5ea0e9b6783ae66
Reviewed-on: https://chromium-review.googlesource.com/c/1488757
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59862}
2019-02-26 11:46:06 +00:00
Yang Guo
8c9fe2d8a1 Use null prototype for extras binding and utils objects
R=bmeurer@chromium.org

Bug: chromium:934201
Change-Id: I73048fef3afea5d06be88a2768d77f7e349daef5
Reviewed-on: https://chromium-review.googlesource.com/c/1488760
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59861}
2019-02-26 11:41:56 +00:00
Toon Verwaest
c47a8f63f3 [preparser] Avoid name.string_ nullptr check in failure mode
By making EmptyIdentifierString (used for failure-mode parsing) point to the
empty_string() we can drop nullptr checks in the preparser. This is similar to
what the parser already does.

Change-Id: I4640f7ae6b24afc8d5275818caed0cca185ca72c
Reviewed-on: https://chromium-review.googlesource.com/c/1488759
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59860}
2019-02-26 11:27:04 +00:00
Michael Achenbach
da138ed927 [build] Prepare renaming gcc builders
We'll remove the gcc version from the builder name in a follow up.

TBR=sergiyb@chromium.org
NOTRY=true

Bug: chromium:933093
Change-Id: I65359afd7245f155f7d1fd0519033ab8f8f736bb
Reviewed-on: https://chromium-review.googlesource.com/c/1488758
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Sergiy Belozorov <sergiyb@chromium.org>
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59859}
2019-02-26 11:08:24 +00:00
Toon Verwaest
dcd70aa177 [parser] Use ScopedPtrLists for temporary lists in DesugarLexicalBindingsInForStatement
That way we can avoid allocating unreusable zone memory.

Change-Id: I0f30cbf5133026c63a9729bc45e728daa4740e9f
Reviewed-on: https://chromium-review.googlesource.com/c/1488756
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59858}
2019-02-26 10:54:34 +00:00
Sigurd Schneider
d2729be4ae Revert "Optimize in operator"
This reverts commit 32fc0acfef.

Reason for revert:

https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8-Blink%20Linux%2064/30270

layout test breakage:

https://test-results.appspot.com/data/layout_results/V8-Blink_Linux_64/30270/webkit_layout_tests%20%28with%20patch%29/layout-test-results/results.html

There is a dead node arriving in representation selection, which might indicate that the problem is not in this CL, but that this CL stirs up the node soup in such a way that dead code elimination gets confused.

Original change's description:
> Optimize `in` operator
> 
> This change implements optimizations for the `in` operator for packed array
> elements and object properties. It adds a new feedback slot kind and an IC
> path similar to KeyedLoadIC for handling the lookups. TurboFan uses the
> feedback to optimize based on the maps and keys.
> 
> For more details see:
> https://docs.google.com/document/d/1tIfzywY8AeNVcy_sen-5Xev21MeZwjcU8QhSdzHvXig
> 
> This can provide 10x performance improvements of on loops of the form:
> 
>     for (let i = 0; i < ary.length; ++i) {
>       if (i in ary) {
>         ...
>       }
>     }
> 
> 
> Bug: v8:8733
> Change-Id: I766bf865a547a059e5bce5399bb6112e5d9a85c8
> Reviewed-on: https://chromium-review.googlesource.com/c/1432598
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Commit-Queue: Matt Gardner <magardn@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#59843}

TBR=ulan@chromium.org,rmcilroy@chromium.org,jkummerow@chromium.org,jarin@chromium.org,ishell@chromium.org,bmeurer@chromium.org,verwaest@chromium.org,magardn@microsoft.com

Change-Id: Ib2db974e5bed4c4a2b6b450f796bdc4b0b8fd562
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8733
Reviewed-on: https://chromium-review.googlesource.com/c/1488761
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59857}
2019-02-26 10:40:26 +00:00
Michael Starzinger
f94cd449e4 [wasm] Flip section code for exception and data-count.
This flips the section codes for the exception section (part of the
exception handling proposal) and the data-count section (part of the
bulk memory proposal).

Also see the following discussions for the underlying motivation:
https://github.com/WebAssembly/bulk-memory-operations/pull/42
https://github.com/WebAssembly/exception-handling/issues/70

R=binji@chromium.org
BUG=v8:8868

Change-Id: I9f5f524e7aec067720346a5bb8d45c7c80a4c7a2
Reviewed-on: https://chromium-review.googlesource.com/c/1478207
Reviewed-by: Ben Smith <binji@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59856}
2019-02-26 10:38:42 +00:00
Georg Neis
5ac4f47405 Add .ccls-cache to .gitignore
This directory is created by ccls (language server for C++ and others).

R=sigurds@chromium.org

Change-Id: I2413921ca896ad2003fcfd10fdadb739f1af18c8
Reviewed-on: https://chromium-review.googlesource.com/c/1487151
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59855}
2019-02-26 10:32:45 +00:00
Sigurd Schneider
4b6b8cf610 [cleanup] Start cleaning up utils.h
Remove EmbeddedVector from utils.h

Bug: v8:8834, v8:8912
Change-Id: I04e9f12121757bd0b87c68d7a4a5b213c2d8b686
Reviewed-on: https://chromium-review.googlesource.com/c/1486473
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59854}
2019-02-26 10:22:05 +00:00
Sergiy Belozorov
c89c54ef7a Update V8 DEPS.
Rolling v8/build: 9f11dc3..ebd384a

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

Change-Id: I1cb46f5fdd1604f0beb509e18a1bda31bbe8a2e1
Reviewed-on: https://chromium-review.googlesource.com/c/1485245
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@{#59853}
2019-02-26 10:18:14 +00:00
Michael Starzinger
85b4ec5090 [wasm] Fix {StreamingDecoder} to reject multiple code sections.
R=ahaas@chromium.org
TEST=mjsunit/regress/wasm/regress-935138
BUG=chromium:935138

Change-Id: I73465e0edcdfcd33b96764ffaf5f33519e424bb8
Reviewed-on: https://chromium-review.googlesource.com/c/1486471
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59852}
2019-02-26 09:59:44 +00:00
Michael Achenbach
fa07eba873 [test] Switch gcc testing to Xenial
NOTRY=true
TBR=sergiyb@chromium.org

Bug: chromium:933093
Change-Id: I48236ef06c990526b72be418773d0a098c85178f
Reviewed-on: https://chromium-review.googlesource.com/c/1488754
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59851}
2019-02-26 09:45:14 +00:00
Georg Neis
bbba0c4d9e [runtime] Remove redundant empty-string check in lookup iterator
Change-Id: I2d5b54c88bece3e22c4ae25d7fba094647f64f52
Reviewed-on: https://chromium-review.googlesource.com/c/1487051
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59850}
2019-02-26 09:14:04 +00:00
Matt Gardner
73d16d9ad8 Remove obsolete MSVC 10.0 workaround for std::floor
MSVC 14.x and 15.x handle -0 correctly unless /fp:fast is used. /fp:precise
is the default.


bug: v8:3477, v8:8912
Change-Id: I242a1dfd845f750cab7c56f13107612259d44d23
Reviewed-on: https://chromium-review.googlesource.com/c/1487414
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59849}
2019-02-26 08:28:13 +00:00
Simon Zünd
45dfb6c340 [torque-ls] Implement basic Json parser for the language server
This CL contains a basic Json parser used to read and write the
Json-RPC messages of the language server protocol.

This CL is part of the initial language server implementation but
submitted separately for easier review.

R=tebbi@chromium.org

Bug: v8:8880
Change-Id: Icea040975e1ed1d587954c3342d8d876e01c26b8
Reviewed-on: https://chromium-review.googlesource.com/c/1479956
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59848}
2019-02-26 07:38:03 +00:00
Caitlin Potter
0cd67eb7c5 [esnext] ship "hashbang" syntax
Turns --harmony-hashbang on by default.

Intent to ship: https://groups.google.com/d/msg/v8-dev/hlCVa_XZ3TM/UWjjyOq3FwAJ
ChromeStatus page: https://www.chromestatus.com/feature/5134505706782720

BUG=v8:8523
R=gsathya@chromium.org, mathias@chromium.org, adamk@chromium.org

Change-Id: I821f69e45eb0a63a3f49181e2b88b0bcd091af2c
Reviewed-on: https://chromium-review.googlesource.com/c/1486113
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#59847}
2019-02-25 20:56:45 +00:00
Z Duong Nguyen-Huu
5c4dd9f05e gm .check should work in win
currently it cannot call run-tests.py since it use Linux path

Change-Id: I15af9c7e6503e6d473611a24f5f223ff68b1dbbd
Reviewed-on: https://chromium-review.googlesource.com/c/1484110
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#59846}
2019-02-25 20:14:29 +00:00
Frank Tang
2f61777d06 Reland "[Intl] Ship Intl.Locale"
This is a reland of f1b21a1066

Original change's description:
> [Intl] Ship Intl.Locale
> 
> Bug: v8:7684
> Change-Id: I5994c3fc4b97c4322c4e0cf20305da75e66efd5a
> Reviewed-on: https://chromium-review.googlesource.com/c/1478220
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#59780}

Bug: v8:7684
Change-Id: I4f73205398a9649e2f55a1b090cd3afffade68c4
Reviewed-on: https://chromium-review.googlesource.com/c/1480918
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59845}
2019-02-25 19:04:04 +00:00
Z Duong Nguyen-Huu
4726e82bfd Add more test for non extensible packed object
Bug: v8:6831
Change-Id: I6e9f6fc718928f2f86d3b3c2dd144a6636b05790
Reviewed-on: https://chromium-review.googlesource.com/c/1481895
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59844}
2019-02-25 18:31:44 +00:00
Matt Gardner
32fc0acfef Optimize in operator
This change implements optimizations for the `in` operator for packed array
elements and object properties. It adds a new feedback slot kind and an IC
path similar to KeyedLoadIC for handling the lookups. TurboFan uses the
feedback to optimize based on the maps and keys.

For more details see:
https://docs.google.com/document/d/1tIfzywY8AeNVcy_sen-5Xev21MeZwjcU8QhSdzHvXig

This can provide 10x performance improvements of on loops of the form:

    for (let i = 0; i < ary.length; ++i) {
      if (i in ary) {
        ...
      }
    }


Bug: v8:8733
Change-Id: I766bf865a547a059e5bce5399bb6112e5d9a85c8
Reviewed-on: https://chromium-review.googlesource.com/c/1432598
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Matt Gardner <magardn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#59843}
2019-02-25 18:11:14 +00:00
Ulan Degenbaev
7fbce1ad4b [heap] Ensure that non-regular chunks are freed before scavenge
This prevents accumulation of non-regular chunks if unmapper tasks
are not making progress.

Bug: chromium:934453
Change-Id: I552bc4f566f4be8877d9e806cca2aa9c284a7f4f
Reviewed-on: https://chromium-review.googlesource.com/c/1483055
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59842}
2019-02-25 17:16:04 +00:00
Mike Stanton
45ed388d3b Reland "[Torque] Port Array.prototype.reduce and reduceRight to Torque"
A custom deoptimization continuation point erroneously cast a parameter
to a number. Tests added.

BUG: v8:7672
Change-Id: I59848aacdedc1de9fd7d83d55045618f37d39fb0
Reviewed-on: https://chromium-review.googlesource.com/c/1485974
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59841}
2019-02-25 17:05:23 +00:00
Michael Lippautz
7b6a7379b6 PersistentValueMapBase: Deprecate outdated marking API
Embedders should use EmbedderHeapTracer::RegisterEmbedderReference
instead.

Bug: chromium:923361
Change-Id: If76c0354475798b09af95bedee0890594b29cd14
Reviewed-on: https://chromium-review.googlesource.com/c/1486472
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59840}
2019-02-25 16:43:33 +00:00
Jakob Gruber
e97c48ec58 [regexp] Again support regexp execution without side effects
This is a quirk needed for the regexp fuzzer, which passes its own
custom RegExpMatchInfo object to RegExpImpl::Exec and expects execution
without side effects.

Bug: chromium:934621
Change-Id: I90286fda06593d7c574d8d4629481ebad2fa5b1d
Reviewed-on: https://chromium-review.googlesource.com/c/1485833
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59839}
2019-02-25 16:18:16 +00:00
Ulan Degenbaev
b6c0c44766 [heap] Start unmapper tasks for freed young large pages
This fixes the case of accumulating large pages after scavenges if
there is no mark-compact GC.

Bug: chromium:934453
Change-Id: Ide57c64ae985cc79ad9f477a759ab729f894c73b
Reviewed-on: https://chromium-review.googlesource.com/c/1482740
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59838}
2019-02-25 16:17:11 +00:00
Junliang Yan
942dc58506 PPC/s390: [objects] Free one bit in the SharedFunctionInfo::flags.
Port 591408cba7

Original Commit Message:

    We'll need one bit in the SharedFunctionInfo::flags to record whether
    it's safe to skip arguments adaptor frames (for v8:8895), so this
    just removes the SharedFunctionInfo::IsDerivedConstructorBit which is
    redundant, since the same information is already available in the
    SharedFunctionInfo::FunctionKindBits, and most places in the code
    use that already, with the exception of the JSConstructStubGeneric
    builtin.

    This changes the JSConstructStubGeneric builtin to just check the
    function kind instead of testing the explicit bit, which also makes
    this more consistent. It seems like there's not much overhead to
    that, doing an additional bitmasking plus two comparisons instead
    of one. This shouldn't really matter since invocation and execution
    of the constructors is going to dominate and optimized code inlines
    all of this anyways. If this turns out to affect performance, we
    can still look into encoding the FunctionKindBits more cleverly.

    the shift when accessing the function kind. This seems logic, since
    for the actual boolean bit fields it doesn't matter where they are
    in the flags, whereas for the function kind this saves one shift.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com, miladfar@ca.ibm.com
BUG=
LOG=N

Change-Id: I4e3ba5a066285bf50e869c32228d79d26d57258f
Reviewed-on: https://chromium-review.googlesource.com/c/1486411
Reviewed-by: Milad Farazmand <miladfar@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#59837}
2019-02-25 15:34:41 +00:00
Pierre Langlois
b152bb75f8 [heap] Relax accessing markbits in ranges.
When calling the `bitmap(chunk)` method of the various *MarkingState accessors
we would receive a raw `Bitmap` pointer which does not tell you if accesses to
markbits should be made atomically or not. As a result, we would default to
doing atomic operation when in fact it may not be necessary.

Here we're introducing a templated `ConcurrentBitmap` class that wraps
operations done on the markbits and allows them to be made non-atomic.

Additionaly, some of the `Bitmap` methods were only used to verify the heap and
in the tests so they do not need atomic implementations. Using them in a
concurrent context should now fail to link to make sure they're not mis-used in
the future.

Change-Id: Ifb55f8522c8bf0c87d65da9227864ee428d21bbd
Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_rel
Reviewed-on: https://chromium-review.googlesource.com/c/1482916
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Cr-Commit-Position: refs/heads/master@{#59836}
2019-02-25 15:28:41 +00:00
Mike Stanton
bd9ef0f32a [Torque] Reduce code size by combining FixedArray/FixedDoubleArray paths
This CL reduces the instruction size of Array.prototype.every and some
by ~20%. Should performance allow it we could do the same for other
array builtins. We attach a boolean to the FastJSArrayWitness that
remembers if it's dealing with a FixedArray or a FixedDoubleArray.
We have to check this in the loop, but it is likely that reduced
code size more than pays for the extra check, since the loop will
be dominated by the call to the users callback function.

BUG: v8:7672
Change-Id: Id3bab2b163d7ba73424250d8bb194712909cd37e
Reviewed-on: https://chromium-review.googlesource.com/c/1484293
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59835}
2019-02-25 14:49:27 +00:00
Georg Neis
6d640b9b17 [turbofan] Remove MapsParameterInfo
This was a pair of a set of maps and their common instance type (if
any), but the instance type field was only used in a printing function.
Removing the whole class in favor of ZoneHandleSet<Map> means we avoid
looking at the heap to determine the common instance type. Eventually
we can use the broker to do this if we need to.

Bug: v8:7790
Change-Id: If0cadf9b17e3b9e77cffc4f0b69e2585aff7c85c
Reviewed-on: https://chromium-review.googlesource.com/c/1481214
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59834}
2019-02-25 14:40:17 +00:00
Tobias Tebbi
3bd88999b7 [torque] disable warning for mis-alignment beyond kTaggedSize
Since our allocations don't guarantee more than kTaggedSize alignment,
it doesn't make sense to warn about mis-alignment beyond that.

Bug: v8:8863 v8:7793
Change-Id: Ia1c2dd25efdb2c1084968ab4ffe8de25b8654cdb
Reviewed-on: https://chromium-review.googlesource.com/c/1486251
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59833}
2019-02-25 14:33:57 +00:00
Peter Marshall
67f70038b5 [cpu-profiler] Enable CpuProfileDeepStack test
This  has been marked as flaky for a long time but was fixed by
https://chromium-review.googlesource.com/c/v8/v8/+/1480378.

Bug: v8:5193

Change-Id: I5f03f028fd006bcc83407b48ed49289c5573cade
Reviewed-on: https://chromium-review.googlesource.com/c/1476993
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59832}
2019-02-25 14:31:37 +00:00
Ross McIlroy
5c9abc52c0 [Compiler] If bytecode is flushed during code deserialization, fall through to recompile.
With stress bytecode flushing it's possible for the main SFI of a script to have it's
bytecode flushed during deserialization of the script. If this happens, just fall-through
to recompile the SFI.

BUG=v8:8901,v8:8395

Change-Id: I786c1ca93167b76810481892ade525d14ff9168f
Reviewed-on: https://chromium-review.googlesource.com/c/1485837
Reviewed-by: Mythri Alle <mythria@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59831}
2019-02-25 14:29:18 +00:00
Benedikt Meurer
f8557ef698 [csa] Make FastCheck actually fast :-)
Mark the not_ok case as deferred.

Bug: v8:8834
Change-Id: I17536e45fb6aa309347b8faaf5f25fb3bbfbf6cf
Reviewed-on: https://chromium-review.googlesource.com/c/1485973
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59830}
2019-02-25 14:09:17 +00:00
Benedikt Meurer
b825f43048 [builtins] Also sanity check promise reactions in CSA code.
Add some additional safety net to the CSA code for triggering promise
reactions to make sure we catch security bugs (specifically related
to misuse of the V8 Extras API) on the fast-path.

Bug: chromium:931640, chromium:931949
Change-Id: I76b5dc6653e2404411a29dcd9c54245d7c43d883
Reviewed-on: https://chromium-review.googlesource.com/c/1485972
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59829}
2019-02-25 14:07:57 +00:00
Sigurd Schneider
de0a8c789e Revert "[Torque] Port Array.prototype.reduce and reduceRight to Torque"
This reverts commit b3d8eeb6eb.

Reason for revert: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/win7-rel/25961

Original change's description:
> [Torque] Port Array.prototype.reduce and reduceRight to Torque
> 
> BUG: v8:7672
> Change-Id: I8816ab9051e7900119fd65c239f9e207f5c3d417
> Reviewed-on: https://chromium-review.googlesource.com/c/1478697
> Commit-Queue: Michael Stanton <mvstanton@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#59807}

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

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

Change-Id: Ib15bd4499618a22185d8ef173c4df7b7d55f54ce
Reviewed-on: https://chromium-review.googlesource.com/c/1485971
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59828}
2019-02-25 13:30:16 +00:00
Toon Verwaest
f24cee185b [parser] Move Token::NEW parsing into the switch of ParsePrimaryExpression
All uses of ParseMemberExpression go through
ParseMemberWithNewPrefixesExpression, and ParseMemberExpression always starts
with ParsePrimaryExprssion, so we can simply move Token::NEW handling into
ParsePrimaryExpression. That avoids an unnecessary branch on the hot path.

Change-Id: I2bcce8e106c547c6d308ee6b0fce8747c7214886
Reviewed-on: https://chromium-review.googlesource.com/c/1485838
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59827}
2019-02-25 13:14:01 +00:00
Toon Verwaest
792383e3ad [parser] Outline handling of postfix ops
This saves some binary size.

Change-Id: I64d20be63922ba0aab0b664fb30c3e2e023bb860
Reviewed-on: https://chromium-review.googlesource.com/c/1485841
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59826}
2019-02-25 13:12:56 +00:00
Benedikt Meurer
75629d5f9a [turbofan] Skip arguments adaptor when target cannot observe arguments.
When calling a known function from optimized code, where the number of
actual arguments does not match the number of expected arguments,
TurboFan has to call indirectly via the arguments adaptor trampoline,
which creates an argument adaptor frame underneath the activation record
for the callee. This is done so that the callee can still get to the
actual arguments, using either

1. the arguments object, or
2. rest parameters (to get to superfluous arguments), or
3. the non-standard Function.arguments accessor (for sloppy mode
   functions), or
4. direct eval(), where we don't know whether there's a use of the
   arguments object hiding somewhere in the string.

However going through the arguments adaptor trampoline is quite
expensive usually, it seems to be responsible for over 60% of the
call overhead in those cases.

So this adds a fast path for the case of calling strict mode functions
where we have an arguments mismatch, but where we are sure that the
callee cannot observe the actual arguments. We use a bit on the
SharedFunctionInfo to indicate that this is safe, which is controlled
by hints from the Parser which knows whether the callee uses either
arguments object or rest parameters.

In those cases we use a direct call from optimized code, passing the
expected arguments instead of the actual arguments. This improves the
benchmark on the document below by around 60-65%, which is exactly
the overhead of the arguments adaptor trampoline that we save in this
case.

This also adds a runtime flag --fast_calls_with_arguments_mismatches,
which can be used to turn off the new behavior. This might be handy
for checking the performance impact via Finch.

Bug: v8:8895
Change-Id: Idea51dba7ee6cb989e86e0742eaf3516e5afe3c4
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Doc: http://bit.ly/v8-faster-calls-with-arguments-mismatch
Reviewed-on: https://chromium-review.googlesource.com/c/1482735
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59825}
2019-02-25 12:47:36 +00:00
Mike Stanton
ad7537ae6a [TurboFan] Use regular arrays instead of vector for checkpoint params
We don't need dynamic allocation for these arrays.

Change-Id: I12095ec0e3b6e9d70be56adfb77aded5c25eb3d5
Reviewed-on: https://chromium-review.googlesource.com/c/908462
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59824}
2019-02-25 12:45:56 +00:00
Maciej Goszczycki
993e452006 Switch RehashBasedOnMap to use ReadOnlyRoots
This means ReadOnlyDeserializer can be made isolate independent. Without
this Isolate is needed for rehashing read-only space.


Bug: v8:7464
Change-Id: Id2c9968a0ecfa2362f499ded6c7e0f7b2be00dfb
Reviewed-on: https://chromium-review.googlesource.com/c/1483054
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59823}
2019-02-25 12:28:26 +00:00
Sigurd Schneider
257433ecf3 [cleanup] Remove ast.h include in shared-function-info-inl.h
This removes ast.h as include from about ~500 includers of the latter.

Bug: v8:8834
Change-Id: I294026d4bb29b878820d43c117b04a9645a457ae
Reviewed-on: https://chromium-review.googlesource.com/c/1485835
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59822}
2019-02-25 12:03:41 +00:00