Commit Graph

21703 Commits

Author SHA1 Message Date
Camillo Bruni
aecb020e27 [parser] Use shared buffer to create PreparseData
Directly access the std::vector buffer backing store to write bytes. By
reserving enough space upfront we can avoid many superflous bounds checks
that were previously necessary when using push_back.

Change-Id: I9b2fb467809e40743b0d9409c9cccb0c6f36f8c1
Reviewed-on: https://chromium-review.googlesource.com/c/1425910
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59036}
2019-01-23 15:32:06 +00:00
Andreas Haas
76a41418e4 [wasm] Update spec tests
R=titzer@chromium.org

Change-Id: I45693c7bc7600dde4d01d1130f3be1641c5e9250
Reviewed-on: https://chromium-review.googlesource.com/c/1430102
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59034}
2019-01-23 14:57:21 +00:00
Clemens Hammacher
b60eb45c82 [cctest] Reenable V8 disposal
This was disabled in 2014 (https://crrev.com/267383002), together with
a comment about a broken serializer. The conditional v8 initialization
was since then moved back to be unconditional, but the TearDown was
never restored.
Now we need it for wasm, since during tear down the wasm engine
synchronizes on all background compile jobs. Omitting this leads to
uses of the disposed platform (see https://crrev.com/c/1429861).

R=mstarzinger@chromium.org

Bug: v8:8689, v8:7921, v8:8725
Change-Id: Ia24f746094f38fc6ce349532587b622384379125
Reviewed-on: https://chromium-review.googlesource.com/c/1430059
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59032}
2019-01-23 14:34:49 +00:00
Andreas Haas
e7e61ce620 [wasm][anyref] Introduce anyfunc locals
R=titzer@chromium.org

Bug: v8:7581
Change-Id: I153b09ac1676c75590f37c4b7d1f8659c37bbe96
Reviewed-on: https://chromium-review.googlesource.com/c/1421837
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59029}
2019-01-23 13:45:07 +00:00
Toon Verwaest
0b69b05a08 [parser] Iterate declarations to set initializer positions
This allows us to remove the PatternRewriter.

Change-Id: I54ec74ed3bd31e76e38c69f9b0b2a78f8620cd89
Reviewed-on: https://chromium-review.googlesource.com/c/1429863
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59028}
2019-01-23 13:28:58 +00:00
Georg Neis
66eaf9fe7d [parsing] Don't validate module if parsing failed.
Otherwise we might come across invalid locations.

Bug: chromium:923675
Change-Id: I0b01ba4b11cc7270744ec438bedb0b8ada2aa29d
Reviewed-on: https://chromium-review.googlesource.com/c/1426126
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59026}
2019-01-23 12:09:17 +00:00
Jakob Gruber
b766299d2c [arm] Add missing RELATIVE_CODE_TARGET iteration
Code object iteration was missing logic for RELATIVE_CODE_TARGET
reloc entries. Garbage collection could thus miss objects that were
referenced only as targets of pc-relative calls or jumps.

RELATIVE_CODE_TARGETs are only used on arm, mips, and s390 and only
at mksnapshot-time.

This exposed another issue in that the interpreter entry trampoline
copy we generate for profiling *did* contain relative calls in
runtime-accessible code. This is a problem, since code space on arm is,
by default, too large to be fully addressable through pc-relative
calls. This CL thus also disables the related
FLAG_interpreted_frames_native_stack feature on arm.

Drive-by: Ensure the builtins constants table does not contain Code
objects.

Bug: v8:8713,v8:6666
Change-Id: Idd914b46970ad08f9091fc72113fa7aed2732e71
Reviewed-on: https://chromium-review.googlesource.com/c/1424866
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59023}
2019-01-23 10:45:50 +00:00
Michael Achenbach
9042f2e333 Revert "Expose the number of microtasks from RunMicrotasks"
This reverts commit 516d90685b.

Reason for revert: Breaks layout tests:
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8-Blink%20Linux%2064/29444

See also:
https://v8.dev/docs/blink-layout-tests

Original change's description:
> Expose the number of microtasks from RunMicrotasks
> 
> This CL adds the number of processed microtasks to the tracing marker
> of RunMicrotasks, plus let RunMicrotasks return the number.
> 
> Bug: v8:7804, v8:8124
> Change-Id: Ie584e22964121fbda3a822379d760e7518fc54a7
> Reviewed-on: https://chromium-review.googlesource.com/c/1425277
> Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#59017}

TBR=bmeurer@chromium.org,tzik@chromium.org

Change-Id: I7db675dbbc496cc3c45220aa141252dd371d2780
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7804, v8:8124
Reviewed-on: https://chromium-review.googlesource.com/c/1429859
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59018}
2019-01-23 08:21:51 +00:00
tzik
516d90685b Expose the number of microtasks from RunMicrotasks
This CL adds the number of processed microtasks to the tracing marker
of RunMicrotasks, plus let RunMicrotasks return the number.

Bug: v8:7804, v8:8124
Change-Id: Ie584e22964121fbda3a822379d760e7518fc54a7
Reviewed-on: https://chromium-review.googlesource.com/c/1425277
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59017}
2019-01-23 05:02:46 +00:00
Frank Tang
45fe356e24 [Intl] Remove linebreak from Segmenter
Sync w/ https://github.com/tc39/proposal-intl-segmenter/pull/60

Bug: v8:8717
Change-Id: I98fe9e88367a611c14c82195222c8fe8a52e4bc8
Reviewed-on: https://chromium-review.googlesource.com/c/1422749
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59016}
2019-01-23 04:54:56 +00:00
Frank Tang
008a0d75a4 [Intl] Updates comments & adds tests to catch monkey-patching
Follow up cl for the change of CanonicalizeLocaleList in
https://tc39.github.io/proposal-intl-locale/#sec-canonicalizelocalelist

Bug: v8:8655
Change-Id: I2505057e03511806320104974519fd4b97848b53
Reviewed-on: https://chromium-review.googlesource.com/c/1423323
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59014}
2019-01-23 00:35:57 +00:00
Deepti Gandluri
7ff145b792 [wasm] Fix I64Atomics convert test
Change-Id: Iac6aca817f1b96b80c7ebc46b4dcc098858a0ddd
Reviewed-on: https://chromium-review.googlesource.com/c/1427661
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59013}
2019-01-22 22:52:51 +00:00
Deepti Gandluri
7c64d88374 [wasm] Use DefaultLowering for I64Atomic narrow operations
Clusterfuzz generated test cases for narrow Load, CmpExchg nodes in
which the index is a word64 expression. This was not handled correctly
leading to a malformed graph. Use default lowering for all atomic
narrow operations, and add reduced test cases in wasm cctests with the
same sequence as the ones generated by binaryen for other I64Atomic
operations as well.

Change-Id: I50d63747b16a8f69289ca4e76547b325d84b22d3
Bug: chromium:921366, chromium:920120, chromium:900681
Reviewed-on: https://chromium-review.googlesource.com/c/1423177
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59012}
2019-01-22 20:11:03 +00:00
Suraj Sharma
f243c9421f [parser] Updated the Error Message for Unparenthesized Exponentiation Expression
-5**2 now produces
SyntaxError: Unary operator used immediately before exponentiation expression.
Parenthesis must be used to disambiguate operator precedence.

Bug: v8:6894
Change-Id: I89dd034ff90ee1a49ba61e0c613da534fbf8b41b
Reviewed-on: https://chromium-review.googlesource.com/c/1418592
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Suraj Sharma <surshar@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#59011}
2019-01-22 19:37:23 +00:00
Sven Sauleau
d4831b31b8 [wasm] fix js-api memory/grow
Fix WebAssembly's memory/grow js-api. The argument is a unsigned long,
this change refactors most of arithmetic and bounds checks type from int64 to
uint32_t, according to the spec.

Bug: v8:8319
Change-Id: I662c704d1d50288ad68be70c72a3db7052a80014
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Reviewed-on: https://chromium-review.googlesource.com/c/1351028
Commit-Queue: Sven Sauleau <ssauleau@igalia.com>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59008}
2019-01-22 19:03:05 +00:00
Matt Gardner
1e5b2358a7 Check for "SuperNotCalled" on "delete this" in a constructor
V8 implements "delete this" as "LdaTrue", but an error needs to be thrown
if done in a constructor before calling super. ThrowIfHole checks the
accumulator, so we need to load 'this' into the accumulator. The check is
inserted by the load since it has HoleCheckMode::kRequired

Bug: https://bugs.chromium.org/p/v8/issues/detail?id=6711

Change-Id: I9f2ce4439505cec4327d88d1195898782edea721
Reviewed-on: https://chromium-review.googlesource.com/c/1419084
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Matt Gardner <magardn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#59007}
2019-01-22 18:58:42 +00:00
Daniel Clifford
4c9bc648f3 Reland "[torque] Implement safe initialization of classes through hidden structs"
This is a reland of d11a0648af

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

Bug: v8:7793
Change-Id: Ia8c23a36a661a73b5dc34437efd514a7c13a1ae8
Reviewed-on: https://chromium-review.googlesource.com/c/1426840
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59005}
2019-01-22 17:49:39 +00:00
Peter Marshall
b63fcd190b [cleanup] Reduce the includes and forward-declarations of log.h
Some includes in log.h were only needed by log.cc so move them there.
Some were not needed at all, so remove them completely.

Drive-by cleanup FunctionEvent(), which was never called without args
for the last parameters which had default values.

Change-Id: Id8b0c634c4d39d3c278ab3d932ed7af4142fd9c9
Reviewed-on: https://chromium-review.googlesource.com/c/1425914
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59003}
2019-01-22 17:25:48 +00:00
Ulan Degenbaev
30602560a8 [heap] Fix stress marking observer and remove --black-allocation
The main fix is to ensure that the recently allocated object is marked
black in StressMarkingObserver::Step. Otherwise, the concurrent marker
can observe an uninitialized white object in the old generation.

This patch also removes the --black-allocation flag.

Bug: v8:8676
Change-Id: Iba8f00330eabc4847eaef2cd3dfb2884d62a48b4
Reviewed-on: https://chromium-review.googlesource.com/c/1425915
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59002}
2019-01-22 17:08:19 +00:00
Maya Lekova
a61f5ccdcb [test] Fix flaky OOM regression test
The test was originally testing the max string length limit, but due to
refactoring of Array.join started consuming too much memory, resulting in
OOMs on TSAN builds. The new implementation still checks for the limit,
while reducing the memory consumption drastically.

R=jarin@chromium.org

Bug: v8:8504, chromium:336820
Change-Id: I4db9001541103d5908149e623ce4a4beee551e6c
Reviewed-on: https://chromium-review.googlesource.com/c/1426839
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59000}
2019-01-22 16:42:40 +00:00
Simon Zünd
b959ece470 [array] Enable copying from the prototype chain when sorting JSArrays
This CL enables the pre-processing step of copying from the
prototype chain for JSArrays. Previously, this was done for everything
BUT JSArrays. This brings Array#sort more in line with other engines
in the case of undefined behavior.

R=jgruber@chromium.org

Bug: v8:8666
Change-Id: I832d470dc02111b64dc4919e84e7e3e47c8fdd47
Reviewed-on: https://chromium-review.googlesource.com/c/1426119
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58999}
2019-01-22 16:34:38 +00:00
Ross McIlroy
162402f9c5 [Compile] Move decision of whether an IIFE is oneshot into parser.
The decision as to whether to optimize an IIFE as oneshot depends on
whether it's outer scope is the script scope. During lazy compile, we
might have discarded scopes which don't need a context between the IIFE
and the script scope, which means we might treat an IIFE as oneshot,
even though initial eager compile treated it as non-oneshot. Both
bytecode flushing and lazy source positions rely on us generating the
same bytecode during lazy compile as eager compile, so we move the
decision into the parser where it happens once and is then stored in
the SFI for any future lazy compiles.

BUG=v8:8395,v8:8510

Change-Id: I88f1e74ad95d47a2636c393ceb1318d7d610055d
Reviewed-on: https://chromium-review.googlesource.com/c/1421841
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58996}
2019-01-22 15:19:39 +00:00
Ulan Degenbaev
3f25e56f58 [heap] Activate the memory reducer on smaller heaps
Currently the memory reducer is activated only after the first mark-
compact GC, which triggered after the old generation reaches 8 MB.

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

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

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

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

Reason for revert: <INSERT REASONING HERE>

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

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

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

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

Drive by: add validation to check for duplicate field declarations

Bug: v8:7793
Change-Id: I8b5e85980d6a103ef9fc3262b76f6514f36ebf88
Reviewed-on: https://chromium-review.googlesource.com/c/1411252
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58979}
2019-01-22 10:03:11 +00:00
Mathias Bynens
effb7ad728 [esnext] Add more hashbang syntax tests
BUG=v8:8523

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

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

Change-Id: Ia0a622ba42a338fc91eea1e0c1a72d2582d9f867
Reviewed-on: https://chromium-review.googlesource.com/c/1400842
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58972}
2019-01-21 17:08:59 +00:00
Clemens Hammacher
6962334df8 [platform] Allow to memory-map empty files
This current fails, since {mmap} fails with EINVAL for empty mappings.
The destructor already has special handling for a {nullptr} mapping, so
we can just use {nullptr} for empty files. We get a similar error on
windows, and can fix it the same way.

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

R=mlippautz@chromium.org

Change-Id: I2b73da7ff6df72d8bdd40df1fff6422e0a46881e
Reviewed-on: https://chromium-review.googlesource.com/c/1424861
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58970}
2019-01-21 16:02:47 +00:00
Michael Lippautz
42e0bf22c5 [global-handles] Update declarations
The change is just a refactoring without functional changes.

Bug: chromium:923361
Change-Id: Ie633c56122ff72658f0238dc40db698350a7b8e7
Reviewed-on: https://chromium-review.googlesource.com/c/1421363
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58963}
2019-01-21 13:45:12 +00:00
Clemens Hammacher
ce2bfb8e2f [Liftoff][arm] Avoid use of temp registers
The temp registers might be needed by the assembler, so avoid using them
in LiftoffAssembler. Use Liftoff cache registers instead. This might
introduce additional spills if all registers are in use, but this is
unlikely.

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

R=ahaas@chromium.org

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

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

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

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

TBR=titzer@chromium.org

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

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

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

R=ahaas@chromium.org

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

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

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

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

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

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

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

R=jgruber@chromium.org

Bug: v8:8708
Change-Id: I833506531bcff1c4703b9a21678028cf0e63638d
Reviewed-on: https://chromium-review.googlesource.com/c/1424858
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58952}
2019-01-21 10:39:45 +00:00
Peter Marshall
ba56557793 [cpu-profiler] Cleanup and use std atomics in Sampler
There's no reason to use our self-baked atomics anymore. Also

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

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

Change-Id: I2d3e5ec6f8f5068284cdbaa6900797950fc7e01a
Reviewed-on: https://chromium-review.googlesource.com/c/1422739
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58946}
2019-01-21 09:32:46 +00:00
Sven Sauleau
0e9e8164c2 [wasm] fix js-api table/get-set
Fix WebAssembly's table/get-set js-api. The argument is a unsigned long,
this change refactors most of arithmetic and bounds checks type from
int64 to uint32_t, according to the spec.

Bug: v8:8319
Change-Id: I088f631c6805b0e5ba29089b08ea15e78fe5852d
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Reviewed-on: https://chromium-review.googlesource.com/c/1414914
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Sven Sauleau <ssauleau@igalia.com>
Cr-Commit-Position: refs/heads/master@{#58941}
2019-01-19 09:15:37 +00:00
Frank Tang
2c9efe52f9 Update test262.
Rolling v8/test/test262/data: https://chromium.googlesource.com/external/github.com/tc39/test262/+log/af984c0..4f1155

Bug: v8:7834
Change-Id: I6eeff251b9a3a773b386d7963981dc72f48d6e44
Reviewed-on: https://chromium-review.googlesource.com/c/1423096
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Frank Tang <ftang@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58939}
2019-01-19 01:19:54 +00:00
Frank Tang
4682a3572f [Intl] Move GetOptions('localeMatcher') earlier
See https://github.com/tc39/proposal-intl-list-format/pull/36

Bug: v8:8614
Change-Id: Ifa9bebf27163420562c0d62867b9a240b5c4c502
Reviewed-on: https://chromium-review.googlesource.com/c/1386324
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58938}
2019-01-19 00:09:51 +00:00
Sven Sauleau
fc27711780 [wasm] fix js-api table/grow
Fix WebAssembly's table/grow js-api. The argument is a unsigned long,
this change refactors most of arithmetic and bounds checks type from
int64 to uint32_t, according to the spec.

Bug: v8:8319
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: Ia29121c930d7fb930668e54a5a769dae25234f2c
Reviewed-on: https://chromium-review.googlesource.com/c/1351006
Commit-Queue: Sven Sauleau <ssauleau@igalia.com>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58936}
2019-01-18 20:19:51 +00:00
Caitlin Potter
a62c96a014 [counters] remove "override mistake" use counters
v8::Isolate::kAttemptOverrideReadOnlyOnPrototypeSloppy and
v8::Isolate::kAttemptOverrideReadOnlyOnPrototypeStrict are no longer
incremented.

BUG=v8:8175
R=gsathya@chromium.org, littledan@chromium.org

Change-Id: Ia5f8f9226a54d88c15a3c3b4a5941d774eb1834a
Reviewed-on: https://chromium-review.googlesource.com/c/1417381
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#58934}
2019-01-18 19:27:29 +00:00
Michael Achenbach
b7cc4f7a12 Revert "[wasm] Split compilation in three stages"
This reverts commit 4e1d7c87b9.

Reason for revert:
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20arm%20-%20sim%20-%20debug/14986

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

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

Change-Id: Ic3d0287b354ef5f834b76bc2cdc096d2231f4477
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8689
Reviewed-on: https://chromium-review.googlesource.com/c/1422917
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58932}
2019-01-18 19:22:19 +00:00
Clemens Hammacher
4e1d7c87b9 [wasm] Split compilation in three stages
In order to refactor ownership between objects in wasm compilation, the
compilation (executed by background tasks) is split in three stages:
getting a compilation unit (while holding a mutex), executing the work
(without any mutex and without keeping the NativeModule alive), and
submitting the work (with a mutex again).

This CL prepares this design by splitting compilation from submission.
Both steps are still executed right after each other. This will be
changed in a follow-up CL.

R=titzer@chromium.org
CC=mstarzinger@chromium.org

Bug: v8:8689
Change-Id: I2f92aee8e2f2d45470d8c63314ed026341630902
Reviewed-on: https://chromium-review.googlesource.com/c/1414920
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58929}
2019-01-18 16:02:02 +00:00
Camillo Bruni
61b217b1cb [parser] Use shared data buffer for PreparseData generation
By using a shared byte buffer on the preparser we can drastically
reduce the number of ZoneChunkLists.

Each PreparseDataBuilder now explicitly keeps track of all inner
builders/functions and writes out the data in consecutive order.

Change-Id: I0aada118d869b150108c1f633d9960474ad2f9a1
Reviewed-on: https://chromium-review.googlesource.com/c/1411600
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58926}
2019-01-18 15:02:26 +00:00
Peter Marshall
41a1632e62 [cpu-profiler] Remove extra logging
We found the nexus 5x flake so this is no longer needed.

Leave the printing functions themselves as they will still be useful
for local debugging.

Bug: v8:8649
Change-Id: Ie0af2bc9b0fc7fb8ac00ec0039b6898553865189
Reviewed-on: https://chromium-review.googlesource.com/c/1420957
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58923}
2019-01-18 13:49:17 +00:00
Igor Sheludko
6d6825f295 [cleanup] Fix kPointerSize usages in the rest of runtime
Bug: v8:8477, v8:8562
Change-Id: Ieb677e0989f77ed207567d468faec0bf92752967
Reviewed-on: https://chromium-review.googlesource.com/c/1388529
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58922}
2019-01-18 13:22:02 +00:00
Ross McIlroy
2619f59c26 [SFI] Free up unused IsDeserializedBit from SFI::flags.
BUG=v8:8395,v8:8510

Change-Id: I1571877d709d6cc37966ace9014fa327e0820a80
Reviewed-on: https://chromium-review.googlesource.com/c/1417634
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58919}
2019-01-18 12:32:03 +00:00
Andreas Haas
ea26454fb7 [wasm][streaming] Add test for the ModuleCompiledCallback
This test checks that the ModuleCompiledCallback is called eventually.

R=clemensh@chromium.org
CC=adamk@chromium.org

Bug: v8:8677
Change-Id: I360f88064f870dd4a12db019e3c9f72154abf13b
Reviewed-on: https://chromium-review.googlesource.com/c/1420759
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58917}
2019-01-18 12:04:00 +00:00
Ulan Degenbaev
8b3fbe1d9f Reland "[heap] Remove bailout marking worklist."
This reverts commit 13e07389ff.

Original change's description:
> [heap] Remove bailout marking worklist.
>
> The concurrent marker can now process all objects.
> This patch also eagerly visits the objects that undergo layout
> changes. This is because previously such objects were pushed
> onto the bailout worklist, which is gone now.
> To preserve the incremental step accounting, the patch introduces
> a new GC tracer scope called MC_INCREMENTAL_LAYOUT_CHANGE.
>
> Bug: v8:8486
> Change-Id: Ic1c2f0d4e2ac0602fc945f3258af9624247bd65f
> Reviewed-on: https://chromium-review.googlesource.com/c/1386486
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58712}

Change-Id: I85c99837819f6971c248198bd51ad40eebdb4fac
Reviewed-on: https://chromium-review.googlesource.com/c/1417595
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58913}
2019-01-18 10:04:17 +00:00
Simon Zünd
e38faab1c7 [array] Remove CHECK_LE from RemoveArrayHolesGeneric
This CL removes a CHECK_LE that does not hold in all cases. After
moving all elements to the front, current_pos will point to the next
free spot. In the case where an object is 'packed', i.e. each index
has a non-undefined value, and the length is smaller then the max
index, current_pos will be greater than the length (limit in the code).

Sidenote: The block after taking the minimum (where the counted
undefineds get set) will not be affected. In the case where
num_undefined > 0, current_pos should be guaranteed to be smaller
than limit, as long there are no accessors with side-effects.

R=jgruber@chromium.org

Bug: chromium:923265
Change-Id: Id533cdc4db6c6c6f266cf7c6a8ab6ecbbeee7016
Reviewed-on: https://chromium-review.googlesource.com/c/1420679
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58912}
2019-01-18 10:01:37 +00:00
Maya Lekova
697885b9df Revert "Change SetProperty/SetSuperProperty to infer language mode when possible"
This reverts commit 0896599f6f.

Reason for revert: Speculative revert, seems to cause a layout test failure blocking the LKGR - https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8-Blink%20Linux%2064/29320

Original change's description:
> Change SetProperty/SetSuperProperty to infer language mode when possible
> 
> In most cases, the language mode can be inferred from the closure and
> the context. Computing the language mode instead of passing it around
> simplifies the ICs and will make it possible to go towards lazily
> allocating feedback vectors. Currently ICs obtain the language mode from
> the feedback vectors and with lazy feedback allocation we may not always
> have feedback vectors. Since computing language mode is a bit expensive
> we want to defer it as far as possible.
> 
> In Array builtins and other builtins like Reflect.Set we need to force a
> language mode when setting the properties. To support these cases the
> SetProperty methods allow the language mode to be overridden when needed.
> 
> This is a first cl in a series of cls, that will defer the language mode
> computation further and remove language mode where it is not needed.
> 
> BUG: v8:8580
> Change-Id: I9c2396e3bcfe77c3c9d6760c46d86954d54744b9
> Reviewed-on: https://chromium-review.googlesource.com/c/1409426
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Commit-Queue: Mythri Alle <mythria@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58893}

TBR=mlippautz@chromium.org,mythria@chromium.org,jgruber@chromium.org,verwaest@chromium.org

Change-Id: I2e0f80a4577a8ca86c05a62205f9dfa488418a52
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/1420758
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58911}
2019-01-18 09:43:50 +00:00
Frank Tang
1b41a5fdf0 Revert "[Intl] Cleans up intl-relative-time-format flag"
This reverts commit 048a3a3ecb.

Reason for revert: Break V8 Linux64 GC Stress 

Original change's description:
> [Intl] Cleans up intl-relative-time-format flag
> 
> Cleans up always=true intl-relative-time-format flag
> It shipped in m71 in Dec 2018.
> 
> Bug: v8:8704
> Change-Id: I52d86aea9aedf201a216a1df0773a486fbee37b9
> Reviewed-on: https://chromium-review.googlesource.com/c/1417299
> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58904}

TBR=jshin@chromium.org,gsathya@chromium.org,ftang@chromium.org

Change-Id: I811decf09e2e1e06323eb5a651cd921d669fc4db
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8704
Reviewed-on: https://chromium-review.googlesource.com/c/1420359
Reviewed-by: Frank Tang <ftang@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58905}
2019-01-18 07:54:08 +00:00
Frank Tang
048a3a3ecb [Intl] Cleans up intl-relative-time-format flag
Cleans up always=true intl-relative-time-format flag
It shipped in m71 in Dec 2018.

Bug: v8:8704
Change-Id: I52d86aea9aedf201a216a1df0773a486fbee37b9
Reviewed-on: https://chromium-review.googlesource.com/c/1417299
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58904}
2019-01-18 07:16:57 +00:00
Sathya Gunasekaran
263194adeb [test262] Roll
Change-Id: Ic1d4371dc5603df1451bc9adc8386a83f9971786
Bug: v8:7834
Reviewed-on: https://chromium-review.googlesource.com/c/1418857
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58902}
2019-01-17 23:08:17 +00:00
tzik
eebdb0f54d Use local MicrotaskQueue in unittests
MicrotaskQueueTest uses Isolate's default_microtask_queue for testing,
however the instance is shared between test cases, and causes flaky
failure of MicrotaskQueueTest.BufferGrowth.

This CL adds a MicrotaskQueue instance for each test fixture, so that
each test cases use separate ones.

Also, this CL removes the DCHECK that denies non-default MicrotaskQueue
to run, which is unneeded after https://crrev.com/c/1369906.

Bug: v8:8124
Change-Id: I4ff236c327bf0be14f582b3ca8c802fd72661b42
Reviewed-on: https://chromium-review.googlesource.com/c/1417315
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58901}
2019-01-17 21:42:52 +00:00
Frank Tang
2bb5b40f75 [Intl] Fix Intl/getCanonicalLocales/canonicalized-tags
and also fix part of test in intl402/Locale/likely-subtags

Improve Intl::ToLanguageTag to also handle -yes in -u- extension
Avoid removing if there are other text after -true and -yes before -

Bug: v8:7669, v8:8236
Change-Id: I59943651889602288e6978d0b1c875d89199fe33
Reviewed-on: https://chromium-review.googlesource.com/c/1383094
Reviewed-by: Jungshik Shin <jshin@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58900}
2019-01-17 19:52:41 +00:00
Z Duong Nguyen-Huu
f85a3554d2 Handle Date.p.setYear edge cases from test262
The current implementation does not correctly handle the edge case for setYear
where input is something like -0.99

Bug: v8:5139
Change-Id: Ia919814eb6282c7f996cccc4531ed073e843ba27
Reviewed-on: https://chromium-review.googlesource.com/c/1412501
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#58899}
2019-01-17 18:29:36 +00:00
Andreas Haas
62fa048749 [wasm] Reschedule compilation tasks
At the moment, the whole WebAssembly compilation may run in a single
background task. On a low-end device, this can mean that the background
thread is busy for seconds and thereby blocks other tasks, see e.g.
https://crbug.com/914757.

With this CL we re-schedule compilation tasks after every 50ms. These
50ms are an arbitrary number. I don't want to introduce too much
overhead, but since this is in the background we also don't have to
make tasks super short.

Tasks which are going to compile with TurboFan will be posted with
lower priority.

This change requires changes in the CancelableTaskManager. At the
moment it is not possible that a background task posts a new task
which is managed by the same task manager as itself. The problem is
about how to deal with another thread which calls CancelAndWait
concurrently. At the moment, if a new task gets posted after the call
to CancelAndWait, then `CHECK(!canceled_)` in
CancelableTaskManager::Register will fail. If we used a lock to
synchronize the calls to CancelAndWait and Register, then there would
be a deadlock, where the thread which calls CancelAndWait waits for
the task which wants to call Register, but at the same time blocks that
task by holding the lock.

With the change here, posting a task after the call to CancelAndWait
will just immediately cancel the new task. This matches the behavior
you would get if CancelAndWait is called right after calling Register.

Bug: chromium:914757
Change-Id: I6d57aba161db8a915ec0d745658e0c28d25219a8
Reviewed-on: https://chromium-review.googlesource.com/c/1411884
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58898}
2019-01-17 18:27:08 +00:00
Junliang Yan
3ed8675b9c PPC/s390: [test] Refactor AllocateAssemblerBuffer
Port 1a1f4e1ef4

Original Commit Message:

    Refactor the AllocateAssemblerBuffer helper for the new Assembler API.
    This is the only non-mechanical part, all other callsites that create
    Assembler instances can be trivially changed to the new API. This will
    be done in a separate CL.

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

Change-Id: I8e22f8c2b6c2b1b9158969d28d4edf291a84bcf0
Reviewed-on: https://chromium-review.googlesource.com/c/1416952
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#58897}
2019-01-17 17:37:32 +00:00
Junliang Yan
b7205f462f PPC/s390: [assembler] Remove legacy constructor
Port edfb8cadd0

Original Commit Message:

    Refactor all call sites to use the new API introduced in
    https://crrev.com/c/1411347 and remove the legacy constructors.

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

Change-Id: I5fea49f4d969edede114101314763d245e9a1fa1
Reviewed-on: https://chromium-review.googlesource.com/c/1417950
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#58896}
2019-01-17 17:11:57 +00:00
Aleksandar Rikalo
aac8b6e348 MIPS32: Fix failing build
Build started to fail after commit
4064757cbf

Change-Id: Ibda0a156f10da4708589ee4edad33239278ad411
Reviewed-on: https://chromium-review.googlesource.com/c/1417830
Reviewed-by: Predrag Rudic <prudic@wavecomp.com>
Commit-Queue: Predrag Rudic <prudic@wavecomp.com>
Cr-Commit-Position: refs/heads/master@{#58895}
2019-01-17 16:54:49 +00:00
Mythri
0896599f6f Change SetProperty/SetSuperProperty to infer language mode when possible
In most cases, the language mode can be inferred from the closure and
the context. Computing the language mode instead of passing it around
simplifies the ICs and will make it possible to go towards lazily
allocating feedback vectors. Currently ICs obtain the language mode from
the feedback vectors and with lazy feedback allocation we may not always
have feedback vectors. Since computing language mode is a bit expensive
we want to defer it as far as possible.

In Array builtins and other builtins like Reflect.Set we need to force a
language mode when setting the properties. To support these cases the
SetProperty methods allow the language mode to be overridden when needed.

This is a first cl in a series of cls, that will defer the language mode
computation further and remove language mode where it is not needed.

BUG: v8:8580
Change-Id: I9c2396e3bcfe77c3c9d6760c46d86954d54744b9
Reviewed-on: https://chromium-review.googlesource.com/c/1409426
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58893}
2019-01-17 15:32:13 +00:00
Ben L. Titzer
e254ec915b [utils] Add IsInBounds(index, size, max) helper
This CL adds a helper function that simplifies a bounds check pattern
that appears repeatedly in the code.

R=clemensh@chromium.org

Change-Id: I8c617515b34eb2d262d58a239a29c1515de2d92d
Reviewed-on: https://chromium-review.googlesource.com/c/1417611
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58892}
2019-01-17 15:25:42 +00:00
Tobias Tebbi
10df816e87 [torque] fix std::set iterator invalidation bug
Bug: v8:7793
Change-Id: Ifb3f27c7da02c2040fdf5042dafa13b336007f94
Reviewed-on: https://chromium-review.googlesource.com/c/1413875
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58890}
2019-01-17 14:44:39 +00:00
Tobias Tebbi
4108304fd0 [torque] allow structs as label parameters
This inlines macros with structs as label parameters, to work-around
a limitation in the C++ lowering of macros that doesn't allow this.

Bug: v8:7793
Change-Id: Idd177c115f3a0b277e8cf99b8a051e6d253359b3
Reviewed-on: https://chromium-review.googlesource.com/c/1417613
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58888}
2019-01-17 14:16:35 +00:00
Ben L. Titzer
cb4e772921 [wasm] table.copy: handle overlap and zero count cases
This CL fixes the zero-count and overlapping cases for the table.copy
bytecode.

R=mstarzinger@chromium.org
CC=binji@chromium.org
BUG=v8:7747

Change-Id: I6211e4c899621069ebf8bc088b3ab4e80c7bbd0a
Reviewed-on: https://chromium-review.googlesource.com/c/1417172
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58887}
2019-01-17 13:55:20 +00:00
Clemens Hammacher
fa06d7071a [test] Remove TEARDOWN macro, use managed pointers instead
Clean-up to remove explicit resource deallocation by using unique_ptr
instead.

R=mstarzinger@chromium.org

Bug: v8:8562
Change-Id: I603cf1b9e2cfe33bc7e6bd84cdd228cf10ff20ba
Reviewed-on: https://chromium-review.googlesource.com/c/1415492
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58886}
2019-01-17 13:45:46 +00:00
Andreas Haas
b565cda493 [wasm] Implement anyfunc parameters
Implementation of anyfunc parameters. Different to anyref parameters we
have to do a validation in the js-to-wasm wrapper: Only exported wasm
functions are allowed. I implemented this check in a runtime function.

R=titzer@chromium.org

Bug: v8:7581
Change-Id: I6145782fb8578124ddc21b50133c82235d666f19
Reviewed-on: https://chromium-review.googlesource.com/c/1417470
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58885}
2019-01-17 13:43:59 +00:00
Clemens Hammacher
edfb8cadd0 [assembler] Remove legacy constructor
Refactor all call sites to use the new API introduced in
https://crrev.com/c/1411347 and remove the legacy constructors.

R=mstarzinger@chromium.org

Bug: v8:8689, v8:8562
Change-Id: Id73686413726b2860f551dd200ef4b8823ef3034
Reviewed-on: https://chromium-review.googlesource.com/c/1415491
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58884}
2019-01-17 12:39:57 +00:00
Clemens Hammacher
1a1f4e1ef4 [test] Refactor AllocateAssemblerBuffer
Refactor the AllocateAssemblerBuffer helper for the new Assembler API.
This is the only non-mechanical part, all other callsites that create
Assembler instances can be trivially changed to the new API. This will
be done in a separate CL.

R=mstarzinger@chromium.org

Bug: v8:8689, v8:8562
Change-Id: I6c150748eeea778d9b70f41fd66fbb1221035a1b
Reviewed-on: https://chromium-review.googlesource.com/c/1415490
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58881}
2019-01-17 11:57:07 +00:00
Simon Zünd
4bf28a33ee [array] Fix prototype chain interaction in sort pre-processing
This CL fixes two bugs. First, when looking for a free spot while
moving elements to the front, the prototype chain was also considered,
even though an object at a specific index might have a hole (free
spot).

Second, when moving an element to the front, we are not allowed to
delete it immediately (to preserve semantics when interacting with
non-extensible objects). Such an element is then a free spot, but
won't be recognised as such. This CL sets that element to undefined
after it was moved, to mark it as a free spot.

R=jgruber@chromium.org

Bug: chromium:897512,v8:8369
Change-Id: I79207215b8b0a3c714f064450d8fe5ca0ea4a096
Reviewed-on: https://chromium-review.googlesource.com/c/1417171
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58878}
2019-01-17 11:53:52 +00:00
kingwl
65bb02593f [objects] Correctly Object.isSeal for TypedArray
Add a special handle of TypedArray elements in TestElementsIntegrityLevel

Bug: v8:8082
Change-Id: I60be644801618b576b0b8b1883ac67bf0040c849
Reviewed-on: https://chromium-review.googlesource.com/c/1412133
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58874}
2019-01-17 10:46:29 +00:00
Ujjwal Sharma
2f543fad22 [test] add performance tests for String#startsWith
Add benchmarks for String.prototype.startsWith in order to keep track
of performance ahead of the torque port.

Bug: v8:8400
Change-Id: I0276b84b315024bba1a0d6f761ee2c6cf2c516a2
Reviewed-on: https://chromium-review.googlesource.com/c/1416070
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58870}
2019-01-17 08:23:06 +00:00
Clemens Hammacher
edab9a2021 Use forwarding constructors for MacroAssembler
and TurboAssembler. Instead of listing all the different combinations
of arguments (which is one more now, temporarily), just forward all
arguments down via MacroAssembler and TurboAssembler to
TurboAssemblerBase.
Interestingly, this requires more specific types sometimes (int instead
of size_t), since further down the forwarding chain, the compiler does
not recognize any more that the value is a constant, and emits a
warning about a possibly truncating implicit conversion.

R=mstarzinger@chromium.org

Bug: v8:8689, v8:8562
Change-Id: Ifd13d2210ee64251c0075c0d9b68cacd5107d9ab
Reviewed-on: https://chromium-review.googlesource.com/c/1414913
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58869}
2019-01-17 08:20:36 +00:00
Alexei Filippov
defbef78d2 [inspector] An Error with no stack description should not be empty
Make the description return the class name as it used to be.

BUG=chromium:919292

Change-Id: Idbc07643f15014a39a08a545a5003be891d95bd3
Reviewed-on: https://chromium-review.googlesource.com/c/1416318
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58867}
2019-01-16 23:59:04 +00:00
tzik
ba363c755b Merge MicrotaskQueue::RunMicrotasks and Isolate::RunMicrotasks
This retires Isolate::RunMicrotasks in favor of using
MicrotaskQueue::RunMicrotasks.

Bug: v8:8124
Change-Id: I717dabce7c4127d7e4524bdb639f46c3d55df49b
Reviewed-on: https://chromium-review.googlesource.com/c/1385969
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58866}
2019-01-16 23:35:24 +00:00
Sven Sauleau
e65736241b [wasm] fix js-api global/value-get-set
Fix WebAssembly's global/value-get-set. The argument must not be
undefined.

mjsunit tests were updated.

Bug: v8:8319
Change-Id: Id3d3c9b18cbc8854e589481dfc7c52f35cfb7bf7
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Reviewed-on: https://chromium-review.googlesource.com/c/1411886
Reviewed-by: Ben Smith <binji@chromium.org>
Commit-Queue: Sven Sauleau <ssauleau@igalia.com>
Cr-Commit-Position: refs/heads/master@{#58863}
2019-01-16 18:56:51 +00:00
Clemens Hammacher
4064757cbf [cleanup] Clean up base::EnumSet
After moving to its own header, this CL cleans up some parts of the
interface. It fixes names and const-declarations of simple accessors,
and adds a named constructor to make it explicit that an EnumSet should
be constructed from an integral value.
Also refactor the use in cctest.h to have less statically declared
constants. Instead, just create the set of extensions in the individual
tests.

R=titzer@chromium.org

Bug: v8:8562
Change-Id: I6178d1aba25afa1d7f54c29ccf81505c165e7cd3
Reviewed-on: https://chromium-review.googlesource.com/c/1409366
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58862}
2019-01-16 18:17:35 +00:00
Daniel Clifford
b615dfa550 [torque] Implement methods and constructors for structs and classes
With the changes in this patch,	it is now possible to add methods to
both Torque's class and struct types. As a special case, "constructor"
methods are used to initialize the values of classes and structs when
they are constructed.

The functionality in this patch	includes:

- The refactoring of class- and struct-handling code to share field
  and method declaration code between both.

- Addition of the "%Allocate" intrinsic that allocates raw bytes to be
  allocated from the V8 GC's NewSpace heap as the basis for freshly
  created, initialized class objects.

- An implementation of a CallMethodExpression AST node that enables
  calling methods and constructors, including special handling of
  passing through the "this" pointer for method calls on structs by
  reference. The syntax for struct construction using "{}" remains as
  before, but now calls the struct's matching constructor rather than
  implicitly initializing the struct fields with the initialization
  arguments. A new syntax for allocation classes is introduced: "new
  ClassName{constructor_param1, constructor_param1, ...}", which
  de-sugars to an %Allocate call followed by a call to the matching
  constructor.

- class	constructors can use the "super" keyword to initialize	their
  super class.

- If classes and struct do not have a constructor, Torque creates a
  default constructor for them based on their field declarations,
  where each field's initial value is assigned to a same-typed
  parameter to the the default constructor. The default constructor's
  parameters are in field-declaration order, and for derived classes,
  the default constructor automatically uses a "super" initialization
  call to initialize inherited fields.

- Class field declarations now automatically create ".field" and
  ".field=" operators that create CSA-compatible object accessors.

- Addition of a no-argument constructor for JSArrays that creates an
  empty, PACKED_SMI_ELEMENTS JSArray using the machinery added
  elsewhere in this patch.

Bug: v8:7793
Change-Id: I31ce5f4b444656ab999555d780aeeba605666bfa
Reviewed-on: https://chromium-review.googlesource.com/c/1392192
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58860}
2019-01-16 17:13:13 +00:00
Toon Verwaest
d5f321cb5a [parser] Check conflicting var declarations from eval at compile-time
Change-Id: I9195c7ffdc4b841f14701662527c97c9698bd472
Reviewed-on: https://chromium-review.googlesource.com/c/1411888
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58859}
2019-01-16 17:01:31 +00:00
Ben L. Titzer
8a40e88db3 [wasm] Implement table.copy bytecode
The table.copy bytecode copies a range of table entries in a similar
way to memcopy. This CL implements the behavior in a runtime call
that calls into the wasm engine.

R=mstarzinger@chromium.org,binji@chromium.org
BUG=v8:7747

Change-Id: I420451202b1b78ea92cbd10387a644ed57e111c8
Reviewed-on: https://chromium-review.googlesource.com/c/1414919
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58858}
2019-01-16 16:55:31 +00:00
Michael Starzinger
30882a5076 [wasm] Fix {OpcodeLength} for invalid br-on-exn opcodes.
R=clemensh@chromium.org
TEST=mjsunit/regress/wasm/regress-922432
BUG=chromium:922432

Change-Id: I3843eaee2027fff770fd77bc9205b70788fffa37
Reviewed-on: https://chromium-review.googlesource.com/c/1414917
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58853}
2019-01-16 14:50:13 +00:00
Toon Verwaest
f2303d9a34 [parser] Use cached kDynamic variable for eval-introduced vars
That makes the declaration in sync with how dynamic references are resolved,
avoiding duplicate variable creation in the likely case that the variable is
also referenced within the eval.

Bug: v8:5112, v8:5135, v8:8693
Change-Id: I0c55495f573fe8b5076b1627c139ff72d1adda74
Also-by: leszeks@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/1408890
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58850}
2019-01-16 14:18:33 +00:00
Leszek Swirski
928417997c [parser] Declarations store Variables not proxies
Storing a VariableProxy in declarations means that a declaration and
initialisation assignment are tightly coupled to use the same var. In
particular, this means that Var declarations in with scopes have to
clone the VariableProxy to split the declaration and initializer LHS
lookup.

This patch changes declarations to point directly to the Variable, not
the VariableProxy. This will allow future refactoring to decouple
declarations and initialisations.

Change-Id: I0baa77bfd12fe175f9521d292740d7d712cffd37
Reviewed-on: https://chromium-review.googlesource.com/c/1406683
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58843}
2019-01-16 09:34:44 +00:00
Caitlin Potter
10a408a6a7 [esnext] add support for hashbang syntax
Implements https://tc39.github.io/proposal-hashbang/, which simply
ignores the first line of a source file if it begins with '#!'
(U+0023 U+0021).

The test cases are influenced by
https://github.com/tc39/test262/pull/1983, which have not been pulled
into test262 local-tests due to issues with parseTestRecord.

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

Change-Id: I4ae40222298de768a170c7a1d45fec118ed5713c
Reviewed-on: https://chromium-review.googlesource.com/c/1409527
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Daniel Ehrenberg <littledan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58838}
2019-01-15 19:42:21 +00:00
Ulan Degenbaev
93283bf04a [heap, api] Add API for automatically restoring the heap limit.
Now the embedder can instruct V8 to restore the initial heap limit
once the heap size drops below the given percentage of the heap limit.

Bug: chromium:922038
Change-Id: Ib668406c5d59c02b45a8eae7de96527ebc3f2b4d
Reviewed-on: https://chromium-review.googlesource.com/c/1411606
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58837}
2019-01-15 18:08:07 +00:00
Yang Guo
62876856a6 [api] add test for nested isolates
R=petermarshall@chromium.org

Change-Id: Id15504e2df9fd63755dba6c1f8d9deb7aa341b0a
Reviewed-on: https://chromium-review.googlesource.com/c/1409422
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58836}
2019-01-15 17:31:26 +00:00
Michael Starzinger
aaee69584f [wasm] Switch to new 'catch' and 'br_on_exn' proposal.
This switches the experimental exception handling implementation to the
new proposal where 'catch' blocks behave in a catch-all fashion and a
new 'br_on_exn' operation is used to check for a certain exception type
and extract the exception values on a match.

R=clemensh@chromium.org
TEST=unittests/FunctionBodyDecoderTest,mjsunit/wasm/exceptions
BUG=v8:8091

Change-Id: Ib12ba28b3aa2a7d831312a83abcb00bf56d0adc3
Reviewed-on: https://chromium-review.googlesource.com/c/1409431
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58832}
2019-01-15 14:46:30 +00:00
Toon Verwaest
5f8a3e1e21 [parser] Clear parenthesized flag on collapsing nary expressions
The parenthesized flag guarantees that the contents was validated as a possible
arrow head. By collapsing a parenthesized expression with an outer binary
expression we invalidly kept the flag and invalidly assumed that the collapsed
expression was validated.

Bug: chromium:921382
Change-Id: I207dcbfd228a1ed216130226fdb7ea045b89b85a
Reviewed-on: https://chromium-review.googlesource.com/c/1412172
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58829}
2019-01-15 13:26:23 +00:00
Clemens Hammacher
57fa8f5ba3 [wasm] Split Result/ResultBase in WasmError and Result
We often use ResultBase or VoidResult to store or pass wasm errors
(errors with locations). This CL extracts a WasmError class which can
store an error (can also be empty), and Result<T> which stores an error
or a T (exactly one of them).

R=titzer@chromium.org

Bug: v8:8689
Change-Id: I3f5203559984a0ae8757e0130a9184957fa28df5
Reviewed-on: https://chromium-review.googlesource.com/c/1409365
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58827}
2019-01-15 12:48:02 +00:00
Andreas Haas
51ad897d3f [wasm][anyref] Implement re-export of mutable anyref globals
R=mstarzinger@chromium.org

Bug: v8:7581
Change-Id: If469467663e632a1dba3bd55ace830e1b2f38f7e
Reviewed-on: https://chromium-review.googlesource.com/c/1409427
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58824}
2019-01-15 12:27:56 +00:00
Toon Verwaest
8436715fe6 [parser] Give hoisting sloppy block functions a valid position
A sloppy function in a block scope implicitily creates a var in the outer
declaration scope if it's not blocked. The assignment created reads the local
lexical declaration for the function. The reference introduced automatically
takes part in NeedsHoleCheck, requiring the reference to have a valid position.
Since the assignment will happen after the local declaration, we give the
end_position() of the closure as the position of the reference, so hole checks
can be omitted.

Bug: chromium:917755
Change-Id: Iee0e042b2463f97f05075f9eec09dac8c6eaf539
Reviewed-on: https://chromium-review.googlesource.com/c/1408991
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58823}
2019-01-15 11:52:28 +00:00
Andreas Haas
b3e6013eb4 [wasm][anyref] Support importing mutable anyref globals
With this CL we support importing mutable anyref globals. The CL
contains the following changes:

* We store a reference to the buffer of the imported global in
  `WasmInstance::imported_mutable_globals_buffer`. This FixedArray is
  already used to keep the ArrayBuffers of value-typed imported
  mutable globals alive but was not accessed otherwise.

* We store the offset in the buffer of the imported global in
  `WasmInstance::imported_mutable_globals`. This `Address`-array is
  used for value-typed imported mutalbe globals to store direct
  pointers into the backing store of the ArrayBuffer of the imported
  global.

* In wasm-compiler.cc we generate code to load these fields and then
  load or store globals.

* in module-compiler.cc I removed the counter variable
  `next_imported_mutable_global_index`. The variable was only used for
  a DCHECK. I replaced the DCHECK with a slightly weaker DCHECK now.

* Tests.

R=mstarzinger@chromium.org

Bug: v8:7581
Change-Id: I11f0f4d8637c98eded5fb2eec44bc8ead8ed5c7b
Reviewed-on: https://chromium-review.googlesource.com/c/1409169
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58822}
2019-01-15 11:40:24 +00:00
Jakob Gruber
b00ef71370 [nojit] Add a few flag implications based on --jitless
--jitless -> --no-opt
          -> --no-validate-asm
          -> --wasm-interpret-all -> --no-asm-wasm-lazy-compilation
                                  -> --no-wasm-lazy-compilation

Note that wasm still isn't supported in jitless mode since it generates
code at runtime even with --wasm-interpret-all.

Drive-by: Fail early when trying to compile irregexp code in jitless
mode.

Cq-Include-Trybots: luci.v8.try:v8_linux_arm_lite_rel_ng
Bug: v8:7777
Change-Id: I7f0421f71efeaaeb030ed9ec268d12a659667acf
Reviewed-on: https://chromium-review.googlesource.com/c/1406677
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58820}
2019-01-15 11:20:19 +00:00
Clemens Hammacher
94fbd51b95 [base] Move EnumSet to its own header
EnumSet currently lives in src/utils.h, which is a conglomerate of many
different helper functions and classes. In order to remove unneeded
include, move the EnumSet to its own header.

R=titzer@chromium.org

Bug: v8:7490, v8:8562
Change-Id: I979814167e87b914e9807b03e342d8b34e514331
Reviewed-on: https://chromium-review.googlesource.com/c/1409430
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58818}
2019-01-15 10:57:26 +00:00
Ben L. Titzer
97cdf35f4a [wasm] Implement table.drop
The table.drop bytecode "drops" the backing storage for an element
initializer. In the V8 implementation, this is a nop, other than
updating a per-instance boolean array so that two drops of the same
segment or a drop of an active segment will trap.

This is implemented with inline code in TurboFan in order to be symmetric
to memory.drop, but could as easily be a runtime call to be supported in
Liftoff.

R=mstarzinger@chromium.org
CC=​binji@chromium.org
BUG=v8:7747

Change-Id: Ic017398eaa764dd3a9ff19523453ff7142c9abf6
Reviewed-on: https://chromium-review.googlesource.com/c/1408996
Reviewed-by: Ben Smith <binji@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58817}
2019-01-15 10:07:17 +00:00
Frank Tang
5b64c8a641 [Intl] Implement changes in CanonicalizeLocaleList
Change the code to reflect
https://tc39.github.io/proposal-intl-locale/#sec-canonicalizelocalelist

Bug: v8:8655
Change-Id: I114488dee854b7322a5719de13e4fb8b6f18283c
Reviewed-on: https://chromium-review.googlesource.com/c/1400851
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58808}
2019-01-15 01:37:51 +00:00
Frank Tang
7701af034b [Intl] Allow Intl.Locale to create "und"
Bug: v8:8657, v8:8236, v8:7684
Change-Id: I369a3b302ef70e3fa37208e5c7d1e2fcea1fa390
Reviewed-on: https://chromium-review.googlesource.com/c/1400852
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Jungshik Shin <jshin@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58807}
2019-01-15 01:25:35 +00:00
Jakob Kummerow
102e22658d [cleanup] Use Page::FromHeapObject where applicable
It is slightly faster than Page::FromAddress(o->address()) (saves
one instruction), and more concise than Page::FromAddress(o->ptr()).
Same for MemoryChunk::FromHeapObject().

Bug: v8:8562
Change-Id: I9dc2b787aed5cad2d4087850dfa2e8eb157ad225
Reviewed-on: https://chromium-review.googlesource.com/c/1405031
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58806}
2019-01-15 01:20:11 +00:00
Deepti Gandluri
0f57319ebb [wasm] Reorder SIMD Select parameters to match the Spec
Change-Id: Icad57d5cdae273c0e2cd6c1e441c36908436b704
Bug: v8:8646
Reviewed-on: https://chromium-review.googlesource.com/c/1407179
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Aseem Garg <aseemgarg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58802}
2019-01-14 17:56:15 +00:00
milad
43c74957c5 owners file cleanup and adding myself to the list
Change-Id: Ibd2d9919ce47638debde8e59c10714c4836b9292
Reviewed-on: https://chromium-review.googlesource.com/c/1408388
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Commit-Queue: Joran Siu <joransiu@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#58801}
2019-01-14 17:53:55 +00:00
Leszek Swirski
b4a3af9157 [ignition] Move for-of desugaring to bytecode
This removes the iteration protocol from the parser entirely, and opens
up future possibilities for more bytecodes implementing the various
functions of the protocol.

Change-Id: I316b8a92434d3b5f47927408a235ddaecd65d5bb
Reviewed-on: https://chromium-review.googlesource.com/c/1403125
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58795}
2019-01-14 16:37:41 +00:00
Ross McIlroy
09576a81b1 [Test] Unskip array-multiple-receiver-maps with added tracing.
BUG=v8:8653

Change-Id: I7cb6ef7046ca37474f46a04ae75110f0fa998d8a
Reviewed-on: https://chromium-review.googlesource.com/c/1409425
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58794}
2019-01-14 16:08:45 +00:00
Clemens Hammacher
94958319d9 [wasm] Store enabled features in compilation env
The background compile tasks should not access the NativeModule during
the main compile phase.
This CL moves on of the accessed fields into the {CompilationEnv}. It
is initialized from the existing field on the {NativeModule}.

R=titzer@chromium.org

Bug: v8:8689
Change-Id: I9738e2fb4681a035cbacf3c9e00b9e5cc9419416
Reviewed-on: https://chromium-review.googlesource.com/c/1409423
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58793}
2019-01-14 15:57:41 +00:00
Ben L. Titzer
f726d7f0c4 [mjsunit] Dont generate dumps from regression test
The --perf-prof flag generates unwanted .dump files, while the
--perf-prof-unwinding-info flag enables the functionality under test here.

R=jgruber@chromium.org
BUG=chromium:913844

Change-Id: Ie5ee374977d6105854f42065600dac1bc5ba6df7
Reviewed-on: https://chromium-review.googlesource.com/c/1409363
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58791}
2019-01-14 15:26:16 +00:00
Ulan Degenbaev
13e07389ff Revert "[heap] Remove bailout marking worklist."
This reverts commit 68a8bdd829.

Reason for revert: memory regression: crbug.com/921239

Original change's description:
> [heap] Remove bailout marking worklist.
> 
> The concurrent marker can now process all objects.
> This patch also eagerly visits the objects that undergo layout
> changes. This is because previously such objects were pushed
> onto the bailout worklist, which is gone now.
> To preserve the incremental step accounting, the patch introduces
> a new GC tracer scope called MC_INCREMENTAL_LAYOUT_CHANGE.
> 
> Bug: v8:8486
> Change-Id: Ic1c2f0d4e2ac0602fc945f3258af9624247bd65f
> Reviewed-on: https://chromium-review.googlesource.com/c/1386486
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58712}

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

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

Bug: v8:8486, chromium:921239
Change-Id: I1f851b948f4ce403316e469999f0b16e8dfdb62d
Reviewed-on: https://chromium-review.googlesource.com/c/1408990
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58787}
2019-01-14 15:00:11 +00:00
Ben L. Titzer
6d3d8f7be6 [wasm] Add runtime call plumbing for Table operations.
This CL adds two new runtime calls for table operations:
  - Runtime_WasmTableInit
  - Runtime_WasmTableCopy

These runtime calls (will) implement the semantics for the corresponding
bytecodes from the bulk memory proposal. The actual implementation
of these runtime calls will be done in further CLs.

The third table operation, table.drop, will be implemented with inline
code, similar to memory.drop. This is also be done in a further CL.

R=mstarzinger@chromium.org
CC=​binji@chromium.org
BUG=v8:7747

Change-Id: I498aa054329baf9f72ae55d245b12c3ccd4157b7
Reviewed-on: https://chromium-review.googlesource.com/c/1408994
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58786}
2019-01-14 14:33:08 +00:00
Camillo Bruni
a6f4462987 Reland "[parser] Inline byte scope data into PreparseData object"
This is a reland of e2d44ede95

Original change's description:
> [parser] Inline byte scope data into PreparseData object
> 
> Each PreparseData object had at least one pointer to a PodArray for its
> serialized scope data. These objects usually have only tens of bytes of
> payload. By inlining the byte data we save 3 words per PreparseData object.
> This optimization saves 140KB of data on cnn.com.
> 
> 
> - Store data_length and inner_length as int32 saving a words on 64bit
> - Inline store byte data into PreparseData
> - OnHeapConsumedPreparseData directly uses the PreparseData object
> - get_inner, set_inner no longer allow Null sentinels
> 
> Change-Id: I1f62154d05ea2f98a6574efa738b32a8a84319d5
> Reviewed-on: https://chromium-review.googlesource.com/c/1406673
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58751}

Change-Id: I1f0a22c641d0d67f435b01c82daf8da7f144bff4
Reviewed-on: https://chromium-review.googlesource.com/c/1407066
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58785}
2019-01-14 14:17:05 +00:00
Yang Guo
c8567109f5 [bootstrapper] consistently skip transferring existing property.
R=jgruber@chromium.org

Bug: v8:8669
Change-Id: I3c3995fa2e5661fa267a11649bdef1991b87c722
Reviewed-on: https://chromium-review.googlesource.com/c/1407064
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58784}
2019-01-14 14:03:32 +00:00
Clemens Hammacher
bd502b2bdd [wasm] Do not store the NativeModule in compilation units
Instead, pass it as a parameter to the compilation.
This makes compilation units slimmer with the end goal of them being
just the function index and execution tier.
It also makes ownership handling of the NativeModule easier.

R=titzer@chromium.org

Bug: v8:8343, v8:7921
Change-Id: I0522c894569c71d8b7245f5ed5612ab2a249e1ad
Reviewed-on: https://chromium-review.googlesource.com/c/1406668
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58776}
2019-01-14 12:28:38 +00:00
Ben L. Titzer
ca4c236fd3 [wasm] Rename WasmTableInit to WasmElemSegment
This matches the terminology that is used throughout the spec.

R=clemensh@chromium.org

Change-Id: I62445e750415e6048b805110c7306f3bdbf9da60
Reviewed-on: https://chromium-review.googlesource.com/c/1408988
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58774}
2019-01-14 12:01:18 +00:00
Sven Sauleau
ae5c2ea8f9 [wasm] support calling an imported func that returns a i64
It removes the assertion that caused the bug report by introducing a new
trampoline (WasmBigIntToI64) for the conversion code stub between a Bigint
object and a Wasm i64 BigIntToI64).

The tests were updated to cover calling the stub from a Wasm callsite.

Bug: v8:8625
Change-Id: I55891001cfa72f6f2849792293b43bbb54147f1a
Reviewed-on: https://chromium-review.googlesource.com/c/1405028
Commit-Queue: Sven Sauleau <ssauleau@igalia.com>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58767}
2019-01-14 10:28:45 +00:00
Benedikt Meurer
55decb637e [dx] Turn on zero cost async stack traces by default.
Bug: v8:7522, v8:8673
Change-Id: Iee2d6fda9291fbdd346d25d2c535874dba13fdc9
Ref: nodejs/node#11865
Design-Document: http://bit.ly/v8-zero-cost-async-stack-traces
Reviewed-on: https://chromium-review.googlesource.com/c/1396425
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58765}
2019-01-14 09:06:46 +00:00
Adam Klein
469754d01c [parser] Allow same-named labelled blocks in if/else statements
Bug: chromium:917215
Change-Id: Ie2127953a8ce3d6da4feb3478039ba318774e21d
Reviewed-on: https://chromium-review.googlesource.com/c/1404176
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58755}
2019-01-11 17:40:18 +00:00
Maya Lekova
7ebbe03e08 [test] Update inspector test expectations for await optimization
Bug: v8:8672
Change-Id: I3cd7319f81280447486b713b1b321f6e8ee099f6
Reviewed-on: https://chromium-review.googlesource.com/c/1405855
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58754}
2019-01-11 16:04:42 +00:00
Maya Lekova
1ec1712c5b Revert "[parser] Inline byte scope data into PreparseData object"
This reverts commit e2d44ede95.

Reason for revert: Breaks GC stress tests - https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/23527

Original change's description:
> [parser] Inline byte scope data into PreparseData object
> 
> Each PreparseData object had at least one pointer to a PodArray for its
> serialized scope data. These objects usually have only tens of bytes of
> payload. By inlining the byte data we save 3 words per PreparseData object.
> This optimization saves 140KB of data on cnn.com.
> 
> 
> - Store data_length and inner_length as int32 saving a words on 64bit
> - Inline store byte data into PreparseData
> - OnHeapConsumedPreparseData directly uses the PreparseData object
> - get_inner, set_inner no longer allow Null sentinels
> 
> Change-Id: I1f62154d05ea2f98a6574efa738b32a8a84319d5
> Reviewed-on: https://chromium-review.googlesource.com/c/1406673
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58751}

TBR=ulan@chromium.org,cbruni@chromium.org,leszeks@chromium.org

Change-Id: I39d92ee7bd2864e1b0c3a8fed4a11b68b3e14d58
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/1407073
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58753}
2019-01-11 16:02:05 +00:00
Camillo Bruni
e2d44ede95 [parser] Inline byte scope data into PreparseData object
Each PreparseData object had at least one pointer to a PodArray for its
serialized scope data. These objects usually have only tens of bytes of
payload. By inlining the byte data we save 3 words per PreparseData object.
This optimization saves 140KB of data on cnn.com.


- Store data_length and inner_length as int32 saving a words on 64bit
- Inline store byte data into PreparseData
- OnHeapConsumedPreparseData directly uses the PreparseData object
- get_inner, set_inner no longer allow Null sentinels

Change-Id: I1f62154d05ea2f98a6574efa738b32a8a84319d5
Reviewed-on: https://chromium-review.googlesource.com/c/1406673
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58751}
2019-01-11 15:20:37 +00:00
Andreas Haas
b9854da1ec [fuzzer] Remove the wasm section fuzzers
The fuzzers were already removed on the chrome side and therefore
inactive, see https://crrev.com/c/1194228.

R=machenbach@chromium.org

Bug: v8:8562
Change-Id: I0cf5ec6d07e07452c5168ea952f45028bcea1c85
Reviewed-on: https://chromium-review.googlesource.com/c/1406678
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58750}
2019-01-11 15:18:47 +00:00
Leszek Swirski
df6f5f6b69 [parser] Check assignment LHS for paren errors
It is not legal for destructuring patterns and identifiers in declarations
to be in parentheses. This includes nested patterns/identifiers inside
another pattern.

We were checking sub-patterns for parentheses when parsing possible
sub-patterns, but this check missed sub-patterns with a default
initialiser (e.g. [({x:y})=1] = {}), as the AssignmentExpression hid
the pattern.

So, we now additionally record declaration/pattern errors of an assignment
LHS when parsing the assignment cover grammar.

Bug: v8:8630
Change-Id: Ia5a97003671fc1da7f68d7fb15943928ce9496e3
Reviewed-on: https://chromium-review.googlesource.com/c/1404452
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58743}
2019-01-11 12:56:38 +00:00
Jakob Gruber
3c24404675 [regexp] Fix oob read in JSRegExp::HasCompiledCode
The JSRegExp's data fixed array is variable size depending on the
regexp kind.

Bug: v8:8572
Change-Id: I8f07b8e8d2a9a81e0905563fb701e1e3687cafb5
Reviewed-on: https://chromium-review.googlesource.com/c/1405034
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58741}
2019-01-11 12:46:45 +00:00
Jakob Gruber
f3a23accad Remove fast_sqrt generated code
As far as I can tell these were unused; their only callers were arm
and ppc simulators, but codegen explicitly returned nullptr if in a
simulator build, falling back to std::sqrt.

There's more potential cleanup to be done here for other functions
defined in codegen-*.cc files.

Tbr: clemensh@chromium.org
Bug: v8:7777, v8:8675
Change-Id: I4b9d6062c6724a810ab094d09e3cd04a0b733d9b
Reviewed-on: https://chromium-review.googlesource.com/c/1405851
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58740}
2019-01-11 12:45:38 +00:00
Yang Guo
f451d6ce77 [logging] correctly log code events from deserialization.
R=jarin@chromium.org

Bug: v8:8671, v8:8674
Change-Id: I5cdcd49d05f08206aa32426f2fe0560568291f2e
Reviewed-on: https://chromium-review.googlesource.com/c/1405852
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58739}
2019-01-11 12:44:29 +00:00
Michael Achenbach
1efb130a8e [test] Remove leftovers of the interrupt-budget fuzzer
TBR=sergiyb@chromium.org

Bug: v8:8174, v8:8457
Change-Id: Ie87eddcc6986e1c724040b11b036b502e399dd05
Reviewed-on: https://chromium-review.googlesource.com/c/1404437
Reviewed-by: Sergiy Belozorov <sergiyb@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58735}
2019-01-11 11:21:01 +00:00
Clemens Hammacher
8518d12200 [Liftoff] Fix sub of the same register
In the degenerate case where we wanted to emit {x = x - x} (where {x}
is any register), ia32 and x64 generated wrong code (producing {-x + -x}
instead). Fix this by special casing this case.

R=ahaas@chromium.org

Bug: chromium:919308
Change-Id: I9cd9818d2a678450ac6530107e7a5cbb625ddb8d
Reviewed-on: https://chromium-review.googlesource.com/c/1405029
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58731}
2019-01-11 10:57:09 +00:00
Michael Starzinger
1583e86d56 [wasm] Remove Isolate from WasmImportWrapperCache.
R=clemensh@chromium.org

Change-Id: I48bfae1dbbfaafb1cadad8d3cbbc921c53801f8c
Reviewed-on: https://chromium-review.googlesource.com/c/1405857
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58727}
2019-01-11 10:24:45 +00:00
Clemens Hammacher
92843517b3 [wasm][fuzzer] Automatically compute year for test generation
This avoids having to update either the source code or the generated
test cases each year.

R=ahaas@chromium.org

Change-Id: I33fb85dc4ae7d45f8d05d982e0285d6fd3008a26
Reviewed-on: https://chromium-review.googlesource.com/c/1405032
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58725}
2019-01-11 09:55:25 +00:00
Clemens Hammacher
1740bc7bf6 [wasm] Fix maximum value length in scope info
i64 values can be up to 20 characters long (19 + sign), plus we need
one character for the terminating null character. Thus the previous 18
needs to be increased to 21.
Also extend the test to check the longest possible i64 values.

R=ahaas@chromium.org
CC=kozyatinskiy@chromium.org

Bug: v8:8644
Change-Id: Ia9458db162a55dd57b5e8bc7cf7db73c3bab4734
Reviewed-on: https://chromium-review.googlesource.com/c/1404443
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58724}
2019-01-11 09:37:59 +00:00
Clemens Hammacher
f59d6d96e1 [Liftoff][arm] Leave scratch register to the assembler
In {Assembler::and_} we might need to use the scratch register. Thus use
a free LiftoffRegister instead to emit i32 popcnt.

R=ahaas@chromium.org
CC=george.wort@arm.com

Bug: chromium:918284
Change-Id: Ia814899bf6e33dd4989fd09329542b4bc09b48df
Reviewed-on: https://chromium-review.googlesource.com/c/1405036
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58723}
2019-01-11 08:27:16 +00:00
Deepti Gandluri
8468150d35 Reland "[wasm] Fix SIMD boolean reductions on Intel"
This is a reland of 8f83fd0a55

Original change's description:
> [wasm] Fix SIMD boolean reductions on Intel
> 
>  - Both AllTrue/AnyTrue values should return boolean 0/1
>    instead of 0xffffffff to match Spec/Toolchain
>  - Fix AllTrue implementation to be correct
>  - Add unit tests to spot check return values as the
>    cumulative test can coerce some return values to True/False
> 
> Change-Id: I84eb73c915414c9ec290e73f1306404ceff729f0
> Bug: v8:8636
> Reviewed-on: https://chromium-review.googlesource.com/c/1404197
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58715}

Bug: v8:8636
Change-Id: Ifc438d7b64bf5d461cc848851165665104fe57d0
Reviewed-on: https://chromium-review.googlesource.com/c/1405909
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58719}
2019-01-11 01:21:27 +00:00
Frank Tang
c17d21a0fa [Intl] Not harden the array return by supportedLocalesOf
see spec change in
https://github.com/tc39/ecma402/pull/278/

Bug: v8:8398
Change-Id: If5582f96d6dc3debdccb466d3d239efa52bbbf06
Reviewed-on: https://chromium-review.googlesource.com/c/1404436
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58717}
2019-01-10 21:39:47 +00:00
Michael Achenbach
82e58aaa80 Revert "[wasm] Fix SIMD boolean reductions on Intel"
This reverts commit 8f83fd0a55.

Reason for revert: Seems to break older intel chips:
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20debug/23954

Original change's description:
> [wasm] Fix SIMD boolean reductions on Intel
> 
>  - Both AllTrue/AnyTrue values should return boolean 0/1
>    instead of 0xffffffff to match Spec/Toolchain
>  - Fix AllTrue implementation to be correct
>  - Add unit tests to spot check return values as the
>    cumulative test can coerce some return values to True/False
> 
> Change-Id: I84eb73c915414c9ec290e73f1306404ceff729f0
> Bug: v8:8636
> Reviewed-on: https://chromium-review.googlesource.com/c/1404197
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58715}

TBR=bbudge@chromium.org,gdeepti@chromium.org

Change-Id: I0eba24e0fe5215c1f8f377776692db245239e134
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8636
Reviewed-on: https://chromium-review.googlesource.com/c/1405321
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58716}
2019-01-10 20:18:12 +00:00
Deepti Gandluri
8f83fd0a55 [wasm] Fix SIMD boolean reductions on Intel
- Both AllTrue/AnyTrue values should return boolean 0/1
   instead of 0xffffffff to match Spec/Toolchain
 - Fix AllTrue implementation to be correct
 - Add unit tests to spot check return values as the
   cumulative test can coerce some return values to True/False

Change-Id: I84eb73c915414c9ec290e73f1306404ceff729f0
Bug: v8:8636
Reviewed-on: https://chromium-review.googlesource.com/c/1404197
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58715}
2019-01-10 19:11:35 +00:00
Jaroslav Sevcik
ef12b47b59 [turbofan] Fix invocation frequency computation with NaN.
If feedback for call site frequency is 0, then the combined frequency
is still 0, even if the current function invocation count is infinity.

Bug: chromium:919754
Change-Id: I97be096b6b38f934fb13f01b2b22e148c539e1c0
Reviewed-on: https://chromium-review.googlesource.com/c/1404445
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58714}
2019-01-10 19:04:05 +00:00
Mike Stanton
72d8307f78 [Builtins] Array.prototype.filter species creation error
If a species constructor is installed, filter() needs to loop over
the elements of the array in the "slow" way, because it doesn't
know the ElementsKind of the output array. The code failed to
bail out to the slow case for the loop right away on discovering this.

Bug: chromium:920184, chromium:920491
Change-Id: I74496db20a90807b631c1bebe7604d85b199df67
Reviewed-on: https://chromium-review.googlesource.com/c/1405035
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58713}
2019-01-10 18:09:36 +00:00
Ulan Degenbaev
68a8bdd829 [heap] Remove bailout marking worklist.
The concurrent marker can now process all objects.
This patch also eagerly visits the objects that undergo layout
changes. This is because previously such objects were pushed
onto the bailout worklist, which is gone now.
To preserve the incremental step accounting, the patch introduces
a new GC tracer scope called MC_INCREMENTAL_LAYOUT_CHANGE.

Bug: v8:8486
Change-Id: Ic1c2f0d4e2ac0602fc945f3258af9624247bd65f
Reviewed-on: https://chromium-review.googlesource.com/c/1386486
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58712}
2019-01-10 17:39:45 +00:00
Clemens Hammacher
e8316b64b2 [Liftoff][arm] Fix stack moves
Use the right register type for the temporary register.

R=titzer@chromium.org

Bug: v8:6600, chromium:917588
Change-Id: Ia2617f6b406924ca7f496608fd495faf04dff25b
Reviewed-on: https://chromium-review.googlesource.com/c/1403127
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58711}
2019-01-10 17:21:47 +00:00
Toon Verwaest
6c2cc582e5 [parser] Change and fix how we MarkLoopVariableAsAssigned
Keep track of loop nesting depth on FunctionState and use that to decide
whether to mark var as assigned. That also fixes the weird cornercase where a
loop body can have multiple expressions due to multiple declarations with
independent initializers in a single var-statement.

Change-Id: Ia24affde29e22e9464448fd390062f6dd983faf2
Reviewed-on: https://chromium-review.googlesource.com/c/1405037
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58707}
2019-01-10 15:56:49 +00:00
Leszek Swirski
5e2c23e2d3 [destructuring] Get non-coercible message contents in runtime
For desrtucturing assignments from null/undefined, we throw an error
that references the destructuring object literal's property name, e.g.
for
  var { x } = null;
we report that we cannot destructure 'x' from null.

Rather than calculating this property during bytecode generation (and
including it in the bytecode as an argument to the type error
constructor), we can calculate it at exception throwing time, by
re-parsing the source in a similar way to the existing call site
rendering.

This slightly decreases bytecode size and slightly decreases the amount
of work the bytecode compiler needs to do. In the future, it could also
allow us to give more detailed error messages, as we now have access to
the entire AST and are on the slow path anyway.

Bug: v8:6499
Change-Id: Icdbd4667db548b4e5e62ef97797a3771b5c1bf72
Reviewed-on: https://chromium-review.googlesource.com/c/1396080
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58706}
2019-01-10 15:23:05 +00:00
Jakob Kummerow
fc329ce22a [ubsan] Fix various cases of undefined behavior
Mostly signed integer overflows, and a few cases of double
division by zero (which is defined by IEEE-754 to return
Infinity (or NaN for 0/0) but is UB in C++).
In base/ieee754.cc, use constants for NaN and Infinity instead
of computing these values.
In spaces-unittest.cc, ensure that a large enough allocation
is used.

Bug: v8:3770
Change-Id: I50d9a77dc860ef9993b7b269a5f8c117b0f62f9d
Reviewed-on: https://chromium-review.googlesource.com/c/1403454
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58701}
2019-01-10 13:52:04 +00:00
Jakob Gruber
8ea94bb3eb Revert "[test] add perf tests for String.p.startsWith"
This reverts commit 5dee355fe6.

Reason for revert: https://ci.chromium.org/p/v8-internal/builders/luci.v8-internal.ci/v8_linux64_perf_1/4282

Original change's description:
> [test] add perf tests for String.p.startsWith
> 
> Add performance tests for String.prototype.startsWith ahead of port to
> torque in order to keep track of how performance is affected.
> 
> Bug: v8:8400
> Change-Id: Ifc753a6f13da20c1760e545a99fd693717e3acc6
> Reviewed-on: https://chromium-review.googlesource.com/c/1402934
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58685}

TBR=jgruber@chromium.org,usharma1998@gmail.com

Change-Id: I5855b08fa5e55ab8594185a0a84a26f567e2b9d3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8400
Reviewed-on: https://chromium-review.googlesource.com/c/1404446
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58697}
2019-01-10 12:34:51 +00:00
Jakob Kummerow
40ac5a39fc [ubsan] Fix numerical overflows in wasm
Mostly signed integer overflows, and a few cases of double
division by zero (which is defined by IEEE-754 to return
Infinity (or NaN for 0/0) but is UB in C++).

Bug: v8:3770
Change-Id: Id92725b0ac57cb357978124a3dc6f477430bc97d
Reviewed-on: https://chromium-review.googlesource.com/c/1403133
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58696}
2019-01-10 12:24:51 +00:00
Leszek Swirski
f9a858fc96 [ignition] Remove useless iterator 'done' setting
The 'done' setting dance in BuildFillArrayWithIterator turned out to
not be useful, as the StoreInArrayLiteral call could not ever throw an
exception. Since iterator exceptions count as done, we are guarnteed to
be done as soon as we enter the loop.

Change-Id: Ibe2ba1fcbe383bfcfedb185169890b6931cc7884
Reviewed-on: https://chromium-review.googlesource.com/c/1402792
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58695}
2019-01-10 11:37:42 +00:00
Leszek Swirski
7fbbce5fa1 [ignition] Fix iteration finalization exception suppression
The IteratorClose spec specifies that exceptions in
%GetMethod(iterator.return) are not suppressed by exceptions in the
given continuation (body of a loop, assignments in destructuring),
while exceptions in the execution of iterator.return() are.

This means that we have to split out the property access + a typeof
check to be outside the try-catch, and keep the call inside of it.

The non-split version is only for cases when there is no 'throws'
continuation (as is the case for yield* calling IteratorClose), so
the existing BuildIteratorClose can be renamed to reflect this.

Change-Id: Id71aea4fddd6ffb986bd9aaa09d29615a8800f71
Reviewed-on: https://chromium-review.googlesource.com/c/1402789
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58694}
2019-01-10 11:29:12 +00:00
Jakob Kummerow
af8ff984f6 [ubsan] Fix numerical overflows in the compiler
Mostly signed integer overflows, and a few cases of double
division by zero (which is defined by IEEE-754 to return
Infinity (or NaN for 0/0) but is UB in C++).

Bug: v8:3770
Change-Id: I8007987594ff534ca697c1c3247215a72a001343
Reviewed-on: https://chromium-review.googlesource.com/c/1403132
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58693}
2019-01-10 11:17:37 +00:00
Jakob Gruber
566a885d4a [nojit] Don't allocate executable memory in jitless mode
This CL disables RX (read and execute) permissions for Code memory
when in jitless mode. All memory that was previously allocated RX
is now read-only.

Bug: v8:7777
Cq-Include-Trybots: luci.v8.try:v8_linux_arm_lite_rel_ng
Change-Id: I52d6ed785d244ec33168a02293c5506d26f36fe8
Reviewed-on: https://chromium-review.googlesource.com/c/1390122
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58692}
2019-01-10 10:55:48 +00:00
Andreas Haas
2755543ab3 [wasm] Remove --experimental-wasm-mut-global flag
The flag has been enabled by default since June 2018, see
https://crrev.com/c/1095650.

R=binji@chromium.org

Bug: v8:7625
Change-Id: I7cb4874db7f632b593f912e084b9fb7b8d568afe
Reviewed-on: https://chromium-review.googlesource.com/c/1402546
Reviewed-by: Ben Smith <binji@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58689}
2019-01-10 09:40:56 +00:00
Ujjwal Sharma
5dee355fe6 [test] add perf tests for String.p.startsWith
Add performance tests for String.prototype.startsWith ahead of port to
torque in order to keep track of how performance is affected.

Bug: v8:8400
Change-Id: Ifc753a6f13da20c1760e545a99fd693717e3acc6
Reviewed-on: https://chromium-review.googlesource.com/c/1402934
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58685}
2019-01-10 08:20:48 +00:00
Frank Tang
d286fe3dbc [Intl] Fix getting undefined property crash
If the key of the u-ext has no value it will return error so
we should just return undefined for that case.

Bug: v8:8663
Change-Id: I7446ad74c8d0609ad268385b6f4d986060424ce9
Reviewed-on: https://chromium-review.googlesource.com/c/1404194
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58682}
2019-01-10 00:59:53 +00:00
Clemens Hammacher
24a43b3c4e [Liftoff] Fix reloading register spilled multiple times
Since register can be used multiple times on the stack, they can also
be spilled into multiple stack slots. At merge points, we then might
have to reload the spilled slots. A DCHECK currently checks that each
register is only loaded once. Instead of failing, just load the first
stack slot, the others are statically known to contain the same value
anyways.

R=ahaas@chromium.org

Bug: v8:6600, chromium:919533
Change-Id: Ic0c806238b2997f006829b4b509a50468a55befa
Reviewed-on: https://chromium-review.googlesource.com/c/1403124
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58676}
2019-01-09 16:12:50 +00:00
Ben L. Titzer
49a526ace9 Remove invalid DCHECKS in unwinding-info-writer
The unwinding info writer was assuming that a block that had no initial
state must be the start or end block. It was trying to check if the
block was the start or end by asserting that the block had either
no predecessors or no successors. Loop rotation breaks this assumption,
since it can move a block from inside a loop to before the loop
header, and the block can then be the "start" block. But since
such a block has both predecessor(s) and a successor, the check was
wrong.

R=clemensh@chromium.org
BUG=chromium:913844

Change-Id: Ic24c67a822d510cb082f25608089d313c3459be8
Reviewed-on: https://chromium-review.googlesource.com/c/1373770
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58675}
2019-01-09 15:52:08 +00:00
Yang Guo
c736883ed4 Optionally use halfsiphash for integer hashing.
Change-Id: Ibd14f7b3fe78635675c76ae864112e3a3a7bc701
Reviewed-on: https://chromium-review.googlesource.com/c/1382463
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58674}
2019-01-09 15:20:51 +00:00
Camillo Bruni
e355052048 [parser] Cleaning up adding skippable function preparse data
- Add DataGatheringScope::AddSkippableFunction
- Rename preparsed_scope_data_builder to preparse_data_builder

Change-Id: Ic882de638bed91a6ca4716f88db859410f1450b8
Reviewed-on: https://chromium-review.googlesource.com/c/1400846
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58673}
2019-01-09 15:19:46 +00:00
Leszek Swirski
5e725a2b43 [parser] Don't desugar destructuring declarations.
Emit a single destructuring assignment for destructuring declarations,
which can be desugared by the bytecode generator. This allows us to
remove destructuring desugaring from the parser (specifically, the
pattern rewriter) entirely.

The pattern "rewriter" is now only responsible for walking the
destructuring pattern to declare variables, mark them assigned, and
potentially rewrite scopes for the edge case of parameters with a sloppy
eval.

Note that since the rewriter is no longer rewriting, we have to flip the
VariableProxy copying logic for var re-lookup, so that we now pass the
new VariableProxy to the variable declaration and leave the original
unresolved (rather than passing the original through and rewriting to a
new unresolved VariableProxy).

This change does have some effect on breakpoint locations, due to some
of the available information changing between the parser and bytecode
generator, however the new locations appear to be more consistent
between assignments and declarations.

Change-Id: I3a58dd0a387d2bfb8e5e9e22dde0acc5f440cb82
Reviewed-on: https://chromium-review.googlesource.com/c/1382462
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58670}
2019-01-09 14:09:23 +00:00
Predrag Rudic
d586857cff [MIPS] Add Predrag Rudic and Aleksandar Rikalo as owners of MIPS files
Ivica Bogosavljevic is no longer part of MIPS V8 team, and therefore his
name is removed from OWNERS.

TBR=mstarzinger@chromium.org
NOTRY=true

No-Presubmit: true
Change-Id: I1ea6745b795573a17362dfd869528ddf78b8ab41
Reviewed-on: https://chromium-review.googlesource.com/c/1402775
Commit-Queue: Predrag Rudic <prudic@wavecomp.com>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58667}
2019-01-09 13:40:20 +00:00
Michael Starzinger
082bfec916 [asm.js] Fix semicolon insertion in presence of Unicode.
R=clemensh@chromium.org
TEST=mjsunit/asm/regress-920076
BUG=chromium:920076

Change-Id: Ieb6d1dd84ab9434ff17ee09444e7d8ce830f898c
Reviewed-on: https://chromium-review.googlesource.com/c/1402778
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58664}
2019-01-09 12:38:41 +00:00
Toon Verwaest
5b4d4c2401 [parser] Parenthesized identifiers are invalid as part of a declaration
Bug: v8:8659
Change-Id: I7208589dcb5c40dd915a50517f83f3da646202be
Reviewed-on: https://chromium-review.googlesource.com/c/1402547
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58657}
2019-01-09 11:02:55 +00:00
Joyee Cheung
c8561b1ad4 [parser] add source posisionts to private field synthetic variables
Bug: v8:8354
Change-Id: I20bb169695d7ecca739f14f9a3ddfafed0dcb964
Reviewed-on: https://chromium-review.googlesource.com/c/1393284
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Cr-Commit-Position: refs/heads/master@{#58652}
2019-01-09 05:11:24 +00:00
Sathya Gunasekaran
f417b4aad8 [class] Fix early error for duplicate private fields
Bug: v8:8656
Change-Id: I86f00d377ac99a065c4ecf02abed08ec4feb3686
Reviewed-on: https://chromium-review.googlesource.com/c/1401214
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58650}
2019-01-09 00:53:05 +00:00
Sathya Gunasekaran
82e9aa59bf [class] Add tests for private static fields
Bug: v8:5368
Change-Id: I4142c4051e394f1a249421bf68da456381e390ae
Reviewed-on: https://chromium-review.googlesource.com/c/1401326
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58649}
2019-01-09 00:53:05 +00:00
Deepti Gandluri
f8e2634e96 [wasm] Add SIMD Shuffles for x64
Change-Id: I241565dea56db982a46eed8ecdd2fd2692c368ce
Reviewed-on: https://chromium-review.googlesource.com/c/1395800
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58648}
2019-01-08 21:46:39 +00:00
Frank Tang
09b995e18f [Intl] Remove skipped tests depend on stable sort
TC39 accept stable sort in Oct 2018

Bug: v8:7808
Change-Id: I2ad1bca62bda10838dc33acb109a5c937a3b1947
Reviewed-on: https://chromium-review.googlesource.com/c/1400401
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58646}
2019-01-08 19:11:47 +00:00
Frank Tang
c985078234 [Intl] Fix -0 formatting bugs
The spec changed in 7/2018 to treat -0 and 0 differently.
https://github.com/tc39/ecma402/pull/232

Bug: v8:7474, v8:8099
Change-Id: I77db4ae716b081b7628dc7ee253a463520c7f6e9
Reviewed-on: https://chromium-review.googlesource.com/c/1400403
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58645}
2019-01-08 19:10:42 +00:00
Maya Lekova
1ab4b006a3 [test] Disabling mjsunit/compiler/array-multiple-receiver-maps temporarily
TBR=machenbach@chromium.org

Bug: v8:8653

NOTRY=true

Change-Id: Ifb80024142491649e66114bed2179faa45365b73
Reviewed-on: https://chromium-review.googlesource.com/c/1400843
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58642}
2019-01-08 15:44:05 +00:00
Peter Marshall
8784512feb [cpu-profiler] Add logging to flaky tests
These flakes can't be reproduced locally so we need more information
when they fail. Add some logging so that we can figure out why they
are breaking.

Bug: v8:8649, v8:8648
Change-Id: I2fb1384bb7592c6fc68c08952505e79329f00bec
Reviewed-on: https://chromium-review.googlesource.com/c/1400418
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58641}
2019-01-08 15:38:42 +00:00
Toon Verwaest
7c3595effa [parser] Reparse arrow functions with unidentified syntax errors in the correct scope
Bug: chromium:919710
Change-Id: I5a04e76fbc925a89b0ebe1916637f6ae5d109b24
Reviewed-on: https://chromium-review.googlesource.com/c/1400419
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58637}
2019-01-08 14:46:07 +00:00
Andreas Haas
0adcb82a8b [wasm][anyref] Allow export of mutable anyref globals
R=titzer@chromium.org

Bug: v8:7581
Change-Id: I4725eada889cc8cf6a3ca537f05b1da2f5e83f2b
Reviewed-on: https://chromium-review.googlesource.com/c/1400413
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58632}
2019-01-08 13:30:59 +00:00
Dan Elphick
3427ec9dfb [intepreter] Make bytecode mismatch failures more verbose
Print all the mismatch failures in the bytecode rather than aborting at
the first mismatch.

R=rmcilroy

Change-Id: Id572ead5fdc4d126ac9a05942f940b0eaef7150f
Reviewed-on: https://chromium-review.googlesource.com/c/1400412
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58628}
2019-01-08 12:58:15 +00:00
Jakob Kummerow
683dd5fe17 [ubsan] Misc post-Object-migration cleanup
Bug: v8:3770
Change-Id: I9214212454034cf1238cab43dc34d8d9f8ed2d37
Reviewed-on: https://chromium-review.googlesource.com/c/1398222
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58627}
2019-01-08 12:34:34 +00:00
Andreas Haas
741f2312d1 [wasm][anyref] Allow anyref values in WebAssembly.Global objects
This CL adds support for anyref in WebAssembly.Global objects. Note
that the specification is not complete yet in this area.

I did the following changes:
- I renamed the `array_buffer` field of WasmGlobalObject to
  `untagged_buffer`
- I added an additional field of type FixedArray, `tagged_buffer`.
  - In the constructor of WasmGlobalObject I allocate either the former
    or the latter, but not both.
- In the WebAssembly.Global constructor I added special handling for
  the case where no initial value is provided. In that case I set the
  inital value to `null` and not to `undefined`.

R=titzer@chromium.org

Bug: v8:7581
Change-Id: I7e4855d7e6c04a9bcdc7ebd450caca5819d060e2
Reviewed-on: https://chromium-review.googlesource.com/c/1398226
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58625}
2019-01-08 12:02:51 +00:00
Clemens Hammacher
f1fb7bca44 [Liftoff] Fix corner case of register moves
If we have both f32 and f64 locals, we use the same register to hold
their zero value. On stack transfers, we might thus encounter the same
fp register with both the f32 and f64 type. Explicitly allow that case
to happen.

R=ahaas@chromium.org

Bug: chromium:918917, v8:6600
Change-Id: I6937008d38853fe2bdccd9715e1a2499cf6bf7c6
Reviewed-on: https://chromium-review.googlesource.com/c/1398225
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58623}
2019-01-08 10:57:05 +00:00
Sigurd Schneider
5a9fa8f304 [turbofan] Restrict redundancy elimination from widening types
This CL prevents redundancy elimination from widening types, which
can cause problems if the input of a DeadValue (which has type None)
is replaced by an equivalent node that does not have type None. This
can happen because load elimination does not re-type nodes, for
example.

Bug: chromium:919340
Change-Id: I89e872412edbcdc610e70ae160cde56cd045006c
Reviewed-on: https://chromium-review.googlesource.com/c/1397709
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58617}
2019-01-08 09:48:28 +00:00
Jakob Kummerow
ae8f83fe08 [ubsan] Rename ObjectPtr to Object
The two names refer to the same thing by now, so this patch is
entirely mechanical.

Bug: v8:3770
Change-Id: Ia360c06c89af6b3da27fd21bbcaeb2bdaa28ce22
Reviewed-on: https://chromium-review.googlesource.com/c/1397705
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58615}
2019-01-08 09:08:59 +00:00
Toon Verwaest
09674b9283 WIP: [parser] Fix arrow function name inferring
This is a reland of part of
https://chromium-review.googlesource.com/c/v8/v8/+/1397664.

It drops the explicit fni_.Infer() call after parsing arrow functions. We'll
want to avoid inferring if the arrow function is an argument to a function
call.

It also avoids adding the single argument of "name => " to the inferred name.

Bug: chromium:916975
Change-Id: I96a934408113483d73eba14073fe21e8cfe2ada6
Reviewed-on: https://chromium-review.googlesource.com/c/1397665
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58613}
2019-01-08 08:10:03 +00:00
Maxim Mazurok
58ef241d9e Fixed typos
- "constuctor" -> "constructor"
- "dependendencies" -> "dependencies"
- "develpers" -> "developers"
- ["nonexistant"][1] -> ["nonexistent"][2]
- "reponsible" -> "responsible"

  [1]: https://en.wiktionary.org/wiki/nonexistant
  [2]: https://en.wiktionary.org/wiki/nonexistent

Change-Id: I8bb482d03c391bd0d37afd5d616229fa50a4ab77
Reviewed-on: https://chromium-review.googlesource.com/c/1390203
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58610}
2019-01-08 07:31:02 +00:00
Frank Tang
8b16a54ff5 [Intl] Implement nu/numberingSystem
Sync with latest Intl.RelativeTimeFormat spec.
See https://github.com/tc39/proposal-intl-relative-time/pull/99
See https://github.com/tc39/proposal-intl-relative-time/pull/100

Bug: v8:8613
Change-Id: Icc5bb73ecf65e979abc23cc430259584a7bf4b48
Reviewed-on: https://chromium-review.googlesource.com/c/1385930
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58607}
2019-01-08 03:17:07 +00:00
Frank Tang
6bff5d7974 [Intl] Reland part of "Validate u extension type"
Fix intl402/*/ignore-invalid-unicode-ext-values
intl/*/check-*

Bug: v8:7481
Change-Id: I5c9d7e19c010953ff9503a2e0981fa148278a451
Reviewed-on: https://chromium-review.googlesource.com/c/1396739
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58606}
2019-01-08 02:10:56 +00:00
Frank Tang
75eed9af71 [Intl] Reland tests of "Validate u extension type"
This is a PARTIAL reland of 8d0942499c
Only land the newly added tests files

Original change's description:
> [Intl] Validate u extension type
>
> Fix intl402/*/ignore-invalid-unicode-ext-values
> Add tests for other valid/invalid -u- ext values.
>
> Bug: v8:7481
> Change-Id: I429effd071bb03599a1e767bb2a9e9918a91b850
> Reviewed-on: https://chromium-review.googlesource.com/c/1351307
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58173}

Bug: v8:7481
Change-Id: I0a1c5701ade330026e2cf7eb554c6390b048a68d
Reviewed-on: https://chromium-review.googlesource.com/c/1396737
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58604}
2019-01-08 01:53:26 +00:00
Sven Sauleau
4365bf23aa [wasm] fix js-api global/constructor
Fix WebAssembly's global/constructor js-api. Globals with a value
of i64 is now valid even if Wasm BigInt feature isn't activated.

Bug: v8:8319
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: Ia41ad69efa5253064ecdb8f59b149393cd672b68
Reviewed-on: https://chromium-review.googlesource.com/c/1382747
Commit-Queue: Ben Smith <binji@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Ben Smith <binji@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58603}
2019-01-07 22:56:18 +00:00
Sathya Gunasekaran
0bd4e348e0 [dict] Add more useful methods
Change-Id: I1bed84a7aa2004f13a51cc60c4d6596b21968ba8
Bug: v8:6443, v8:7569
Reviewed-on: https://chromium-review.googlesource.com/c/1387995
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58602}
2019-01-07 19:39:34 +00:00
Joyee Cheung
5d40e9de86 [class] show private name in invalid private field access
This patch sets the name slot of the private name symbols for
private fields and display the names in error messages of invalid
private field accesses.

TBR: adamk@chromium.org
Bug: v8:8144
Change-Id: Id34c468e2bddd1c3001517b4d447c7497402df76
Reviewed-on: https://chromium-review.googlesource.com/c/1374332
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Cr-Commit-Position: refs/heads/master@{#58601}
2019-01-07 19:26:23 +00:00
Camillo Bruni
53b9e1ed26 [parser] Rename PreParsedScopeData to PreparseData
We plan to store additional information that is not related to scopes.
The new name will reflect this fact better.

Change-Id: I4ddb1017bc255e6ad271e4448848ed630f367d5b
Reviewed-on: https://chromium-review.googlesource.com/c/1388538
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58591}
2019-01-07 14:49:21 +00:00
peterwmwong
400fe0690f [js] Remove Experimental Extras JS Natives
- Removes build step and bootstrapping associated with building/loading `EXPERIMENTAL_EXTRAS` JS natives.
- Removes `--experimental-extras` flag

Bug: v8:7624
Change-Id: I4c45fe70da42847545037d63e9f1da77f5957f8b
Reviewed-on: https://chromium-review.googlesource.com/c/1397906
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Peter Wong <peter.wm.wong@gmail.com>
Cr-Commit-Position: refs/heads/master@{#58590}
2019-01-07 14:43:41 +00:00
Jaroslav Sevcik
426312c88e [turbofan] Add missing heap object check
Bug: chromium:918763
Change-Id: Ic9faaed6b3194269748ba35740cda0dc8dde3241
Reviewed-on: https://chromium-review.googlesource.com/c/1397707
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58589}
2019-01-07 14:38:50 +00:00
Jakob Kummerow
81becb8c10 [ubsan] Fix errors related to AsmType
The AsmType class uses a design similar to the old Object* model, where
arbitrary values (including 0) are reinterpret_cast to pointers. This
yields the following UBSan error, among others:

    src/asmjs/asm-parser.cc:2000:51: runtime error: member call on null
    pointer of type 'v8::internal::wasm::AsmType'

This patch does the smallest possible fix by turning the affected methods
into static functions. Longer-term, we should consider switching the
overall class design to a "struct wrapping an Address" model like the new
Object definition, which is a bit non-trivial because some AsmType types
are ZoneObject subclasses.

Bug: v8:3770
Change-Id: Ie2a7cdc9eab32c4c469d699212c84b0419480b4f
Reviewed-on: https://chromium-review.googlesource.com/c/1397663
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58586}
2019-01-07 13:07:26 +00:00
peterwmwong
263dce9b57 [js] Remove CORE JS Natives (prologue.js), port extra utils to C++/Torque
- Removes the last `CORE` JS native script: `prologue.js`.
- Removes build step and bootstrapping associated with building/loading `CORE` JS natives.
- Removes `natives_utils_object` from context.
- Deprecates `--expose-natives-as` flag.
- Ports extra utils functions to C++ (`uncurryThis`) or Torque
  (`createPrivateSymbol`, `markPromiseAsHandled`, and `promiseState`).
- Move extra utils constants initialization into bootstrapper
  (`kPROMISE_PENDING`, `kPROMISE_FULFILLED`, `kPROMISE_REJECTED`).
- Removes unused extra utils functions `log` and `logStackTrace`.

Drive-by: Added test coverage for Array#includes being an unscopeable.

Bug: v8:7624
Change-Id: I5d983f8d11b76cb4dd3c2c67592ce1dc88364cd9
Reviewed-on: https://chromium-review.googlesource.com/c/1381672
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Peter Wong <peter.wm.wong@gmail.com>
Cr-Commit-Position: refs/heads/master@{#58577}
2019-01-07 11:57:46 +00:00
Hajime Hoshi
9301ea6a2a Reset the platform at MockPlatform in the test
This CL fixes the problem that the platform was set at MockPlatform's
constructor but was not reset.

Bug: v8:8527
Change-Id: I21c3b19320885b1b38999161db7cc1b8f15d798e
Reviewed-on: https://chromium-review.googlesource.com/c/1397821
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58574}
2019-01-07 11:47:41 +00:00
Benedikt Meurer
b6bcf3210a [async] The Promise.all() fast-path must check @@species protector.
We cannot take the fast-path if the user messed with the Symbol.species
property on the Promise.prototype, as that makes the internal promises
observable.

Bug: chromium:917076
Change-Id: I928e0bd17836ca78cf88591610526aa7bc1d293c
Reviewed-on: https://chromium-review.googlesource.com/c/1396426
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58563}
2019-01-07 08:22:56 +00:00
Yang Guo
61f4c2251e Assume flat string when checking CompileFunctionInContext arguments.
R=jkummerow@chromium.org

Change-Id: I54c6137a3c6e14d4102188f154aa7216e7414dbc
Reviewed-on: https://chromium-review.googlesource.com/c/1388533
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58562}
2019-01-07 07:19:06 +00:00
Andreas Haas
122d8b5103 [wasm][anyref] Add support for importing anyref globals
With this CL it is possible to import any JavaScript object as an anyref
global. The exception is WasmGlobalObject, which cannot hold anyref
globals yet.

R=clemensh@chromium.org

Bug: v8:7581
Change-Id: I5b0fc686a4ec5c579d1d635b53be5ccdf0a78f27
Reviewed-on: https://chromium-review.googlesource.com/c/1382452
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58557}
2019-01-04 16:10:18 +00:00
Sigurd Schneider
8a632f5c38 [mjsunit] Fix webkit/run-json-stringify in Debug mode again
Clang is known to use a lot of stack space for Debug builds, so
this patch lowers the recursion depth of that test.

Failing bot:

https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20full%20debug

First failing run:

https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20full%20debug/6606

Change-Id: Ib1da016b190fa0d9d7d38bced19f600a284c7f01
Reviewed-on: https://chromium-review.googlesource.com/c/1396079
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58555}
2019-01-04 15:53:38 +00:00
Peter Marshall
a0572f0bc7 [cpu-profiler] Reduce the size of inlining information
Previously we stored the source position table, which stored a mapping
of pc offsets to line numbers, and the inline_locations, which stored a
mapping of pc offsets to stacks of {CodeEntry, line_number} pairs. This
was slightly wasteful because we had two different tables which were
both keyed on the pc offset and contained some overlapping information.

This CL combines the two tables in a way. The source position table now
maps a pc offset to a pair of {line_number, inlining_id}. If the
inlining_id is valid, then it can be used to look up the inlining stack
which is stored in inline_locations, but is now keyed by inlining_id
rather than pc offset. This also has the nice effect of de-duplicating
inline stacks which we previously duplicated.

The new structure is similar to how this data is stored by the compiler,
except that we convert 'source positions' (char offset in a file) into
line numbers as we go, because we only care about attributing ticks to
a given line.

Also remove the helper RecordInliningInfo() as this is only actually
used to add inline stacks by one caller (where it is now inlined). The
other callers would always bail out or are only called from
test-cpu-profiler.

Remove AddInlineStack and replace it with SetInlineStacks which adds all
of the stacks at once. We need to do it this way because the source pos
table is passed into the constructor of CodeEntry, so we need to create
it before the CodeEntry, but the inline stacks are not (they are part of
rare_data which is not always present), so we need to add them after
construction. Given that we calculate both the source pos table and the
inline stacks before construction, it's just easier to add them all at
once.

Also add a print() method to CodeEntry to make future debugging easier
as I'm constantly rewriting this locally.

Bug: v8:8575, v8:7719, v8:7203

Change-Id: I39324d6ea13d116d5da5d0a0d243cae76a749c79
Reviewed-on: https://chromium-review.googlesource.com/c/1392195
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58554}
2019-01-04 15:05:55 +00:00
Mathias Bynens
40eb442783 [test] Fix expectations in WebKit JSON.stringify tests
The reference implementation used in the tests does not fully match
the spec, so for the diverging cases we need to explicitly specify
the correct expectation.

Every single change in this patch has been verified against every
major JavaScript engine using eshost + jsvu. All implementations
match the spec (and the V8 implementation), with the following two
exceptions:

- One expectation was wrong because of a JavaScriptCore bug (that
  is, we inherited the incorrect expectation when importing the
  tests from WebKit). A comment was added for that one.
- This work resulted in the discovery of bugs in Moddable/XS:
  https://github.com/Moddable-OpenSource/moddable/issues/112

Change-Id: I05d91d7acc5c8765e941fcd68c1086c2694c710c
Reviewed-on: https://chromium-review.googlesource.com/c/1396081
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58546}
2019-01-04 11:35:57 +00:00
Peter Marshall
af0428aca9 [cpu-profiler] Add source positions for inlined function calls
Currently in both kCallerLineNumbers and kLeafNodeLineNumbers modes, we
correctly capture inline stacks. In leaf number mode, this is simple as
we simply add the path onto the existing tree. For caller line numbers
mode this is more complex, because each path through various inlined
function should be represented in the tree, even when there are
multiple callsites to the same function inlined.

Currently we don't correctly show line numbers for inlined functions.
We do actually have this information though, which is generated by
turbofan and stored in the source_position_table data structure on the
code object.

This also changes the behavior of the SourcePositionTable class. A
problem we uncovered is that the PC that the sampler provides for every
frame except the leaf is the return address of the calling frame. This
address is *after* the call has already happened. It can be attributed
to the next line of the function, rather than the calling line, which
is wrong. We fix that here by using lower_bound in GetSourceLineNumber.

The same problem happens in GetInlineStack - the PC of the caller is
actually the instruction after the call. The information turbofan
generates assumes that the instruction after the call is not part of
the call (fair enough). To fix this we do the same thing as above - use
lower_bound and then iterate back by one.

TBR=alph@chromium.org

Bug: v8:8575, v8:8606
Change-Id: Idc4bd4bdc8fb70b70ecc1a77a1e3744a86f83483
Reviewed-on: https://chromium-review.googlesource.com/c/1374290
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58545}
2019-01-04 11:12:06 +00:00
Clemens Hammacher
5ed7dff356 [Liftoff][ia32] Fix i64 sign extension on non-byte register
The {movsx_b} instruction can only take byte registers (or operands) as
source. Ensure that for i8 sign extensions to i64, the src register is
moved to a temporary byte register first, similar to the same operation
on i32 a few lines above.

R=ahaas@chromium.org

Bug: chromium:918149, v8:6600
Change-Id: I17bc942127baee57279a7fc0caac9d82bd7c6bfb
Reviewed-on: https://chromium-review.googlesource.com/c/1394555
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58542}
2019-01-04 10:12:06 +00:00
Ross McIlroy
289452b06e [Test] Disable bytecode flushing in DecideToPretenureDuringCompilation.
The high GC stressing in this tests causes bytecode flushing which breaks some
invariants in the test.

BUG=v8:8629

Change-Id: I7efff098ed4fa96006c8200e174132a6297bd36f
Reviewed-on: https://chromium-review.googlesource.com/c/1394743
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58541}
2019-01-04 10:09:26 +00:00
Sigurd Schneider
5bcd6e1a60 [mjsunit] Disable test unsuitable for GC stress
regress-6989 uses assertOptimized and will hence fail randomly depending
on GC timing. This means we should not run it under GC stress.

This can be verified by running the test under GC stress and changing the
--gc-interval. It is easy to find values for which the test fails, and
values for which the test passes.

Change-Id: Ibd8bfbc1712ad60830255e4d89ea795023134891
Reviewed-on: https://chromium-review.googlesource.com/c/1396078
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58540}
2019-01-04 09:51:55 +00:00
Andreas Haas
fc664bda17 [wasm] Update spec tests
One spec test is failing at the moment. I disabled it for now and
created an bugtracker issue:

https://crbug.com/v8/8633

R=gdeepti@chromium.org

Change-Id: Ibc3087d0582b95395d45d261155f6ac7e1a47f0c
Reviewed-on: https://chromium-review.googlesource.com/c/1394551
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58538}
2019-01-04 09:15:59 +00:00
Mathias Bynens
214282249f [harmony] Add flat/flatMap to Array.prototype[Symbol.unscopables]
https://github.com/tc39/proposal-flatMap/issues/74
https://github.com/tc39/proposal-flatMap/pull/75

BUG=v8:7220

Change-Id: I93ce66bddbb429beaa7486311f120ec32d6a35fb
Reviewed-on: https://chromium-review.googlesource.com/c/1390125
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58537}
2019-01-04 08:12:28 +00:00
Frank Tang
3a72cd090b [Intl] Fix CHECK fail in Intl::ToLanguageTag()
Make the function return Maybe<std::string> to propagate error.

Bug: chromium:917151
Change-Id: I4330b0c54c122b1eddd3b37e21e0f387cb5d803a
Reviewed-on: https://chromium-review.googlesource.com/c/1392205
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58535}
2019-01-04 01:33:26 +00:00
Clemens Hammacher
9f90c8dc43 [wasm] Force GC earlier to avoid running OOM
We currently trigger a GC when creating a module while the remaining
uncommitted code space is below 32MB. For bigger modules, this is not
enough. Instead, make this limit relative: Trigger GC if we fall below
50% of the available code space, and re-adjust this limit after each GC
to avoid repeated GCs that do not free anything.

R=ahaas@chromium.org

Bug: v8:8624
Change-Id: I7abfad3b57663d528a26d29232ad6bc2dc63cef4
Reviewed-on: https://chromium-review.googlesource.com/c/1391753
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58527}
2019-01-03 16:07:53 +00:00
Clemens Hammacher
20b6330037 [Liftoff] Keep consistent register mapping in non-merged regions
We currently de-duplicate used registers also in regions which do not
need merging. In those regions though it can never happen that we need
to pass different values from any merge input. Apart from introducing
unnecessary register moves, this also causes a DCHECK to fail, because
we might later want to merge back different registers into one.

Assume this initial stack state (where each letter is a register):
[A B B C]
If in any child block the two Bs get de-duplicated so something like
[A B D C]
then we run into trouble when merging back this state into the parent
state, because both B and D would need to be put into B.
In this case we can statically infer that B and D must hold the same
value anyway, but having this situation does not make much sense in the
first place, so the DCHECK fires correctly.

R=titzer@chromium.org

Bug: v8:8423, chromium:917412
Change-Id: I24c36b062e04a134cf7051725afab98126753f31
Reviewed-on: https://chromium-review.googlesource.com/c/1392190
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58522}
2019-01-03 14:37:48 +00:00
Clemens Hammacher
14faced4c0 [Liftoff] Fix moving stack values
On x64 the {kScratchRegister} cannot be held in a {LiftoffRegister},
since it is not a valid cache register. Also, the code unnecessarily
checked whether there is an unused cache register, but then didn't use
it. Simplify the logic to always use the scratch register, just
distinguish between 4-byte and 8-byte moves.
On ia32 we did not move 64-bit values correctly if we didn't have
unused registers and needed to move via the stack.

R=titzer@chromium.org

Bug: v8:6600, chromium:917588, chromium:917450
Change-Id: I0bbe946c6ac8fca62f85711ae47afdac9c02ae6b
Reviewed-on: https://chromium-review.googlesource.com/c/1391755
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58521}
2019-01-03 14:25:47 +00:00
Clemens Hammacher
4339f5f179 [base] Refactor STATIC_CHAR_VECTOR into a template
Templates are nicer than macros, and in this case it's not more complex.

R=tebbi@chromium.org

Bug: v8:8562
Change-Id: I3aea7b4138f144166418c0827dd7c58ea459c670
Reviewed-on: https://chromium-review.googlesource.com/c/1392200
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58518}
2019-01-03 12:55:15 +00:00
Mythri
fa844bdbee Set the correct scope when initializing parameters.
If the parameter list contains class declarations we should use the
block scope corresponding to the class when rewriting the initializers.

Bug: chromium:917988
Change-Id: I7fcd44a264b7c0113cbd821b759e0bee6c9345a0
Reviewed-on: https://chromium-review.googlesource.com/c/1392240
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58515}
2019-01-03 10:18:11 +00:00
Leszek Swirski
00a2481a24 [ignition] Move destructuring assignments to bytecode generation
Instead of de-sugaring destructuring assignment in the parser (using the
pattern rewriter), pass the Object/ArrayLiterals through to the bytecode
generator, which can desugar them in-place.

This allows us to decrease the amount of AST node creation, and improve
the generated bytecode using domain-specific knowledge. As a side effect
we partially fix an old execution ordering spec bug.

Currently only implemented for assignments, not declarations, as the
latter has some additional complexity.

Bug: v8:4951
Change-Id: I3d69d232bea2968ef20df68a74014d9e05808cfe
Reviewed-on: https://chromium-review.googlesource.com/c/1375660
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58512}
2019-01-03 09:41:27 +00:00
Frank Tang
74d00a9b34 [Intl] Implement ApplyOptionsToTag in Intl.Locale
Bug: v8:7684
Change-Id: Ibe7db0ef1baacb33d07a45234e6bda4f69e95643
Reviewed-on: https://chromium-review.googlesource.com/c/1381732
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jungshik Shin <jshin@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58511}
2019-01-03 06:17:10 +00:00
Frank Tang
5182e1ad11 Revert "[Intl] Validate u extension type"
This reverts commit 8d0942499c.

Reason for revert: Cause Memory regression

TBR=gsathya@chromium.org

Original change's description:
> [Intl] Validate u extension type
>
> Fix intl402/*/ignore-invalid-unicode-ext-values
> Add tests for other valid/invalid -u- ext values.
>
> Bug: v8:7481
> Change-Id: I429effd071bb03599a1e767bb2a9e9918a91b850
> Reviewed-on: https://chromium-review.googlesource.com/c/1351307
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58173}

TBR=cira@chromium.org,jshin@chromium.org,gsathya@chromium.org,ftang@chromium.org

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

Bug: v8:7481
Change-Id: Idabf2183684f264271ebe2b8c0ca10ae8e30d811
Reviewed-on: https://chromium-review.googlesource.com/c/1393499
Reviewed-by: Frank Tang <ftang@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58506}
2019-01-03 01:40:09 +00:00
Clemens Hammacher
088bdc00e4 Store TypeCache as pointer instead of reference
Apart from being more in-line with the style guide, this allows to use
DEFINE_LAZY_LEAKY_OBJECT_GETTER for defining {TypeCache::Get}.

R=tebbi@chromium.org

Bug: v8:8562
Change-Id: I016b28624950ce9404180fc1ca1a232551f75cd0
Reviewed-on: https://chromium-review.googlesource.com/c/1392201
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58500}
2019-01-02 17:13:39 +00:00
peterwmwong
75ca843c5c [typedarray] Check for a detached buffer before each iteration of TypedArray.p.join.
Bug: chromium:917980
Change-Id: Ia9b68f492bb9f0769dc6ee1706baf8b09de49968
Reviewed-on: https://chromium-review.googlesource.com/c/1392070
Commit-Queue: Peter Wong <peter.wm.wong@gmail.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58490}
2018-12-31 18:27:51 +00:00
Deepti Gandluri
29c1c5d6ca [wasm] Validate prefixed opcode reads
Identify validation fails to read the index of prefixed opcodes, and not
continue to decode the next bytes.

Change-Id: I2c737af55615ba69ba0c5f5adf18a06c6cdb951a
Bug: chromium:905815
Reviewed-on: https://chromium-review.googlesource.com/c/1390927
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58485}
2018-12-28 07:07:11 +00:00
Alexei Filippov
4eae3bb140 [inspector] Make InjectedScript::getProperties respect custom formatters
BUG=chromium:917136

Change-Id: I02696a3315c22b34705bbc48cddaeb9e6c59fa9f
Reviewed-on: https://chromium-review.googlesource.com/c/1391749
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58482}
2018-12-27 23:17:57 +00:00
Igor Sheludko
4a44cf83b0 [cleanup][csa] Introduce Times[SystemPointer|Tagged]Size instead of TimesPointerSize
Bug: v8:8477, v8:8562
Change-Id: I54b857cdacf9360b95d64147a486a0d5fa1ffe10
Reviewed-on: https://chromium-review.googlesource.com/c/1388526
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58473}
2018-12-27 03:48:55 +00:00
Jakob Kummerow
056f927861 [ubsan] Port Object to the new design
Tbr: ahaas@chromium.org,leszeks@chromium.org,verwaest@chromium.org
Bug: v8:3770
Change-Id: Ia6530fbb70dac05e9972283781c3550d8b50e1eb
Reviewed-on: https://chromium-review.googlesource.com/c/1390116
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58470}
2018-12-26 20:54:07 +00:00
Jakob Kummerow
444741ac11 Revert "[error] extend error stack w/ function parameters"
This reverts commit 97628eeeb9.

Reason for revert: breaks compilation in Lite mode, which does not allow overriding of certain flags. See https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket.appspot.com/8926078411629093216/+/steps/build/0/steps/compile/0/stdout.

Original change's description:
> [error] extend error stack w/ function parameters
> 
> Extend FrameArray to hold weak references to parameters for functions in
> the call stack. The goal here is to provide more metadata for postmortem
> tools (such as llnode), especially in cases of rethrowing (this will be
> particularly useful when using postmortem with promises on Node.js).
> 
> Besides postmortem, these changes allow us to print a more detailed
> stack trace for errors with parameters types (or even values), which can
> be useful since JavaScript functions can receive any number of
> parameters of any type, and having a function behave differently
> according to the number of parameters received as well as their types is
> a common pattern on JS libraries and frameworks.
> 
> R=​bmeurer@google.com, yangguo@google.com
> 
> Change-Id: Idf0984d0dbac16041f11d738d4b1c095a8eecd61
> Reviewed-on: https://chromium-review.googlesource.com/c/1289489
> Commit-Queue: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58468}

TBR=yangguo@chromium.org,bmeurer@google.com,bmeurer@chromium.org,mat@mmarchini.me

Change-Id: Ide0a434c1521ab2bbeca6821397ff63ba7d40fe5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/1390128
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58469}
2018-12-26 19:03:45 +00:00
Matheus Marchini
97628eeeb9 [error] extend error stack w/ function parameters
Extend FrameArray to hold weak references to parameters for functions in
the call stack. The goal here is to provide more metadata for postmortem
tools (such as llnode), especially in cases of rethrowing (this will be
particularly useful when using postmortem with promises on Node.js).

Besides postmortem, these changes allow us to print a more detailed
stack trace for errors with parameters types (or even values), which can
be useful since JavaScript functions can receive any number of
parameters of any type, and having a function behave differently
according to the number of parameters received as well as their types is
a common pattern on JS libraries and frameworks.

R=bmeurer@google.com, yangguo@google.com

Change-Id: Idf0984d0dbac16041f11d738d4b1c095a8eecd61
Reviewed-on: https://chromium-review.googlesource.com/c/1289489
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58468}
2018-12-26 11:54:17 +00:00
Ulan Degenbaev
eb537d7485 [tests] Bump up the heap limit for the pause-on-oom test
Bug: v8:8521
Change-Id: I6e02930108ba90adf6d54aca319d2d2680964860
Reviewed-on: https://chromium-review.googlesource.com/c/1388543
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58464}
2018-12-24 10:58:35 +00:00
Jakob Gruber
f2411cf2b9 [nojit] Disable embed tests on noembed builds
These test off-heap builtin call sequences and don't make sense in
noembed builds.

Tbr: sigurds@chromium.org
Bug: v8:7777
Change-Id: I2795257e33b6ad87958d08f0845b75a7e88988f2
Reviewed-on: https://chromium-review.googlesource.com/c/1390120
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58461}
2018-12-24 09:48:55 +00:00
Adam Klein
43fff3d7b1 [runtime] Remove %AddNamedProperty and %AddElement
%AddNamedProperty was only used by regression tests, and is easily
replaced by Object.defineProperty (or deleted, in the case of a
cctest that was designed to test it directly).

%AddElement was unused (probably due to the death of array.js).

Bug: v8:7624
Change-Id: Icc17fd7a7419aa649275414a351f176f104040e2
Reviewed-on: https://chromium-review.googlesource.com/c/1387990
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58448}
2018-12-21 16:56:12 +00:00
Maya Lekova
9bb78e3279 Revert "[parser] Create arrow function scopes while parsing the head"
This reverts commit 3411e7c3e8.

Reason for revert: Breaks test expecations - https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux_chromium_rel_ng/260731

Original change's description:
> [parser] Create arrow function scopes while parsing the head
> 
> This simplifies NextArrowFunctionInfo, allows us to Scope::Snapshot::Reparent
> directly rather than moving it, and allows us to skip reparenting in the simple
> parameter arrow function cases.
> 
> This CL additionally fixes arrow function name inferring.
> 
> Change-Id: Ie3e5ea778f3d7b84b2a10d4f4ff73931cfc9384a
> Reviewed-on: https://chromium-review.googlesource.com/c/1386147
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58405}

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

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

Change-Id: I8f31b96f844f0673364bf435fa6c809e40d62fa3
Reviewed-on: https://chromium-review.googlesource.com/c/1388541
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58446}
2018-12-21 16:09:25 +00:00
Jakob Gruber
9365d0904e [coverage] Rework continuation counter handling
This changes a few bits about how continuation counters are handled.

It introduces a new mechanism that allows removal of a continuation
range after it has been created. If coverage is enabled, we run a first
post-processing pass on the AST immediately after parsing, which
removes problematic continuation ranges in two situations:

1. nested continuation counters - only the outermost stays alive.
2. trailing continuation counters within a block-like structure are
   removed if the containing structure itself has a continuation.

R=bmeurer@chromium.org, jgruber@chromium.org, yangguo@chromium.org

Bug: v8:8381, v8:8539
Change-Id: I6bcaea5060d8c481d7bae099f6db9f993cc30ee3
Reviewed-on: https://chromium-review.googlesource.com/c/1339119
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58443}
2018-12-21 15:29:48 +00:00
George Wort
491eff86b5 [liftoff][arm] GetUnusedRegister before Acquire
Ensure that GetUnusedRegister is always called before
acquiring the scratch register in case it is needed
for spilling the value of the used register.

Bug: v8:6600, chromium:910824
Change-Id: I93ae684ad504584807dfa6227b6af14609c6bcf5
Reviewed-on: https://chromium-review.googlesource.com/c/1387498
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58442}
2018-12-21 14:57:18 +00:00
Jakob Gruber
ccc068d5fd [nojit] Skip the on-heap trampoline for builtin calls
This CL does two things:

1. It introduces Call/JumpCodeObject as the bottleneck for all calls
   to non-heap-constant Code objects; and
2. it dispatches directly to the off-heap entry point for all embedded
   code.

Codegen at runtime remains unchanged to preserve the shorter,
branch-less calling sequence.

Bug: v8:7777
Change-Id: I15fdcb51625209904c6a56737f085a23219319b9
Reviewed-on: https://chromium-review.googlesource.com/c/1382461
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58440}
2018-12-21 14:43:16 +00:00
Ulan Degenbaev
6c740734c4 [heap] Add a regression test for v8:8617
This also adjusts debug printing of descriptor arrays and adds a check
to the code serializer.

Bug: v8:8617
Tbr: mlippautz@chromium.org
Change-Id: Ic04f01abf9f7ed5a310b9e51a22c04fda108f563
Reviewed-on: https://chromium-review.googlesource.com/c/1387501
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58438}
2018-12-21 14:38:36 +00:00
Sigurd Schneider
2a72b8acee Reland "[deoptimizer] Refactor GenerateDeoptimizationEntries"
This is a reland of f63a657ed9

Original change's description:
> [deoptimizer] Refactor GenerateDeoptimizationEntries
>
> This reduces preprocessor-expanded source size by 64,359 from
>
> gen         (   21 files):    71,570 to    1,613,100 (   23x)
> src         (  624 files):   367,830 to   52,964,659 (  144x)
> test        (  392 files):   490,924 to   37,360,916 (   76x)
> third_party (  432 files):   239,085 to    9,547,902 (   40x)
> total       ( 1521 files): 1,184,093 to  102,461,098 (   87x)
>
> to
>
> gen         (   21 files):    71,570 to    1,613,100 (   23x)
> src         (  624 files):   367,837 to   52,919,005 (  144x)
> test        (  392 files):   490,924 to   37,342,211 (   76x)
> third_party (  432 files):   239,085 to    9,547,902 (   40x)
> total       ( 1521 files): 1,184,100 to  102,396,739 (   86x)
>
> Bug: v8:8562
> Change-Id: Iee474e22ababa1e080b8d6359af4d0076903e59a
> Reviewed-on: https://chromium-review.googlesource.com/c/1384091
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58424}

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

Bug: v8:8562
Change-Id: I7a8a350414941f49c6155ff43e36e0cb0b2006e5
Reviewed-on: https://chromium-review.googlesource.com/c/1387497
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58437}
2018-12-21 14:30:17 +00:00
Mike Stanton
98b47ebb33 [Test] CSuite benchmark runner
It's nice to have a quick way to get stable results on the local
machine for the classic d8 benchmarks. CSuite revitalizes an
old tool called BSuite which offers multiple averaged runs,
and a nice ascii display of results.

Sample usage:

./csuite.py octane baseline ~/src/v8/out/d8
./csuite.py octane compare ~/src/v8/out-mine/d8

                              benchmark:    score |   master |      % |
===================================================+==========+========+
                                Richards:  26201.0 |  26568.0 |   -1.4 |
                               DeltaBlue:  55744.0 |  58309.0 |   -4.4 |
                                  Crypto:  31831.0 |  31815.0 |        |
                                RayTrace:  73481.0 |  73185.0 |    0.4 |
              ............<snip>............................
                                  Octane:  36388.0 |  35741.0 |    1.8 |
---------------------------------------------------+----------+--------+


See README.md for more documentation.

Change-Id: I182490506ca07fab1240bd485bd1d7a8920db893
Reviewed-on: https://chromium-review.googlesource.com/c/1387487
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58434}
2018-12-21 13:15:57 +00:00
Camillo Bruni
c6ffff9dea [parser] Minor cleanup PreParsedScopeDataBuilder
- Mark Serialize method as non-virtual
- Use simple scheme to mask out bytes when de-/serializing Uint32

- Improve ByteArray::ByteArrayPrint method

Drive-by-fix: 
Change-Id: I9a6779587c0a031bcf23e4f431d17026b83a808d
Reviewed-on: https://chromium-review.googlesource.com/c/1387493
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58428}
2018-12-21 12:03:28 +00:00
Igor Sheludko
d183d42fe7 [cleanup][x64] Final set of x64-specific kPointerSize fixes
Bug: v8:8477, v8:8562
Change-Id: I28a8244ef22035db85b520d86aa6d5578c7c7f5d
Reviewed-on: https://chromium-review.googlesource.com/c/1384309
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58426}
2018-12-21 11:52:43 +00:00
Sigurd Schneider
4b4175d7ff Revert "[deoptimizer] Refactor GenerateDeoptimizationEntries"
This reverts commit f63a657ed9.

Reason for revert: breaks compile on lite mode:

https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket.appspot.com/8926535782549686576/+/steps/build/0/steps/compile/0/stdout


Original change's description:
> [deoptimizer] Refactor GenerateDeoptimizationEntries
> 
> This reduces preprocessor-expanded source size by 64,359 from
> 
> gen         (   21 files):    71,570 to    1,613,100 (   23x)
> src         (  624 files):   367,830 to   52,964,659 (  144x)
> test        (  392 files):   490,924 to   37,360,916 (   76x)
> third_party (  432 files):   239,085 to    9,547,902 (   40x)
> total       ( 1521 files): 1,184,093 to  102,461,098 (   87x)
> 
> to
> 
> gen         (   21 files):    71,570 to    1,613,100 (   23x)
> src         (  624 files):   367,837 to   52,919,005 (  144x)
> test        (  392 files):   490,924 to   37,342,211 (   76x)
> third_party (  432 files):   239,085 to    9,547,902 (   40x)
> total       ( 1521 files): 1,184,100 to  102,396,739 (   86x)
> 
> Bug: v8:8562
> Change-Id: Iee474e22ababa1e080b8d6359af4d0076903e59a
> Reviewed-on: https://chromium-review.googlesource.com/c/1384091
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58424}

TBR=ulan@chromium.org,jarin@chromium.org,sigurds@chromium.org

Change-Id: I06e6f95255a3cea6a428713e9e841781425dffe8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8562
Reviewed-on: https://chromium-review.googlesource.com/c/1387494
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58425}
2018-12-21 10:57:06 +00:00
Sigurd Schneider
f63a657ed9 [deoptimizer] Refactor GenerateDeoptimizationEntries
This reduces preprocessor-expanded source size by 64,359 from

gen         (   21 files):    71,570 to    1,613,100 (   23x)
src         (  624 files):   367,830 to   52,964,659 (  144x)
test        (  392 files):   490,924 to   37,360,916 (   76x)
third_party (  432 files):   239,085 to    9,547,902 (   40x)
total       ( 1521 files): 1,184,093 to  102,461,098 (   87x)

to

gen         (   21 files):    71,570 to    1,613,100 (   23x)
src         (  624 files):   367,837 to   52,919,005 (  144x)
test        (  392 files):   490,924 to   37,342,211 (   76x)
third_party (  432 files):   239,085 to    9,547,902 (   40x)
total       ( 1521 files): 1,184,100 to  102,396,739 (   86x)

Bug: v8:8562
Change-Id: Iee474e22ababa1e080b8d6359af4d0076903e59a
Reviewed-on: https://chromium-review.googlesource.com/c/1384091
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58424}
2018-12-21 10:45:03 +00:00
Jakob Gruber
4edfaa1f39 Reland "[regexp] Escape newlines when setting [[OriginalSource]]"
This is a reland of 0e22ec737b

Original change's description:
> [regexp] Escape newlines when setting [[OriginalSource]]
> 
> This escapes LineTerminator characters in a regexp pattern when
> creating the string that will be stored in the [[OriginalSource]] slot.
> 
> As an example, the source property for all following objects will equal
> "\n" (a '\' character followed by 'n'):
> 
>   /\n/
>   new RegExp("\n")
>   new RegExp("\\n")
> 
> Bug: v8:1982, chromium:855009
> Change-Id: I3b539497a0697e3d51ec969cae49308b0b312a19
> Reviewed-on: https://chromium-review.googlesource.com/c/1384316
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Mathias Bynens <mathias@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58387}

Bug: v8:1982, chromium:855009
Change-Id: I1ba22395477ec37e8e8c944000f9beade1e3250b
Reviewed-on: https://chromium-review.googlesource.com/c/1386495
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58419}
2018-12-21 09:15:09 +00:00
Sathya Gunasekaran
15a7059412 [class] Parse static private fields
Bug: v8:5368
Change-Id: I0f6edc028baf009b81612ecc4be9a70c3621bc4e
Reviewed-on: https://chromium-review.googlesource.com/c/1385528
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58416}
2018-12-20 20:58:43 +00:00
Michael Lippautz
caec42a8df Fix DCHECK in finalizer scavenging logic
The DCHECK was overly restrictive when checking that a weak handle is
not a finalizer when hitting it through a regular scavenge processing
path.

Only happened with finalizers to unmodified API wrappers or regular
objects that were also marked as independent.

Bug: v8:8586
Change-Id: I2c2a5b21f6e8a5ddc6671f762b508ba083c04335
Reviewed-on: https://chromium-review.googlesource.com/c/1387485
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58414}
2018-12-20 20:13:03 +00:00
Jakob Kummerow
9302db480e [ubsan] Port HeapObject to the new design
Merging the temporary HeapObjectPtr back into HeapObject.

Bug: v8:3770
Change-Id: I5bcd23ca2f5ba862cf5b52955dca143e531c637b
Reviewed-on: https://chromium-review.googlesource.com/c/1386492
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58410}
2018-12-20 16:43:49 +00:00
Toon Verwaest
3411e7c3e8 [parser] Create arrow function scopes while parsing the head
This simplifies NextArrowFunctionInfo, allows us to Scope::Snapshot::Reparent
directly rather than moving it, and allows us to skip reparenting in the simple
parameter arrow function cases.

This CL additionally fixes arrow function name inferring.

Change-Id: Ie3e5ea778f3d7b84b2a10d4f4ff73931cfc9384a
Reviewed-on: https://chromium-review.googlesource.com/c/1386147
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58405}
2018-12-20 14:42:48 +00:00
Yang Guo
3b02afc538 Add test for integer hash quality.
Change-Id: I8de0f11c0a7d21d980f5d8691a6e3888a386cbba
Reviewed-on: https://chromium-review.googlesource.com/c/1386144
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58400}
2018-12-20 13:29:09 +00:00
Michael Achenbach
cd5f5937cd Revert "[regexp] Escape newlines when setting [[OriginalSource]]"
This reverts commit 0e22ec737b.

Reason for revert: Breaks layout tests:
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8-Blink%20Linux%2064/28814

Original change's description:
> [regexp] Escape newlines when setting [[OriginalSource]]
> 
> This escapes LineTerminator characters in a regexp pattern when
> creating the string that will be stored in the [[OriginalSource]] slot.
> 
> As an example, the source property for all following objects will equal
> "\n" (a '\' character followed by 'n'):
> 
>   /\n/
>   new RegExp("\n")
>   new RegExp("\\n")
> 
> Bug: v8:1982, chromium:855009
> Change-Id: I3b539497a0697e3d51ec969cae49308b0b312a19
> Reviewed-on: https://chromium-review.googlesource.com/c/1384316
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Mathias Bynens <mathias@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58387}

TBR=yangguo@chromium.org,jgruber@chromium.org,mathias@chromium.org

Change-Id: I1db7e6a0c6cd1cd995fe9f499458108e88dc8cb9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:1982, chromium:855009
Reviewed-on: https://chromium-review.googlesource.com/c/1386493
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58396}
2018-12-20 12:48:43 +00:00
Clemens Hammacher
f328613d04 [wasm] Fix i8 to i32 sign extension on ia32
The source register of {movsx_b} must be a byte register.

Drive-by: Add missing sign extension opcodes to wasm-constants.js.

R=herhut@chromium.org

Bug: chromium:916869
Change-Id: I571c1ea2a0e197afefc810f306eed238250cd5e0
Reviewed-on: https://chromium-review.googlesource.com/c/1386110
Reviewed-by: Stephan Herhut <herhut@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58394}
2018-12-20 12:28:54 +00:00
Jakob Gruber
93e5db5f61 Remove the js minifier
V8 is almost completely JS-free. There's no need to ship the minifier
any more.

Bug: v8:7624,v8:5505,v8:4240,v8:4235,v8:4188,v8:1557
Change-Id: Iee15bf68c66bac27a67fe70e10b1edd4dcef89d1
Reviewed-on: https://chromium-review.googlesource.com/c/1386146
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58392}
2018-12-20 11:54:27 +00:00
Mythri
b29c0459c3 Disable mjsunit/spread-large-* in lite mode
Disable mjsunit/spread-large-array and mjsunit/spread-large-string in
lite mode.

Bug: v8:8394
Change-Id: I630efc1e2b397189b0ea1e602fbfa472851abe1f
Reviewed-on: https://chromium-review.googlesource.com/c/1386484
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58391}
2018-12-20 11:46:57 +00:00
Jakob Gruber
0e22ec737b [regexp] Escape newlines when setting [[OriginalSource]]
This escapes LineTerminator characters in a regexp pattern when
creating the string that will be stored in the [[OriginalSource]] slot.

As an example, the source property for all following objects will equal
"\n" (a '\' character followed by 'n'):

  /\n/
  new RegExp("\n")
  new RegExp("\\n")

Bug: v8:1982, chromium:855009
Change-Id: I3b539497a0697e3d51ec969cae49308b0b312a19
Reviewed-on: https://chromium-review.googlesource.com/c/1384316
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58387}
2018-12-20 10:12:48 +00:00
Frank Tang
12f04d8179 [Intl] Use icu::Locale as storage in JSLocale
Remove flags and all string in JSLocale
This does not change the logic of Intl.Locale constructor
but only the way we store the information.
Preparation for logic rewrite that sync with latest spec.

Bug: v8:7684
Change-Id: Ib61705eaf00e5bcf63443c55c29f0b0b61f8e4c9
Reviewed-on: https://chromium-review.googlesource.com/c/1377996
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58386}
2018-12-20 06:31:05 +00:00
Frank Tang
5b607f1912 [Intl] Remove passed tests pending on stable sort
Bug: v8:7808
Change-Id: Idcfd927d9e4df3dc30ab8cf815149c6ede76b852
Reviewed-on: https://chromium-review.googlesource.com/c/1384800
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58385}
2018-12-20 06:30:00 +00:00