Commit Graph

51817 Commits

Author SHA1 Message Date
Dan Elphick
e896905547 [snapshot] Clean up Strong root iteration in deserialization
When deserializing the startup snapshot, call IterateStrongRoots with
VISIT_FOR_SERIALIZATION rather than VISIT_ONLY_STRONG. To compensate,
make the StartupDeserializer explicitly iterate over the partial
snapshot cache.

This makes the deserializer and serializer consistent in their use of
the function and makes their differences explicit in the snapshot code
itself.

Bug: chromium:902230
Change-Id: I3a2ac858f4f6b3097b98a10ed2dd5ac5b9bf83e8
Reviewed-on: https://chromium-review.googlesource.com/c/1319585
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57275}
2018-11-06 12:55:35 +00:00
Sathya Gunasekaran
8fd5fa2238 [Intl] Validate extension keys
- Fix ParseBCP47 to return just the extension. The second argument to
  substr function is actually the length, not the end position of the
  substring :')
- Remove extension keys that aren't part of the relevant extension keys
- Use 'ca' as an relevant extension key for DateTimeFormat
- Use the canonicalized locale tag after create the ICU locale is
  created, rather than the input locale tag.

Bug: chromium:895942, v8:5751
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I189709714d847e684b04409b734a60ff04ed7dd2
Reviewed-on: https://chromium-review.googlesource.com/c/1291076
Reviewed-by: Frank Tang <ftang@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57274}
2018-11-06 12:11:50 +00:00
Mike Stanton
9681eb5fa9 [Builtins] Create DWARF debugging info for JavaScript builtins
Bug: v8:8418
Change-Id: I6d2efdf87bb4fc5454e5a4ee8e5a66463533615e
Reviewed-on: https://chromium-review.googlesource.com/c/1317810
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57273}
2018-11-06 12:06:30 +00:00
Yang Guo
4495cba3d6 [snapshot] clear internal fields that are serialized by callback
This is to ensure the snapshot is deterministic.

Internal fields can contain:
- reference to heap object
- embedder-defined aligned pointer
- a smi

The latter two are not distinguishable by V8, so if the serializer
callback returns non-zero value, we consider it to be an aligned pointer
and clear it to ensure that the snapshot does not contain memory
addresses that may not be deterministic. If the callback returns
{ nullptr, 0 } as result, we consider it to be a smi or some in-place
data that we then serialize verbatim.


R=jgruber@chromium.org

Bug: chromium:870584
Change-Id: I3cf9abf135ffd28d8138fa32636b12596b076e13
Reviewed-on: https://chromium-review.googlesource.com/c/1304441
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57272}
2018-11-06 11:48:19 +00:00
Peter Marshall
e18fec6b63 [cpu-profiler] Skip a failing test for multiple isolates
Causing ASAN failures

Bug: v8:5193
Change-Id: I7a899a6390bd1258a1afc8738e85f73239f44a59
Reviewed-on: https://chromium-review.googlesource.com/c/1319583
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57271}
2018-11-06 11:03:40 +00:00
Daniel Clifford
769be76162 Reland "Fix Array.prototype.sort speed regression"
This is a reland of c88994f84c

Turned out to not be the issue.

Original change's description:
> Fix Array.prototype.sort speed regression
>
> CanUseSameAccessor<ElementsAccessor: type> is array-sort.tq is super
> performance-critical. Reverting the type-safe cleanup made in this
> function while landing Array.prototype.slice.
>
> Bug=chromium:852764
>
> Change-Id: I1252d2ff8e431581f916794807e59abb39248abb
> Reviewed-on: https://chromium-review.googlesource.com/c/1317815
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Commit-Queue: Daniel Clifford <danno@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57248}

TBR=danno@chromium.org

Change-Id: I627a131a8525ae4e131c6467561cab9832f3792f
Reviewed-on: https://chromium-review.googlesource.com/c/1319581
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57270}
2018-11-06 10:55:42 +00:00
Georg Neis
9e83f1f2d9 Skip spread fast-path if input string size exceeds kMaxFastArrayLength.
Bug: chromium:901944
Change-Id: Iaf1dfaa5763162ae7952381fb8b64661d85ea1a8
Reviewed-on: https://chromium-review.googlesource.com/c/1317822
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57269}
2018-11-06 10:34:24 +00:00
Toon Verwaest
ab101d05ab [parser] Immediately throw if () isn't followed by =>
Change-Id: Iefea33f47ee4492c9c4d4e105e30f7e2d9128bc7
Reviewed-on: https://chromium-review.googlesource.com/c/1319576
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57268}
2018-11-06 10:23:56 +00:00
Sigurd Schneider
32224e4a14 [turbolizer] Improve page-load performance for >10MB json files
Notry: true
Change-Id: Iacc8aadc62956cf5fab13c60a9eaa52318519d62
Bug: v8:7327
Reviewed-on: https://chromium-review.googlesource.com/c/1317813
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Stephan Herhut <herhut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57267}
2018-11-06 10:22:36 +00:00
Michael Achenbach
9f3d2d55fa [build] Add configs for pointer-compression bots
NOTRY=true
TBR=sergiyb@chromium.org

Bug: v8:8421
Change-Id: Ifbc7271da8a210b197b698f92aad925d3adf7244
Reviewed-on: https://chromium-review.googlesource.com/c/1319579
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57266}
2018-11-06 10:12:23 +00:00
Leszek Swirski
aeb74d1ca0 Revert "Fix Array.prototype.sort speed regression"
This reverts commit c88994f84c.

Reason for revert: Seems to break AccessibilitySelectionTest.List in webkit_unit_tests (https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8-Blink%20Mac/15618)

Original change's description:
> Fix Array.prototype.sort speed regression
> 
> CanUseSameAccessor<ElementsAccessor: type> is array-sort.tq is super
> performance-critical. Reverting the type-safe cleanup made in this
> function while landing Array.prototype.slice.
> 
> Bug=chromium:852764
> 
> Change-Id: I1252d2ff8e431581f916794807e59abb39248abb
> Reviewed-on: https://chromium-review.googlesource.com/c/1317815
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Commit-Queue: Daniel Clifford <danno@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57248}

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

Change-Id: Ie447fd0382fee344326d928398595aa450ccdcca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/1319577
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57265}
2018-11-06 09:50:05 +00:00
Toon Verwaest
2fbbf7ebc7 [parser] Fix error message for invalid property reference
This rethrows the underlying expression error if there is one.

Bug: v8:8409
Change-Id: Icc8253e4006c554df9f6a6d850b087b03d88de2d
Reviewed-on: https://chromium-review.googlesource.com/c/1319570
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57264}
2018-11-06 09:38:37 +00:00
Clemens Hammacher
bd99d02f4a [wasm] Refactor StreamingDecoder to use more Vector
Instead of passing and storing uint8_t* and size_t, we now more often
store a Vector or OwnedVector, which encapsulates these two fields.
This provides some more DCHECKs which happen automatically when getting
a subvector into the buffer.

Drive-by: More refactorings and removals of unneeded or rarely used helper
methods.

R=ahaas@chromium.org

Bug: v8:8238
Change-Id: I1b24f90f1517fc50360854f46c2d001075544858
Reviewed-on: https://chromium-review.googlesource.com/c/1317817
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57263}
2018-11-06 09:08:11 +00:00
Igor Sheludko
47304413cb [disassembler] Better support for roots
In particular, output root name instead of root value when detecting accesses
to roots table. For example:

  REX.W cmpq [r13+0x80] (root (0x391473a00569 <Map[16]>)),rbx
  REX.W movq rdi,[r13+0x18] (root (0x391473a007b9 <Map>))
  REX.W movq rdi,[r13-0x20] (root (0x391473a005b9 <the_hole>))

turns into

  REX.W cmpq [r13+0x80] (root (heap_number_map)),rbx
  REX.W movq rdi,[r13+0x18] (root (fixed_array_map))
  REX.W movq rdi,[r13-0x20] (root (the_hole_value))

Bug: v8:8238
Change-Id: I0f7bdcb7774a2fe450f930c1bc2f3ccd03064201
Reviewed-on: https://chromium-review.googlesource.com/c/1317823
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57262}
2018-11-06 09:07:02 +00:00
Joyee Cheung
0483e9a9ab [api] Allow embedder to construct an Array from Local<Value>*
Currently to obtain a v8::Array out of a C array or a std::vector,
one needs to loop through the elements and call array->Set() multiple
times, and these calls go into v8::Object::Set() which can be slow.
This patch adds a new Array::New overload that converts a
Local<Value>* with known size into a Local<Array>.

Change-Id: I0a768f0e18eec51e78d58be455482ec6425ca188
Reviewed-on: https://chromium-review.googlesource.com/c/1317049
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Cr-Commit-Position: refs/heads/master@{#57261}
2018-11-06 08:17:08 +00:00
Michael Achenbach
3c8e0220f5 Skip slow tests on arm64
TBR=sigurds@chromium.org
NOTRY=true

Bug: v8:7783
Change-Id: I17f1c17be365db7398e7e13dd62a6dd86a6cb008
Reviewed-on: https://chromium-review.googlesource.com/c/1319569
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57260}
2018-11-06 07:54:26 +00:00
tzik
14654f8422 Ensure Isolate::GetEnteredOrMicrotaskContext returns a NativeContext
Unlike other v8::Context getter on v8::Isolate, the v8::Context returned
by GetEnteredOrMicrotaskContext may be non-NativeContext. However,
Blink implicitly assumes all v8::Context is backed by NativeContexts.

This CL updates GetEnteredOrMicrotaskContext() to check the resulting
Context is NativeContext, and updates callers of EnterMicrotaskContext
to use NativeContext.

Change-Id: Ifae528f4ce8feb067f4ad1a43330dc55f4a8ed79
Reviewed-on: https://chromium-review.googlesource.com/c/1301653
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57259}
2018-11-06 04:00:24 +00:00
v8-ci-autoroll-builder
6546405856 Update V8 DEPS.
Rolling v8/build: b5b1fdc..47ccdba

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/03ce64d..9a5dbc6

Rolling v8/third_party/depot_tools: 7e0b0c4..459aaba

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

Change-Id: I24add833a4dee7301efa3f1ee2248351e3864074
Reviewed-on: https://chromium-review.googlesource.com/c/1319250
Reviewed-by: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#57258}
2018-11-06 03:38:06 +00:00
Deepti Gandluri
bdb9e7a517 Revert "[wasm-simd] Implement remaining I8x16 SIMD ops on x64"
This reverts commit de88bfb270.

Reason for revert: Breaks msvc build https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Win64%20-%20msvc/5765

Original change's description:
> [wasm-simd] Implement remaining I8x16 SIMD ops on x64
> 
>  - Implementation for I8x16 Shifts, and Mul
>  - Fix convert bug
>  - Enable all tests except for shuffle tests
> 
> Change-Id: Id1a469d2883c30ea782c51d21dc462d211f94420
> Reviewed-on: https://chromium-review.googlesource.com/c/1318609
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57254}

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

Change-Id: I09efd8002e27f457e89250336e6c3a12d8d9682c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/1318097
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57257}
2018-11-06 00:02:03 +00:00
Adam Klein
64c668a224 Split spread-large.js into five individual tests
This should allow for better parallelization when running these tests.

Change-Id: Ib3cae7d6e8f0d2608470ca616eeac7eecae3b7ab
Reviewed-on: https://chromium-review.googlesource.com/c/1318094
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57256}
2018-11-05 23:33:46 +00:00
v8-ci-autoroll-builder
5cd9436799 Update V8 DEPS.
Rolling v8/build: cd2c8fe..b5b1fdc

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/8c035b3..03ce64d

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

Change-Id: I5df515eea0c133826fcc1a78fb2453a2a8043c98
Reviewed-on: https://chromium-review.googlesource.com/c/1318093
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Reviewed-by: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#57255}
2018-11-05 23:31:22 +00:00
Deepti Gandluri
de88bfb270 [wasm-simd] Implement remaining I8x16 SIMD ops on x64
- Implementation for I8x16 Shifts, and Mul
 - Fix convert bug
 - Enable all tests except for shuffle tests

Change-Id: Id1a469d2883c30ea782c51d21dc462d211f94420
Reviewed-on: https://chromium-review.googlesource.com/c/1318609
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57254}
2018-11-05 23:30:16 +00:00
Sergiy Byelozyorov
691dbd2fbe [tools] Stop passing ensure_logs_on_timeout since it defaults to True now
TBR=machenbach@chromium.org

Bug: chromium:899721
Change-Id: Ifdb4864e47a56cb0fe2565e44e79f3def496b138
Reviewed-on: https://chromium-review.googlesource.com/c/1317821
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57253}
2018-11-05 20:57:55 +00:00
Jakob Kummerow
6d706ae3a0 [ubsan] Port Smi to the new design
and split Smi out of objects.h into smi.h.

Bug: v8:3770, v8:5402
Change-Id: I5ff7461495d29c785a76c79aca2616816a29ab1e
Reviewed-on: https://chromium-review.googlesource.com/c/1313035
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57252}
2018-11-05 20:52:51 +00:00
Junliang Yan
03c3e3d2a8 PPC/s390x: make atomics(64)-stress as slow test.
Change-Id: I273764acb3881a5f682d3cc77e2c8f66bbb7b071
Reviewed-on: https://chromium-review.googlesource.com/c/1318091
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#57251}
2018-11-05 20:49:49 +00:00
Frank Tang
31ee18096e [Intl] Stage Intl.ListFormat
This will give us some clusterfuzz coverage.

Bug: v8:7871
Change-Id: I670572454e196b7617a446769216722302f697a9
Reviewed-on: https://chromium-review.googlesource.com/c/1306973
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57250}
2018-11-05 19:55:14 +00:00
Frank Tang
3aa8267bb7 Roll Test262
Bug: v8:7834
Change-Id: Ib53448757bbaf785ff39ba0da6f54c91e449035b
Reviewed-on: https://chromium-review.googlesource.com/c/1314113
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57249}
2018-11-05 19:54:04 +00:00
Daniel Clifford
c88994f84c Fix Array.prototype.sort speed regression
CanUseSameAccessor<ElementsAccessor: type> is array-sort.tq is super
performance-critical. Reverting the type-safe cleanup made in this
function while landing Array.prototype.slice.

Bug=chromium:852764

Change-Id: I1252d2ff8e431581f916794807e59abb39248abb
Reviewed-on: https://chromium-review.googlesource.com/c/1317815
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57248}
2018-11-05 17:55:37 +00:00
Georg Neis
c0ca982ca5 [turbofan] Remove redundant call to SerializePrototype.
The maps in question are already processed in
NativeContextData::Serialize.

R=jarin@chromium.org

Bug: v8:7790
Change-Id: Ifbbff64e10458605b09c74fe09e574b2f2659839
Reviewed-on: https://chromium-review.googlesource.com/c/1317809
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57247}
2018-11-05 17:37:56 +00:00
Toon Verwaest
20ce2c6f87 [parser] Use ScopedPtrList for more statement lists
In particular FunctionLiteral body. Now clients cannot use
function_literal->body() == nullptr anymore to figure out whether it was
preparsed; but have to check the eager compile hint.

Change-Id: Ia0d3a6b51c6fb7e803157e98a9d224224e03c8a7
Reviewed-on: https://chromium-review.googlesource.com/c/1317811
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57246}
2018-11-05 16:21:28 +00:00
Clemens Hammacher
2d7b85a526 [wasm][cleanup] Avoid return-after-else
Use early returns instead. The general scheme is to return early in the
abnormal case (e.g. error) and fall through to the end of the method in
the normal case.

R=ahaas@chromium.org

Bug: v8:8238
Change-Id: I281d35f5aad1f51b6d476fdc685565d9819397bb
Reviewed-on: https://chromium-review.googlesource.com/c/1317812
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57245}
2018-11-05 15:57:40 +00:00
Toon Verwaest
c28ecb1a86 [parser] Fix IsValidReferenceExpression
A Property access is only a valid reference expression if the accessed object
is a valid expression.

Bug: v8:8409
Change-Id: I9bc9ac60ca3bf4e261d10af97aba18e9db2085ea
Reviewed-on: https://chromium-review.googlesource.com/c/1317816
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57244}
2018-11-05 15:54:00 +00:00
Michael Starzinger
fc755be9da [wasm] Enable node splitting during scheduling.
R=herhut@chromium.org

Change-Id: Ice45defac8f065b6b1c848fd42ead6ab46da89ab
Reviewed-on: https://chromium-review.googlesource.com/c/1317573
Reviewed-by: Stephan Herhut <herhut@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57243}
2018-11-05 15:52:51 +00:00
Marja Hölttä
a51f3fc652 [js weak refs] Add WeakRef
- Add the WeakRef class and its deref() function.

- Add WeakFactory.prototype.makeRef

- Implement the "keep during job" behavior for WeakRef constructor and deref().

- Here we keep the targets alive longer than until the end of the job
  (microtask), contradicting the spec. However, this is probably the indended
  behavior, see https://github.com/tc39/proposal-weakrefs/issues/39 .

BUG=v8:8179

Change-Id: I41990d41ac1799e34f675d8431b9a7aa7ed3d48d
Reviewed-on: https://chromium-review.googlesource.com/c/1306435
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57242}
2018-11-05 15:10:46 +00:00
peterwmwong
986aa36b1f [builtins] Add Array.p.join fastpath for single element array.
This is resurrecting an optimization from the pre-torque version.
Avoid allocating another sequential string for the result when there's only one
element, just return the ToString-ed element.  This not only saves time writing
to this destination string, but also reduce GC pressure.

The System Health Memory Benchmark (load:media:google_images) exposed this missing
optimization with a 15% regression in memory usage.  Very large external strings
were being copied into V8's heap as sequential string.

Bug: chromium:896612
Change-Id: Ieb61906f64100cdc15bf96f3ebcccb1207f75356
Reviewed-on: https://chromium-review.googlesource.com/c/1316620
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Peter Wong <peter.wm.wong@gmail.com>
Cr-Commit-Position: refs/heads/master@{#57241}
2018-11-05 14:45:34 +00:00
Georg Neis
87e1b85d9f Reland "Add fast paths to Array.from."
This is a reland of 7bd9eb7e1e. No changes
to that patch other than adding a test case. The bug that lead to the
revert has been fixed in 9bf8f72c5b.

Original change's description:
> Add fast paths to Array.from.
>
> This reuses the fast path from IterableToList for Array.from. The fast
> paths are taken when .from is called with the receiver Array and the only
> argument is the iterable (no mapping function or thisArg).
>
> Bug: v8:7980
> Change-Id: I975b0c5e3f838262d7b71ad4dec5111fb031d746
> Reviewed-on: https://chromium-review.googlesource.com/c/1297322
> Commit-Queue: Hai Dang <dhai@google.com>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#56993}

Bug: v8:7980
Change-Id: Id081837946c0989ec2b31ce991f48d09e0219b09
Reviewed-on: https://chromium-review.googlesource.com/c/1317586
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57240}
2018-11-05 14:24:04 +00:00
Michael Starzinger
fbeaeb26ef [wasm] Remove test-only {RelocInfo::JS_TO_WASM_CALL}.
The relocation mode in question was by now only used in tests to model a
wrapper call from wrapper code (on the GC'ed heap) to a non-movable wasm
code object. Instead of using a special relocation mode, we switch to
using the existing {EXTERNAL_REFERENCE} mode similar to other static C++
functions called from generated code.

R=sigurds@chromium.org
BUG=v8:8238

Change-Id: I30af98b92aed207c52ccccaf018a455ecac39c2b
Reviewed-on: https://chromium-review.googlesource.com/c/1309821
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57239}
2018-11-05 13:49:18 +00:00
Tobias Tebbi
ece9156c4c [torque] allow qualified access to different modules/namespaces
This introduces a new syntax for identifiers and calls: modulename::foo.
Such a name is resolved by trying to find a module modulename in one of
the parent scopes and looking for foo there. So this roughly corresponds
to C++ qualified namespace lookup.

Bug: v8:7793
Change-Id: Iedc43e6ebe125cd74575cbbcbf990bbcc0155a1f
Reviewed-on: https://chromium-review.googlesource.com/c/1309818
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57238}
2018-11-05 13:34:03 +00:00
Clemens Hammacher
75da45ff4b [wasm][iwyu] Remove unneeded heavy-weight includes
R=ahaas@chromium.org

Bug: v8:8238, v8:7490
Change-Id: I27a57a43ad767d77e64764eda1d9017db87bdfcb
Reviewed-on: https://chromium-review.googlesource.com/c/1317588
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57237}
2018-11-05 13:31:18 +00:00
Jakob Gruber
166e74d581 [snapshot] Rename allocators
There's only one allocator kind left post-builtin-snapshot-removal,
so the 'Default' prefix can be removed.

Bug: v8:6666, v8:7990
Change-Id: Ib3c3eeb121792708591ca7be1e30adef77d3c111
Reviewed-on: https://chromium-review.googlesource.com/c/1309638
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57236}
2018-11-05 13:22:58 +00:00
Tobias Tebbi
23b4892060 [torque] qualified access to CSA assemblers
No longer use inheritance to associate Torque-generated assemblers
with corresponding CSA subclasses. Instead, all references to CSA
and CSA-derived assemblers are now explicitly qualified, by generating
a short-lived assembler instance in-place. As a consequence, Torque
files have to mention the assembler external macros live in.
The CodeStubAssembler is the default for this and can be omitted.
As a drive-by cleanup, also distinguish between names that are emitted
in C++ and names that are intended to be read in error messages. This
is relevant for generic instantiations, where the generated names are
rather unreadably mangled.

As a follow-up, it will be easy to allow for qualified access to
different modules, thus implementing full namespace semantics for
modules.

Bug: v8:7793
Change-Id: Ie6f1b6b549b510fb49be2442393d898d5f130950
Reviewed-on: https://chromium-review.googlesource.com/c/1309636
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57235}
2018-11-05 12:47:57 +00:00
Camillo Bruni
7621325d79 [runtime] Harden OptimizeFunctionOnNextCall
Ignore invalid input for all arguments of OptimizeFunctionOnNextCall
potentially produced by fuzzers.

Bug: chromium:901645
Change-Id: Ic185812c228a92f8dbb48212c45685bd14892947
Reviewed-on: https://chromium-review.googlesource.com/c/1317567
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57234}
2018-11-05 12:32:05 +00:00
Michael Starzinger
f86ee274b7 [wasm] Fix missing {CompilationState} field initialization.
R=clemensh@chromium.org

Change-Id: Icba445650131dcd54495f40f194ffe64cce24f94
Reviewed-on: https://chromium-review.googlesource.com/c/1317587
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57233}
2018-11-05 12:16:23 +00:00
Georg Neis
9bf8f72c5b Fix array spread on large sets and maps.
The fast paths for sets and maps did not support allocation in
large object space, yet they were taken in these cases. This CL
adds support, simply by passing the kAllowLargeObjectAllocation
argument to AllocateJSArray.

It also changes the fast path for strings to use this argument
rather than take the slow path.

Bug: v8:7980, v8:8410
Change-Id: I18e88cb4ceb7ebeca250edd8b8b0eb401fdbd6e4
Reviewed-on: https://chromium-review.googlesource.com/c/1317507
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57232}
2018-11-05 12:03:35 +00:00
Tobias Tebbi
06c8ce5957 [torque] cleanup generics and scopes
- Name lookup in module scopes has namespace semantics now: All
  overloads from all parent modules are combined before overload
  resolution.
- Allow overloads of different callables: runtime-functions,
  macros, builtins, and generics.
- The duplication between the DeclarationVisitor and the
  ImplementationVisitor is removed: The DeclarationVisitor creates
  declarables for everything except for implicit generic specializations.
  The ImplementationVisitor iterates over declarables.
  The DeclarationVisitor only looks at the header of declarations, not
  at the body.
- Modules become Declarable's, which will enable them to be nested.
- Modules replace the existing Scope chain mechanism, which will make it
  easier to inline macros.
- The DeclarationVisitor and Declarations become stateless. All state is
  moved to contextual variables and the GlobalContext.
- Implicit specializations are created directly from the
  ImplementationVisitor. This will enable template parameter inference.
- As a consequence, the list of all builtins is only available after the
  ImplementationVisitor has run. Thus GenerateBuiltinDefinitions has to
  move to the ImplementationVisitor. Also, this makes it necessary to
  resolve the link from function pointer types to example builtins only
  at this point.


Bug: v8:7793
Change-Id: I61cef2fd3e954ab148c252974344a6e38ee2d01d
Reviewed-on: https://chromium-review.googlesource.com/c/1304294
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57231}
2018-11-05 11:49:40 +00:00
Daniel Clifford
2593d0733d Remove bogus cast in and rename GetReceiverLengthProperty
BUG=chromium:901040

Change-Id: I0c28a2bd9a43d107e8afe8a8c0d53d1d3278121a
Reviewed-on: https://chromium-review.googlesource.com/c/1317506
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57230}
2018-11-05 09:15:19 +00:00
Takuto Ikuta
d4219df603 Remove V8_INLINE from non-inlineable function from parser.h
I will enable /Zc:DllexportInlines- flags for faster build time on windows.
But the flag makes clang's -Wundefined-inline check more strict as a secondary effect.

Actually, having inline function specifier for the function not defined in header file seems bit strange.
Let me remove inline specifier from such functions.

Bug: chromium:857548, chromium:901709
Change-Id: Ic06d10e2445cfedc7af67b72154f93a51ac26853
Reviewed-on: https://chromium-review.googlesource.com/c/1186017
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57229}
2018-11-05 08:56:26 +00:00
v8-ci-autoroll-builder
eab36a246d Update V8 DEPS.
Rolling v8/build: 5fafa7f..cd2c8fe

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

Change-Id: I841cf4971c83f84dbe02d1ca771f503ca4856f82
Reviewed-on: https://chromium-review.googlesource.com/c/1316621
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Reviewed-by: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#57228}
2018-11-05 03:43:16 +00:00
Jungshik Shin
6f7b2c9788 Drop the two ICU entries from Tsan suppresion list
ICU 63.1 fixed it and v8's ICU was rolled to ICU 63.1

TBR=sigurds@chromium.org

Bug: v8:8110
Change-Id: Ic44c8f4293d6d39b597a90318f0acbf5aea6eccf
Reviewed-on: https://chromium-review.googlesource.com/c/1316615
Reviewed-by: Jungshik Shin <jshin@chromium.org>
Commit-Queue: Jungshik Shin <jshin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57227}
2018-11-04 06:11:51 +00:00
Jakob Kummerow
15c9b8535a [cleanup] De-templatize CopyWords, drop MoveWords
CopyWords, as the name implies, copies raw words anyway, so there
is no need for type specialization.
MoveWords was dead code.

Bug: v8:8238
Change-Id: Ib497cfbabdcf8bac672ac74ef69f679b50ddfd6e
Reviewed-on: https://chromium-review.googlesource.com/c/1316609
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57226}
2018-11-04 03:53:09 +00:00