Commit Graph

21262 Commits

Author SHA1 Message Date
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
Adam Klein
6776944f8f Remove always-true --harmony-array-prototype-values flag
It's been enabled for several releases now.

R=gsathya@chromium.org

Change-Id: Ib1806a1373821ee542dae2fd80f639b56bd99ed9
Reviewed-on: https://chromium-review.googlesource.com/c/1384796
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58381}
2018-12-19 20:48:56 +00:00
Sathya Gunasekaran
e5e0501552 [dict] Remove HasKey from OrderedNameDictionary
Since we have FindEntry, this is redudant.

This patch also
* Makes the tests for FindEntry stricter by testing the value
* Makes the OrderedNameDictionary::Add and
  SmallOrderedNameDictionary::Add consistent by using GetHash and
  using a DCHECK for the FindEntry call

Bug: v8:6443, v8:7569
Change-Id: I4859cd6735ec385c19acad6ce5cecaeac45173dd
Reviewed-on: https://chromium-review.googlesource.com/c/1382828
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58380}
2018-12-19 20:32:34 +00:00
Igor Sheludko
4ba29d0503 [cleanup][heap] Fix kPointerSize usages in src/heap/
Bug: v8:8477, v8:8562
Change-Id: Iaa995c8fbb9f309dadac4e308d727f628fdb8b3c
Reviewed-on: https://chromium-review.googlesource.com/c/1384314
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58379}
2018-12-19 19:58:20 +00:00
Sathya Gunasekaran
b6dfeb0d8a [dict] Use new ObjectPtr design
Bug: v8:6443, v8:7569
Change-Id: I1bcd3458c2d548d36bf2961a2faf41919c433a91
Reviewed-on: https://chromium-review.googlesource.com/c/1382829
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58378}
2018-12-19 19:23:46 +00:00
Bruce Dawson
4bd1215c95 Workaround VS/UCRT fmod bug
Recent versions of the Windows Universal CRT changed the behavior of
fmod for when the first parameter is negative. In particular, a result
of negative zero became positive zero. This is rarely critical but it
causes test failures and may effect some JS test suites or web pages.

The fix is to modify Modulo to check for a result of 0 when the first
parameter is negative and change the result to -0. That fixes four of
the five test failures and the fifth one is fixed by comparing the
results against Modulo instead of std::fmod.

Bug: chromium:915045
Change-Id: Ia4490ec98361a37006d6c338acd33f959fa3ccea
Reviewed-on: https://chromium-review.googlesource.com/c/1383091
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58377}
2018-12-19 18:05:18 +00:00
Toon Verwaest
704c050a6b [parser] Change how conflicting param and let in body declarations are detected
Now we just check for each variable declared in the parameter scope whether it
occurs as a lexical variable in the body scope. This way the preparser will
also identify them.

Bug: v8:2728, v8:5064
Change-Id: I9fd96590fa431de0656c85295fd31af9b36f2e32
Reviewed-on: https://chromium-review.googlesource.com/c/1384225
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58375}
2018-12-19 17:10:57 +00:00
Mythri
7458a75b4b Disable a slow test in lite mode
Bug: v8:8394
Change-Id: I698b769369abd8ab1e6384f5e64d4111b4d6486d
Reviewed-on: https://chromium-review.googlesource.com/c/1384317
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58374}
2018-12-19 17:03:26 +00:00
Ulan Degenbaev
0400fc2049 [heap] Optimize marking of descriptor arrays.
Now a descriptor array tracks the number of descriptors that were
already marked. The marking visitor of a map only marks the subset
of the descriptors that it needs and that are not already marked.

If a descriptor array is shared between M maps and has N descriptos,
then the number of marking operations is reduced from O(M*N) to O(N).

This patch also adds a marking barrier for descriptors.

The marked descriptor counter in a descriptor array is not cleared
after mark-compact GC. Instead, it embeds two bits from the global
mark-compact epoch counter and is considered 0 if the bits do not match
the current value of the global epoch counter.

Bug: v8:8486
Change-Id: I2a7822a6833f3143e1d351e5e4819c2ef2c07fb0
Reviewed-on: https://chromium-review.googlesource.com/c/1382746
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58372}
2018-12-19 16:49:06 +00:00
Sathya Gunasekaran
635f938f2a [dict] Add facade around the two different kind of dicts
OrderedNameDictionarHandler is the external API to interface with the
OrderedNameDictionary variants. This abstracts away the need for the
user to know that there are two different backing stores.

Bug: v8:6443, v8:7569
Change-Id: Ief4f0904823988e629a01060b018b4cb0291542d
Reviewed-on: https://chromium-review.googlesource.com/c/1381758
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58369}
2018-12-19 16:04:19 +00:00
Mythri
1ca0de67d2 [reland] Don't allocate feedback vectors and feedback metadata in lite mode
Don't allocate feedback vectors and feedback metadata in lite mode.
Also updates to skip tests that require feedback vectors.

This is a reland of
https://chromium-review.googlesource.com/c/v8/v8/+/1384087 after skipping
the failing tests.

Bug: v8:8394
Change-Id: I7766533b85a144e62996ceed8d542cdc534feeb5
Reviewed-on: https://chromium-review.googlesource.com/c/1384307
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58363}
2018-12-19 14:29:30 +00:00
Igor Sheludko
50f6baf404 [cleanup] Fix kPointerSize usages in src/wasm/
Also added != 0 for readability in checks like:
  if (FIELD_SIZE(kFooOffset) != 0) {...}

Bug: v8:8477, v8:8562
Change-Id: Ibc305103475e6ec029e89e7ad095ec0a1fa30189
Reviewed-on: https://chromium-review.googlesource.com/c/1382743
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58360}
2018-12-19 12:42:24 +00:00
Sigurd Schneider
4aa97de1af [conversions] Speed up double to CString conversion
This addresses most of the regression in of
Kraken's json-stringify-tinderbox-orig with
31bit Smis: Many object properties become heap
numbers, and printing an integer which is
represented as a double is slower than printing
the integer directly.

Change-Id: I9a14c4da61721b6c3f22e88145acc6a61ed4a419
Bug: v8:8344
Reviewed-on: https://chromium-review.googlesource.com/c/1382741
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58358}
2018-12-19 12:10:50 +00:00
Toon Verwaest
89a64f04d1 [parser] Eagerly throw pattern error even if we lazily throw lhs error for calls
We don't eagerly throw for assignments to calls; see v8:4480. They are simply
turned into assignments to Property instead. We need to record a declaration
error, however. Otherwise we'll end up with a Property in a declaration
context.

To reduce the scope of the lazy throwing, in this fix I record a pattern error
instead, making calls as assignment target in a destructuring assignment
context throw eagerly.

Bug: chromium:916288
Change-Id: If94a46b5d2b65c3549c641e0e19135c6c8af7a9a
Reviewed-on: https://chromium-review.googlesource.com/c/1384084
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58357}
2018-12-19 11:39:30 +00:00
Clemens Hammacher
9efa28bf00 Revert "Do not allocate feedback vectors and feedback metadata in lite mode"
This reverts commit 62e86b88e5.

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

Original change's description:
> Do not allocate feedback vectors and feedback metadata in lite mode
> 
> Don't allocate feedback vectors and feedback metadata in lite mode.
> Also updates to skip tests that require feedback vectors.
> 
> Bug: v8:8394
> Change-Id: I22c64a32c44bb8f25fb09003d6e9fc5a04e84f8a
> Reviewed-on: https://chromium-review.googlesource.com/c/1378173
> Commit-Queue: Mythri Alle <mythria@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58351}

TBR=rmcilroy@chromium.org,yangguo@chromium.org,mlippautz@chromium.org,mythria@chromium.org

Change-Id: I88fd37ea4e21aa2cc81eceb87ddb35c23224beae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8394
Reviewed-on: https://chromium-review.googlesource.com/c/1384087
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58355}
2018-12-19 11:31:32 +00:00
Toon Verwaest
a5f559c3f8 [parser] Change how catch is parsed
- Directly declares the special catch variable from the parser-base.
- Tracks Scope on PreParserBlock and finds conflicting lexical declarations by
  simply walking the VariableMap of the block inserted for the pattern; or the
  catch variable in case of identifier.
- This also enables throwing errors for duplicate let in the preparser. We may
  have to back that out if it breaks something.

Bug: v8:2728, v8:7828
Change-Id: Id2eea62062533eb99cd6670c42a4b1da87139008
Reviewed-on: https://chromium-review.googlesource.com/c/1382095
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58353}
2018-12-19 11:02:01 +00:00
Mythri
62e86b88e5 Do not allocate feedback vectors and feedback metadata in lite mode
Don't allocate feedback vectors and feedback metadata in lite mode.
Also updates to skip tests that require feedback vectors.

Bug: v8:8394
Change-Id: I22c64a32c44bb8f25fb09003d6e9fc5a04e84f8a
Reviewed-on: https://chromium-review.googlesource.com/c/1378173
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58351}
2018-12-19 10:30:48 +00:00
Sigurd Schneider
5c38b47af5 [assembler] Factor out Registers from assembler.h
This refactoring reduces the LoC after preprocessor expansion by 370,322

gen         (   21 files):    71,503 to    1,631,168 (   23x)
src         (  624 files):   367,639 to   53,231,764 (  145x)
test        (  392 files):   490,770 to   37,450,839 (   76x)
third_party (  432 files):   239,085 to    9,547,902 (   40x)
total       ( 1521 files): 1,183,681 to  102,836,194 (   87x)

gen         (   21 files):    71,503 to    1,613,222 (   23x)
src         (  624 files):   367,634 to   52,964,046 (  144x)
test        (  392 files):   490,771 to   37,366,181 (   76x)
third_party (  432 files):   239,085 to    9,547,902 (   40x)
total       ( 1521 files): 1,183,677 to  102,465,872 (   87x)

Bug: v8:8562
Change-Id: Ib4e771c37471a2ff19c5538e62c038943cc74eaf
Reviewed-on: https://chromium-review.googlesource.com/c/1382469
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58349}
2018-12-19 09:18:20 +00:00
Toon Verwaest
5c0e5a5b56 [parser] Fix late-checked destructuring pattern followed by property (2)
Now just accumulate right before we might validate a property and once we're
done, so we're guaranteed to catch all PatternErrors.

Bug: v8:8607
Change-Id: Ibc5bc7773756f4827868ca01d0f9fb0c5545e59b
Reviewed-on: https://chromium-review.googlesource.com/c/1382749
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58343}
2018-12-18 20:10:36 +00:00
Toon Verwaest
81a11c173b [parser] Fix late-checked destructuring pattern followed by property
Otherwise the error would have been dropped between the previous
accumulate and the subsequent ValidateExpression.

Bug: v8:8607
Change-Id: I29f5d5b6887b57f4b70369ba370fe0b44b1d6798
Reviewed-on: https://chromium-review.googlesource.com/c/1382744
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58339}
2018-12-18 17:52:10 +00:00
Mythri
2ea009086f Fix ObjectToString builtin to work for subclasses
When we call ObjectToString on JSValues we only looked at string tags
on the prototype map of the JSValue's value type and do not check the
tags on the JSValue's prototype chain which may be non-trivial if
subclassing is involved. For ex: if we have a class Test extend Number,
we only looked for tags on the Number prototype and not on the Test
prototype. This cl fixes the builtin to also check for these cases.


Bug: v8:7706
Change-Id: I9f0e3bb6499646bf27b92bf4fb4e9014f6efa56b
Reviewed-on: https://chromium-review.googlesource.com/c/1378176
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58338}
2018-12-18 17:33:50 +00:00
Georg Neis
63ce4ba47a Reland "Use CopyElements (which uses memcpy) to copy FixedDoubleArray."
This is a reland of fac6f63eb8, after
adding initialization of unused element slots.

Original change's description:
> Use CopyElements (which uses memcpy) to copy FixedDoubleArray.
>
> This improves the performance of ExtractFixedArray and
> CloneFastJSArray for double arrays, which in turn improve the
> performance of cloning double arrays with slice() or spreading.
>
> This, however, does not improve performance of spreading holey
> double arrays, because spreading needs extra work to convert
> holes to undefined.
>
> Bug: v8:7980
> Change-Id: Ib8aed74abbb0b06982a3b754e134fa415cb7de2d
> Reviewed-on: https://chromium-review.googlesource.com/c/1280308
> Reviewed-by: Michael Stanton <mvstanton@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Commit-Queue: Hai Dang <dhai@google.com>
> Cr-Commit-Position: refs/heads/master@{#56680}

Bug: v8:7980
Change-Id: I899af60c061b9cd6eb619c247c5fc515b92e9fd7
Reviewed-on: https://chromium-review.googlesource.com/c/1382735
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58333}
2018-12-18 16:34:49 +00:00
Toon Verwaest
dde5e3a134 [parser] Detect duplciate lexical declarations in preparser
This changes how rewind upon preparser abort works. It now rewinds to the start
of the parameter scope. In the case of "function X(" it is before the "(". In
the case of arrow functions it's before the start of the arrow function. This
allows us to reparse the arrow function from the start so all parameters are
declared properly.

Bug: v8:2728, v8:7390
Change-Id: I1c40056a49ec198560e63cd73949a59221ee0401
Reviewed-on: https://chromium-review.googlesource.com/c/1382736
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58332}
2018-12-18 16:32:28 +00:00
peterwmwong
682db7845c [typedarray] Add TA.p.toLocaleString check for a detached buffer.
Bug: chromium:915783
Change-Id: I053ee6e905a98e0aafcabcf0838ada836a05c181
Reviewed-on: https://chromium-review.googlesource.com/c/1382553
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Peter Wong <peter.wm.wong@gmail.com>
Cr-Commit-Position: refs/heads/master@{#58327}
2018-12-18 15:06:15 +00:00
Ross McIlroy
1a5d6a5384 [Compiler] Fix flaky tsan error for bytecode flushing.
The SFI's flags can be changed by the mutator while the concurrent marker is checking
the flags for bytecode flushing. None of the flag bits checked for bytecode flushing
are changed, however since they are in an int32 field TSAN will complain if any of the
other flags are changed while reading from another flag. Fix this by making the flags
use the RELAXED_INT32_ACCESSORS.

BUG=v8:8592,v8:8395

Change-Id: I5fbb4fd381c2b288abf0cd36eb0b8256e1929af6
Reviewed-on: https://chromium-review.googlesource.com/c/1382458
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58325}
2018-12-18 14:49:13 +00:00
Andreas Haas
32562e91af [wasm][anyref] Implement anyref globals
This CL implements the global.get and global.set instruction for anyref
globals. This includes:

* Properly decode anyref globals.
* Add a FixedArray to WasmInstanceObject to store anyref globals.
* Initialize the FixedArray.
* Generate code for global.get and global set.

This CL does not allow to import globals yet.

R=clemensh@chromium.org

Bug: v8:7581
Change-Id: I62617409271d9b6f2253a191681189865aa1f459
Reviewed-on: https://chromium-review.googlesource.com/c/1380112
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58318}
2018-12-18 13:28:34 +00:00
Ross McIlroy
11a4da99d2 [Deflake] Fix data-race relating to accessing FLAG_* on worker thread during background compile
The parser object can now be created on a worker thread, therefore we shouldn't access
global FLAGs during the constructor. Instead move them to the ParseInfo constructor
and set the parser fields based on these. Also avoid accessing always_opt flags in
bytecode-flags - instead accessing it in ParseInfo and propagating to the bytecode
generator.

Also gets rid of unused kUntrustedCodeMitigations flag in UnoptimizedCompilationInfo

BUG=v8:8582

Change-Id: I6e6fdc8cc7865803cb5f334f652abc0e3e4cb3ce
Reviewed-on: https://chromium-review.googlesource.com/c/1375918
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58316}
2018-12-18 12:49:23 +00:00
Yang Guo
c30e65e15b [api] simplify String::WriteToUtf8.
Since we always flatten the string upfront, we don't need to
implement the the UTF8 conversion as a string visitor anymore.

R=petermarshall@chromium.org

Bug: v8:6780, v8:8605
Change-Id: I27946551d7c3742f47ac36d5c909c19a7f2b0371
Reviewed-on: https://chromium-review.googlesource.com/c/1371828
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58312}
2018-12-18 11:08:04 +00:00
Jakob Gruber
6cf1341975 Reland "[snapshot] Clear irregexp code prior to serialization"
This is a reland of 1efe6259a8

Original change's description:
> [snapshot] Clear irregexp code prior to serialization
> 
> Compiled irregexp code should be cleared unless
> FunctionCodeHandling::kKeep is passed.
> 
> Bug: v8:8572
> Change-Id: Icb74cc6e0f39a69f8383b05f1638cf0e3be1807c
> Reviewed-on: https://chromium-review.googlesource.com/c/1373773
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58272}

Bug: v8:8572
Change-Id: I2dfe0c1b4419c47fe2a1916c3bc16800a30309c5
Reviewed-on: https://chromium-review.googlesource.com/c/1379937
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58308}
2018-12-18 08:35:50 +00:00
Toon Verwaest
d1b4e31bc5 [parser] Replacing ExpressionClassifier with ExpressionScope that knows what it's tracking
Since it's explicit what we're tracking, we can immediately throw errors in
certain cases, and ignore irrelevant errors. We don't need to use the
classifier itself to track "let let", since we know whether we're parsing a
"let". Errors that were previously (almost) always accumulated are now
immediately pushed to the scopes that care (parameter initialization errors).

This CL drops avoiding allocation of classified errors, at least for now, but
that doesn't affect performance anymore since we don't aggressively blacklist
anymore. Classified errors are even less likely with the more precise approach.

ParseAssignmentExpression doesn't introduce its own scope immediately, but
reuses the outer scope.

Rather than using full ExpressionClassifiers + Accumulate to separate
expressions/patterns from each other while keeping track of the overall error
state, this now uses an explicit AccumulationScope.

When we parse (async) arrow functions we introduce new scopes
that track that they may be (async) arrow functions.

We track StrictModeFormal parameters in 2 different ways if it isn't
immediately certain that it is a strict-mode formal error: Either directly on
the (Pre)ParserFormalParameters, or on the NextArrowFunctionInfo in the case
we're not yet certain that we'll have an arrow function. In the latter case we
don't have a FormalParameter object yet, and we'll copy it over once we know
we're parsing an arrow function. The latter works because it's not allowed to
change strictness of a function with non-simple parameters.

Design doc:
https://docs.google.com/document/d/1FAvEp9EUK-G8kHfDIEo_385Hs2SUBCYbJ5H-NnLvq8M/

Change-Id: If4ecd717c9780095c7ddc859c8945b3d7d268a9d
Reviewed-on: https://chromium-review.googlesource.com/c/1367809
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58307}
2018-12-18 08:32:30 +00:00
Marja Hölttä
34f8d88d9a [js weak refs] Add simple cctests for JSWeakRefs
BUG=v8:8179

Change-Id: I8ef7d3b576db9e872ab527895f5ba3be4ba3f6ce
Reviewed-on: https://chromium-review.googlesource.com/c/1379881
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58304}
2018-12-18 07:56:29 +00:00
Maxim Mazurok
ff746139fd Fixed typo and added new author
- Changed "Formating" to "Formatting" in comment
- Added Maxim Mazurok <maxim@mazurok.com> to AUTHORS file as required by
https://www.chromium.org/developers/contributing-code#TOC-Legal-stuff

Change-Id: I48633694975879013c983580fa9b8c71dcb2e8f4
Reviewed-on: https://chromium-review.googlesource.com/c/1379231
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58303}
2018-12-18 07:27:19 +00:00
Frank Tang
8c3112733a [Intl] Rename position to index in Intl.Segmenter
Sync with
https://github.com/tc39/proposal-intl-segmenter/pull/55
and
https://github.com/tc39/test262/pull/1994

Bug: v8:8588
Change-Id: Ifc46779f156ea986e3dbe6a632a781bb7134112b
Reviewed-on: https://chromium-review.googlesource.com/c/1374997
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58301}
2018-12-18 05:39:35 +00:00
Frank Tang
cc494cd3f9 [Intl] Sync Intl.Segmenter w/ latest spec
Change the initial value of breakType to undefined
Store break type into bits
Change the algorithm

Bug: v8:6891
Change-Id: Id2cc1e90c28d92364318928fc8a377f172ebb339
Reviewed-on: https://chromium-review.googlesource.com/c/1374996
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58298}
2018-12-17 23:00:06 +00:00
Frank Tang
57d4b8e619 [test262] test262 roll
Bug: v8:7834
Change-Id: Id8018c01e757741aad9ecbdf331bfb1a4b050d81
Reviewed-on: https://chromium-review.googlesource.com/c/1379570
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58296}
2018-12-17 21:42:54 +00:00
Jakob Kummerow
766ef168fb [objects.h splitting] Move HeapNumber to heap-number.h
Along with HeapNumberBase and MutableHeapNumber, of course.

Bug: v8:5402
Change-Id: I14a7f8052de3839cad36bb7e4ebb6da38b2ac096
Reviewed-on: https://chromium-review.googlesource.com/c/1379884
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58293}
2018-12-17 17:58:09 +00:00
Clemens Hammacher
d637ab9141 [c++11] Replace V8_ALIGNAS and V8_ALIGNED by alignas
C++ introduces the {alignas} keyword, which can be used with types or
integral constant expressions. Use this instead of the V8_ALIGNAS (for
types) or V8_ALIGNED (for integral constants) macros.

R=ulan@chromium.org

Bug: v8:8562
Change-Id: I54999b56a5715237f88c63d8543ef728a5b2eff5
Reviewed-on: https://chromium-review.googlesource.com/c/1379935
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58290}
2018-12-17 16:03:59 +00:00
Jakob Kummerow
b5a2839b92 [objects.h splitting] Move FreeSpace to free-space.h
Bug: v8:5402
Change-Id: I07f276dc6a06a2850aaae0a5ee4cbbfd27d8aa81
Reviewed-on: https://chromium-review.googlesource.com/c/1379875
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58289}
2018-12-17 15:56:39 +00:00
Camillo Bruni
2ba5c10db1 [scope] Use contains_asm_module_ bit to bypass recursive checks
Parser::MaybeResetCharacterStream calls Scope::ContainsAsmModule which
recursively checks whether a Scope is an asm module or any of its
sub-scopes. This is sub-optimal for deeply nested scopes and many
functions which do not contain any asm modules.

Drive-by-fix:
- rename Scope::asm_module to Scope::is_asm_module


Change-Id: I922270c608b54c6525f0672ead4aca90f57a6551
Reviewed-on: https://chromium-review.googlesource.com/c/1360636
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58288}
2018-12-17 15:48:59 +00:00
Jakob Kummerow
7520a0fab8 [ubsan] Port Struct subclasses, part 10
Tuple2 and subclasses: EnumCache, SourcePositionTableWithFrameCache,
TemplateObjectDescription

Bug: v8:3770
Change-Id: Icff0860a04445dda542119834ef9866167ba2263
Reviewed-on: https://chromium-review.googlesource.com/c/1377772
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58287}
2018-12-17 15:47:54 +00:00
Jakob Gruber
fa3cbf60d5 [nojit] Change builtin pointers to use Smis underneath
This changes Torque's builtin pointers to use a Smi representation
underneath instead of storing the Code target object. Callsites look
up the target entry point through IsolateData::builtin_entry_table.

The notable effect of this CL is that builtin pointer calls no longer
call any on-heap Code.

Bug: v8:7777
Change-Id: Ibf6c749dd46cae7aba51494b09921229dd436f63
Reviewed-on: https://chromium-review.googlesource.com/c/1379880
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58286}
2018-12-17 15:35:59 +00:00
Marja Hölttä
23ab6b685c [iwyu] Remove include factory.h -> js-array-buffer.h
BUG=v8:7490,v8:8562

Change-Id: Ie3e277fef97900dbefbf08cb02f6c03e8dd408b7
Reviewed-on: https://chromium-review.googlesource.com/c/1379877
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58285}
2018-12-17 15:34:54 +00:00