Commit Graph

48850 Commits

Author SHA1 Message Date
Frank Tang
97cdf44d7c [Intl] Implement Intl.RelativeTimeFormat constructor
Spec: http://tc39.github.io/proposal-intl-relative-time/

Design Doc: go/add-intl.relativetimeformat-to-v8

Test: test262/intl402/RelativeTimeFormat/*, intl/relative-time-format/*

R=gsathya@chromium.org, mstarzinger@chromium.org

Bug: v8:7869
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I2cfe8dba9d3a99957ad4b444023c89bbdae08c7c
Reviewed-on: https://chromium-review.googlesource.com/1124121
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54358}
2018-07-10 14:20:06 +00:00
Michael Starzinger
dfffde4a52 [wasm] Add proper --turbo-stats-wasm flag.
This gathers TurboFan compilation statistics for WebAssembly separately
from the JavaScript statistics. It is a preparation to having multiple
Isolates trigger TurboFan compilations in a shared engine. By adding
compilation statistics to the engine, their lifetime is independent of
any particular Isolate.

R=ahaas@chromium.org

Change-Id: I1bd0fbe6d6bde65ca813ccfd1154558ea6cddb07
Reviewed-on: https://chromium-review.googlesource.com/1131121
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54357}
2018-07-10 14:07:26 +00:00
Michael Starzinger
8442795a32 [wasm] Fix destructor ordering for {NativeModule}.
R=clemensh@chromium.org
BUG=v8:7921

Change-Id: I82a1c5cff7fd00603a509221b448b11d82edee7e
Reviewed-on: https://chromium-review.googlesource.com/1131176
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54356}
2018-07-10 13:51:41 +00:00
Andreas Haas
d87287bc48 [wasm][anyref] Allow tables of different reference types
Allow the decoding of multiple tables, and allow these tables to have
any reference type. In addition, rename function-tables (in different
occurrences) to tables.

R=titzer@chromium.org

Bug: v8:7581
Change-Id: I191ea8e303b76563f9d91ae7447b373c4760d8b8
Reviewed-on: https://chromium-review.googlesource.com/1019581
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54355}
2018-07-10 13:50:36 +00:00
Leszek Swirski
7184ce3934 Revert "[parser] Make PreParsedScopeData array-like"
This reverts commit a9fed96c00.

Reason for revert: Serializer test msan failures

Original change's description:
> [parser] Make PreParsedScopeData array-like
> 
> Make PreParsedScopeData a new array-like instance type, which holds its
> child data inline, rather than indirecting to a FixedArray. Should save
> one map word per PreParsedScopeData.
> 
> TBR=jarin@chromium.org
> 
> Bug: chromium:818642
> Change-Id: I72dc21160ed9781ad12b18559468f6cce56886fa
> Reviewed-on: https://chromium-review.googlesource.com/1127055
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Marja Hölttä <marja@chromium.org>
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#54349}

TBR=ulan@chromium.org,marja@chromium.org,jarin@chromium.org,leszeks@chromium.org,verwaest@chromium.org

Change-Id: If2f39379bb0bdfca7d36ec1a3ec738519481aa4e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:818642
Reviewed-on: https://chromium-review.googlesource.com/1131234
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54354}
2018-07-10 12:47:14 +00:00
Sathya Gunasekaran
256b4a8247 [intl] Port NumberFormat.prototype.format and bound format function to C++
This increases the size of a NumberFormat instance by a word to store
the bound format function.

The instance to be bound is stored on the context of this builtin function.

Bug: v8:5751, v8:7800
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: Ie85d8db7d10aabb5c40e77687e6f7112a84f3ebd
Reviewed-on: https://chromium-review.googlesource.com/1122153
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54353}
2018-07-10 12:06:44 +00:00
Benedikt Meurer
cf080aebaa [async-generators] Add fast-path to skip "then" lookup in AsyncGeneratorResolve.
This extends the Promise#then protector to also guard the intrinsic
%ObjectPrototype%, making it usable for fast-path logic in the
AsyncGeneratorResolve operation, where we can skip the "then" lookup
on the iteratorResult in that case. We also add a corresponding fast-
path to the ResolvePromise builtin itself, which avoids the second
"then" lookup on the async iterator side.

This reduces execution time of the fibonacci-async-es2017-native test
from 298.16ms to 280.55ms, which corresponds to an improvement of ~6%
in this case.

This is a rebased reland of

  https://chromium-review.googlesource.com/967203

which landed earlier, but had to be reverted as part of the mega-revert
that was necessary to fix the async_hooks breakage in Node 10.

Bug: v8:7253
Change-Id: Id9dd1ddc4a8285d64e92cd2030f3168a12e4b509
Reviewed-on: https://chromium-review.googlesource.com/1130523
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54352}
2018-07-10 12:05:40 +00:00
Sathya Gunasekaran
2bb56165af [JSObject] Refactor AddDataElement
This can't fail.

Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I2b8972fe02d3446726ce12f615fd1f92d00632ff
Reviewed-on: https://chromium-review.googlesource.com/1131015
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54351}
2018-07-10 11:21:59 +00:00
Andreas Haas
adbb4d1d50 [wasm] Update spec tests
R=herhut@chromium.org

Change-Id: I565dbd636b54f6537e401a43cf3d3910654dc279
Reviewed-on: https://chromium-review.googlesource.com/1130521
Reviewed-by: Stephan Herhut <herhut@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54350}
2018-07-10 11:18:19 +00:00
Leszek Swirski
a9fed96c00 [parser] Make PreParsedScopeData array-like
Make PreParsedScopeData a new array-like instance type, which holds its
child data inline, rather than indirecting to a FixedArray. Should save
one map word per PreParsedScopeData.

TBR=jarin@chromium.org

Bug: chromium:818642
Change-Id: I72dc21160ed9781ad12b18559468f6cce56886fa
Reviewed-on: https://chromium-review.googlesource.com/1127055
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54349}
2018-07-10 11:16:30 +00:00
Hannes Payer
3917714854 Cleanup: Use std::atomic<T> instead of base::AtomicNumber<T> in isolate.
Bug: chromium:842083

Change-Id: I015db53853c7da42c4879c791f437bf44eea7a00
Reviewed-on: https://chromium-review.googlesource.com/1130516
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54348}
2018-07-10 11:12:20 +00:00
Clemens Hammacher
ceb21bd15e Introduce Diamond::EffectPhi method
Similar to {Diamond::Phi}, the {EffectPhi} method makes it easier to
create an effect phi for the merge of the diamond.

R=mstarzinger@chromium.org

Change-Id: Iad33eda14052caeacd480d981a629a9fe9a91aa4
Reviewed-on: https://chromium-review.googlesource.com/1129143
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54347}
2018-07-10 09:41:19 +00:00
Stephan Herhut
7679c71194 [build] Remove non-existant header file
Change-Id: I23bd2ca20f3913f334278e865bab41e58f90af0d
Reviewed-on: https://chromium-review.googlesource.com/1129221
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Stephan Herhut <herhut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54346}
2018-07-10 08:57:14 +00:00
Dan Elphick
36e8b3fe23 [explicit isolates] Make Heap::InNewSpace static
Heap::InNewSpace only needs to access the heap for a DCHECK and the part
that uses the heap only needs it if the object is in NEW_SPACE, in which
case getting it via pointer magic is fine.

Bug: v8:7786
Change-Id: Iaac237a3b8bcc9d55e436e3f972475e04b97f1f8
Reviewed-on: https://chromium-review.googlesource.com/1127798
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54345}
2018-07-10 08:52:29 +00:00
Georg Neis
251e3f51fb [turbofan] Introduce DisallowHeapAccess helper.
R=jarin@chromium.org

Bug: v8:7790
Change-Id: I79c6904a9969afc6aac7530c5d876da15018b3bc
Reviewed-on: https://chromium-review.googlesource.com/1129142
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54344}
2018-07-10 08:40:29 +00:00
Maya Lekova
614c8077c2 [async] Implement error handling when running async hooks
Bug: chromium:860788
Change-Id: I5311cd670b57edf5b63173a10cf84a575e1fcd04
Reviewed-on: https://chromium-review.googlesource.com/1128750
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54343}
2018-07-10 08:12:09 +00:00
Georg Neis
fc39b9e371 [turbofan] Add Disallow* scopes to checkpoint elimination.
No changes were needed.

R=jarin@chromium.org

Bug: v8:7790
Change-Id: I5842a39db1395ab25f61aab2443c0061f613a883
Reviewed-on: https://chromium-review.googlesource.com/1128897
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54342}
2018-07-10 07:51:59 +00:00
Georg Neis
1f6afa86e8 [turbofan] Brokerize common operator reducer.
R=jarin@chromium.org

Bug: v8:7790
Change-Id: Idca77ca34c06fddfa73f412f20ba72500bbddf9c
Reviewed-on: https://chromium-review.googlesource.com/1128963
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54341}
2018-07-10 07:45:09 +00:00
Georg Neis
6862128951 [turbofan] Brokerize simplified operator reducer.
R=jarin@chromium.org

Bug: v8:7790
Change-Id: I4d9c561720005f7b667085c7dcf4e777e65d1e05
Reviewed-on: https://chromium-review.googlesource.com/1128891
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54340}
2018-07-10 07:34:09 +00:00
Georg Neis
a74a796016 [turbofan] Cleanup heap broker a little.
R=jarin@chromium.org

Bug: v8:7790
Change-Id: Ic1b1d47a655972d2b2f6264550db4fa5898fa46e
Reviewed-on: https://chromium-review.googlesource.com/1128871
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54339}
2018-07-10 07:03:09 +00:00
v8-ci-autoroll-builder
e51439d01a Update V8 DEPS.
Rolling v8/build: 84b1e58..9b4b413

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/9eaedb7..0c92958

Rolling v8/third_party/depot_tools: 92745a5..c3975e5

Rolling v8/tools/clang: 230416c..2024df9

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

Change-Id: Ia1da8838fb8f942932698840515bdec60119ea75
Reviewed-on: https://chromium-review.googlesource.com/1130944
Commit-Queue: V8 Autoroller <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Reviewed-by: V8 Autoroller <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#54338}
2018-07-10 03:49:49 +00:00
Alexey Kozyatinskiy
82bb301f7b [inspector] pause inside any context group after nearHeapLimitCallback
If context is not available during nearHeapLimitCallback then request
break inside any context group.

R=dgozman@chromium.org

Bug: chromium:846311
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I2b7dcda8e9758672f27c15ce18620bd57c4152c0
Reviewed-on: https://chromium-review.googlesource.com/1129100
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54337}
2018-07-10 00:18:46 +00:00
Brian Stell
3ba5445b8a Port BuildLanguageTagREs from Javascript to C++.
Bug: v8:5751
Test: None (no caller yet)

Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: Ifbe243b945ae6e1750e9db8430da178ae137e34f
Reviewed-on: https://chromium-review.googlesource.com/1117303
Commit-Queue: Brian Stell <bstell@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Jungshik Shin <jshin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54336}
2018-07-09 19:40:17 +00:00
Junliang Yan
6335989f65 PPC/s390: [turbofan] Remove remnants of deferred frame building.
Port 476a885343

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

Change-Id: Ia34b1829db73502b9d5780866e9b00ac236dd2e1
Reviewed-on: https://chromium-review.googlesource.com/1129333
Reviewed-by: Michael Dawson <michael_dawson@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#54335}
2018-07-09 19:20:57 +00:00
Dan Elphick
45b622d95c [explicit isolates] Add Handle getters to ReadOnlyRoots
Add <root>_handle getters to ReadOnlyRoots, so an Isolate isn't required
to get a handle of a root.

Also convert one GetIsolate()->factory()->accessor() to
GetReadOnlyRoots().accessor_handle() in FixedArray.

Bug: v8:7786
Change-Id: I1b72c58f90eacf64be95abb65df91cf993178a93
Reviewed-on: https://chromium-review.googlesource.com/1129225
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54334}
2018-07-09 16:37:13 +00:00
Michael Starzinger
16aa6d0490 [wasm] Remove obsolete i-cache flushes.
Now that we no longer use code specialization to patch WasmCode after it
was generated, we no longer need to flush the instruction cache after
instance building finishes.

R=clemensh@chromium.org

Change-Id: I4ce31876dde9c6dcc4ad945e024641b72330fe4f
Reviewed-on: https://chromium-review.googlesource.com/1128975
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54333}
2018-07-09 15:38:23 +00:00
Clemens Hammacher
338f90a64a [wasm] Fix effect chain in {BuildChangeTaggedToFloat64}
1) Refactor code using the {Diamond} helper.
2) Fix the effect chain to include the loads in that method.

R=mstarzinger@chromium.org

Change-Id: I8583b46c1c56b226842248f3c1763c7565ef3797
Reviewed-on: https://chromium-review.googlesource.com/1128864
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54332}
2018-07-09 14:53:37 +00:00
Théotime Grohens
c4323e084e [turbofan] Add DataView setters in TurboFan
This CL completes the implementation of DataView prototype methods
in TurboFan, by implementing the Uint8, Int8, Uint16, Int16,
Uint32, Int32, Float32 and Float64 setters.

DataView performance is now ahead of the equivalent TypedArray wrapper,
and is now expected to at least match TypedArray performance in
the general case as well.

This CL also adds a test file in the compiler directory, to make
sure that the setters actually behave correctly.

Change-Id: I4ad4341c6b9b9d461348b62216f37a73abe321e8
Reviewed-on: https://chromium-review.googlesource.com/1128867
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Théotime Grohens <theotime@google.com>
Cr-Commit-Position: refs/heads/master@{#54331}
2018-07-09 14:46:47 +00:00
Sigurd Schneider
95ab75790d [tools] Add an averaging script
This script averages numbers output from another script. It is useful
to average over a benchmark that outputs one or more results of the form
  <key> <number> <unit>
key and unit are optional.

For example, if
  $ bch --allow-natives-syntax toNumber.js
outputs
  Number('undefined'):  155763 Kps
  (+'undefined'):  193050 Kps
  parseFloat('undefined'):  23736 Kps
then
  $ avg.py 10 bch --allow-natives-syntax toNumber.js
will output
  [10/10] (+'undefined')         : avg 192,240.40 stddev   6,486.24 (185,529.00 - 206,186.00) Kps
  [10/10] Number('undefined')    : avg 156,990.10 stddev  16,327.56 (144,718.00 - 202,840.00) Kps
  [10/10] parseFloat('undefined'): avg  22,885.80 stddev   1,941.80 ( 17,584.00 -  24,266.00) Kps

Change-Id: I237706da8ade1b152e04084e0189007460d359c5
Reviewed-on: https://chromium-review.googlesource.com/1128747
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54330}
2018-07-09 14:45:42 +00:00
Clemens Hammacher
5b744bfbd4 Fix and extend lldbinit
1) Define all commands in one file.
2) Add logic to make 'jco' print current pc by default.
3) Add a comment to explain how to load the lldb_commands.py file.
4) Minor refactorings.

R=ahaas@chromium.org
No-Try: true

Bug: v8:7754
Change-Id: I553f2ce4cefedad05466c692a8665a570372b76a
Reviewed-on: https://chromium-review.googlesource.com/1127892
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54329}
2018-07-09 14:34:02 +00:00
Dominik Inführ
fa4bcc4da0 [heap] Add GCTracer for updating refs after scavenge
Updating refs to new space in internal data structures could take some
time, so also measure this.

Bug: chromium:844008
Change-Id: I9f5af4d09f8ef580ca0ad0019cfc78a994d62ffd
Reviewed-on: https://chromium-review.googlesource.com/1128889
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@google.com>
Cr-Commit-Position: refs/heads/master@{#54328}
2018-07-09 14:24:03 +00:00
Sigurd Schneider
2f9aad53e0 [turbofan] Set builtin index from optimized compilation info
Bug: v8:6666
Change-Id: I5940e957452d47edac243898fa7cddf772b54e72
Reviewed-on: https://chromium-review.googlesource.com/1127057
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54327}
2018-07-09 14:06:22 +00:00
Michael Starzinger
44ca9863fc Revert "[wasm] Move code generation fully to background task."
This reverts commit 231b3e15fc.

Reason for revert: Flakes in inspector/debugger/wasm-stack

Original change's description:
> [wasm] Move code generation fully to background task.
> 
> This moves the entire code generation phase (including code emission
> into the native module) into the background task. The code manager is
> fully thread safe by now and there are no Isolate-bound steps anymore.
> 
> R=​clemensh@chromium.org
> BUG=v8:7921
> 
> Change-Id: Ie3e8565e126bfdb58bf472291a1f9fbebe7b5431
> Reviewed-on: https://chromium-review.googlesource.com/1128743
> Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
> Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#54324}

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

Change-Id: Ice5d80425cebd3921d9683d06f70d5173f663e42
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7921
Reviewed-on: https://chromium-review.googlesource.com/1129059
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54326}
2018-07-09 14:00:43 +00:00
Clemens Hammacher
916925f33b [wasm] Document {BuildChangeFloat64ToTagged}
It took me a while to understand what this code is doing. This CL just
renames a few local variables and documents the checks that are done.

R=mstarzinger@chromium.org

Bug: v8:7754
Change-Id: I4072c4b1969f8b88d4454c8f3022c9b9de825197
Reviewed-on: https://chromium-review.googlesource.com/1128862
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54325}
2018-07-09 13:58:22 +00:00
Michael Starzinger
231b3e15fc [wasm] Move code generation fully to background task.
This moves the entire code generation phase (including code emission
into the native module) into the background task. The code manager is
fully thread safe by now and there are no Isolate-bound steps anymore.

R=clemensh@chromium.org
BUG=v8:7921

Change-Id: Ie3e8565e126bfdb58bf472291a1f9fbebe7b5431
Reviewed-on: https://chromium-review.googlesource.com/1128743
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54324}
2018-07-09 13:36:09 +00:00
Théotime Grohens
f659efb15c [dataview] Fix JSTests.json
This CL correctly updates the JSTests.json file in test/mjsunit/
to reflect the new DataView Float32/64 performance tests from
commit e14699c520.

Change-Id: I9cbb05ac0cbd37f8d8a0bc66ebb59c1e05298776
Reviewed-on: https://chromium-review.googlesource.com/1128880
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Théotime Grohens <theotime@google.com>
Cr-Commit-Position: refs/heads/master@{#54323}
2018-07-09 12:42:17 +00:00
Georg Neis
299d2b49d9 [turbofan] Brokerize typed optimization.
Bug: v8:7790
Change-Id: Ia9526c507769f8a7f973a9ed7aedd7cc56d169d0
Reviewed-on: https://chromium-review.googlesource.com/1128756
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54322}
2018-07-09 12:22:17 +00:00
Leszek Swirski
084d472f51 [liveedit] Patch changed SFIs' constant pools
When live edit patches a script, it distinguishes between 'changed' and
'unchanged' functions, and unchanged functions have their position and
source script patched to the new script instead of being replaced by a
new SFI.

However, if a 'changed' function has an inner 'unchanged' function, it
also holds a pointer to the inner function in its bytecode constant
pool. This constant pool entry was not being updated for changed
functions (it was for unchanged), and therefore the outer changed
function would compile the redundant new function instead of the old,
patched, unchanged function.

This patch fixes this by patching 'changed' functions' bytecode constant
pools. This is done by swapping the script and script function list
position of the old new and old 'unchanged' function, rather than just
setting the script (and position) on the old one, and using the new
function (now pointing at the old script) to read off the old function
literal id. This could also be done by reading the function_literal_id
off the new function, but we are soon removing that field anyway.

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ib22078c06539c795b418d29a493d8224ecea182e
Reviewed-on: https://chromium-review.googlesource.com/1127941
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54321}
2018-07-09 11:06:57 +00:00
Sigurd Schneider
23dbb81d8f [turbofan] Use relative calls/jumps on arm for builtins
This CL uses pc-relative jumps and calls (B/BL) for calls from embedded
builtins to embedded builtins. To make this work, the code range size is
limited to 32MB on arm during mksnapshot, which ensures that all builtin
to builtin offsets for jumps/calls fit into the B/BL immediate. At code
generation time, we put a placeholder into the instruction offset which
we resolve to the right code object when the code is copied to the heap.
We use a new relocation mode RELATIVE_CODE_TARGET for these relative jumps.
The relocation mode RELATIVE_CODE_TARGET should never appear after
generating the snapshot.

We modify the target_address/set_target_address methods of RelocInfo
such that they return the absolute target addresses for pc-relative B/BL
instructions. This ensures that the GC can treat RELATIVE_CODE_TARGET in
the same way as code targets. This, however, only matters during
snapshot creation time, and production code never contains
RELATIVE_CODE_TARGET relocations.

Bug: v8:6666
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: If7eab83ad588859ca87c654a5ddc3e37caea884c
Reviewed-on: https://chromium-review.googlesource.com/1117181
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54320}
2018-07-09 10:53:07 +00:00
Leszek Swirski
39e2d97bc4 [sfi] Replace start/end position with UncompiledData
Add new types for function data for SharedFunctionInfo, for uncompiled
functions. UncompiledData holds start/end positions, allowing us to
remove these fields from SFI. Uncompiled functions with pre-parsed
scope data now hold an UncompiledDataWithScope that has a pointer to
PreParsedScopeData -- this allows us to also remove the start/end pos
from PreParsedScopeData.

Bug: chromium:818642
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I56f3c4e62cbf38929babac734a332709f12a8202
Reviewed-on: https://chromium-review.googlesource.com/1126381
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54319}
2018-07-09 10:49:27 +00:00
Andreas Haas
43744b9670 [wasm][anyref] Support decoding of signatures with AnyFunc
With this CL we now also support the decoding of the AnyFunc
type. I will add the type more deeply in subsequent CLs.

R=titzer@chromium.org

Bug: v8:7581
Change-Id: I9f30706a442462f915adfd8f720eb65168b80bb8
Reviewed-on: https://chromium-review.googlesource.com/1014111
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54318}
2018-07-09 09:59:02 +00:00
Jaroslav Sevcik
f695855cf8 [turbofan] Brokerize JSCreateLowering::ReduceJSCreate
Bug: v8:7790
Change-Id: I918af0461e86ce8eacb9155de18954d8b6270ecc
Reviewed-on: https://chromium-review.googlesource.com/1123831
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54317}
2018-07-09 09:05:48 +00:00
Michael Starzinger
d78235e3d6 [wasm] Add separate accounting allocator to {WasmEngine}.
This adds an {AccountingAllocator} to the {WasmEngine}, separate from
the allocator used per Isolate. It is in preparation of being able to
share engines across multiple Isolates. For now we just add up the
stats from both allocators until a public API for the engine becomes
available.

R=ahaas@chromium.org
TEST=cctest/test-wasm-shared-engine/SharedEngineRunImported
BUG=v8:7424

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ia915a1ae4aa7ebed27073b7b6bd067e31717a6ea
Reviewed-on: https://chromium-review.googlesource.com/1127788
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54316}
2018-07-09 09:04:42 +00:00
Georg Neis
75ad46a4b0 [turbofan] Add Disallow* scopes to type narrowing reducer.
No changes were necessary.

R=jarin@chromium.org

Bug: v8:7790
Change-Id: I8a5c308b9534ee1fb669a901b6626c338883fbf8
Reviewed-on: https://chromium-review.googlesource.com/1128741
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54315}
2018-07-09 08:58:12 +00:00
Georg Neis
8a7812e4dd [turbofan] Brokerize constant folding reducer.
R=jarin@chromium.org

Bug: v8:7790
Change-Id: I42c1208f3555a7e5a3a241860d0a1609b8530b79
Reviewed-on: https://chromium-review.googlesource.com/1128740
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54314}
2018-07-09 08:55:12 +00:00
Georg Neis
e4bfa5a622 [turbofan] Add Disallow* scopes to dead code elimination.
No changes were necessary.

R=jarin@chromium.org

Bug: v8:7790
Change-Id: I70efc56dd07f778dffda3b38f28b9b94d634361e
Reviewed-on: https://chromium-review.googlesource.com/1128739
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54313}
2018-07-09 08:30:22 +00:00
Clemens Hammacher
2683675ce6 [wasm] Reduce size of critical section
This reduces the critical section in {NativeModule::AddOwnedCode} to
not include the memcpy.
It also contains small drive-by fixes.

R=mstarzinger@chromium.org

Bug: v8:7921
Change-Id: Idbed5d1ab5627fe2ab3f60887ec2b31c5525e36c
Reviewed-on: https://chromium-review.googlesource.com/1127025
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54312}
2018-07-09 08:22:49 +00:00
Michael Lippautz
848f989e3d [embedder-tracing] Deprecate NumberOfWrappersToTrace
Deprecates EmbedderHeapTracer::NumberOfWrappersToTrace and replaces it
with EmbedderHeapTracer::IsTracingDone.

V8 only really cares about the final state (emptiness) here and
embedders may choose implementations that have a hard time determinining
exact size for their work queues.

Bug: chromium:843903
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I1e141c47771ef08aab7dbe204e8175cfee99cf92
Reviewed-on: https://chromium-review.googlesource.com/1127599
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54311}
2018-07-09 08:06:49 +00:00
Sathya Gunasekaran
9942994e33 [JSFunction] Undef macro after use
Change-Id: I755f2426d4f0e34115ff0c73e487e47db5290df1
Reviewed-on: https://chromium-review.googlesource.com/1127916
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54310}
2018-07-09 07:11:29 +00:00
Benedikt Meurer
907d7bcd18 [promise] Implement Swallowed Rejection Hook.
This extends the current Promise Rejection Hook with two new events

  kPromiseRejectAfterResolved
  kPromiseResolveAfterResolved

which are used to detect (and signal) misuse of the Promise constructor.
Specifically the common bug like

  new Promise((res, rej) => {
    res(1);
    throw new Error("something")
  });

where the error is silently swallowed by the Promise constructor without
the user ever noticing can be caught via this hook.

Doc: https://goo.gl/2stLUY
Bug: v8:7919
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I890a7e766cdd1be88db94844fb744f72823dba33
Reviewed-on: https://chromium-review.googlesource.com/1126099
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54309}
2018-07-09 06:06:39 +00:00