Commit graph

25455 commits

Author SHA1 Message Date
Paul Berry 8b17b2e143 Migration: add support for null-aware accesses.
Change-Id: Ie034c0410e667f2e55fd2b9d9e9b2b3b3726de30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105465
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-10 19:53:06 +00:00
Paul Berry 881a2e9e48 Migration: remove unnecessary constructor argument
Change-Id: Ic544c37070d6ac3b874dc1a34d1709cf0949ff70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105441
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 18:11:30 +00:00
Paul Berry eba533dcd1 Migration: Clean up handling of LUB and substitution nodes.
Previously we created artifical edges from a LUB node's components to
the LUB node; now the nullability propagation algorithm understands
how to propagate nullability downstream through LUB and substitution
nodes, so no artificial edges are needed.

Change-Id: Ib2fef14c3dcd58a013ad8e057fd55597a1deb4fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105402
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 18:11:30 +00:00
Brian Wilkerson c41e9ae0e8 Fix wording in spec
Change-Id: I468d0afa21102fc6fe6f30aa1c7bd0d1c46d8f94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105464
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 17:24:35 +00:00
Paul Berry 0a0927de9c Migration: Separate the implementation from the NNBD migration engine's public API.
Change-Id: I0ea000b9068661d4e9122414320202ebd4f8563b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105413
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 17:10:45 +00:00
Vijay Menon b3b9aacc5f [dartdevc] enable testing on ff/safari/edge
Change-Id: Ice9cc8f4955561a7d36b7ab2bc7a0622cc4966b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105482
Auto-Submit: Vijay Menon <vsm@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-06-10 16:24:55 +00:00
Paul Berry 575a6424c3 Migration: Remove transitional API
Change-Id: I9853b7577ba4b39bf1d51f7d03ba3c2d6499e79b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105412
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 16:18:05 +00:00
Paul Berry e23b00745f Migration: Move classes out of transitional_api.dart
This paves the way for removing the transitional API altogether.

Change-Id: I95181b04173d3439d278f898ae3b5ec574108b32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105411
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 15:13:23 +00:00
Paul Berry 47865b7643 Migration: remove unused field Variables._graph.
It wasn't detected by the "unused field" hint because there is another
field in the same file with the same name that *is* used
(NullabilityMigration._graph).

Change-Id: I955f30d010ddaa2d218f61daf32978d391182708
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105410
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 15:13:23 +00:00
Konstantin Shcheglov 4270982dd1 TypeSystem tests code motion.
Drop `Strong` prefix, extract LeastUpperBoundFunctionsTest.

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

Change-Id: I2ab28f23e28698f4c2063eb07362ae6df2938054
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-10 14:47:53 +00:00
Konstantin Shcheglov 0629ce94cc Change location where we set AnalysisDriver.useSummary2 in build mode.
We need to make sure that it is set when we create FileState(s).

Change-Id: I68103902d0f4df659291e02dd7809b2140b9af72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-10 14:47:03 +00:00
Brian Wilkerson f94628fb1b Convert the remaining diagnostics tests to test for location
Change-Id: I00fef7e7228bbe6d63c48267f42b5efc4900556d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105414
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 13:21:52 +00:00
Paul Berry 51046368c5 Move NNBD migration tool to a fresh package.
This gives us more flexibility for how we want to publish and deploy
the tool.  We now have the option, for example, of making a command
line app that invokes the tool and does not depend on analysis_server.

Note that some testing infrastructure had to be duplicated.  I plan to
consolidate this infrastructure in follow-up CLs.

Change-Id: I046506bc2bb5c3e467e15885f198ee0632351ee9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105463
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-09 17:45:35 +00:00
Brian Wilkerson 6c358d3ba6 Permissive mode reports the exceptions that were thrown and ignored
Change-Id: I1876577acc43ba076ff4eec3b2891e329c109c24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105407
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-08 14:29:09 +00:00
Sigmund Cherem 586e05e415 Set exitcode on generic runner if no output log folder is provided.
This is a temporary way to ensure the bots will fail on these test suites until
the test matrix provides the output directory. At that point, the .json files
will be used to track test failures and the exit code is no longer necessary

TBR=vsm@google.com

Change-Id: Ie96c3835760de02addc89f7ccbcb3ccb04c21940
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105405
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-06-07 22:59:49 +00:00
Sigmund Cherem fddecf659c Do not hide problems in kernel_sdk.dart
This addresses the most concerning problem in #37117

Change-Id: I38feb310023b066922a8049c5026a49572c3e399
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105461
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-06-07 22:51:49 +00:00
Brian Wilkerson 9559e4d444 Initial documentation for a small sample of diagnostics and a script to generate a markdown file containing that documentation
Change-Id: I06602a29c95829b42add1d655ad8d7190ae7100a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105141
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-07 22:31:16 +00:00
Nicholas Shahan 80fb7891eb Cleanup violation of no_duplicate_case_values lint
Technically 'let' is an invalid identifier in ES6 strict mode.
http://www.ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors

We are never passing `strictMode = false` so either way it always returns true.

Change-Id: I7891202d76dce621ee314dc583c6a44f916ab5b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104382
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-06-07 21:59:06 +00:00
Sigmund Cherem efaec6449d Add --use-sdk support for dart2js and ddk modular tests
This allows the test runners to use snapshots instead of using the compilers
directly from source.

Change-Id: I70664a740bed8de647adb658bd521cd574aa685e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104385
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-06-07 21:54:56 +00:00
Sigmund Cherem f6d67a549b Turn ddc and dart2js modular tests into suites and share their test cases
For this to work properly, we first need the test infrastructure to have support
for the `--output-directory` flag (see base CL)

Change-Id: I75f788d19ad3b4e9523830250c4a1c9de8418cda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104400
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-06-07 21:54:56 +00:00
Nate Bosch 8614f86c9b Remove remaining support for dart:isolate on web
Closes #37153

Isolate.resolvePackageUri was the only API which had an implementation
across DDC and dart2js. The implementation in dart2js has been broken by
default since Dart 2.0.0 without a user implemented hook that is not
used on any public repo on github. Our current supported path for
invoking the compilers on projects disallows the import altogether on
the web and it is only usable with an older version of the
`build_web_compilers` package, or by invoking the compiler manually
outside of the build system. This CL does not break the ability to have
the import when invoking outside of the build system.

- Drop implementation for `Isolate.resolvePackageUri` from the dart2js
  and DDC patch files.
- Drop all references to `defaultPackagesBase` since it is not used.
- Drop all tests under `isolate/browser` since we do not expect any
  support on the web. Most of these tests would have already been
  failing. Remove status file entries that refer to the deleted tests.

Change-Id: I4a19213b0946d835c00e9c107a714f3bc5672f86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105080
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-06-07 21:13:06 +00:00
Sam Rawlins 7a1af14458 Do not report that abstract methods should call super.
Change-Id: Ib365361c91b8b489c0d40c9097f2248ecca54176
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105344
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-06-07 21:12:56 +00:00
Stephen Adams d10dffbfbf Add simple test to create dynamic
- Add testing entry points to create Universe
- Add creation of 'dynamic'

Change-Id: I54dd27b9a2f6c93a382c4927e6a306b11bcea96c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105345
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-07 19:40:12 +00:00
Brian Wilkerson 065c42705c Added an errors field to allow permissive mode to display the exceptions that are being ignored
Change-Id: Id8fd27a7882c6dd20854d055477af25d17de3582
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105440
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-06-07 19:32:35 +00:00
Jacob MacDonald b7aa075ca2 add a --libraries-file option to ddk
Change-Id: If0698f5b3f3736fe597fbfe0a1d13cc4205c9575
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105403
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2019-06-07 18:03:15 +00:00
Konstantin Shcheglov 2bba747ae3 Don't attempt to serialize FunctionExpression(s).
R=brianwilkerson@google.com

Change-Id: I18df1789eca4460edc40285a3fde08c81cdbe96d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105351
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-07 15:46:00 +00:00
Jacob MacDonald 8a57c1d463 handle range errors when getting locations
Bug: https://github.com/dart-lang/sdk/issues/37018
Change-Id: I7a9e0d4186abe37133ef29c719a81461e26cc54f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105340
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2019-06-07 14:37:20 +00:00
Paul Berry 15a3df3c10 Migration: add support for cascade expressions.
Change-Id: Iae52bef6a18c9536db3187102566423bc2f1dba8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105325
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-07 13:39:49 +00:00
Brian Wilkerson da66902e4f Fix a bug in constructor element display string (issue 37165)
Change-Id: Ie5fe3b5c4e78be67887cf56e4698554d44095fd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105349
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-07 13:21:59 +00:00
Paul Berry 85cadff46b Revert "Fix implementation of isDartCore and isDartAsync."
This reverts commit 0779751b82.

Reason for revert: Broke test unittest-asserts-release-win:pkg/analyzer/test/generated/resolver_test (see https://ci.chromium.org/p/dart/builders/ci.sandbox/analyzer-win-release/5691)

Original change's description:
> Fix implementation of isDartCore and isDartAsync.
> 
> It's not sufficient to check the name of the library, since a
> user-provided library could always name itself `dart.core` or
> `dart.async`.
> 
> Change-Id: Id99cfc1ec89c5941e16b556e3c4dd175875a673f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104580
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>

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

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

Change-Id: I7a27b46f4b2d1b3b43f9943933ec2a75b5a5b806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105346
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-07 12:29:09 +00:00
Dmitry Stefantsov 40ef0c6d9f Specify type of _location field in Widget Inspector Transformer
The change in the CL prevents the widget transformer from introducing
compile-time errors.

Change-Id: Ib4a73eb13fb33397daeb5d17c613c42a1d1a6025
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105245
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-07 08:02:54 +00:00
Konstantin Shcheglov fd77972d8f Print time to prepare linking inputs.
R=brianwilkerson@google.com

Change-Id: I1e2779bb5468dd77a3551276796f5725900c1603
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105350
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-07 01:20:58 +00:00
Konstantin Shcheglov 8c9765c648 Clean up lazy_ast a bit.
R=brianwilkerson@google.com

Change-Id: Idf4ca6535088e5646474ac8728dbc6cff44eac4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105348
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-07 00:40:07 +00:00
Konstantin Shcheglov 6e0d978505 Build elements in default values.
R=brianwilkerson@google.com

Change-Id: I67c9e15832b28eeb49eeb7f8ecfd91734551b4d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105342
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 22:38:21 +00:00
Vijay Menon 612a3f8978 [dartdevc] enable sdk compilation from dartdevc
Kernel mode only

Build with:
> dart bin/dartdevc.dart -k --compile-sdk dart:core --modules amd -o dart_sdk.js

For now, this doesn't support building only parts of the SDK - dart:core brings everything in.

Change-Id: I23cda3064408778dc93c9b3d4be757f1e99bae0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104811
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-06-06 21:59:21 +00:00
Konstantin Shcheglov 587806476f Remove parsed units caching for now.
I see that we leak them when using DAS.
So, lets remove them for now until we can do this safely.

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

Change-Id: Iaf349225c6e338eacb40e82deb5f84dfaa82e48d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105326
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 21:49:53 +00:00
asiva 7e9a4b786d [VM/benchmarks] Rework Dart2JSCompileAll test to instead do CFE compile all
The Dart2JSCompileAll test has not been working for a while due to
- issues with package config
- issues with getting the sources compiled with CFE after the switch to
  kernel pipeline.
Revised this benchmark/test to instead load the kernel_service dill file and do a CompileAll of CFE.

Should fix
https://github.com/dart-lang/sdk/issues/36630
https://github.com/dart-lang/sdk/issues/27369

Change-Id: I07f5c81fc6938d318b84fa9ea2fa033ec30a05e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103406
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-06-06 21:36:02 +00:00
Dan Rubel 41eea71a69 improve dartfix fix descriptions and add examples
Change-Id: I19c74bd9c55da29460ebe6f41b79e327429d6b22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105323
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-06 20:23:48 +00:00
Dan Rubel b324850eae cleanup list of fixes in dartfix help text
This CL cleans up the displayed help text, better organizes and displays
the list of fixes that are or can be applied, and addresses
a comment in https://dart-review.googlesource.com/c/sdk/+/105002

Change-Id: I2e71001ae7eda61b3b01ce999cb9fdca968a9b93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105322
Commit-Queue: Dan Rubel <danrubel@google.com>
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2019-06-06 19:57:12 +00:00
Samir Jindel c4541e63f8 [vm/aot] Update serializer for V8's "snapshot profile" format
Fixes https://github.com/dart-lang/sdk/issues/37183
Addresses https://github.com/dart-lang/sdk/issues/37126

Change-Id: I1c1e516ac2bcc45e46059f4439f16aaee6d824fe
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105302
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-06 19:54:12 +00:00
Paul Berry c130384c71 Migration: support assignments to fields and setters.
Change-Id: I4dbf43878f5cbf0a16a041e0975880c3d844fa13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105041
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-06 19:52:37 +00:00
Mike Fairhurst 527dffd21b Use StringSource in type provider tests to prevent bad path lookups.
Prevent windows from doing a path lookup for 'dart:core' which will
crash. All we need is a string source with a uri..

Change-Id: I742060633f3bd89323ad3e3f0f19ae80c1aedbae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104806
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-06-06 19:38:27 +00:00
Mike Fairhurst 09296499c2 Resolve type names in decls to * types in legacy libs
Change-Id: Icac40493e069d93abedc0422e77e3bcf29e965d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104960
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-06 18:45:20 +00:00
Konstantin Shcheglov 4bdd6e160b Compute unlinked API signatures from AST.
With this change summary2 does not use content hash as API signature,
so can reuse linked bundles when method bodies are changed.

The implementation of the API signature computation is from:
https://dart-review.googlesource.com/74925

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

Change-Id: I2a53957b8fff5208055aa28a188d6481ba24f5df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105321
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-06 18:22:50 +00:00
Brian Wilkerson 14b75b522b Remove some unused imports
Change-Id: I02b2ceba0bf545932e8e99c940bb2373d9eb75ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105320
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 17:18:37 +00:00
Brian Wilkerson 30390c6ba1 Prepare to compute the documentation URL for diagnostics
Change-Id: Ib1b7e4887e18b90c1552f3f8501948ee8d8d2c1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105260
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-06 16:41:46 +00:00
Brian Wilkerson c34f74fd68 Update the minimum SDK constraint to allow the use of ui-as-code features
Change-Id: Iaa8e6bb3427f486c3432f76dac8e35052b5664ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105280
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-06 15:59:52 +00:00
Dan Rubel ba8e5f6535 list fixes when displaying help
This removes this --list option from dartfix and instead displays
the list of fixes when the --help option is specified.

Partially addresses https://github.com/dart-lang/sdk/issues/36875

Change-Id: Ibd8b124c2c20a752f7e661672eac8aa2e4483b26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105002
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-06 14:22:15 +00:00
Konstantin Shcheglov b9e877be78 Extract informative data from linked data.
So, that when changes to code that don't affect APIs are made, we
can use already linked bundles, and fuse it with informative data to
create elements with actual offsets and comments.

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

Change-Id: Ia0aa8af3c734b2cff497b49363064a26d601ebf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105142
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 14:14:10 +00:00
Konstantin Shcheglov 3bd2b03980 Issue 2972. Fix 'Wrap with...' for assignment.
R=brianwilkerson@google.com, pquitslund@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/2972
Change-Id: I4dda6f73516d1715686884d55dc43405b36f3631
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 14:14:09 +00:00
Dan Rubel 4a27605fdc generate kernel experimental flags
Change-Id: I9430d95c012b752bc4ca0530d79252b8b032a26b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104841
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Auto-Submit: Dan Rubel <danrubel@google.com>
2019-06-06 14:03:29 +00:00
Brian Wilkerson 3894b0896e Add partial code tests for extension methods
Change-Id: I5886c275383302566e997cb2f7e968c446b79369
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105160
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-06 12:41:19 +00:00
Brian Wilkerson 7e933abe68 Convert more tests to include diagnostic location information
Change-Id: If0d0dec8839fd6f836cff2b5f021cc8c40969b0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105140
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-06 12:40:39 +00:00
Aske Simon Christensen c8ee114beb [cfe] Pass triple-shift flag to scanner.
Fixes https://github.com/dart-lang/sdk/issues/37082

Change-Id: I3aead7432b64433a040d4586623e13d8ac5388ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104004
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-06-06 12:00:24 +00:00
Jens Johansen 1e6f08d41c Fix crash when non-class is given as supertype
Before this CL this code would crash fasta:
```
class A extends Function() {}
```

Now it produces a compile time error instead:

```
t.dart:1:7: Error: Can't use a function type as supertype.
class A extends Function() {}
      ^
```

(technically it already issued it, but crashed before doing so).

Bug: #36824

Change-Id: Iaeb9dc8390d4a9ab7b473848c3311f08a4dbba6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101283
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-06-06 11:33:24 +00:00
Jens Johansen b4d190f5cd [incremental compiler] Streamline processing of reused/removed builders
Suprisingly this doesn't seem to affect performance, but doing basically
the same thing in two different ways is suboptimal.

Change-Id: I1cc52bceb05a0af4d0e0d0574c3599c063cf42a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105242
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-06-06 11:31:55 +00:00
Jens Johansen 5eff2a0374 Split CanonicalNameError, no warning if CanonicalNameSdkError
Prior to this CL, we would issue a warning whenever a CanonicalNameError
was encountered.
This is in principal a good thing, but because we currently have no way
to detect if the sdk we get is the one we expect
(by any other measure than when it issues a CanonicalNameError) we often
issue these warnings for no "real reason" whenever, for instance,
the flutter sdk changes.

This CL splits the CanonicalNameError in two such that errors with
references to the sdk ("dart:" libraries) issue CanonicalNameSdkError
instead, an we then handle that differently. Namely we silently ignore
the error (i.e. don't issue a warning) and just don't initialize from
dill.

This should remedy the situation and be strictly better than to always
swallow CanonicalNameErrors.

Bug: 36032
Change-Id: Idbae0b5ee5b9843a5dbeb49b3c65ae25f5962e36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105240
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-06-06 10:10:46 +00:00
Brian Wilkerson 0c1c0afba3 Fix the documentation for ElementVisitor (issue 37151)
Change-Id: I03fbcb022bc92aaa88f65aeb895cad5de0b38e6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105100
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 01:31:04 +00:00
Konstantin Shcheglov cabd3237f5 Build new elements for GenericFunctionType in DeclarationResolver.
It seems that we don't really need to have the same elements for them
for resynthesizing element model and resolved AST.

R=brianwilkerson@google.com

Change-Id: I05efdf90671f596f2f8b85a3808eb2c4c87ea8c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105003
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 01:09:50 +00:00
Stephen Adams 237d3ca398 dart2js: Add skeleton dart:_rti libary
- Skeleton Rti type
- Skeleton test
- Add dependency on command-line flag to get dart:_rti into platform dill

Change-Id: Idf383269c66c9951e23fd70a45ce65c54a973586
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104921
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-06 01:02:20 +00:00
Brian Wilkerson 9efd0fa899 Use the right type provider based on the feature set of the library
Change-Id: I82a22cef142b89579c19e2063fb888e2827f2bb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104362
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 21:36:51 +00:00
Jaime Wren bbf0055a28 Follow up on recent computer_hover.dart changes, the containingLibraryName should not include relative paths from /.
Change-Id: I0fa25196e60eac694a09f3c71c36b2c09563c789
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 21:35:03 +00:00
Alexander Markov 86ea9ad1e7 [vm/bytecode] Add source positions for more bytecode instructions
Also, correct source position for CheckStack instruction in the prologue of
a closure.

Change-Id: I175e5398296f17a1f67a223d45725206e65e0e8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105040
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-06-05 21:06:56 +00:00
Nicholas Shahan 9cfe9bd34e [analyzer] Fix runtime error when creating SDK manager
Caused by a ternary operator with differently typed branches.

Change-Id: I5f9cfc28c274c125db0a999237f81dc3523896cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104240
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-06-05 20:44:56 +00:00
Paul Berry 9a061448a5 Migration: support assignment to index expressions.
Change-Id: I7f295247d059f532cabd24518f5009f017a34fd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104946
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-05 19:58:07 +00:00
Johnni Winther 74636a5777 Generate more fine-grained timing of the emission
+ emit a bit more progress info with -v

Change-Id: I60e44b2a383c8f55ef57c2a4cca98340baa66a01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104001
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-06-05 18:44:02 +00:00
Dan Rubel 487326eef4 fix AstTextPrinter
This fixes a bug found in
https://dart-review.googlesource.com/c/sdk/+/105000

Change-Id: I9d2e12557ad506a1b5a433cdae35229c04affed4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105001
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-05 16:52:54 +00:00
Dan Rubel 9b22dd8e92 remove hard coded feature index
Change-Id: Ib01f2c9b1516987ec39591a5a320bab81138718d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104786
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-05 16:49:24 +00:00
Brian Wilkerson 37976dd26d Improve test so that snippet is displayed when an exception is thrown
Change-Id: Ib5a7ed985df42b7d56dd98e104a145fddc895599
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105020
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 16:44:52 +00:00
Brian Wilkerson 788dcf681e Set or map literals can be ambiguous in invalid code
Change-Id: Ic17f5b80836bdf1891065af97adf5e9a5e021995
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105021
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 16:30:12 +00:00
Danny Tuppeny 94968f9bae Correct LSP completion relevance to add maximum boost instead of all boosts
Equiv change to https://github.com/JetBrains/intellij-plugins/pull/660.

Change-Id: I93192588de11afc1828b1f26e8f14f9b836cfd19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104982
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-06-05 15:24:22 +00:00
Paul Berry 42688f9d28 Migration: add support for reads from fields.
Change-Id: Iaa74a0d5d730df0a5ad57de839de01f1b54c1240
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104807
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-05 14:25:50 +00:00
Paul Berry 2cd86030a5 Fix return value in GraphBuilder.visitVariableDeclaration.
This method should return `null`, since it doesn't visit an expression.

Change-Id: I018241c0d2e9b9f00bfe293352cf2707551c81e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-05 14:24:20 +00:00
Dan Rubel 9197b34a0e generate analyzer experimental flags
Change-Id: I7dc2be03e7266b6ef0a936269a2dbe584096e3db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104785
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-05 14:17:35 +00:00
Dan Rubel 4181185070 parse nullable function typed formal parameter
Change-Id: I502d4c6649a8974883b9ded038ce8927d34eea10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-05 13:37:01 +00:00
Johnni Winther 682ffb6e7a Handle unevaluated constants in annotations
Change-Id: Icbcdac10ea5aabedbeebd7953134d297ab6c1d32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104561
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-06-05 13:05:00 +00:00
Paul Berry 79989d2627 Migration: recognize /*?*/ as expressing nullability.
Change-Id: I132d15775bb55ca4772a7b48f6a85c12c930a498
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104880
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-05 12:41:41 +00:00
Paul Berry 4402fbe672 Migration: support index expressions.
Change-Id: Ie43b5045df75b325a74243a8ae8801387c73c64a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-05 11:49:52 +00:00
Danny Tuppeny a684f2051b Reduce JSON for LSP completions by moving edits to resolve
See https://github.com/dart-lang/sdk/issues/37163.

Change-Id: I336245590560f7b30315a1dbda59ea56e5e9e043
Bug: https://github.com/dart-lang/sdk/issues/37163
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104862
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-06-05 06:47:51 +00:00
Danny Tuppeny 2f0c9904ee Remove docs from LSP (suggestion set) completions and provide during resolve
Change-Id: I1e3c99e3076e829822b418ffaf19dcb891e93f81
Bug: https://github.com/dart-lang/sdk/issues/37163
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104861
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 06:47:51 +00:00
Danny Tuppeny 91b3281531 Reduce LSP completion JSON by removing optional fields set to defaults
This addresses some of the things mentioned in https://github.com/dart-lang/sdk/issues/37163 but doesn't entirely solve the issue (for example it doesn't touch docs yet).

Change-Id: Ib0a094695905120ac5e222dae52165b9a5f9a825
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 06:47:51 +00:00
Brian Wilkerson 6031ca4116 Remove an unused import from the LSP support
Change-Id: I7fc72f249c18688cd8262f73ccd9c14aea45f908
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104943
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Danny Tuppeny <dantup@google.com>
2019-06-05 06:47:21 +00:00
Konstantin Shcheglov 37b714401d Add AvailableSuggestion.declaringLibraryUri
We need this to support existingImports filtering, because filtering
is done on suggestion basis, not on the whole suggestion set basic,
because of re-exports.

R=brianwilkerson@google.com

Change-Id: Id97cb122fa6e3c5c62e367098e1917eba997a76f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104808
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 01:20:51 +00:00
Konstantin Shcheglov cf4a9f4f75 Revert "Restore explicit SimpleIdentifier."
This reverts commit bb6e558534.

I found a problem with --use-summary2 in DAS.
When we implement actual API signatures, changes in bodies
change offsets for nodes, but summary2 also includes offsets,
and they don't match. So, DAS crashes. I will need to rework
offsets and other @informative data storage, so its turns
out that we cannot pretend so use real SimpleIdentifier(s)
anymore.

R=brianwilkerson@google.com

Change-Id: I1193cc3f6fd25aea1c39531e8a685b60b347166e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104949
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-05 00:34:22 +00:00
Brian Wilkerson f7526daebd Fix a hint in the migration engine
Change-Id: I119c44b30a1d3c6fb0d725ddb546cd3dcb31dab1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104809
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-06-04 22:18:43 +00:00
Paul Berry fa19cd7bb8 Migration: handle simple assignment expressions (x = y).
Change-Id: I580b902e83325a7a0a85686ebf7393993e531446
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104803
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-04 17:12:01 +00:00
Paul Berry 74b7165cc8 Migration: support references to local variables.
Change-Id: I43c4e2882c003b9cb219406c2aaac507b7f63979
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104802
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-04 17:03:56 +00:00
Danny Tuppeny 64a9253763 Add LSP method to fetch super method/class for a position
Change-Id: If8f28a708312113916cc9cecd75e768f7fec393b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104823
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-06-04 16:05:15 +00:00
Paul Berry 15c0315e8e Migration: add support for local variable declarations.
Change-Id: Ifead9354c583a070a7240d158823eafe1be3d875
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104840
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-04 15:53:25 +00:00
Paul Berry 46dd19609e Migration: recognize /*!*/ as expressing non-null intent.
Change-Id: Ic9f0b3f560df00adf5e7cbab71b3380f6c43c0aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104801
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-04 14:54:29 +00:00
Paul Berry 53de6054d9 Add a missing migration test case for binary expression
Change-Id: I996976d2247b3b19670f02dd9d3577cc7d8c1fdc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-04 13:49:29 +00:00
Vijay Menon 3b5a187726 [dartdevc] move ddc internal libraries under sdk
Note, this has the effect of including all DDC Dart sources with the
shipped SDK: we ship everything under sdk/lib.

This should enable https://github.com/dart-lang/build/issues/2262

Change-Id: If66bc7c620034e7f2acf7d2c3e9524a408417681
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104383
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-04 13:47:29 +00:00
Danny Tuppeny 9a3478ac20 Add support + tests for closing labels
Change-Id: I415a352010044d3b4aeb156d9d11dbbd94e86461
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104782
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-04 13:35:57 +00:00
Danny Tuppeny 0200a1e7b2 Extract LSP initializationOptions into a class
Change-Id: I50402bb75f51a771931d9b5255b7b9207d0f316b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104761
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-06-04 13:35:17 +00:00
Kevin Millikin bd60fa1ad5 [cfe] Write constant field initializers into outlines
For constant field initializers, compile the initializer expression
to Kernel, perform local type inference, and perform necessary
rewrites during outline construction.  This will support constant
evaluation during separate compilation.

Change-Id: I65fe601595c04c45d586d0bac97c2ade6ab15a90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104564
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-06-04 13:14:29 +00:00
Jens Johansen 422553798e [incremental compiler] Don't process dill libraries twice
An internal benchmark via kernel worker of lots of outline
calculations in worker mode with reuse and the incremental compiler
(and lots of dill loaded dependencies) goes from ~160 seconds to ~150 seconds.

Change-Id: I80afa10caacef5e14e569928a1d421bd3e8ab342
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104003
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-06-04 11:33:29 +00:00
Paul Berry 0779751b82 Fix implementation of isDartCore and isDartAsync.
It's not sufficient to check the name of the library, since a
user-provided library could always name itself `dart.core` or
`dart.async`.

Change-Id: Id99cfc1ec89c5941e16b556e3c4dd175875a673f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-04 03:12:28 +00:00
Konstantin Shcheglov d24b407568 Add --use-summary2 flag to AnalysisServer.
So that we can start dogfooding it.

I noticed that we logged too much data, so I reworked what we
log in LibraryContext.

Currently performance will be subpar, due to using content hash as
file's API signature. So, any change to a file, even in a method
body will cause the whole library cycle (and everything that depends
on it) invalidation. I will implement computing API signatures for
parsed unit (hopefully reusing something already existing) in a
following CL.

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

Change-Id: Ifb77e29188484b6784edbaa6a6d5daca6800ef2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104603
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-04 02:58:29 +00:00
Mike Fairhurst 55d3bbf13f Promote parameter of == to nullable when invoked.
This is required because otherwise

Object() == null

requires the type signature of Object.operator==(Object o) to be
changed to Object.operator==(Object? o). Which I don't think is the
behavior we want.

Confirmation that this CL is correct has been sent to the language
team. I recommend we land, which will unblock my subtyping CL, and
roll back/readdress later if need be.

Change-Id: I498f9870e7128b2cac3012fff0cb1ab50fcc8df7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104344
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-06-04 00:36:24 +00:00
Nate Bosch 0241e40c15 Track Library URI for classes
Closes #36771

- Add getLibraryUri and setLibraryUri runtime utility.
- When emitting classes add a statement to set the library URI.

Change-Id: I8974c7fdd4d9986f27a35f116d9881af043c0c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104641
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-06-03 21:47:17 +00:00
Vijay Menon 69063ab552 [dartdevc] automatically find d8 in ddb
Also remove stale files

Change-Id: Ie3004a3c7f30148459caa1a4b08d909c08484eca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104420
Commit-Queue: Vijay Menon <vsm@google.com>
Auto-Submit: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-06-03 20:02:46 +00:00
Sigmund Cherem 1045ef1ceb Use generic test runner to log data using the test infrastructure jsonl format
Mostly this is adding an abstraction so we can produce the jsonl files that will
allow us to track the status of each test individually.

On a separate CL I'll be moving the tests out of the current unit tests into
their own step in the test matrix.

Change-Id: Id4537db1458949370195124164b120b49a7a526c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104384
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-06-03 19:16:49 +00:00
Brian Wilkerson 34a45de500 Add support for representing nullable function-typed parameters
Change-Id: Ia667236d5d60bb5c1aca7fc0747702f244182a19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104621
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 19:06:09 +00:00
Konstantin Shcheglov c54eac55ad Reuse field tails/offsets in VTable instances.
So, that we don't have to allocate these lists for each instance.
This makes it cheaper to have serialize more objects.

In a synthetic performance test, where we turn IDL builders into
bytes 100 times, this improves time to bytes from 45 to 34 seconds.

R=paulberry@google.com

Change-Id: Ie8c9a8ed01b4c0d4abeba96ed5e99bd430f9309d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104600
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 18:28:19 +00:00
Mike Fairhurst 15e6c0bca9 Fix Never? in two ways: print ? in diagnostics, and don't set on element.type
Change-Id: I3f846f18c2c52d459c6876de108e9228f1082747
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104341
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-06-03 18:01:38 +00:00
Konstantin Shcheglov d63466041c Issue 131596231. Suggest names for SimpleFormalParameter(s).
R=brianwilkerson@google.com, jwren@google.com

Change-Id: I9074ef1a5aaeee32303dcf247c2be86f9c173d14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104460
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2019-06-03 17:34:18 +00:00
Konstantin Shcheglov bb6e558534 Restore explicit SimpleIdentifier.
It does not look that using name/nameOffset saves us much.

R=brianwilkerson@google.com

Change-Id: I00c297d64399ad1027a5ff0c2b8d7c757b190b78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-03 17:01:51 +00:00
Konstantin Shcheglov ef62349c6d Turn on useSummary2 in build mode only temporary when computing errors.
We don't want to keep it on while building summary1, because there
are changes in type manipulations that depend on it.

R=brianwilkerson@google.com

Change-Id: I4f84860ec197eb8f40dba80ecb51868f3d48e5e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 16:13:44 +00:00
Paul Berry 578629ad26 Add migration support for property accesses.
Also made some minor improvements to the handling of method calls.

Change-Id: I8728a7901cfe61f88563b71e290e9d5b303afda1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104486
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-03 14:51:34 +00:00
Paul Berry b1e28691d1 Only create hard edges for local variable/parameter references.
Exception: also create hard edges for the relation between a type
argument and the corresponding type parameter bound, because that
can't be fixed by a null check.
Change-Id: I71b21ddb11c1bb1060cb6f13efde13855770e2b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104485
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 14:51:34 +00:00
Paul Berry 8776bdbf42 Rename migration visitors to reflect terminology in the design doc
Change-Id: I9e554356032700bbbac93df4e754fa1fc1c67041
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104484
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-03 14:51:34 +00:00
Kevin Millikin 907f31e6de Reland "[cfe] Build some annotations during outlining"
Reland the change to build some annotations during outlining, with a
bug fix.  Annotations from patch classes and procedures were not
applied to the actual class or procedure, which is fixed.

The original commit was reviewed at
https://dart-review.googlesource.com/c/sdk/+/103806

The revert was reviewed at
https://dart-review.googlesource.com/c/sdk/+/104220

The original commit message was:

    During the outline phase, after top-level type inference, compile
    annotations for libraries, classes, fields, procedures, and
    constructors.

Change-Id: I836160ddad4114ded72701e8a3938f703228931c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104560
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-06-03 10:20:15 +00:00
Paul Berry e31af09992 Remove NullabilityMigrationAssumptions class.
This was a lot of bookkeeping for very little added value.  If we want
to experiment with changing the behavior of the migration tool in the
future, we should experimentally change it and see whether the quality
of the migration improves; it's not worth speculatively keeping
multiple behaviors around while the tool is being developed.

Change-Id: I9a59e2626be7e9e84a937e287421abcdc971aba5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104482
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 02:20:26 +00:00
Paul Berry 709df79404 Clean up logic to decide whether to create hard edges
Previously we were creating hard edges for the default values of
optional parameters.  This was incorrect; we don't want a hard edge
because we don't want evidence of non-nullability to propagate
upstream from an optional parameter to the const expression that sets
its default value.

Change-Id: I44e12ae96987fd7a9defc538b0704cf76262473f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104500
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 02:20:26 +00:00
Paul Berry 01694dcca1 Handle nullability nodes for dynamic types more cleanly.
Rather than use an edge from `always` to ensure that these nodes are
nullable (which is error prone since it could be overridden by an
assertion), we simply place these nodes in the ordinary nullable state
at the time they are created.

As a side effect we can reduce the amount of code we have to plumb the
nullability graph through.

Change-Id: I46cf5b2026aeb2917cb35a7ad0d36a0a0562ecc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104481
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 02:20:26 +00:00
Paul Berry 9aa88b1168 Add a const bool to make it easy to enable dumping the nullability graph
Change-Id: I6fc5c5f78cf1665f2551206979ebb5246f03c998
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104480
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 02:20:26 +00:00
Paul Berry c229555d87 Rework the graph representation for the migration tool based on the design doc.
Change-Id: I1777042926f83cd2f95da6c6db315a8d49c64df1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104422
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 02:20:26 +00:00
Paul Berry ca84a69609 Modify NullabilityNode to allow the 4 possible states from the design doc.
Change-Id: Ic28867227ad6080d693eff7576335e0a15bbe178
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104440
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 00:00:05 +00:00
Konstantin Shcheglov 2c4a2237d2 Disable search.getDeclarations with summary2.
It is unlinked summary based, we don't support it with summary2.
So, to not crash we return the empty list.

R=brianwilkerson@google.com

Change-Id: Ic220ae3526a3a3e2f06c60b4e25d7e7cef69af60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104201
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-01 18:21:48 +00:00
Konstantin Shcheglov 519ddc1ac4 Document that AVAILABLE_SUGGESTION_SETS also turns on existingImports.
R=brianwilkerson@google.com

Change-Id: I053c68eb541358f0bbd891ca16f1c5628e701096
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104342
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-01 17:27:03 +00:00
Konstantin Shcheglov 577ab8d631 Issue 37129. Check for missing importedLibrary.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/37129
Change-Id: I60f5c1382cdb19988e786fff81e8450a6de3888c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-01 17:26:41 +00:00
danrubel 6f2f92f578 improve extension method declaration recovery
Address comment in https://dart-review.googlesource.com/c/sdk/+/103580

Change-Id: Ie92e4fa752eaf851fec9465565d640524b569760
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-31 23:30:25 +00:00
Régis Crelier cddf2bbdfe [vm/debugger] Support debugging of interpreted frames.
Change-Id: Iaf59e6ed887ed973fcfc7f1c414ad52ef98f01d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100270
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-05-31 21:40:32 +00:00
Mike Fairhurst c5e03e5cce Fix tests that assign null to non-null locations
Change-Id: I3cda901d3645f162ddc60e071b0eaa46d06c356b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104284
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-05-31 18:57:35 +00:00
Konstantin Shcheglov 9d4649a44c Set context type for downward inference in constants.
R=brianwilkerson@google.com

Change-Id: Ifca9953d970906c7291c32f8db6f4d294429cce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104283
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-31 18:31:44 +00:00
Konstantin Shcheglov b3f262298c Fix recording covariance for default parameters.
R=brianwilkerson@google.com

Change-Id: If904634685a223713e467fc93c0e04afd1378ce0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-31 16:56:44 +00:00
Danny Tuppeny 190599de78 Skip LSP cancellation handling for Notification requests
Change-Id: I0edf6206db66ed07390dafcd5ea72bb2397468fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-31 14:45:24 +00:00
Johnni Winther edae8c474c Fix _createSdkModule for Windows
Change-Id: I3392742a80a3f27062e0d48c02f58b4ddf20c376
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103810
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-05-31 14:20:24 +00:00
Johnni Winther a620c56e8d Ensure output unit data for late members
+ assert classes and members have an output unit

Change-Id: I69749d54d79a66fea4947034458295010f83c0cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103805
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-31 14:20:24 +00:00
Brian Wilkerson abc8195541 Add more failing tests for downward inference in nnbd
Change-Id: I67225cd56c3ecf23cf7e03860aa750e7f951dcb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104188
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-31 13:24:44 +00:00
Dan Rubel 2938630937 update parser to handle "!." in nnbd expressions
Fix https://github.com/dart-lang/sdk/issues/37111

Change-Id: I6e156a804085c9be12e5e7a0d0019cfeb77c9128
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104187
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-31 11:37:44 +00:00
Stephen Adams a25f927ba9 Split HTypeConversion
Introduce HPrimitiveCheck for checking the receiver or argument of
primitive operations. These will eventually go away with NNBD since it
will be a call-site type error to invoke `+` with a null receiver or
operand.

Change-Id: I54bf64f8231a234341c1ddf5ad4dba26909d613d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104185
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-30 23:38:25 +00:00
Nicholas Shahan c4a1ca903f [dartdevc] Cleanup violations of unrelated_type_equality_checks lint
These violations look like actual bugs and were not simply mechanical fixes.

Change-Id: I69ae67751e48829fc4733dcb327ba0aa52602c91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104063
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-05-30 21:35:25 +00:00
Konstantin Shcheglov e34d63bd11 Visit return types of functions/methods to consumer GenericFunctionType(s).
R=brianwilkerson@google.com

Change-Id: I8f57065a6c54afc749168e02966f46a93ec0307d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104261
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-30 21:22:42 +00:00
Alexander Markov 372b02d97f [vm/bytecode] Add information about local variables to bytecode
Change-Id: I22bbd3b7ea0cccc0a8d721c3766a80ae1c72060d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/87701
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-05-30 21:21:44 +00:00
Konstantin Shcheglov 0a66b3e644 Fix scopes for resolving class / mixin headers.
R=brianwilkerson@google.com

Change-Id: I981fc1b76435d2a7e2ae1045f49ade12febafa01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104186
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-30 21:13:15 +00:00
Brian Wilkerson d51d41b109 Add some failing tests for downward inference in nnbd
Change-Id: I8ae6924ef22efffc0ff5b42c45864eedf75e7c0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104184
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-30 19:27:16 +00:00
Brian Wilkerson 556c9134ac Update the SDK version associated with constant update hints
Change-Id: Id082dcfbbbf19672c8bc036161326a15c8f9d9f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104260
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-30 18:22:16 +00:00
Konstantin Shcheglov 7c956f4387 Make it possible to consume summary2 in build mode, but don't turn it on yet.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Iad4d625217e3eeb6d8e5142825224dc0b2dcf8bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-30 16:49:04 +00:00
Konstantin Shcheglov 13ff60ec02 Use Substitution for typeAfterSubstitution with summary2.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: If8c4a4ad7db406fa4af9f22456ec40d153588db9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104183
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-30 15:33:17 +00:00
Konstantin Shcheglov dad211bfca Store offset for ConstructorDeclaration.
R=brianwilkerson@google.com

Change-Id: I49ee91ee44b01f320b0e1d8b87ccaafe9774ded1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-30 15:25:22 +00:00
Konstantin Shcheglov 47ed7f737a Resolve default values in mixin method parameters.
R=brianwilkerson@google.com

Change-Id: Ie31fa9f484a0810731a08907fbb8a7725ca21115
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104165
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-30 15:25:14 +00:00
Vyacheslav Egorov 39ec9fc4f3 Revert "[cfe] Build some annotations during outlining"
This reverts commit 1df5fb3d57.

Reason for revert: large regressions on Flutter microbenchmarks. Reverting to prevent this reaching Flutter.

Original change's description:
> [cfe] Build some annotations during outlining
> 
> During the outline phase, after top-level type inference, compile
> annotations for libraries, classes, fields, procedures, and
> constructors.
> 
> Change-Id: I95ca65fd58ad88d9452a28d5a0652bee44aeda3a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103806
> Commit-Queue: Kevin Millikin <kmillikin@google.com>
> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>

TBR=alexmarkov@google.com,dmitryas@google.com,askesc@google.com,kmillikin@google.com

Change-Id: I67c0719f9175c1bd75b609d7d5c0cea5c294bd6d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104220
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2019-05-30 08:46:55 +00:00
Kevin Millikin 1df5fb3d57 [cfe] Build some annotations during outlining
During the outline phase, after top-level type inference, compile
annotations for libraries, classes, fields, procedures, and
constructors.

Change-Id: I95ca65fd58ad88d9452a28d5a0652bee44aeda3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103806
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-05-30 07:29:12 +00:00
Brian Wilkerson 0325ba4b4a Update test framework to uniformly use NNBD in type strings
Change-Id: I060ec6491c2100982a701a51f89af0f55ef8d706
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104162
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-30 04:04:02 +00:00
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
Brian Wilkerson e43d81af5f Folders containing overlayed files should exist even if they do not exist on disk
Change-Id: I511b5075cb10b2594dce9dc33f165b64d9527043
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103565
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-24 20:47:46 +00:00
pq e42d4a1d89 fix missing returns in lambdas
Change-Id: I5005ffc057749468844d47e8e5c195871586bd57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103601
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-05-24 19:24:02 +00:00
Sigmund Cherem baa721ba23 Add an sdk module to the modular_test pipeline
+ and use it in the dart2js modular tests

Change-Id: I66cf29dcea7fb705135049e7a6ea4eb17052f3d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103575
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-24 19:09:12 +00:00
Sigmund Cherem 64ed4bf664 Changes to bazel worker to support modular testing.
This includes:
 * accepting null values like sdk-summary or .packages (which are not used when building kernel for the sdk itself)
 * allow enabling language experiments
 * only exclude-non-sources on the non-incremental code path if that's requested

Change-Id: I08eeb643676f1f1406f0f3030c341d68179d42a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103574
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-05-24 19:09:12 +00:00
Dan Rubel f4f2c77d4a improve missing body error messages
This builds on the prior CL to improve the error messages
for missing switch statement body, missing finally clause body,
and others.

Change-Id: Ia2def1f3a75d5581356c12aee4705ef21870f749
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103571
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-24 17:03:25 +00:00