Commit Graph

21233 Commits

Author SHA1 Message Date
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
Jakob Kummerow
ecdcae8492 [ubsan] Port Struct subclasses, part 9
CallbackInfo, InterceptorInfo, Tuple3

Bug: v8:3770
Change-Id: I47a380949c031ed9eba0e5a7d752669efc0af76c
Reviewed-on: https://chromium-review.googlesource.com/c/1377771
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58284}
2018-12-17 15:00:34 +00:00
Jakob Kummerow
c911f91b5b [objects.h splitting] Move Foreign to foreign.h
Bug: v8:5402
Change-Id: Ifdbc61eb401160d03b98336292f1725d604e7f51
Reviewed-on: https://chromium-review.googlesource.com/c/1379936
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58283}
2018-12-17 14:33:02 +00:00
Jakob Kummerow
824596aa28 [ubsan] Replace a few more Object** with alternatives
Either Address* or Handle<Object> or ObjectSlot, depending on
circumstances.

Bug: v8:3770
Change-Id: Id00dfede6eb92ec30b658c0090b5310548ba5162
Reviewed-on: https://chromium-review.googlesource.com/c/1379228
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58282}
2018-12-17 14:17:22 +00:00
Clemens Hammacher
e7cdc378de Reduce input size limit of parser fuzzer to 2kB
R=mmoroz@chromium.org

Bug: chromium:911644
Change-Id: Icc42e5ace80ea816925c95e2ea330b484b68e7cf
Reviewed-on: https://chromium-review.googlesource.com/c/1379878
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58280}
2018-12-17 13:39:05 +00:00
Jakob Kummerow
8dc9e26eda [ubsan] Port Struct subclasses, part 8: Script
Bug: v8:3770
Change-Id: Id7a05e5687d36c9347f35f6f3276af2a4b6115fd
Reviewed-on: https://chromium-review.googlesource.com/c/1377770
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58279}
2018-12-17 13:36:35 +00:00
Sigurd Schneider
01b0afd527 Reland "[assembler] Split out CPUFeatures into its own file"
This is a reland of 3ad101f5bf

Original change's description:
> [assembler] Split out CPUFeatures into its own file
>
> This reduces the preprocessor expanded source size by 84,675 LoC:
>
> gen         (   20 files):    71,349 to    1,523,934 (   21x)
> src         (  624 files):   367,410 to   53,253,894 (  145x)
> test        (  392 files):   490,503 to   37,436,176 (   76x)
> third_party (  432 files):   239,085 to    9,547,902 (   40x)
> total       ( 1520 files): 1,183,031 to  102,736,424 (   87x)
>
> to
>
> gen         (   20 files):    71,349 to    1,523,794 (   21x)
> src         (  624 files):   367,411 to   53,186,896 (  145x)
> test        (  392 files):   490,504 to   37,418,639 (   76x)
> third_party (  432 files):   239,085 to    9,547,902 (   40x)
> total       ( 1520 files): 1,183,033 to  102,651,749 (   87x)
>
>
> Change-Id: Ia8a79092051a42815b65e86a0784297915368c9b
> Reviewed-on: https://chromium-review.googlesource.com/c/1291471
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
> Reviewed-by: Marja Hölttä <marja@chromium.org>
> Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58266}

TBR=marja@chromium.org,clemensh@chromium.org,ulan@chromium.org

Change-Id: I5b857666508b1c80dcadd0b470aada37dd49077e
Reviewed-on: https://chromium-review.googlesource.com/c/1379872
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58278}
2018-12-17 12:33:39 +00:00
Jakob Kummerow
ec04cd33fc [ubsan] Port Struct subclasses, part 6
FeedbackCell, FunctionTemplateRareData, TemplateInfo,
FunctionTemplateInfo, ObjectTemplateInfo

Bug: v8:3770
Change-Id: Ic30ff2563fe30088b7740d5e98ade03cdae7fdd8
Reviewed-on: https://chromium-review.googlesource.com/c/1377459
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58274}
2018-12-17 11:34:43 +00:00
Maya Lekova
e24c2b91d2 Revert "[snapshot] Clear irregexp code prior to serialization"
This reverts commit 1efe6259a8.

Reason for revert: Broken V8 Linux - arm - sim - lite build - https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20arm%20-%20sim%20-%20lite/1259

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}

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

Change-Id: I7a8c7f5c1500714bccee5c11224fbdf0132c6d78
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8572
Reviewed-on: https://chromium-review.googlesource.com/c/1379874
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58273}
2018-12-17 11:33:39 +00:00
Jakob Gruber
1efe6259a8 [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}
2018-12-17 11:09:58 +00:00
Yang Guo
d945ea7616 [value serializer] check for stack overflow for verify object count.
R=jgruber@chromium.org

Bug: chromium:915435
Change-Id: Ic5535adb2aa09ffc72bf4e50ff8ec624dea1909e
Reviewed-on: https://chromium-review.googlesource.com/c/1379932
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58270}
2018-12-17 10:21:18 +00:00
Maya Lekova
316b152a30 Revert "[assembler] Split out CPUFeatures into its own file"
This reverts commit 3ad101f5bf.

Reason for revert: Broken Android Arm64 debug builder - https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Android%20Arm64%20-%20debug%20builder/3089

Original change's description:
> [assembler] Split out CPUFeatures into its own file
> 
> This reduces the preprocessor expanded source size by 84,675 LoC:
> 
> gen         (   20 files):    71,349 to    1,523,934 (   21x)
> src         (  624 files):   367,410 to   53,253,894 (  145x)
> test        (  392 files):   490,503 to   37,436,176 (   76x)
> third_party (  432 files):   239,085 to    9,547,902 (   40x)
> total       ( 1520 files): 1,183,031 to  102,736,424 (   87x)
> 
> to
> 
> gen         (   20 files):    71,349 to    1,523,794 (   21x)
> src         (  624 files):   367,411 to   53,186,896 (  145x)
> test        (  392 files):   490,504 to   37,418,639 (   76x)
> third_party (  432 files):   239,085 to    9,547,902 (   40x)
> total       ( 1520 files): 1,183,033 to  102,651,749 (   87x)
> 
> 
> Change-Id: Ia8a79092051a42815b65e86a0784297915368c9b
> Reviewed-on: https://chromium-review.googlesource.com/c/1291471
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
> Reviewed-by: Marja Hölttä <marja@chromium.org>
> Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58266}

TBR=ulan@chromium.org,marja@chromium.org,sigurds@chromium.org,clemensh@chromium.org

Change-Id: I111f9bbef9e66cd1ee7f4206b6af1097f7c50e66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/1379933
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58268}
2018-12-17 10:15:09 +00:00
Sigurd Schneider
6720666064 [test] Ensure random generator in JSTests does not use float arithmetic
Change-Id: I3530c3f50fdb805d68099108dc33d93abe6bdb39
Bug: v8:8344
Reviewed-on: https://chromium-review.googlesource.com/c/1379931
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58267}
2018-12-17 10:05:08 +00:00
Sigurd Schneider
3ad101f5bf [assembler] Split out CPUFeatures into its own file
This reduces the preprocessor expanded source size by 84,675 LoC:

gen         (   20 files):    71,349 to    1,523,934 (   21x)
src         (  624 files):   367,410 to   53,253,894 (  145x)
test        (  392 files):   490,503 to   37,436,176 (   76x)
third_party (  432 files):   239,085 to    9,547,902 (   40x)
total       ( 1520 files): 1,183,031 to  102,736,424 (   87x)

to

gen         (   20 files):    71,349 to    1,523,794 (   21x)
src         (  624 files):   367,411 to   53,186,896 (  145x)
test        (  392 files):   490,504 to   37,418,639 (   76x)
third_party (  432 files):   239,085 to    9,547,902 (   40x)
total       ( 1520 files): 1,183,033 to  102,651,749 (   87x)


Change-Id: Ia8a79092051a42815b65e86a0784297915368c9b
Reviewed-on: https://chromium-review.googlesource.com/c/1291471
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58266}
2018-12-17 10:03:18 +00:00
Yang Guo
91ac1341c7 Revert "[esnext] ship Object.fromEntries"
This reverts commit dde25872f5.

Reason for revert: GC-Stress failures https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/23168

Original change's description:
> [esnext] ship Object.fromEntries
> 
> Enable --harmony-object-from-entries by default.
> 
> Object.fromEntries is a new standard library method, whose proposal
> (https://tc39.github.io/proposal-object-from-entries/) is currently
> at stage 3.
> 
> It simply creates a JSObject from an iterable collection of key/value
> pairs, such that `Object.fromEntries([ [ "a", "b" ] ]) -> { a: "b" }`
> 
> BUG=v8:8021
> R=​gsathya@chromium.org, adamk@chromium.org
> 
> Change-Id: Ib55bb6ca43727d66b471c0fd14845735c1ca2894
> Reviewed-on: https://chromium-review.googlesource.com/c/1373918
> Commit-Queue: Caitlin Potter <caitp@igalia.com>
> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58262}

TBR=adamk@chromium.org,gsathya@chromium.org,caitp@igalia.com

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

Bug: v8:8021
Change-Id: Id9582e2710ee6b46be3fbac1cbafefd5c0151cd0
Reviewed-on: https://chromium-review.googlesource.com/c/1379871
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58265}
2018-12-17 09:48:38 +00:00
Marja Hölttä
fef6f8eddc [js weak refs] Migrate the WeakRef parts into the new API
New API is here: https://github.com/tc39/proposal-weakrefs/issues/55

The WeakCell parts stay in the old API, resulting in temporary code duplication
in some parts. Those parts will go away once the WeakCell-related parts are
migrated to the new API (but the spec needs some work first).

BUG=v8:8179

Change-Id: I81ca824a14d830e3c5fa515d5ad7e5f78c10e19d
Reviewed-on: https://chromium-review.googlesource.com/c/1378171
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58264}
2018-12-17 08:58:56 +00:00
Caitlin Potter
dde25872f5 [esnext] ship Object.fromEntries
Enable --harmony-object-from-entries by default.

Object.fromEntries is a new standard library method, whose proposal
(https://tc39.github.io/proposal-object-from-entries/) is currently
at stage 3.

It simply creates a JSObject from an iterable collection of key/value
pairs, such that `Object.fromEntries([ [ "a", "b" ] ]) -> { a: "b" }`

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

Change-Id: Ib55bb6ca43727d66b471c0fd14845735c1ca2894
Reviewed-on: https://chromium-review.googlesource.com/c/1373918
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58262}
2018-12-15 17:13:02 +00:00
Frank Tang
33408e6e3d [Intl] Add date-format/check-hc-option.js
Bug: v8:7482
Change-Id: Icd3383e350555907c01ec65d2620477973117ea3
Reviewed-on: https://chromium-review.googlesource.com/c/1368864
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58258}
2018-12-14 23:39:50 +00:00
Jakob Kummerow
2a5415c40e Fix build after CL collision
https://chromium-review.googlesource.com/c/v8/v8/+/1377455 and
https://chromium-review.googlesource.com/c/v8/v8/+/1363143 passed
the commit queue individually, but need a one-line adaptation in
order to work together.

TBR=jgruber@chromium.org

No-Tree-Checks: true
No-Try: true
Change-Id: Id04344f1440ffa797ca852aff63acbbcbe57065c
Reviewed-on: https://chromium-review.googlesource.com/c/1378690
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58257}
2018-12-14 23:35:00 +00:00
Jakob Kummerow
c31f33b212 [ubsan] Port Struct subclasses, part 2
AllocationMemento, AllocationSite, ArrayBoilerplateDescription

Bug: v8:3770
Change-Id: I0081d222c73d9d66ba35ae28e73b6388e4e58ac0
Reviewed-on: https://chromium-review.googlesource.com/c/1377455
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58255}
2018-12-14 20:43:54 +00:00
Jakob Kummerow
4552a7e66b [ubsan] Port Struct subclasses, part 1
AccessCheckInfo, AccessorInfo, AccessorPair, AliasedArgumentsEntry

Bug: v8:3770
Change-Id: I4bc3aebae2637daa4b0066d3946f1bfae8055f84
Reviewed-on: https://chromium-review.googlesource.com/c/1377454
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58254}
2018-12-14 20:31:54 +00:00
Daniel Clifford
a74afec6ba [builtins] Port GetArgumentsFrameAndCount to Torque
In the process, add the bint type (which stands for Best-INTeger),
which implements Torque's idea of CSA's ParameterMode. It maps to
a different type on 32-bit (Smi) and 64-bit (intptr). There are
convert operators that are either no-ops or conversions
to-and-from Smi and intptrs on the each platform, depending on
the underlying type for bint. This allows Torque code to git most
of the benefits of ParameterMode without having to explicitly
pass around the mode, since it is almost always OptimalMode anyways.

Change-Id: I92e08adc1d79cb3e24576c96f9734aec1af54162
Reviewed-on: https://chromium-review.googlesource.com/c/1361160
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58253}
2018-12-14 20:21:50 +00:00
Jakob Kummerow
19da9f24df [objects.h splitting] Move Struct to struct.h
along with subclasses: Tuple2, Tuple3, FeedbackCell, AccessorPair.
The latter two can be separated out later if desired.

Bug: v8:5402
Change-Id: I4e1a6d2621cc6f96b5da208cff0da7cd5de91672
Reviewed-on: https://chromium-review.googlesource.com/c/1371038
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58251}
2018-12-14 19:56:53 +00:00
peterwmwong
76cb4fe626 [esnext] Ship String.p.matchAll/RegExp.p.[@@matchAll]
Enable --harmony-string-matchall by default.

String.prototype.matchAll behaves similarly to
String.prototype.match, but returns a full regexp
result object for each match in a global or sticky
regexp. This offers a simple way to iterate over
matches when access to e.g. capture groups is
needed.

const string = 'a b c';
const regex = /[ac]/g;
for (const match of string.matchAll(regex)) {
  console.log(`${match[0]} at ${match.index}`);
}
// a at 0
// c at 4

More information can be found here:
https://github.com/tc39/proposal-string-matchall

Drive-by: Update debug evaluate side effect
expectations to handle String.p.matchAll and
RegExp.p[@@matchAll]

Bug: v8:6890
Change-Id: Ie3e712af66689936b7d2a15df705b792ccf06bd3
Reviewed-on: https://chromium-review.googlesource.com/c/1377774
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Peter Wong <peter.wm.wong@gmail.com>
Cr-Commit-Position: refs/heads/master@{#58250}
2018-12-14 18:32:51 +00:00
Jeremy Roman
8494c583ca ValueSerializer: Report if buffer expansion fails during WriteHostObject.
Also fail early if we detect that we've previously run out of memory and thus
corrupted the buffer.

Add a unit test for this kind of case.

Bug: chromium:914731
Change-Id: Iaaf3927209bffeab6fe8ba462d9dd9dad8cbbe2f
Reviewed-on: https://chromium-review.googlesource.com/c/1377449
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58248}
2018-12-14 16:41:52 +00:00
Tamer Tas
2a7a827f68 [tools] skipping the debug mode in status files imply skipping in dcheck_always_on as well
R=machenbach@chromium.org
CC=yangguo@chromium.org

Bug: v8:8491
Change-Id: I8379825c194e588da582a3000201eea75b59140a
Reviewed-on: https://chromium-review.googlesource.com/c/1371826
Commit-Queue: Tamer Tas <tmrts@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58243}
2018-12-14 14:26:49 +00:00
Camillo Bruni
fb434f1c6c [runtime] Fix Runtime_InternalSetPrototype
Do not set the name property on any function or classes. This is not
required as per spec #sec-__proto__-property-names-in-object-initializers.

Bug: v8:7773
Change-Id: Iade96573690e5b14b60434c37683f782cf9cb2cb
Reviewed-on: https://chromium-review.googlesource.com/c/1375912
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58239}
2018-12-14 12:06:04 +00:00
Alessandro Pignotti
5f6b780374 OwnedByAddressingOperand should also allow uses by ProtectedLoad
ProtectedLoad/ProtectedStore opcodes are used in WebAssembly to represent memory
accesses. Since they are not part of the allowed opcodes in OwnedByAddressingOperand
it is not possible to take advantage of addressing modes to encode common patterns
for the pointer input value.

R=jarin@chromium.org

Bug: v8:8508
Change-Id: Ic62bf13fed7b1d86afb112d9aa59cd7073a28e72
Reviewed-on: https://chromium-review.googlesource.com/c/1354458
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58237}
2018-12-14 09:39:55 +00:00
Maya Lekova
3dbb374938 [test] Fix flaky wasm test and add stable regression test
Remove a DCHECK that got triggered in the rare condition that GC kicks in
during CompilationDependencies::Commit, changing the pretenuring decision,
thus leading to deoptimization. To make sure this rare case is properly
handled, add a new FLAG_pretenure_during_compilation and a cctest that
simulates it predictably.

R=jarin@chromium.org,mvstanton@chromium.org

Bug: v8:8520
Change-Id: If83f8a3d4659a694357b3869c931c7d7c164fd1a
Reviewed-on: https://chromium-review.googlesource.com/c/1363143
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58236}
2018-12-14 09:32:59 +00:00
Jakob Kummerow
2cce5c52c2 Make RegExpFlagsFromString faster
The new ObjectPtr design makes non-inlined helper functions a little
more expensive because "this" is always a pointer where pass-by-value
would be more efficient, which is an issue for functions whose size puts
them right at the threshold of getting inlined or not. String::Get falls
into this category when called from RegExpFlagsFromString. In this case,
we can do even better than restoring inlineability by fine-tuning
the control flow a bit.

This should repair the regression in crbug.com/910573

Bug: chromium:910573
Change-Id: Ie6b68ef01cd978ec502d8d6c1da788c77422dce7
Reviewed-on: https://chromium-review.googlesource.com/c/1369087
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58234}
2018-12-14 01:25:02 +00:00