Commit graph

55382 commits

Author SHA1 Message Date
Samir Jindel 0bc6e7217a Update expression compilation expectations.
Change-Id: Ia335aad6a736723b571d611f849ba7e8ad991865
Reviewed-on: https://dart-review.googlesource.com/53382
Reviewed-by: Jens Johansen <jensj@google.com>
2018-05-02 13:44:21 +00:00
Samir Jindel 9038b8f45f CFE support for compiling individual expressions in a context.
Change-Id: I6469fb16e8846eccaeca3f8585872f4b69dd3f1e
Reviewed-on: https://dart-review.googlesource.com/38123
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-05-02 12:45:03 +00:00
Samir Jindel 7d5025e814 Fix incorrect handling of NSM forwarders and pull all logic into CFE.
The original implementation was designed around a shared misunderstanding
of optional parameter handling in the spec. (which was also ambiguous about type parameters).

The correct behavior for optional/type parameters is to fill them in with their default values/bounds.
This behavior can be implemented without any backend support, as is done in this CL.

Change-Id: Ib81f17ead2d2920e755703e244db5afc328d0315
Reviewed-on: https://dart-review.googlesource.com/52802
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-02 12:18:30 +00:00
Edward Lemur e2247e5e00 Put the '@' outside the revision variables.
Bug: None
Change-Id: I5627ac27907acfa5e304e47720758383a2e6376a
Reviewed-on: https://dart-review.googlesource.com/53166
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2018-05-02 11:37:58 +00:00
Jens Johansen 9381424204 Fix presubmit on Windows. Dart executable is not called .bat
Change-Id: I3e9212a134dc3302324625aa201466bfb972a788
Reviewed-on: https://dart-review.googlesource.com/53363
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-05-02 08:40:59 +00:00
Johnni Winther 2a8c3515b2 Avoid strong+checked mode: strong mode supersedes checked mode
Change-Id: Ic68f429ec06d583a9e60b6ace1ec88ee83a4be5f
Reviewed-on: https://dart-review.googlesource.com/53202
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-02 08:33:28 +00:00
Jens Johansen b7698dcbce Update status for Windows
Change-Id: Ia7519522b962b39878c822035bc2d71d251420d0
Reviewed-on: https://dart-review.googlesource.com/53362
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-05-02 08:32:58 +00:00
Alexander Thomas 8baa82413b [infra] Remove --no-preview-dart-2 flag from gardening tools
Fixes a regression caused by https://dart-review.googlesource.com/c/sdk/+/52461

Change-Id: I59ba32c2f31e70620bea58466935ed47ed61c1dc
Reviewed-on: https://dart-review.googlesource.com/53361
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-02 08:09:10 +00:00
Jens Johansen 47e9039512 Don't encode strings up front; don't toString uris
Change kernel serialization so that
a) We don't UTF8 encode strings up front, but only as needed
   (if nothing else it makes it more obvious where the cost of stuff is)
b) Don't call toString on URIs to save them in a StringIndexer, only to
   parse the string later to get a URI back again.

This shaves a bit of the serialization time.
Timings from running `flutter test` in flutter/packages/flutter:

Without change:
```
02:14 +2438 ~18: All tests passed!
02:12 +2438 ~18: All tests passed!
02:14 +2438 ~18: All tests passed!
```

with change:
```
02:10 +2438 ~18: All tests passed!
02:11 +2438 ~18: All tests passed!
02:09 +2438 ~18: All tests passed!
```

 => -2.5% +/- 1.83615%

Change-Id: I03e651bbef23445fb1901452a4efcc732789a168
Reviewed-on: https://dart-review.googlesource.com/51302
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-05-02 07:42:40 +00:00
Johnni Winther 4a0ac85cc3 Update co19 status
Change-Id: I75e0fcf72d2606a8cca0324225a14fe1922aad70
Reviewed-on: https://dart-review.googlesource.com/53360
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-02 07:13:41 +00:00
asiva ce7329849d Fix build breakages
- use platform independent path specification is test so that
  it works on windows
- skip test for precompiled and dartk builds as the test uses
  spawnUri which is not supported in these modes

Change-Id: I7b73222ae331f863a65e6f7ff30d244533f29880
Reviewed-on: https://dart-review.googlesource.com/53340
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-05-02 01:03:48 +00:00
asiva ee6351a147 [VM] Set up package config value when invoking the front end for compilation,
this should fix issue 32950 "(Isolate.spawnUri() ignores packageConfig
argument in Dart 2 mode.'

Bug:32950
Change-Id: I1247c87c171ac44d3da6e2a93212adba20c42e54
Reviewed-on: https://dart-review.googlesource.com/52986
Reviewed-by: Alexander Aprelev <aam@google.com>
2018-05-01 22:57:35 +00:00
Stephen Adams d1286a367e Strong mode update for swarm
TBR=sigmund@google.com

Change-Id: Id53d58d05e27bffe17c810614dd37294acc3491d
Reviewed-on: https://dart-review.googlesource.com/53242
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-01 21:25:34 +00:00
Konstantin Shcheglov fd27cc3435 Don't store bytes in the file cache.
We needed bytes only to get their length.
This CL replaces it to using the content (String) length.
This should help to fix heap usage regression.

R=paulberry@google.com

Change-Id: I4d58e91987db21233a71ca600eea8fae3fb38346
Reviewed-on: https://dart-review.googlesource.com/53243
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-01 21:11:04 +00:00
Paul Berry 73abd61304 Re-land "Clean up the use of deprecated API in the analyzer_plugin package".
int.tryParse is now available to internal Google users, so it is safe
to land this change now.

This reverts commit 115850ca1d.
Original commit 86ba29265a.

Change-Id: I92c3d19533d3108c06910f21070266953c3a065b
Reviewed-on: https://dart-review.googlesource.com/53244
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-05-01 21:08:04 +00:00
Ryan Macnak 607f4f5769 [vm] Get more helpful errors from Dart_SetVMFlags and Dart_MakeIsolateRunnable.
Bug: https://github.com/flutter/flutter/issues/12939
Change-Id: I76ddf2a6d3bb3775637d2eef87c7875c650de0a4
Reviewed-on: https://dart-review.googlesource.com/29680
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-05-01 20:54:38 +00:00
Alexander Thomas f044637c8b [infra] Upgrade checked in SDKs to 2.0.0-dev.52.0
TBR=sortie@google.com

Change-Id: I34a986acc5af580463e5ce872c28293d68182613
Reviewed-on: https://dart-review.googlesource.com/53260
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2018-05-01 19:30:44 +00:00
Alexander Thomas dcf10816aa [infra] Add script that updates checked in SDKs
Change-Id: I9de6489dbe613455476cd4c19db4b951456a87cf
Reviewed-on: https://dart-review.googlesource.com/53100
Reviewed-by: Jonas Termansen <sortie@google.com>
2018-05-01 18:50:31 +00:00
Harry Terkelsen f8bea2a7e6 dart2js: Register inlined native methods for dump info
Change-Id: I362b56c70bff7a0afcec3374882c973ff879d48e
Reviewed-on: https://dart-review.googlesource.com/53061
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2018-05-01 18:22:25 +00:00
Kevin Moore 7fe8659613 dump-info: Use relative paths for library canonicalUri...
...if they are within the working directory

Makes output from dump-info more stable, especially with pkg:build

Change-Id: I3e6c444a0aa7df55c10e1bdff4b59ef035d2acc3
Reviewed-on: https://dart-review.googlesource.com/53168
Reviewed-by: Harry Terkelsen <het@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2018-05-01 16:47:26 +00:00
Alexander Aprelev dcf4886500 [frontend-server] Add verbose option.
Change-Id: I49e2e4a70b91262765509504e4da303459f29fba
Reviewed-on: https://dart-review.googlesource.com/53170
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-05-01 16:43:14 +00:00
Alexander Thomas 5087ffa481 [release] Move DDC sync-async flip to correct section in the release notes
TBR=sortie@google.com

Change-Id: I0e3293ca1a7e13d79b2b59fb8500393ef4f0f5e5
Reviewed-on: https://dart-review.googlesource.com/53214
Reviewed-by: Alexander Thomas <athom@google.com>
2018-05-01 16:32:31 +00:00
Alexander Thomas fe7056ebaa [release] Update changelog for 2.0.0-dev.52.0
TBR=sortie@google.com

Change-Id: I2c23a76ab95368a598c1156b5bf6c6ef36f245c8
Reviewed-on: https://dart-review.googlesource.com/53213
Reviewed-by: Alexander Thomas <athom@google.com>
2018-05-01 16:10:27 +00:00
Aske Simon Christensen 011676641a Ignore forwarding stubs when checking for missing implementations.
Fixes https://github.com/dart-lang/sdk/issues/33009

Change-Id: If131193014d99430a0b1934d2f8890cd4f123934
Reviewed-on: https://dart-review.googlesource.com/53203
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-05-01 15:44:24 +00:00
Samir Jindel 12d697b2ea Refactoring to allow compilation inside a library loaded from Dill.
Change-Id: I128e9d171354fbfe3cc1a742f83567a1eb1cb7fe
Reviewed-on: https://dart-review.googlesource.com/51324
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-05-01 14:10:16 +00:00
Johnni Winther 8351dd4928 Support constant instantiation
Closes #32774

Change-Id: I88090246d3fb39e3d3a1f9c3fdcc3b6fd6e0fa4f
Reviewed-on: https://dart-review.googlesource.com/53022
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-01 12:59:18 +00:00
Johnni Winther 687b1b5edd Update status
Change-Id: Ia0d41e674882c4b37160cd3a7da447706c5b62c8
Reviewed-on: https://dart-review.googlesource.com/53210
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-01 12:42:31 +00:00
Johnni Winther f373cfed83 Add omit-implicit-checks mode to equivalence tests.
Change-Id: Ifd98727384943d167b0ef39caaa9c1351b16e9ee
Reviewed-on: https://dart-review.googlesource.com/52805
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-01 12:41:59 +00:00
Alexander Thomas 886b511f76 [infra] Fix dart-arm64 executable in checked in SDK
TBR=sortie@google.com

Change-Id: I1ba54ef12024ee02f2a5ba01a4933c707e89e979
Reviewed-on: https://dart-review.googlesource.com/53205
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2018-05-01 12:02:23 +00:00
Alexander Thomas 2ca9daea83 [infra] Replace vm-kernel-mac with vm-kernel-linux on the CQ
TBR=kustermann@google.com

Change-Id: I13e53e43a49eef3260af63fafc32d15f36f1559a
Reviewed-on: https://dart-review.googlesource.com/53204
Reviewed-by: Alexander Thomas <athom@google.com>
2018-05-01 11:45:08 +00:00
danrubel bf91621857 Improve fasta parser import prefix recovery
Change-Id: Ib1265cee27ff4e7cfc20012d3e4281cd151accdc
Reviewed-on: https://dart-review.googlesource.com/53140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-01 11:26:11 +00:00
Johnni Winther d85c175a22 Register deferredLoadlibrary as backend impact
Closes #32998

Change-Id: If2a0a948f1209652925be360f7f145ebfdb3d60d
Reviewed-on: https://dart-review.googlesource.com/53008
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-01 11:05:31 +00:00
Kevin Millikin 9371ca061c Remove all the contravariance bits
Change-Id: Ib43b32d12749ddac0a93795cb5e8543eb5131dd9
Reviewed-on: https://dart-review.googlesource.com/52867
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-05-01 10:56:11 +00:00
Martin Kustermann c544a9fcd1 [vm/kernel] Implement Constant.getStaticType
Change-Id: I314f423257b970016dcaec9967fc624c7c39c4a8
Reviewed-on: https://dart-review.googlesource.com/53040
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-05-01 09:49:01 +00:00
Jens Johansen 6e2536f585 [kernel] Change dill representation of doubles
Previously doubles was saved as strings in the string table,
with a DoubleLiteral holding a StringReference.

This can cause overhead in both computation time
(converting the double to and from string) as well as size
(e.g. a single usage of the previously unused double 1000000.42
would use (at least)
* 10 bytes for the characters
* 1 byte for the size
* 1 byte for the reference to the string

whereas saving it as a double would simply save the 8 bytes.

On the other hand the string table doesn't contain duplicates so
many usages of the same double will use more space.

The SDK dill file size decreases slightly (< 1 KB).

On a Dart file with 1M different doubles (0.42, 1.42, ..., 999999.42)
added to a list:

Before:

compile and write via fasta (non-strong-mode): 0:12.18
Reading (via dart, eager): 2500-2600 ms
Writing (to null sink) (after reading): 1600-1800 ms
Output dill file (via fasta compile): ~62 MB

After:

compile and write via fasta (non-strong-mode): 0:11.76
Reading (via dart, eager): 2050-2350 ms
Writing (to null sink) (after reading): 400-550 ms
Output dill file (via fasta compile): ~54 MB

Running the dill file is ~the same time, but "Maximum resident set size
(kbytes)" (from /usr/bin/time -v) decreases with ~4%.

On the other side, if it's 1M of the same doubles (0.42), while
compiling is ~the same speed, the output dill goes from 43MB to 50MB.
Surprisingly the "Maximum resident set size (kbytes)" still decreases
though (~3%).

Running flutter test in flutter/packages/flutter:

Before:
```
02:33 +2425 ~18: All tests passed!
02:28 +2425 ~18: All tests passed!
02:28 +2425 ~18: All tests passed!
```

After:
```
02:12 +2425 ~18: All tests passed!
02:11 +2425 ~18: All tests passed!
02:12 +2425 ~18: All tests passed!
```

So that's -12.0267% +/- 3.15253%

File size of a dill file of an arbitrary test using flutter is reduced by ~44 KB (~0.3%).

Change-Id: I64151376cde1dae6f0d02b3d96991bc432a994ae
Reviewed-on: https://dart-review.googlesource.com/41660
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-05-01 09:35:21 +00:00
Alexander Thomas b1611684fe [infra] Upgrade checked in SDKs to 2.0.0-dev.51.0
Closes #32961

Change-Id: Ib326ce5c1027ca32b368904e0d57514779ea170b
Reviewed-on: https://dart-review.googlesource.com/53080
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2018-05-01 08:39:01 +00:00
Alexander Thomas 03ca45c0a8 [release] Merge changelog corrections from dev branch
Change-Id: I11bf3b4dde2b62d1f52bcb512311832ef97a54fb
Reviewed-on: https://dart-review.googlesource.com/53005
Reviewed-by: Jonas Termansen <sortie@google.com>
2018-05-01 08:38:33 +00:00
Johnni Winther 54b8ebd992 Support js-interop classes that implement generic types in Dart 2
This adds a special RTI representation for a type argument of a
(supertype of a) js-interop class, which effectively is the Dart 1
`dynamic` type.

Closes #32969

Change-Id: Ifd92b3fc6779d96d354ad929bd7c07a349299ae6
Reviewed-on: https://dart-review.googlesource.com/53002
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-01 08:37:11 +00:00
Johnni Winther 20c7725954 Handle deferred constant instantiations
Closes #32997

Change-Id: I31661bb223ca9d9bdee2e7cabe4e62bf18e87509
Reviewed-on: https://dart-review.googlesource.com/53007
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-01 08:31:01 +00:00
Alexander Thomas 95338ced3a [infra] Sort CQ builders in config
Change-Id: I798b6c9cd214b86eec11645239844209f6f4edb8
Reviewed-on: https://dart-review.googlesource.com/53020
Reviewed-by: Jonas Termansen <sortie@google.com>
2018-05-01 08:27:52 +00:00
Ryan Macnak cff0e751a5 [vm] Add Dart_NewExternalTypedDataWithFinalizer.
Allows the finalizer to be associated with the correct object when creating ByteData. The finalizer should be associated with the underlying ExternalUint8List, since it can outlive the ByteData via byteData.buffer.asUint8List()

Bug: b/78150644
Change-Id: I3db58792bbe3abf7ed41d2adaf225fa554b8fb25
Reviewed-on: https://dart-review.googlesource.com/52860
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-05-01 01:57:41 +00:00
asiva b64f2acfb9 Revert "[VM] Improve code generation for uint32"
Please see issue https://github.com/dart-lang/sdk/issues/33008 for more
details on the regression caused by this commit.

This reverts commit 9741c220f3.

It also effectively reverts

https://dart-review.googlesource.com/c/sdk/+/53006
https://dart-review.googlesource.com/c/sdk/+/53001

which were follow up CLs to the main commit.

Change-Id: Iac399c620a312ab3c3b27a3cba4e681742bcfe33
Reviewed-on: https://dart-review.googlesource.com/53164
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-05-01 00:25:01 +00:00
Bob Nystrom 26cf0d559c Roll dart_style to 1.0.12.
This has no formatting changes, so is safe to roll without coordinating
with a new prebuilt SDK.

Change-Id: If8b966a7fd402909f82aa016ee9958672a275e8b
Reviewed-on: https://dart-review.googlesource.com/53161
Reviewed-by: Natalie Weizenbaum <nweiz@google.com>
2018-05-01 00:05:21 +00:00
Stephen Adams 1f6f9adb6c dart2js co19 status bingo
TBR=sigmund@google.com

Change-Id: I7f6e1a3e3f80cab42102e1cefa9238ba6b94f6df
Reviewed-on: https://dart-review.googlesource.com/53165
Reviewed-by: Stephen Adams <sra@google.com>
2018-04-30 23:40:38 +00:00
Bob Nystrom 9d34963947 Stop ignoring explicit ("as") cast failures on all but function types.
Change-Id: Ia421cce7bab4fe9c74775b5bf2474901475cfa89
Reviewed-on: https://dart-review.googlesource.com/53160
Reviewed-by: Vijay Menon <vsm@google.com>
2018-04-30 23:05:24 +00:00
Stephen Adams d6a3b85ed2 Use factory methods for async/sync*/async* transforms
The static methods allow type parameters to be registered,
but this means that the type parameters will be dropped unless in strong mode.

Change-Id: I91c1977c287c14742df7d59b988e64ddc46f794d
Reviewed-on: https://dart-review.googlesource.com/52870
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-30 22:32:56 +00:00
Jenny Messerly 2df8db486d fix #30184, private symbols in DDC
Change-Id: I77fe11b49b3f19b0241c8e08c313cb051c4d019b
Reviewed-on: https://dart-review.googlesource.com/52281
Reviewed-by: Vijay Menon <vsm@google.com>
2018-04-30 21:20:40 +00:00
Ryan Macnak 82bf4bb135 [vm] Fail gracefully when a snapshot is loaded without the proper alignment.
Change-Id: Ie9164d54cbea08d0da5b36bfc36ef1a3e7a46b0b
Reviewed-on: https://dart-review.googlesource.com/53122
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-04-30 21:12:41 +00:00
Ryan Macnak 265ab831b6 [vm] Partial fixes for LTO.
Change-Id: Ic867777a7fc5df6631ce11030195d1323d7111ed
Reviewed-on: https://dart-review.googlesource.com/52983
Reviewed-by: Zach Anderson <zra@google.com>
2018-04-30 19:23:58 +00:00
Janice Collins 6d9371aec3 Prepare for analyzer-0.31.2-alpha.2
Change-Id: Ib428b7316633bb77978428a17956bc05e736d57d
Reviewed-on: https://dart-review.googlesource.com/52981
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-04-30 17:56:31 +00:00