Commit Graph

8796 Commits

Author SHA1 Message Date
Mike Stanton
fd334b3216 [builtins] Enable Torque Array.prototype.splice
Before, splice was implemented with a C++ fast path and a
comprehensive JavaScript version.

This impl. is entirely in Torque with a fastpath for SMI,
DOUBLE and OBJECT arrays, and a comprehensive slow path.
The same level of "sparse" array support as given by the
array.js implementation is included.

This reland addresses several issues:

* Removed "sparse" array support from splice.
* Addressed ClusterFuzz issue 876443:
  The test and code that uses the fix is in this CL.
  The fix in isolation can be seen here:
  https://chromium-review.googlesource.com/c/v8/v8/+/1199403
* Removed dead code in elements.cc

BUG=chromium:876443, v8:8131, v8:1956, v8:7221

Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I2d4a66c24ba1edabeca34e27e6ff8ee6136ed5f1
Reviewed-on: https://chromium-review.googlesource.com/1201783
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55610}
2018-09-04 13:18:23 +00:00
Mathias Bynens
0e78acebda Reland "Ship globalThis 🎉"
This reverts commit f7df60d561.

Original change's description:
> Revert "Ship globalThis 🎉"
> 
> This reverts commit 4dac9872ae.
> 
> Reason for revert: Speculative revert for layout test failures:
> https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8-Blink%20Linux%2064/25970
> 
> E.g.:
> virtual/service-worker-servicification/http/tests/serviceworker/webexposed/global-interface-listing-service-worker.html
> 
> Original change's description:
> > Ship globalThis 🎉
> > 
> > Proposal repository:
> > https://github.com/tc39/proposal-global
> > 
> > Intent to ship:
> > https://groups.google.com/d/msg/v8-users/Vkoh0wXRwaM/Yt7MpzhkAgAJ
> > 
> > Bug: v8:5537
> > Change-Id: I60a6c5375165d89548db12fef454a64137d04c27
> > Reviewed-on: https://chromium-review.googlesource.com/1195494
> > Reviewed-by: Adam Klein <adamk@chromium.org>
> > Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
> > Commit-Queue: Mathias Bynens <mathias@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#55543}
> 
> TBR=adamk@chromium.org,gsathya@chromium.org,mathias@chromium.org
> 
> Change-Id: Iacb484d36ba2c8002336038660450b240006e0ab
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: v8:5537
> Reviewed-on: https://chromium-review.googlesource.com/1199743
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#55564}

TBR=adamk@chromium.org,machenbach@chromium.org,gsathya@chromium.org,mathias@chromium.org

Change-Id: I7912be09ab68ef956a8cc164fa8bbd937efb58c5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:5537
Reviewed-on: https://chromium-review.googlesource.com/1200722
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55606}
2018-09-04 11:52:26 +00:00
Michael Starzinger
1003fcc48e [wasm] Fix exception handling with empty try blocks.
R=clemensh@chromium.org
TEST=mjsunit/wasm/exceptions
BUG=v8:8091

Change-Id: I866430e1f3d3e7b93001a4375a869f19de75e65e
Reviewed-on: https://chromium-review.googlesource.com/1203954
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55605}
2018-09-04 11:31:00 +00:00
Michael Starzinger
e8d79f070c [wasm] Make exception creation non-observable by JS.
This fixes exception creation (by the WebAssembly throw operation) so
that it is not observable by JavaScript. Internal properties are now
stored with symbol names instead of string names, which also prevents
them from being accessed or monkey-patched directly by JavaScript.

R=clemensh@chromium.org
TEST=mjsunit/regress/wasm/regress-8094
BUG=v8:8094

Change-Id: I33cb27f4373114cd4db28d9aef23560093e55242
Reviewed-on: https://chromium-review.googlesource.com/1203951
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55602}
2018-09-04 10:37:27 +00:00
Benedikt Meurer
b898112277 [turbofan] Improve typing of ToNumeric and ToNumber.
The previous typing rules for ToNumeric and ToNumber didn't match on the
NonBigIntPrimitive input set, which causes trouble when we morph ToNumeric
nodes into ToNumber nodes, and generally lead to worse typings in the
graph, and thus worse code generation. This change improves the existing
typing rules and turns ToNumber into a chokepoint again.

Bug: chromium:879898, v8:8015
Change-Id: I4a7ff0e9c420c5dcfdb2b96884e019a5943828a4
Reviewed-on: https://chromium-review.googlesource.com/1201522
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55595}
2018-09-03 19:14:09 +00:00
Michael Starzinger
4e20a62a95 [wasm] Fix missing default value for anyref local.
R=titzer@chromium.org
TEST=mjsunit/wasm/anyref

Change-Id: Ia79c78038f6cc92f657ee1b48474323bde981155
Reviewed-on: https://chromium-review.googlesource.com/1201784
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55583}
2018-09-03 11:24:39 +00:00
Simon Zünd
a45a20e446 [array] Move fall-back for Array.p.shift to C++
This CL replaces the JavaScript fall-back for Array.p.shift with a
baseline C++ implementation.

R=jgruber@chromium.org

Bug: v8:7624
Change-Id: Ib55e04e18e4e69089fc541636d3cad7fcb4c7245
Reviewed-on: https://chromium-review.googlesource.com/1186327
Commit-Queue: Simon Zünd <szuend@google.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55576}
2018-09-03 06:10:11 +00:00
Benedikt Meurer
fa54dff255 [turbofan] Add missing -0 support for NumberMax/NumberMin typing.
The typing rules for NumberMax and NumberMin didn't properly deal with
-0 up until now, leading to suboptimal typing, i.e. for a simple case
like

  Math.max(Math.round(x), 1)

TurboFan was unable to figure out that the result is definitely going
to be a positive integer in the range [1,inf] or NaN (assuming that
NumberOrOddball feedback is used for the value x).

Bug: v8:8015
Change-Id: I06e14a9c9b0b813eb214ace7749fcc6ab36bb66a
Reviewed-on: https://chromium-review.googlesource.com/1199304
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55570}
2018-09-02 20:02:34 +00:00
Michael Achenbach
f7df60d561 Revert "Ship globalThis 🎉"
This reverts commit 4dac9872ae.

Reason for revert: Speculative revert for layout test failures:
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8-Blink%20Linux%2064/25970

E.g.:
virtual/service-worker-servicification/http/tests/serviceworker/webexposed/global-interface-listing-service-worker.html

Original change's description:
> Ship globalThis 🎉
> 
> Proposal repository:
> https://github.com/tc39/proposal-global
> 
> Intent to ship:
> https://groups.google.com/d/msg/v8-users/Vkoh0wXRwaM/Yt7MpzhkAgAJ
> 
> Bug: v8:5537
> Change-Id: I60a6c5375165d89548db12fef454a64137d04c27
> Reviewed-on: https://chromium-review.googlesource.com/1195494
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
> Commit-Queue: Mathias Bynens <mathias@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#55543}

TBR=adamk@chromium.org,gsathya@chromium.org,mathias@chromium.org

Change-Id: Iacb484d36ba2c8002336038660450b240006e0ab
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:5537
Reviewed-on: https://chromium-review.googlesource.com/1199743
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55564}
2018-08-31 20:20:42 +00:00
Benedikt Meurer
b1bd6beb4e [turbofan] Fix typo flushed out by recent CL.
Bug: chromium:879560
Change-Id: Ia2d2699851358641d50f9997875810f8cb1100ff
Reviewed-on: https://chromium-review.googlesource.com/1199742
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55553}
2018-08-31 14:58:25 +00:00
Simon Zünd
e7ca2b7cfe [array] Fix wrong receiver when copying from the prototype chain
This CL fixes an issue where getters/setters would get called on a
prototype with the wrong receiver. This happens in the pre-processing
for Array.p.sort when values get copied down from the prototype chain.

R=jgruber@chromium.org

Bug: v8:7682
Change-Id: I0d8ff1dc721c33bd721aaca54ffd357b3d2a2096
Reviewed-on: https://chromium-review.googlesource.com/1198767
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Simon Zünd <szuend@google.com>
Cr-Commit-Position: refs/heads/master@{#55546}
2018-08-31 11:58:15 +00:00
Mathias Bynens
4dac9872ae Ship globalThis 🎉
Proposal repository:
https://github.com/tc39/proposal-global

Intent to ship:
https://groups.google.com/d/msg/v8-users/Vkoh0wXRwaM/Yt7MpzhkAgAJ

Bug: v8:5537
Change-Id: I60a6c5375165d89548db12fef454a64137d04c27
Reviewed-on: https://chromium-review.googlesource.com/1195494
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55543}
2018-08-31 11:38:53 +00:00
Ben L. Titzer
09a717dbb9 [wasm] Fix dispatch table instance update
This CL fixes a bug where the receiving instance was updated improperly
in the dispatch table(s) of an imported table.

BUG=chromium:875322
R=mstarzinger@chromium.org

Change-Id: Ib5af238a0847bf332a12863523e897f59f137c1d
Reviewed-on: https://chromium-review.googlesource.com/1196886
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55534}
2018-08-30 15:54:14 +00:00
Michael Lippautz
8206187381 Revert GC scheduling for external backing stores
Revert "Reland "[heap] Attempt to incorporate backing store counters into heap sizing and GC trigger stragery.""

This reverts commit eb164dbd00.

Revert "[d8] Fixed external gc test (limit multiplied by number of isolates)."

This reverts commit 38cbc26a75.

Revert "[heap] Fixed typo in method name."

This reverts commit 263174af75.

Bug: chromium:845409, chromium:879045
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I555bcff2ad04ae23368c7b3999a237083010f9c6
Reviewed-on: https://chromium-review.googlesource.com/1196550
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55529}
2018-08-30 14:24:38 +00:00
Simon Zünd
2c834b1c17 Remove Array.p.sort regression test "regress-2185"
This CL removes a regression test that was intended to check that the
maximum call stack size was not exceeded when calling Array.p.sort.

As the new sorting algorithm (TimSort) does not work recursively, this
test is no longer really necessary. It is also rather slow and causes
issues on some bots, so we remove the test.

R=mslekova@chromium.org

Bug: v8:7783
Change-Id: I5bb9693ab825fe077776fd6825688545286285fd
Reviewed-on: https://chromium-review.googlesource.com/1196511
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Simon Zünd <szuend@google.com>
Cr-Commit-Position: refs/heads/master@{#55527}
2018-08-30 13:45:55 +00:00
Michael Starzinger
f19a70681d [wasm] Add support for 'except_ref' value type.
This adds experimental support for an 'except_ref' value type for caught
exceptions as per the exception handling proposal. In the current for it
is only allowed to have such types in the stack or in a local, support
for having it as part of any signature was left out.

The default value for a local of type 'except_ref' is the 'ref_null'
value for now. Since this value cannot escape a wasm function, the
concrete value is not actually observable.

R=ahaas@chromium.org
TEST=unittests/LocalDeclDecoderTest.ExceptRef,mjsunit/wasm/exceptions
BUG=v8:8091

Change-Id: I7bd65274327a833262f8749cbe0e24e737f6e0c1
Reviewed-on: https://chromium-review.googlesource.com/1196510
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55526}
2018-08-30 13:39:37 +00:00
Simon Zünd
b9540d447f [array] Fix side-effect for 'from' argument in Array.p.lastIndexOf
This CL fixes a bug if the second argument ('from') for lastIndexOf
changes the array when its converted to an integer.

R=jgruber@chromium.org

Bug: chromium:878845
Change-Id: I8759dd19381c63f0dde1d4c5abc1b6c7291c6048
Reviewed-on: https://chromium-review.googlesource.com/1196507
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Simon Zünd <szuend@google.com>
Cr-Commit-Position: refs/heads/master@{#55525}
2018-08-30 13:34:25 +00:00
Michael Achenbach
6206a3e362 [test] Share resource-fetching logic with all d8 test cases
This shares logic for finding additional resources in JS source code.
Previously the logic was implemented for mjsunit, now it will be used
across all d8-based test cases.

This'll enable adding those test suites for Android testing.

Bug: chromium:866862
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I7c89ba141483aaf692a03c0e168edb61bbb7b010
Reviewed-on: https://chromium-review.googlesource.com/1193873
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55503}
2018-08-29 17:51:43 +00:00
Andreas Haas
f738bb246e [wasm][cleanup] Remove kV8MaxPages from wasm-constants.js
It is better not to have V8-specific constants in mjsunit.js because it
also has V8-independent uses, e.g. in the spec tests.

R=gdeepti@chromium.org

Bug: v8:8015
Change-Id: I3b576f093f639c13e673cbd0bd5305c8101d7281
Reviewed-on: https://chromium-review.googlesource.com/1192843
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55485}
2018-08-29 11:16:03 +00:00
Michael Starzinger
c3baf49f24 [wasm] Fix missing exceptional projections from calls.
This makes sure that direct and indirect calls get proper {IfException}
projections attached to them if they appear within a try-block. It also
re-enables most of the corresponding test cases for this.

R=ahaas@chromium.org
TEST=mjsunit/wasm/exceptions
BUG=v8:8091

Change-Id: I111634759651ed47f76850e80c8754751310001b
Reviewed-on: https://chromium-review.googlesource.com/1195365
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55483}
2018-08-29 09:53:32 +00:00
Maya Lekova
6a7872b7b8 [turbofan] Introduce a CheckStringAdd node instead of cons string lowering
The new node is introduced for literal string addition and calling
String.prototype.concat in the typed lowering phase. It later might get optimized
away during redundancy elimination, keeping the performance of already existing
benchmarks with string addition. In case the operation is about to throw
(due to too long string being constructed) we just deoptimize, reusing
the interpreter logic for creating the error.

Modify relevant mjsunit and unit tests for string concatenation.

Bug: v8:7902
Change-Id: Ie97d39534df4480fa8d4fe3ba276d02ed5e750e3
Reviewed-on: https://chromium-review.googlesource.com/1193342
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55482}
2018-08-29 09:34:26 +00:00
Peter Marshall
c70ac55281 [tests] Skip regress-852258 on TSAN.
Very large allocations can cause timeouts or crashes on TSAN bots. This
test checks the handling of arrays with length > MaxSmi, so allocates a
very large array. It's unlikely that TSAN will find anything interesting
here that other bots won't catch, so disabling the test.

Bug: v8:8103
Change-Id: I8ea01d418ff088a2b9bd1b1ef938d4f69be1155d
Reviewed-on: https://chromium-review.googlesource.com/1193423
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55464}
2018-08-28 14:30:05 +00:00
Michael Starzinger
dd40b33371 [wasm] Fix crash during exception stack unwinding.
This fixes a crash with a predicate used during stack unwinding of
WebAssembly frames during exception handling. The predicate caused an
observable side-effect in JavaScript during unwinding, code that is
inherently unhandlified and is not allowed to be observable.

The fix actually just removes the entire predicate. This is because the
updated proposal causes all JavaScript exceptions to participate in
WebAssembly exception handling, allowing modelling of "finally" language
constructs to perform cleanup independent of the embedders exception
details.

R=ahaas@chromium.org
TEST=mjsunit/regress/wasm/regress-8095
BUG=v8:8095

Change-Id: Ic03bc45e7b7f4562a431ccf910ee9ddcf558aa48
Reviewed-on: https://chromium-review.googlesource.com/1193445
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55457}
2018-08-28 13:02:44 +00:00
Rodrigo Bruno
eb164dbd00 Reland "[heap] Attempt to incorporate backing store counters into heap sizing and GC trigger stragery."
This is a reland of ba735dde20

Original change's description:
> [heap] Attempt to incorporate backing store counters into heap sizing and GC trigger stragery.
> 
> Bug: chromium:845409
> Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
> Change-Id: Ic62a4339110e3dd2a6b1961a246e2bee0c07c03b
> Reviewed-on: https://chromium-review.googlesource.com/1160162
> Commit-Queue: Rodrigo Bruno <rfbpb@google.com>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#55128}

Bug: chromium:845409
Change-Id: Iaff177f7bebbc073460fab0ae4e5cd9e632e1921
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/1177301
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Rodrigo Bruno <rfbpb@google.com>
Cr-Commit-Position: refs/heads/master@{#55454}
2018-08-28 12:41:53 +00:00
Michael Starzinger
dd732b4fb0 [wasm] Cleanup and modularize mjsunit/wasm/exceptions.
R=ahaas@chromium.org
TEST=mjsunit/wasm/exceptions

Change-Id: I6301cf9bcb94e972f4e7eb3d096c650a5afc55ca
Reviewed-on: https://chromium-review.googlesource.com/1190343
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55453}
2018-08-28 12:19:02 +00:00
Georg Neis
609ec4b760 [turbofan] Be consistent about prototype optimization condition.
Change-Id: Ib967337b140594e70307348e6989b1324a62d71e
Reviewed-on: https://chromium-review.googlesource.com/1186641
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55443}
2018-08-28 09:39:02 +00:00
Michael Starzinger
91f3555fce [wasm] Re-enable a mjsunit/wasm/exceptions test case.
R=ahaas@chromium.org
TEST=mjsunit/wasm/exceptions
BUG=v8:8091

Change-Id: If811fdffe31df3ca94c70ff910603fab8d7e1ad4
Reviewed-on: https://chromium-review.googlesource.com/1190303
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55442}
2018-08-28 09:30:55 +00:00
Georg Neis
969a0548d1 [builtins] Fix String#pad{Start,End} for a large maxLength argument.
If maxLength is larger than String::kMaxLength, we used to throw
immediately. However, we must first look at the filler argument, which
is observable. Moreover, if the filler is empty, we must return the
input unchanged.

Bug: v8:8078
Change-Id: Ic3d135f9e25da56df45b059144e45e19dda9c3d8
Reviewed-on: https://chromium-review.googlesource.com/1188313
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55414}
2018-08-24 19:50:09 +00:00
Michael Starzinger
dc5cb1f077 [wasm][test] Fix typo in module-memory test.
R=sigurds@chromium.org
TEST=mjsunit/wasm/module-memory

Change-Id: I30b52a09d8655340199dc449aaa91e6a351e2111
Reviewed-on: https://chromium-review.googlesource.com/1188567
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55410}
2018-08-24 14:18:18 +00:00
Michael Starzinger
f1aef71dd5 [wasm][test] Make module-memory test thread resilient.
R=titzer@chromium.org
TEST=mjsunit/wasm/module-memory

Change-Id: If190f4f75feb0560bfb608b5ec01234c95e1f715
Reviewed-on: https://chromium-review.googlesource.com/1188464
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55400}
2018-08-24 12:27:15 +00:00
Maya Lekova
4f40d83b07 [mjsunit] Disable a flaky regression test on Arm
Bug: v8:8090
Change-Id: I6f8a4d2bcfa25bcc83f29e5fd39f9e72ba18d4ac
Reviewed-on: https://chromium-review.googlesource.com/1188132
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55394}
2018-08-24 11:49:33 +00:00
Michael Starzinger
a500f20175 [test] Remove %SetFlags runtime test method.
This method introduces an inherent race because it allows changing
global static flag variables from concurrently running Isolates (or
Workers). Since there are not too many use-cases left, the method in
question can be removed entirely.

R=hpayer@chromium.org

Change-Id: I9798730dd775b04f0bc83f18ed5982672e76e5d5
Reviewed-on: https://chromium-review.googlesource.com/1186731
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55392}
2018-08-24 10:48:39 +00:00
Ross McIlroy
464dbb7e80 Revert "[Tests] Fix some OOM failures on Android by explicitly setting max_old_space_size."
This reverts commit bca38dbf29.

Reason for revert: Makes ODROIDs flaky.
BUG=v8:8086

Original change's description:
> [Tests] Fix some OOM failures on Android by explicitly setting max_old_space_size.
>
> BUG=v8:8040
>
> Change-Id: I8de22af3978f2a8eb844eabdb757bd635050f901
> Reviewed-on: https://chromium-review.googlesource.com/1181432
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#55227}

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

Bug: v8:8040
Change-Id: Ife980e8706ebbff4d86d87739c2f621d7a976039
Reviewed-on: https://chromium-review.googlesource.com/1188322
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55391}
2018-08-24 10:41:39 +00:00
Simon Zünd
837fec91a4 [array] Replace JS Array.p.reverse with a Torque implementation
This CL adds a baseline implementation for Array.p.reverse in Torque,
as well as fastpaths for PACKED elements kinds.

Support for sparse JSArrays was removed.

R=jgruber@chromium.org, petermarshall@chromium.org

Bug: v8:7624
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I12900fbbb44746f1c5d36b78be826e14b88b4f69
Reviewed-on: https://chromium-review.googlesource.com/1185600
Commit-Queue: Simon Zünd <szuend@google.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55369}
2018-08-24 05:57:20 +00:00
Maya Lekova
027074fd78 [mjsunit] Skip slow test on arm sim
The test is timing out on the Arm simulator when TimSort is disabled.

NOTRY=true
TBR=sigurds@chromium.org

Bug: v8:7783
Change-Id: I51e159822d0010253a458f0c380c52f27f7fe972
Reviewed-on: https://chromium-review.googlesource.com/1186583
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55354}
2018-08-23 13:01:55 +00:00
Michael Achenbach
328ec5441d [test] Skip some slow tests on arm sim
NOTRY=true
TBR=mslekova@chromium.org,sigurds@chromium.org

Bug: v8:7783
Change-Id: I87be7e03b11365eb958fcdb3f031195ada3e57d8
Reviewed-on: https://chromium-review.googlesource.com/1186324
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55330}
2018-08-23 08:26:12 +00:00
Maya Lekova
a64fb9fe2a [mjsunit] Skip a flaky test on Android
Example failure:
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Android%20Arm64%20-%20N5X/279

NOTRY=true
NOTREECHECKS=true
TBR=petermarshall@chromium.org,sigurds@chromium.org

Change-Id: I25243a7f5e6db5661f61b9ac2ceb64fb8264142f
Reviewed-on: https://chromium-review.googlesource.com/1185002
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55306}
2018-08-22 12:42:44 +00:00
Sigurd Schneider
2e0fbb255f [mjsunit] Allow flaky test to pass or fail
Some recent runs had the test passing, which painted the bot red.

NOTRY=true
NOTREECHECKS=true
TBR=mstarzinger@chromium.org,rmcilroy@chromium.org


Bug: v8:8040
Change-Id: Icc289f6615be299e9e401bc42e16a2e712f1445c
Reviewed-on: https://chromium-review.googlesource.com/1184902
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55304}
2018-08-22 11:33:30 +00:00
Tobias Tebbi
e99a109281 Revert "[builtins] Reland Array.prototype.splice() Torque implementation."
This reverts commit cdaaa31151.

Reason for revert: chromium:876445 chromium:876453 chromium:876443

Original change's description:
> [builtins] Reland Array.prototype.splice() Torque implementation.
> 
> Before, splice was implemented with a C++ fast path and a
> comprehensive JavaScript version.
> 
> This impl. is entirely in Torque with a fastpath for SMI,
> DOUBLE and OBJECT arrays, and a comprehensive slow path.
> The same level of "sparse" array support as given by the
> array.js implementation is included.
> 
> Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
> Change-Id: Ia7334a30b401988309e9909cfa0069da0bb6fb9f
> Reviewed-on: https://chromium-review.googlesource.com/1169466
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#55263}

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

Change-Id: I5b750a98e671b7284474ffcabc6b4d37a9d1219e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/1184741
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55289}
2018-08-22 08:57:38 +00:00
Benedikt Meurer
2650fc335d [builtin] Further cleanup %ArrayIteratorPrototype%.next().
Refactor the ArrayIteratorPrototypeNext CSA builtin to handle the
JSArray element access in a dedicated helper macro, very similar
to how it's done for JSTypedArray's. Also add support for dictionary
elements to this helper macro using the existing dictionary access
logic in the CodeStubAssembler.

This improves the readability of the builtin significantly and the
performance of iterating arrays with dictionary elements goes up by
a factor of ~3.5x.

Bug: v8:8015, v8:8070
Change-Id: Ibfee760ea1e4bc0fffb42b232fb1d097b706bd1f
Reviewed-on: https://chromium-review.googlesource.com/1183305
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55283}
2018-08-21 15:42:58 +00:00
Ross McIlroy
20122d46f2 [Tests] Disable regress-752764 on Android since it's still flaky
BUG=v8:8040

Change-Id: I004f5748bafeff60885fd85f1b1a6ea44af06340
Reviewed-on: https://chromium-review.googlesource.com/1183196
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55270}
2018-08-21 13:07:38 +00:00
Tobias Tebbi
cdaaa31151 [builtins] Reland Array.prototype.splice() Torque implementation.
Before, splice was implemented with a C++ fast path and a
comprehensive JavaScript version.

This impl. is entirely in Torque with a fastpath for SMI,
DOUBLE and OBJECT arrays, and a comprehensive slow path.
The same level of "sparse" array support as given by the
array.js implementation is included.

Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: Ia7334a30b401988309e9909cfa0069da0bb6fb9f
Reviewed-on: https://chromium-review.googlesource.com/1169466
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55263}
2018-08-21 11:40:19 +00:00
Benedikt Meurer
6031f172ed [es2015] Use [[ArrayIteratorNextIndex]] to indicate exhaustion.
Instead of changing the [[IteratedObject]] field to undefined to mark an
array iterator as exhausted, store the appropriate maximum value into
the [[ArrayIteratorNextIndex]] field such that the iterator will never
produce any values again.

Without this change the map check and the "length" access on the
[[IteratedObject]] cannot be eliminated inside the loop, since the
object can either be the array or undefined. Even with this change
it's still not possible immediately due to missing aliasing
information in the LoadElimination, but it paves the way for follow
up improvements. Eventually the goal is to have `for..of` as fast as
a traditional `for` loop even for really tight loops.

This CL also hardens the implementation of the ArrayIterator by using
proper CASTs and CSA_ASSERTs. The readability of the CSA builtin was
improved by utilizing proper helper functions.

Bug: v8:7510, v8:7514, v8:8070
Change-Id: Ib46604fadad1a0f80e77fe71a1f47b0ca31ab841
Reviewed-on: https://chromium-review.googlesource.com/1181902
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55261}
2018-08-21 11:26:00 +00:00
Ross McIlroy
16fd84f3bd [Tests] Fix regress/regress-599414-array-concat-fast-path on Android.
BUG=v8:8040

Change-Id: I705f9afebfa770a8415fa268dd13ba00e90808d4
Reviewed-on: https://chromium-review.googlesource.com/1181429
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55260}
2018-08-21 11:02:26 +00:00
Ben L. Titzer
438e7ec6dc Reland "[asmjs] Properly validate asm.js heap sizes"
This is a reland of 5c3092718e
(the CL was reverted because of a Chromium test that is now fixed)

Original change's description:
> Reland "[asmjs] Properly validate asm.js heap sizes"
>
> This is a reland of 5d69010e26
>
> Original change's description:
> > [asmjs] Properly validate asm.js heap sizes
> >
> > Enforce both engine limitations and spec (http://asmjs.org/spec/latest/)
> > limitations on the size of asm.js heaps.
> >
> > R=clemensh@chromium.org
> > CC=​mstarzinger@chromium.org
> >
> > Bug: chromium:873600
> > Change-Id: I104c23bbd0a9a7c494f97f8f9e83ac5a37496dfd
> > Reviewed-on: https://chromium-review.googlesource.com/1174411
> > Commit-Queue: Ben Titzer <titzer@chromium.org>
> > Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#55163}
>
> Bug: chromium:873600
> Change-Id: Id24070bda3aafb9e1a32af0732a1b18f633ef932
> Reviewed-on: https://chromium-review.googlesource.com/1179681
> Commit-Queue: Ben Titzer <titzer@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#55193}

Bug: chromium:873600
Change-Id: I6eca2a89589070837b109278f964fc8e9a0fd6f1
Reviewed-on: https://chromium-review.googlesource.com/1183081
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55249}
2018-08-21 09:00:04 +00:00
Aseem Garg
dd65e4b837 Revert "Reland "[asmjs] Properly validate asm.js heap sizes""
This reverts commit 5c3092718e.

Reason for revert: Broke fast/workers/worker-shared-asm-buffer.html

Original change's description:
> Reland "[asmjs] Properly validate asm.js heap sizes"
>
> This is a reland of 5d69010e26
>
> Original change's description:
> > [asmjs] Properly validate asm.js heap sizes
> >
> > Enforce both engine limitations and spec (http://asmjs.org/spec/latest/)
> > limitations on the size of asm.js heaps.
> >
> > R=clemensh@chromium.org
> > CC=​mstarzinger@chromium.org
> >
> > Bug: chromium:873600
> > Change-Id: I104c23bbd0a9a7c494f97f8f9e83ac5a37496dfd
> > Reviewed-on: https://chromium-review.googlesource.com/1174411
> > Commit-Queue: Ben Titzer <titzer@chromium.org>
> > Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#55163}
>
> Bug: chromium:873600
> Change-Id: Id24070bda3aafb9e1a32af0732a1b18f633ef932
> Reviewed-on: https://chromium-review.googlesource.com/1179681
> Commit-Queue: Ben Titzer <titzer@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#55193}

TBR=mstarzinger@chromium.org,titzer@chromium.org

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

Bug: chromium:873600
Change-Id: I5845c584c7ac399b9b7939f5fd50c09b7b2cc3d2
Reviewed-on: https://chromium-review.googlesource.com/1182616
Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
Reviewed-by: Aseem Garg <aseemgarg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55242}
2018-08-21 00:51:54 +00:00
Ross McIlroy
454f19e6c6 [Tests] Fix math-log2-log10.js on Android
BUG=v8:8074

Change-Id: I012666ff1a06d0a53f893031a3caf38ed0d40229
Reviewed-on: https://chromium-review.googlesource.com/1181421
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55237}
2018-08-20 20:06:13 +00:00
Ross McIlroy
bca38dbf29 [Tests] Fix some OOM failures on Android by explicitly setting max_old_space_size.
BUG=v8:8040

Change-Id: I8de22af3978f2a8eb844eabdb757bd635050f901
Reviewed-on: https://chromium-review.googlesource.com/1181432
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55227}
2018-08-20 17:29:43 +00:00
Michael Starzinger
2af2d88bc5 [wasm] Fix interpreter entry with shared code.
This makes sure that debug info and interpreter handle are created
lazily, even when interpretation is triggered by a different Isolate
sharing the same WasmEngine (and hence the native module).

R=titzer@chromium.org
TEST=mjsunit/wasm/worker-interpreter
BUG=v8:7424

Change-Id: Iba17e207a537007fd2e642cede22dad7a708c6c7
Reviewed-on: https://chromium-review.googlesource.com/1181045
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55220}
2018-08-20 14:20:20 +00:00
Andreas Haas
af4cf8d150 [wasm] Abort decoding of BlockTypeImmediate after an error was detected
R=titzer@chromium.org

Bug: chromium:875556
Change-Id: I989dbaaec1eac3b7d0c761f25efec043cdeb9d71
Reviewed-on: https://chromium-review.googlesource.com/1180964
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55212}
2018-08-20 12:09:11 +00:00