Commit Graph

21823 Commits

Author SHA1 Message Date
Mike Stanton
5c05165d42 [Torque] Make Throw*Error() take context implicitly
Change-Id: I5f0d915351c24b9a2916b8ab1d4bafb4d7eb21c7
Reviewed-on: https://chromium-review.googlesource.com/c/1491217
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59889}
2019-02-27 10:11:18 +00:00
Maya Lekova
226adea450 [cleanup] Refactor out enums from debug-interface.h
Moved CoverageMode and TypeProfileMode enums to interface-types.h
to save one include in isolate.h. This reduces the expanded lines of code
count by ~45k.

Bug: v8:8834

R=yangguo@chromium.org

Change-Id: I399fe8cf66b1aec79bcb5831afd46a74e358244d
Reviewed-on: https://chromium-review.googlesource.com/c/1489072
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59886}
2019-02-27 08:56:48 +00:00
Benedikt Meurer
834c4b3568 [turbofan] Always pass the right arity to calls.
We didn't update the arguments count properly when changing the JSCall
node to a direct Call node.

Bug: chromium:936302, v8:8895
Change-Id: I59a39a07e41151d8eaa2e1a1ea7b1835e00fb501
Reviewed-on: https://chromium-review.googlesource.com/c/1491191
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59885}
2019-02-27 08:40:58 +00:00
tzik
a32e37edac Reland "Do not enqueue or run a microtask on detached contexts"
This is a reland of 734a657522

Original change's description:
> Do not enqueue or run a microtask on detached contexts
>
> This CL disables EnqueueMicrotask and RunMicrotasks on detached
> contexts. That is, if an embedder call DetachGlobal() on a v8::Context,
> EnqueueMicrotask on that context will not take effect, and all Microtask
> that is enqueued before DetachGlobal will be cancelled.
>
> On Blink, this implies that a frame will no longer run a microtask after
> it's navigated away. OTOH, detached frames in Blink are not affected.
>
> Bug: v8:8124
> Change-Id: I5b00ceef5ea2afb87cf067a65eb95c29bf91176d
> Reviewed-on: https://chromium-review.googlesource.com/c/1416071
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#59445}

Tbr: adamk@chromium.org, yangguo@chromium.org, verwaest@chromium.org
Bug: v8:8124
Change-Id: I959a18ae214f1385d5f453b3ed94772e60f71e0f
Reviewed-on: https://chromium-review.googlesource.com/c/1469544
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59884}
2019-02-27 04:57:07 +00:00
Sigurd Schneider
8337a29b0a [cctest] Disable flaky test
TBR=petermarshall@chromium.org

Change-Id: I663735761c4ae730337b1381b52c99371eae2951
Notry: true
Bug: v8:5193
Reviewed-on: https://chromium-review.googlesource.com/c/1489084
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59879}
2019-02-26 17:15:18 +00:00
Peter Marshall
0321a09f86 [cpu-profiler] Disable another test that fails on Windows.
This one fails on Windows.

Bug: v8:5193
Change-Id: Ib028f8d7aa8a2d69a7324f9fcc6c5d03bc6f368c
Notry: true
Reviewed-on: https://chromium-review.googlesource.com/c/1489081
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59878}
2019-02-26 16:37:24 +00:00
Peter Marshall
150e87c51e [cpu-profiler] Disable another failing test on ARM simulator
This one still fails too, whoops.

Bug: v8:5193
Change-Id: I07c0e55c8a1ca59311e0110c851b38bd9028c20f
Notry: true
Reviewed-on: https://chromium-review.googlesource.com/c/1489079
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59876}
2019-02-26 15:48:19 +00:00
Peter Marshall
1ad4d1878a [cpu-profiler] Disable failing test on ARM simulator
This one still fails, whoops.

Bug: v8:5193
Notry: true
Change-Id: Icd7ac2931e08efd176f0d37aea07c9bf30991d9b
Reviewed-on: https://chromium-review.googlesource.com/c/1489078
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59874}
2019-02-26 15:31:19 +00:00
Peter Marshall
db1cbe5d05 [cpu-profiler] Enable previously flaky tests
I can't reproduce any of these flakes anymore on windows or linux.
Some are confirmed fixed with the same root cause as crbug.com/v8/8883.
Others are not reproducible anymore and were probably fixed by other
de-flaking and bugfixes in the last 6 months.

Bug: v8:5193, v8:7054
Change-Id: I23ce47a98f11f3637ccf4baf01ffab5c461a0ebd
Reviewed-on: https://chromium-review.googlesource.com/c/1489074
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59873}
2019-02-26 15:07:49 +00:00
Michael Achenbach
2e6ab9fc30 [test] Don't test jitless without embedded-builtins
NOTRY=true

Bug: v8:8889
Change-Id: I1faf4bcb8f573485915a8b79d551fbb4985a02a0
Reviewed-on: https://chromium-review.googlesource.com/c/1489075
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59872}
2019-02-26 14:33:01 +00:00
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
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
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
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
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
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
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
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
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
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
Jakob Gruber
83e88b338d [nojit] Disable field representation tracking in jitless mode
Field representation tracking is only used by TurboFan.

Bug: v8:7777
Change-Id: I0d930f8dc0b68ff030111f12092b183c4c257ac6
Reviewed-on: https://chromium-review.googlesource.com/c/1481218
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59820}
2019-02-25 11:58:56 +00:00
Ross McIlroy
ec9aef3d1e [Runtime] Ensure template objects are retained if bytecode is flushed.
Template objects should be cached after they are first created and reused on
subsiquent calls to tag functions. Currently these cached objects are stored
on the feedback vector, which has appropriate lifetime, however with bytecode
flushing the feedback vector could be cleared when the bytecode is flushed,
causing the template object to be dropped.

In order to retain the cached template objects in the face of bytecode flushing,
this CL adds a weakmap for each native context that is (weakly) keyed by
shared function info, and holds a linked list of cached template objects
associated with that shared function info, indexed by feedback vector slot id.
Misses will check this weakmap, and if no entry is found, a new template object
is created and added into this weakmap alongside the feedback vector.

BUG=v8:8799,v8:8799,v8:8395

Change-Id: Ia95d5cfc394ce58dc9fe6a1e49780f05299acc17
Reviewed-on: https://chromium-review.googlesource.com/c/1477746
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59818}
2019-02-25 11:20:06 +00:00
Toon Verwaest
4b0c2b32af [parser] Fix stackoverflow on function expressions
This merges all the possible targets for 'member expressions' previously
parsed in ParseMemberExpression into ParsePrimaryExpression; since that's
not independently used anyway. This will make it faster since we don't
need to go through unnecessary branches before ParsePrimaryExpression on
the fast path, *and* it will make the binary smaller since
ParseMemberExpression is inlined but ParsePrimaryExpression is not. It
saves 4kb. Yay :)

Bug: chromium:913222
Change-Id: Ib92e1c2a128fffff1db85b625bb5f311ec8c24ef
Reviewed-on: https://chromium-review.googlesource.com/c/1480379
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59814}
2019-02-25 10:44:26 +00:00
Toon Verwaest
e14a24d32e [parser] Always return a valid var from DeclareVariableName
That way we can continue running in failure mode.

Bug: chromium:933214
Change-Id: I975901a72f615e2b7ed9955b75ce86bbcad0bbbb
Reviewed-on: https://chromium-review.googlesource.com/c/1481219
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59813}
2019-02-25 10:31:26 +00:00
Anna Henningsen
42a38d2ada [inspector] Do not leak Handles from V8InspectorSession methods
Do not leak handles to the outer scopes from inspector methods.
Add `SealHandleScope`s to the tests and the d8 binding, and
`HandleScope`s in the places in the inspector source where
handles are actually used.

Change-Id: I80b1bb0ccc4778b32e9198513f63d5c0652c8f59
Reviewed-on: https://chromium-review.googlesource.com/c/1484304
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59812}
2019-02-25 10:17:11 +00:00
Deepti Gandluri
dfdc0e6de0 [wasm] Reserve upto maximum for a shared WebAssembly.Memory
When using a shared WebAssembly.Memory, always try to reserve up to the
maximum to avoid having to move the buffer. If after multiple retries
it is not possible to reserve the maximum, fall back to initial size
reservation.

 - Add new methods to allocate a Shared WebAssemblyMemory.buffer
 - Use these to reserve upto the mazimum for a Shared WebAssembly.Memory
 - Cleanup js-api so actual allocation is done inside the constructor

BUG: v8:8564
Change-Id: I97815c7c94a2b84416cd867fb23b3c815d7f0f12
Reviewed-on: https://chromium-review.googlesource.com/c/1480910
Reviewed-by: Ben Smith <binji@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59805}
2019-02-23 01:59:12 +00:00
Deepti Gandluri
5d0f5bd739 Revert "[wasm] ReturnCall Implementation (interpreter)"
This reverts commit 6a88f0b1e4.

Reason for revert: Fails UBSAN bots - https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux64%20UBSan/4866

Original change's description:
> [wasm] ReturnCall Implementation (interpreter)
> 
> Implement the ReturnCall functionality for the interpreter.
> 
> Note that some tests have had to be deferred to the implementation
> of ReturnCall for TurboFan.
> 
> Bug: v8:7431
> Change-Id: I091528e72f9113ddf1929bd1a5650b490bc8cc0c
> Reviewed-on: https://chromium-review.googlesource.com/c/1467343
> Reviewed-by: Andreas Haas <ahaas@chromium.org>
> Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
> Commit-Queue: Francis McCabe <fgm@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#59803}

TBR=adamk@chromium.org,ahaas@chromium.org,clemensh@chromium.org,fgm@chromium.org

Change-Id: Ib2a85e586549e9c36f94d70f04f6e103a8272367
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7431
Reviewed-on: https://chromium-review.googlesource.com/c/1484574
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59804}
2019-02-22 23:31:54 +00:00
Francis McCabe
6a88f0b1e4 [wasm] ReturnCall Implementation (interpreter)
Implement the ReturnCall functionality for the interpreter.

Note that some tests have had to be deferred to the implementation
of ReturnCall for TurboFan.

Bug: v8:7431
Change-Id: I091528e72f9113ddf1929bd1a5650b490bc8cc0c
Reviewed-on: https://chromium-review.googlesource.com/c/1467343
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Francis McCabe <fgm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59803}
2019-02-22 19:27:10 +00:00
Junliang Yan
dc13819ff4 [wasm] fix wasm atomic wait callback test on BE
Bug: v8:8075
Change-Id: I8547706b56bab28dc11685e73b5fc084c8f1bf69
Reviewed-on: https://chromium-review.googlesource.com/c/1480912
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59799}
2019-02-22 16:02:26 +00:00
Igor Sheludko
acf741b986 [ptr-compr] Fix broken string externalization tests
... which will work for 32-bit kTaggedSize but we are not there yet.

Bug: v8:7703
Change-Id: Iaceb126ba316f37532221597cbd4f7e85ceb4fb9
Reviewed-on: https://chromium-review.googlesource.com/c/1482917
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59797}
2019-02-22 15:30:21 +00:00
Michael Achenbach
ee3f62fb0d Update V8 DEPS.
Rolling v8/build: e148b4c..ba245a9

Rolling v8/buildtools: 106e9fc..3e50219

Rolling v8/buildtools/third_party/libc++/trunk: e713cc0..22d3f6d

Rolling v8/buildtools/third_party/libc++abi/trunk: 307bb62..0d52966

Rolling v8/test/wasm-js/data: 1fff613..2e2e3a9

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/11e283f..76fb063

Rolling v8/third_party/depot_tools: 61d0c29..36974ad

Rolling v8/third_party/icu: 07e7295..960f195

Rolling v8/tools/clang: 1dc7541..987f14b

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

Bug: v8:8242, v8:8246, v8:8260, v8:8894
Change-Id: I359fb0609c9487488120b6ab8b432db3c5ec2cec
Reviewed-on: https://chromium-review.googlesource.com/c/1482118
Commit-Queue: Michael Achenbach <machenbach@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>
Cr-Commit-Position: refs/heads/master@{#59789}
2019-02-22 10:07:13 +00:00
Jaroslav Sevcik
6660639e7e [turbofan] Re-type JSAdd("", prim) reduction to ToString.
Bug: chromium:934175
Change-Id: I00b4d6931d196037f0ead168cc9cbb19cb83a12d
Reviewed-on: https://chromium-review.googlesource.com/c/1481632
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59787}
2019-02-22 09:24:53 +00:00
Igor Sheludko
69e7ded547 [ptr-compr] Fix string externalization
With 32-bit kTaggedSize small strings may be not externalizable.

Bug: v8:7703
Change-Id: I34002568214742dadb2358fca97dfb4b92a5342a
Reviewed-on: https://chromium-review.googlesource.com/c/1480373
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59770}
2019-02-21 15:03:33 +00:00
Nico Weber
e0fd36b78c v8: Prep for removing TRACE_EVENT_SCOPED_CONTEXT.
It's only used in tests, and for some reason v8 refers to a macro defined
in src.git, so I need to remove this in v8 first before I can remove it
in Chromium.

Bug: chromium:934255
Change-Id: I31ea32aa43cf7a5f518def7b91dce99dcb268709
Reviewed-on: https://chromium-review.googlesource.com/c/1480911
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59769}
2019-02-21 14:59:43 +00:00
Michael Starzinger
cc787e174e [asm.js] Fix handling of bogus code after export statement.
This makes the asm.js validator reject source with trailing expressions
after the module exporting return statement. Most of the time trailing
statements would not affect semantics, since they are unreachable. In
some cases we might hide an expected ReferenceError tough.

R=leszeks@chromium.org
TEST=mjsunit/regress/regress-crbug-934138
BUG=chromium:934138

Change-Id: I790366204f5e9c943715a065b5229f2442e2c86e
Reviewed-on: https://chromium-review.googlesource.com/c/1481216
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59766}
2019-02-21 14:37:37 +00:00
Ulan Degenbaev
ff8f4144db [heap] Simplify idle notification handler
This merges the "do-nothing" case with the "done" case as the former
is no longer useful. This also fixes a bug where the idle time handler
would not make progress by always returning "do-nothing".

Change-Id: Ibdd3189e4fd35acc5405aa82a13ea8ee2fd74cc6
Reviewed-on: https://chromium-review.googlesource.com/c/1478695
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59758}
2019-02-21 12:25:52 +00:00
Sven Sauleau
6f8bd2eb2f [wasm] change test name
Change-Id: Ib45690bb03b9c76502afed89a71e1dc9a545893b
Reviewed-on: https://chromium-review.googlesource.com/c/1481213
Commit-Queue: Sven Sauleau <ssauleau@igalia.com>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59756}
2019-02-21 12:02:47 +00:00
Jakob Gruber
c54bbd2c23 Remove invalid DCHECK in ReplacementStringBuilder
The DCHECK verified capacity just before the call to EnsureCapacity()
(which extends capacity if needed). This DCHECK can just be removed
since FixedArray::set() already checks the given index is in-bounds.

Drive-by: Remove similar duplicate DCHECKs in FixedArrayBuilder.

Bug: chromium:933776
Change-Id: I9f058548063a170ea6dce112a3877792887efcca
Reviewed-on: https://chromium-review.googlesource.com/c/1479955
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59753}
2019-02-21 09:41:06 +00:00
Peter Marshall
51e80efd12 [tracing] Fix races in TracingController implementation
The default TracingController (used by d8 and Node) has some concurrency
issues. The new test flushes these out, when a second thread logs trace
events while the main thread calls StopTracing().

- Use an acquire load in UpdateCategoryGroupEnabledFlags() because this
  was racing with GetCategoryGroupEnabled() where a new category is
  added in the slow path. g_category_groups is append-only, but
  reads/writes to g_category_index need to be correctly ordered so that
  new categories are added and only then is the change to the index
  visible. The relaxed load ignored this and caused unsynchronized
  read/write.
- Use a relaxed load in ~ScopedTracer() to access category_group_enabled
  as this previously used a non-atomic operation which caused a race
  with UpdateCategoryGroupEnabledFlag() which does a relaxed store.
- Replace TracingController::mode_ with an atomic bool as read/writes to
  mode_ were not synchronized and caused TSAN errors. It only has two
  states and it doesn't seem like we will extend this so just convert it
  to bool.
- Take the lock around calling trace_object->Initialize in
  AddTraceEvent(), and around trace_buffer_->Flush() in StopTracing().
  These two raced previously as the underlying TraceBufferRingBuffer
  passes out pointers to TraceObjects in a synchronized way, but the
  caller (AddTraceEvent) then writes into the object without
  synchronization. This leads to races when Flush() is called, at which
  time TraceBufferRingBuffer assumes that all the pointers it handed out
  are to valid, initialized TraceObjects - which is not true because
  AddTraceEvent may still be calling Initialize on them. This could be
  the cause of issues in Node.js where the last line of tracing/logging
  sometimes gets cut off. This is kind of a band-aid solution - access
  to the TraceObjects handed out by the ring buffer really needs proper
  synchronization which at this point would require redesign. It's quite
  likely we will replace this with Perfetto in the near future so not
  much point investing in this code right now.
- Enable TracingCpuProfiler test which was flaky due to these bugs.

Bug: v8:8821
Change-Id: I141296800c6906ac0e7f3f21dd16d861b07dae62
Reviewed-on: https://chromium-review.googlesource.com/c/1477283
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ali Ijaz Sheikh <ofrobots@google.com>
Cr-Commit-Position: refs/heads/master@{#59752}
2019-02-21 08:34:16 +00:00
Benedikt Meurer
adb7e37b28 [cleanup] Remove obsolete representations.
In the Crankshaft days we (mis)used the Representation to also express
the various internal representations that the compiler understands. But
with TurboFan we now have proper MachineRepresentation and MachineType,
which do that independently. So there's no need to have this in the
Representation class anymore, and instead the Representation class only
needs to deal with the field representations.

Bug: v8:8749, v8:8834, v8:8865
Change-Id: I34ea9558b5fdf20d6c7939b52762eaffd4316b06
Reviewed-on: https://chromium-review.googlesource.com/c/1479954
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59750}
2019-02-21 06:07:06 +00:00
Jaroslav Sevcik
9371781f60 [turbofan] Support f64 truncation in f64->tagged representation change.
Bug: chromium:933331
Change-Id: I598a32b1efe2d4b7e8278ddf84140c72f787afa8
Reviewed-on: https://chromium-review.googlesource.com/c/1475496
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59749}
2019-02-21 05:04:26 +00:00
Matt Gardner
db69e088b5 [test] Add perf test for in operator on arrays
Change-Id: I808ce4d0089accd3f6afaeab98bd6237e169f793
Reviewed-on: https://chromium-review.googlesource.com/c/1475915
Commit-Queue: Matt Gardner <magardn@microsoft.com>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59747}
2019-02-20 22:36:13 +00:00
Sathya Gunasekaran
72ce4de2c8 [parser] Refactor ParseSuperExpression
Throw error when accessing private field on super.

Bug: v8:8872
Change-Id: Iad383890fafbdccdd6b6b75a8f9eb32c9d6f5044
Reviewed-on: https://chromium-review.googlesource.com/c/1478219
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59746}
2019-02-20 19:53:36 +00:00
Jeff Fisher
bab6615155 [inspector] Add tests for Debugger domain
New tests added for these calls:

* evaluateOnCallFrame
* setAsyncCallStackDepth
* setBreakpoint
* setVariableValue

For setAsyncCallStackDepth, this change updates the test to manufacture async callstacks in a different way so that there is more than one. The previous promise chain method was broken by f61facf.

Change-Id: I9083b0b1c08849d4c7ebb5349cfa4489f551aa39
Reviewed-on: https://chromium-review.googlesource.com/c/1465118
Commit-Queue: Jeff Fisher <jeffish@microsoft.com>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59745}
2019-02-20 18:57:33 +00:00
Georg Neis
3d943e7791 [test] Explicitly set --turbo-inlining in a cctest
I missed this one in my previous CL.

R=jarin@chromium.org

Change-Id: Ie4b912ee7e3367da48c0d4b092ad09e3f81de788
Reviewed-on: https://chromium-review.googlesource.com/c/1477677
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59743}
2019-02-20 16:38:10 +00:00