Commit Graph

25510 Commits

Author SHA1 Message Date
Nate Bosch 2958e80671 Refactor to conditional and spread elements
Change some of the straightforward collections to use spreads, for
elements, and conditional elements. Many of the patterns in this file
can't be translated because they are more complex - keep the simple ones
with a declarative structure so that it is more clear when there are
extra computations or side effects that are meaningful.

Change-Id: I135b10641f61fc43ebbc4bbd7196c315339c3ee8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104103
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2019-05-30 01:12:12 +00:00
Konstantin Shcheglov 5352c67478 Tweaks for 'Import Library' quick fixes to better reflect the expected behavior.
R=brianwilkerson@google.com

Change-Id: Ifdeb775636322382a40c800dc02d6f980e309369
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-30 00:56:09 +00:00
Konstantin Shcheglov 2ef2eb14d5 Fix FixesTest on Windows.
R=brianwilkerson@google.com

Change-Id: Ie56b0f876895f559f019b311be6460f95f7e37e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-30 00:19:49 +00:00
Nate Bosch 475d68527c Add types on overridden method signatures
We were inconsistent about using return and argument types with
overridden methods. It is technically safe to omit them since they'll be
inferred from the super class - but it's more explicit and readable to
repeat them here. We were already using types on some of the overrides -
add them to the remainder.

Change-Id: Id8529e40a80c8ff3d5feb231a37a12d3d6487b4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104160
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-05-30 00:18:09 +00:00
Sigmund Cherem d99d83ea09 Add ddc modular test suite and single test
The test is failing, for now I plan to just land the test in its failing test and change the status once it starts passing.

Change-Id: I305c32cc7a163e280bdb766f29835264c331c9ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103680
Reviewed-by: Vijay Menon <vsm@google.com>
2019-05-29 22:24:21 +00:00
Mike Fairhurst 2268c65cbe First subtyping rules for nullable types
Change-Id: Ibaaea75f8b5e83f1fb7039332093121854108da8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103548
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-05-29 22:13:11 +00:00
Vijay Menon dd5530a73e [dartdevc] make ImmutableSet private
Patch files should not add public members to the underlying library.

Siggi was hitting this when wiring up modular testing for DDC:
https://dart-review.googlesource.com/c/sdk/+/103680/3/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart#544

The ddk builder appears to have be swallowing this error - not yet sure why.

Change-Id: I86098b25a344b2bb8b69fe3dc386d01f6f7cb309
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103740
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-29 20:04:24 +00:00
Sigmund Cherem 4c9bf5479f Extract generic runner logic, now dart2js modular test is mostly dart2js specific
Change-Id: I73f1a5590681871a54c5bc8dc1ad0d7d0f71024e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103660
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-05-29 19:23:33 +00:00
Konstantin Shcheglov 76750c58f2 Issue 35553. Report WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE.
Locally I see that out of 198 language_2/superinterface_variance/ tests:

* With summary2 we pass 197, and fail 1 test.

* With summary1 we pass 165, and Crash in 33 tests.

R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/35553
Change-Id: I79b5d7d2931c2d0c42ae6f12c19324deb7af784f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103960
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-29 17:13:30 +00:00
Brian Wilkerson 98a4dba4b3 Update Element.appendTo to more closely match Dart syntax
Change-Id: I74bf13f3b072c734b018517e6d06e182a0736bb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103961
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-29 17:06:40 +00:00
Nicholas Shahan 694699c6e4 [dartdevc] Improve NSM errors when making dynamic calls
Add specific error text for the dynamic call failure cases:
* Calling null.
* Calling an object instance with a null `call()` method.
* Passing too few or too many arguments.
* Passing incorrect named arguments.
* Passing too few or too many type arguments.
* Passing type arguments to a non-generic method.

This does not address the issue of a missing name. The errors still just
reference 'call'. Tagging a name could be added in a future change.

Issue: #36165
Change-Id: I21592ef506908559da0bfe9aac5ed5bae7fcb84e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103645
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-05-29 16:57:30 +00:00
Konstantin Shcheglov a332c414f1 Switch server to using DeclarationsTracker for 'Import Library' quick fixes.
We need this to stop using UnlinkedUnit with summary2.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Iaca2f19e6a168818e171f09e6eeda71a75854232
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103921
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-29 16:45:32 +00:00
Brian Wilkerson d74d49e748 Convert more diagnostic tests to include location
Change-Id: Ie7b31b09969acba5efbf9f27008ec805da15a8cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104060
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-29 16:28:20 +00:00
Danny Tuppeny fca2c82be0 Add support for cancelling requests in LSP server
Change-Id: I2a651b1e4f8509c7f10d245b2369aab842d08041
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103845
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-29 14:52:40 +00:00
Vijay Menon 47e63b0eee [dartdevc] encode part file metadata
Fixes https://github.com/dart-lang/sdk/issues/37074

Hand-tested on flutter gallery.  E.g.,:
> dart.getParts('package:flutter_web_ui/ui.dart')
(15) ["src/ui/canvas.dart", "src/ui/compositing.dart", "src/ui/debug_canvas_reuse_overlay.dart", "src/ui/geometry.dart", "src/ui/hash_codes.dart", "src/ui/initialization.dart", "src/ui/lerp.dart", "src/ui/natives.dart", "src/ui/painting.dart", "src/ui/pointer.dart", "src/ui/semantics.dart", "src/ui/browser_location.dart", "src/ui/text.dart", "src/ui/tile_mode.dart", "src/ui/window.dart"]

Change-Id: Ied734d9f3739886d6679a9a9bbeae854e432bc52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103602
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-29 14:48:40 +00:00
Aske Simon Christensen d5405d06f4 [cfe] Allow local const variables as annotations.
Fixes https://github.com/dart-lang/sdk/issues/37065

Change-Id: If902bd22fc6e0925c361a31e22b32d046ea4754e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103628
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-05-29 09:21:39 +00:00
Alexander Thomas 182d55dfda [dart2js] Add support for BabelJS to test.py
This adds support for BabelJS to test.py's dart2js compiler
configuration. When --babel is specified directly or through a named
configuration, test.py will run an additional step after dart2js that
post-processes the javascript output by running it through BabelJS with
the specified Babel configuration. BabelJS is added to the DEPS in its
standalone form. d8 is used to run BabelJS standalone to avoid adding
a dependency on NodeJS. d8 can only write to stdout but not to files or
stderr, which makes it necessary to change the test_runner to handle
commands that expect their output to be piped to a file.

Changes:
* Add --babel option to test.py.
* Add babel option to pkg/smith.
* Switch IE11 builder to use babel transformation.
* Fix option list comparison bugs in pkg/smith.
* Change dart2js compiler configuration to generate files using the
  test name rather than just "out.js" (update test that relied on this).
* Remove runtime_configuration dependency on test_suite.
* Remove obsolete blocks adding --preview-dart-2 dart2js arguments.
* Make dart2js' compiler configuration more like DDC's.
* Remove createCommand method that is no longer used.
* Remove support for "OtherResources" which was only used for
  dart:isolate tests on dart2js and DDC.
* Skip co19_2 tests that are slow to transform with babel.
* Simplify the timeout handling in the test runner with Future.timeout.

Change-Id: I32e4917b2a57ecbe684538e40d744f0101c552a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/90402
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-29 08:39:44 +00:00
Konstantin Shcheglov b1d3a212a7 Fill references to dynamic/Naver in LinkedElementFactory.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I85f61c6322a6332ac6b095aaf8cf4203460babc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-29 01:20:42 +00:00
Stephen Adams f9bf379ae1 Move BOOLEAN_CONVERSION_CHECK to separate HInstruction
The new HBoolConversion instruction can be removed after the NNBD transition is complete.

Change-Id: I136c23f10440cb2414db32e5054b743714f7116b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103681
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-28 21:23:06 +00:00
Brian Wilkerson 2e51423c3d Convert the way function types are displayed to better match the syntax of Dart
Change-Id: Id5068bd52b3a35c70cb0d2ccc735469e2f8a0d3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103701
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-28 20:48:51 +00:00
Konstantin Shcheglov da3ead02c1 Issue 3446. Recurse into attributes to find children widgets.
R=brianwilkerson@google.com, devoncarew@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/3446
Change-Id: Ifa83367c68b406b342e0f99195015d98eaedb049
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-28 20:09:25 +00:00
Paul Berry 9556a95038 Fix string->bytes encoding in overlay_file_system
Change-Id: I2777c09908172c282f59cb2bf0ed5bd208442dd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-28 20:01:05 +00:00
pq fc17a90bed assist for sorting child properties last
Change-Id: Ia39f5b170858789897579f952ece03dcf6765e3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103860
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-28 20:00:05 +00:00
Alexander Aprelev b0a11c9d25 [vm] Fix kernel list loader so that files are relative to the list.
Fixes https://github.com/dart-lang/sdk/issues/33952.

Change-Id: I95325217601dd6a25a058e36d359014eab7e61bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103901
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-05-28 19:42:45 +00:00
Vijay Menon 96c2d3c303 [dartdevc] enable testing of ddc internals
Change-Id: I8f4753a9a1f2f9f61df0d045adf07ff75fe32907
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103820
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-28 19:33:05 +00:00
Ryan Macnak af93ebcf4c [vm] Direct generation of ELF shared libraries.
Change-Id: I41c9911f33490e504f4852f15695ca4c3f32a77f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/81323
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-05-28 18:48:57 +00:00
Vijay Menon 834587a78c [dartdevc] fix import/export declarations for es6 to add extension
d8 assumes a '.js' extension - e.g.,:
```
import { core, dart, dartx } from 'dart_sdk.js';
```

Note: this will enable Siggi's modular compilation framework to run DDC tests on d8.

Change-Id: I1167a36e1454950149fecb8abc793728a16e4591
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103780
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-28 18:48:55 +00:00
Nicholas Shahan d06592b532 [dartdevc] Add details to failed assertion messages
* Source file location
* Assertion source code

This change embeds the information as strings into the compiled source. In the
future we could reconstruct the source file location at runtime from the stack
trace.

In tests with various large applications this added roughly 1MB (0.1MB
compressed) or less to the compiled file size.

Fixes: #36995
Change-Id: I2634f7eab6e54eec209094b52429987dd62c0828
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103568
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-05-28 18:03:38 +00:00
Konstantin Shcheglov 03781b9402 Build also summary2 in build mode.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I172612fd50c1cb50dfad8b5dc2807f744cf973b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-28 17:44:48 +00:00
danrubel fee615c5a5 consolidate multiple modifier error codes
This consolidates the following error codes into MODIFIER_OUT_OF_ORDER

* COVARIANT_AFTER_VAR
* EXTERNAL_AFTER_CONST
* EXTERNAL_AFTER_FACTORY
* EXTERNAL_AFTER_STATIC
* STATIC_AFTER_CONST
* STATIC_AFTER_FINAL
* STATIC_AFTER_VAR

Change-Id: I3f8c41bacc65ebc5d9255806cbee89cddb5ffeb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103880
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-28 17:01:16 +00:00
Todd Volkert 6aee4f390b Make analyzer's File.readAsBytesSync() impls return Uint8List
As part of the rollout plkan for https://github.com/dart-lang/sdk/issues/36900

Bug: dartbug.com/36900
Change-Id: Ic56cc1054ebae5967a1273b19f886a5e41b9460b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103060
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Todd Volkert <tvolkert@google.com>
2019-05-28 15:02:16 +00:00
Danny Tuppeny 85c28b804d Check LSP support for workspace/applyEdit before giving CodeActions that require it
Change-Id: I88af71be9788bd417a1f739f0f3e0efe930c2cd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103842
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-28 14:10:26 +00:00
Dmitry Stefantsov 39dbaecfc1 Remove tests relying on contravariant uses of varaibles in supertypes
Change-Id: Ie614d8f96bbe534117f83528b41fe63fdfa9c9c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103525
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2019-05-28 09:56:43 +00:00
Dmitry Stefantsov e6e2020fb2 [fasta] Allow only covariant uses of type parameters in supertypes
Closes #35792.

Bug: http://dartbug.com/35792
Change-Id: I1c647c74e1e8f8892fd76b735085b457e770f5b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103521
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-05-28 09:56:43 +00:00
Konstantin Shcheglov 527c165426 Deprecate 'abstract' setter in elements, replace with 'isAbstract'.
I deprecated 'abstract', but I don't see any uses of it outside of
analyzer, which I have fixed. So, maybe we should remove them right now?

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ifd86a6b0148be49df6455672742f825ffd50f661
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103661
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-05-28 04:16:43 +00:00
Konstantin Shcheglov d368bb8ecd Make some fields in LinkedNode informative.
R=brianwilkerson@google.com

Change-Id: I76eef7f07678723944e221d65936864d400b561f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-27 21:25:36 +00:00
Danny Tuppeny e4362612b0 Add support for dynamic registration for LSP
Change-Id: I55c7b2f7d683acab0f6aa4bdbcba3b155d2de32c


Change-Id: I6a0b13856053bd86e77637b9664c7fe41194c5f3


Change-Id: I7472cf93efc29585ccbcbd1e6c7b9f703872b3c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103532
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-27 17:36:20 +00:00
Aske Simon Christensen 1025c5bebb [DDC] Only inline textually small constants.
Fixes https://github.com/dart-lang/sdk/issues/36535

Change-Id: I62ad6d6f7390284d0a7a52d0d4b31e57ea1fbea6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103623
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-05-27 11:45:08 +00:00
Aske Simon Christensen 25033cee32 [CFE] Control inlining of const variables from backend.
Needed for https://github.com/dart-lang/sdk/issues/36535

Also preserve StaticGet of unavailable constants not in const context,
rather than wrapping it in an unevaluated constant.

Change-Id: Ifac6f251ea9a90a17d06014be12c0d387a32d757
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99020
Reviewed-by: Vijay Menon <vsm@google.com>
2019-05-27 11:45:08 +00:00
Jens Johansen ae944a68ed [Incremental compiler] Only re-check package-uris if base-uri changed
When the .packages file has changed we need to re-check all package-uris
to see if we need to invalidate the builders (if the file uri for a
package uri library (e.g. if the package was upgrade) has changed we
have to invalidate it).
This translation is semi-expensive though, so if we can avoid it that
would be a good thing.

This CL caches the "base URI" for packages from the previous run,
so we can start by comparing the base-URIs: If the base-uri for a
specific package hasn't changed, nor will the actual translation.
Only if the base uri has changed we do the actual translation,
and thus save many package-to-file-uri translations.

An internal benchmark via kernel worker of lots of outline
calculations in worker mode with reuse and the incremental compiler
(where the .packages file change every time and we have lots of
package-uri libraries) goes from ~185 seconds to ~162 seconds.

Change-Id: I3ed48b23a590dbf66f8a2379bb88e1b177f1f034
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103804
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-05-27 10:46:18 +00:00
Jens Johansen d911d9b5ff Cleanup "libraries" field in DillTarget when their invalidated
Before this CL we removed from from the builders map, but left them in
the libraries list.
When using the incremental compiler via kernel worker (where we
continually replace dill builders) that meant that this list would just
keep growing.

This CL cleans it up and the builders map and the list should now be
in sync

An internal benchmark via kernel worker of lots of outline
calculations in worker mode with reuse and the incremental compiler
goes from ~215 seconds to ~185 seconds.

Change-Id: I254558d517f544fe31b5673e0dc8748048f0c5ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103630
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-05-27 10:46:18 +00:00
Jens Johansen eb131c3d68 [kernel worker] Don't do unnecessary computeCanonicalNames
This was a left-over from when unbinding, and should no longer be needed.
An internal benchmark of lots of outline calculations in worker mode with
reuse and the incremental compiler goes from ~248 seconds to ~215 seconds.

Change-Id: Iedb6a3fb11504610c061503efb741e35919f0d32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103629
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-05-27 10:46:18 +00:00
Johnni Winther 0e5ebcaa96 Add InlineData and InlineDataCache
Merges InlineWeeder and InlineReductive into one visitor and computes
an InlineData object from which all decisions can be made.

Next step is to compute InlineData in the scope visitor (the first visitor
of the first modular phase).

Change-Id: I0c435ae1b3d7afdff1cee7abac657c9362995a67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103632
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-05-27 09:01:25 +00:00
Johnni Winther 508a9fa6b0 Work-around called-once imprecision
This avoids (yet another) inconsistency from the imprecision of
called once. In this case the inlining of some methods that are
called once is dependent on whether we meet their call-site directly
or indirectly first, effectively making the inlining decision subject
to the enqueuing order.

Change-Id: I8d6b9c18fdb82f6d1b566e6bb58344211678daf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103631
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-27 09:01:25 +00:00
Régis Crelier 735669190e [corelib BigInt] Fix implementation of BigInt.modInverse (fixes issue #37008).
A negative result was wrongly returned as a positive value.
Since positive values are preferred, the implementation now adds the modulus
enough times to make the result positive.

Change-Id: I87a2ceb359345846740a749ab6b46b1d45e7ba21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103664
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-05-25 22:05:51 +00:00
pq 5b200ea3dc remove unused import
Change-Id: Ib4b92a3cf453ed4f8945f62bf4213f03ceb8910d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103700
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-05-25 15:33:35 +00:00
Robert Nystrom 70bd05e662 Stop ignoring runtime cast failures on function types.
Change-Id: Id3485e04aafea988604663e893818672d98dc8b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103662
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-05-24 23:52:08 +00:00
Konstantin Shcheglov eff6e95385 Improve code generation for variant classes.
Change-Id: Iabaceebdf6efbec80d0026b74f71eac45b742760
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103600
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-24 21:55:16 +00:00
Jaime Wren 03e415a4e8 Update the hover 'containingLibraryName' to not include the 'file:///' prefix.
This is a follow up on a comment in the previous change https://dart-review.googlesource.com/c/sdk/+/103481/.

Change-Id: I0f377d6c7d68d55464a4e111a6a65715a82e0591
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103546
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-05-24 21:54:56 +00:00
Konstantin Shcheglov 4979a51a9c Add information about existing imports to completion response.
This adds quite a lot of information though, because we send many
strings.

Before: 20686 characters.
After:  55345 characters.

Theoretically we could do better, and send information about existing
imports only once as well, so when the user continues typing in a
single file, without touching imports, we don't send any new data
about imports (maybe just a confirmation that it is still the same).
But I'm not sure if this is a worthwhile optimization.

Actually, even included suggestion sets have similar property - they
don't change for a given file, unless there are changes to other
libraries which we might want to include.

R=brianwilkerson@google.com

Change-Id: I2f55e2dc85508849146aa39eb279beabaec937c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103561
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-24 21:35:06 +00:00