Commit Graph

6018 Commits

Author SHA1 Message Date
Jens Johansen e84bea25df [CFE] Fix crash in incremental compiler caused by async redirecting factory
Redirectig factories are encoded in a special way to "recover" their data
(together with _redirecting# field). Before this CL, if a redirecting
factory was async (that's an error) it was encoded so we couldn't load
that dill again and that we would throw an error if we tried.
This CL fixes that.

Change-Id: If73ef5f662fb23bc083eb1af086d9d7694ca538c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133061
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-01-23 12:52:57 +00:00
Jens Johansen 44316eaade [CFE] Incremental compiler refactor #1
Change-Id: Ibee62f7f61130ebf4af7a2047fe80b04c564f78d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132902
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-23 12:04:17 +00:00
Teagan Strickland a003d5e69a [vm] Refactor debug info handling code into a new package.
Change-Id: Iaf944564ebbe4bdcc215166f784e949362583a69
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132281
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-23 10:14:17 +00:00
Jens Johansen 241d2c6cf5 [CFE] Strong test can have linked dependencies
Change-Id: Ia95789b658147f7e2676a9c92b6ba4a1c419395b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132642
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-01-23 09:37:37 +00:00
Johnni Winther 163fcf6d46 [cfe] Check null nullable accesses and include null in inferred type for null aware expressions
Closes #40205

Change-Id: I679b056a0c733e7bcaf3f79fd4b659fc6844c94c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132842
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-23 08:52:47 +00:00
Jens Johansen 6aa7407d63 [CFE] Proof of concept of using vm service to find leaks
Use the VM service to find leaks in the incremental compiler via the
incremental compiler test suite.

Currently the following tests leak:

incremental_load_from_dill/no_outline_change_2
incremental_load_from_dill/no_outline_change_6
incremental_load_from_dill/no_outline_change_7
incremental_load_from_dill/no_outline_change_10
incremental_load_from_dill/no_outline_change_34

Change-Id: Ie05ad5994f518422c553dc52bd57908ebbf1b16b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132283
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-23 08:30:07 +00:00
Jens Johansen ef7ae27e8a [CFE] Add interactive mode to spell checker
Change-Id: Ieec964b99d1c19c58e100b64f68e091178261172
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132644
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-23 08:23:27 +00:00
Nicholas Shahan befa0a0670 [cfe] Automatically opt out generated multi-tests from the *_2 paths
This expands the "hack" that was added to automatically opt out tests.
It was not working for the multi-tests in the opt out directories since
the sources were being generated into the generated/tests/ directory.

Change-Id: If403ff36c2250f1dbdd04dd5c6ee81bf63c9ab22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132811
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-01-22 21:12:48 +00:00
Johnni Winther 4ad57412bb [cfe] Use legacy erasure and nnbd top merge in computation of supertypes in ClassHierarchyBuilder
Closes #40134

Change-Id: I50e6f4c6fe7b1e0fa7f3e0e609e015f630cff1b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132343
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-01-22 08:37:36 +00:00
Johnni Winther 5e389080a4 [cfe] Test supertypes computed from ClassHierarchyBuilder
Change-Id: Ia079754bd8272d7b5689a3bdab1e69d5188082be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132342
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-22 07:08:36 +00:00
Johnni Winther 42f954d5f1 [cfe] Move type parser to package:kernel
Change-Id: Icbb37b586dd4113605f9a0959e585586ee94c33c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131836
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-01-21 14:37:32 +00:00
Johnni Winther 231416f39e [cfe] Implement ClassHierarchyBuilder supertype computation in terms of DartType
Change-Id: I2a471460c4e10c6625e7aa93c589587f1c98ac85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132340
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-21 14:29:42 +00:00
Vijay Menon 5a5f4010d5 [js] cleanup old dart:js / js_util files
These files have been moved to standard locations in earlier CLs to prep for NNBD migration.
We'll need to cleanup Flutter and internal references to these files before landing this CL.

Change-Id: I965c2395f3ccf88e5628e5f4e24d28be81b15b39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131841
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-21 14:06:32 +00:00
Dmitry Stefantsov 619fcd9ad1 [cfe] Allow invocations of Object's member on nullable receivers
Closes #40079.

Bug: http://dartbug.com/40079
Change-Id: Ib837a96c8ceb3371dfce61fdda2229800afa1336
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132605
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-21 13:12:11 +00:00
Konstantin Shcheglov 020585872a Intersect promoted types in joinV().
Bug: https://github.com/dart-lang/sdk/issues/40010
Change-Id: I02299e48ab1c9305a2d29f804796182444f3d9aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132166
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-17 22:31:37 +00:00
Konstantin Shcheglov 58a65fe4ba Issue 40110. Update switchStatement_end() to 'isExhaustive', use for switch on enum in analyzer.
Bug: https://github.com/dart-lang/sdk/issues/40110
Change-Id: Ic17ab4562f518b7e69b78c3285b577ea3b8d1223
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131712
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-17 22:07:16 +00:00
Johnni Winther 5c20bed09f [cfe] Remove use of '--strong'
Change-Id: I5ff7573c78ed41b44997663b897a5884e72d0af9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131064
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-17 17:44:45 +00:00
Johnni Winther 47743990a1 [cfe] Provide file offset on StringConcatenation
Change-Id: I70d5f47fd118f9b40c01f0f71057bd8e244561d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132240
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-17 09:48:12 +00:00
Johnni Winther 45e966a9eb [cfe] Ensure internal fields for late lowering are not overridden.
Change-Id: I3b40c311cd81966d3c09ee362b96cc7d98890d66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131829
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-17 08:01:45 +00:00
Dmitry Stefantsov 8f382d1385 [cfe] Report errors on method calls with potentially nullable receiver
Closes #40080.

Bug: http://dartbug.com/40080
Change-Id: I21ece74cb57d0ca55f7d62133fc4d17d6bc1e457
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131838
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-01-16 14:52:11 +00:00
Jens Johansen 566cd23ec8 [CFE] Cleanup no longer used 'normalize' for types
Change-Id: Ib0fd8bcce0d7c6face60a55272b29aa28a40ac93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131830
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-01-16 12:50:43 +00:00
Dmitry Stefantsov 369bfd094a [cfe] Fix type inference for various if-null nodes
Change-Id: I70abfb7032194cac07028b50d16125e74b518bb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131823
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-16 09:39:49 +00:00
Jens Johansen 128771af8a [CFE] Version 2 of incremental compiler invalidation strategy
Change-Id: Iff860e2665dee64fc005a50237ae890986ddb0f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127896
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-16 07:50:39 +00:00
Johnni Winther 249414d34a [cfe] Avoid crash on late field override
Change-Id: I588b5e608ac89482c1198354975a028b48db7071
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131800
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-15 14:03:04 +00:00
Johnni Winther fd5bf3ed6b [cfe] Add opt-out version of general testcases
Change-Id: Idf0ea17fdf16c465f32367067b3d77a2e9492367
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131077
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-01-15 11:42:29 +00:00
Dmitry Stefantsov d747c51d8f [cfe] Use nullable context on LHS of if-null expressions
This is a fix for CFE of the same issue as reported in
https://github.com/dart-lang/sdk/issues/39694

Change-Id: Ied7fb27c8074f4c4ddbac29c8470544e9f32712a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131065
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-15 10:53:04 +00:00
Johnni Winther 862d5012ae [cfe] Handle explicit opt-out in nnbd-not-enabled message
Closes #39835

Change-Id: I4ffa3377289f45b7ea909b5477ba53508040b9d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131076
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-01-15 10:30:43 +00:00
Johnni Winther 99e2a348b3 [dart2js,cfe] Move filenames.dart to _fe_analyzer_shared
... and use it fix perf_test on Windows

`currentDirectory` is replaced by `Uri.base` (the former sounded more magical than it was!)

Change-Id: I5fb8dc5dba004ebad221d4b39d213d51964c5ea2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131622
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-15 10:12:23 +00:00
Johnni Winther d302d7f10a [cfe] Insert member signatures for nnbd aware inheritance
Change-Id: I86dbbd586434af81b6dc4f4ae748cbd8177d06e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129080
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-01-15 07:36:28 +00:00
Konstantin Shcheglov c3a2ed9555 Fix failing tests on unittest-asserts-release-win after analyzer Packages change.
Change-Id: Iec83b5d02d10e3b93f2e1e734bd155189f9ef2d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131780
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-15 03:10:24 +00:00
Johnni Winther 22951565c5 [cfe] ClassHierarchyBuilder cleanup before adding member signatures
Change-Id: I2e9f677973bae3f9609a196308f170093a09c267
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131069
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-14 14:54:29 +00:00
Johnni Winther 280fbf2c15 [cfe] Handle type variable typed late fields and locals
Change-Id: I98fb0526369881506b1a494f9b30de4a25dbbc57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131068
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-01-14 14:27:35 +00:00
Johnni Winther c7da96dade [cfe] Report error on await in late local initializer
Closes #40090

Change-Id: I2b3864fa2b77da021b6cc73b79ac91121ee4fec1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131621
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-14 14:04:25 +00:00
Johnni Winther d08f070b28 [cfe] Add canonical way to detect the synthesized redirecting factory field
Change-Id: Ied5ffe786558856c4e63881880cbd19fa0bd6c68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131620
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-14 09:42:45 +00:00
Dmitry Stefantsov 89a7dfb10e [cfe] Add more tests for compile-time errors related to Null Safety
Bug: http://dartbug.com/40054
Change-Id: Idcfaf9ef61d023f6e88507447459f21b6b324a3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131079
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-14 09:02:25 +00:00
Ben Konyi 83fba7bd54 [ VM ] Move vmservice_io code from runtime/bin to dart:_internal/vm/bin
Change-Id: I3966366268ac88c0bc3b639fc76ae543cde5653c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131502
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-01-14 01:42:14 +00:00
Konstantin Shcheglov c0b1a0a599 Switch analyzer perf to using analyzer Packages.
Change-Id: Ib6fe433e9fcf956058913589f434954cc18fdd41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131444
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-14 01:41:34 +00:00
Vijay Menon 28c335d5a2 Move dart:js to patch format
This is prep for nnbd port to ensure APIs remain consistent across DDC and Dart2JS.

Change-Id: I8ec6c5b152eb87868038570f2275e82af3325fb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131000
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-12 01:13:53 +00:00
Konstantin Shcheglov 763b682963 Provide packages map to PackageBuildWorkspace.
Change-Id: Ibca7748c5c1260f392e931063cd1990eb26f8117
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130934
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-10 21:51:22 +00:00
Dmitry Stefantsov b473a6f8ba [cfe] Report errors on missing required named parameters at call sites
Bug: http://dartbug.com/39660
Change-Id: I16bdb5983921654c84fc2374ccb768b5a0f52050
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131061
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-10 12:33:57 +00:00
Johnni Winther c1dc711ee7 [analyzer,cfe,dart2js] Use id_generation to show annotation diff
Change-Id: I1f1d96b3be023e9e9cfa25425f57a540edad6f6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130703
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-01-10 11:51:17 +00:00
Jens Johansen 201e6a86e1 [parser] Fix 'late' used as 'var'
Fixes #39858.

Change-Id: Ic2721fc56d184b3d0ad3082a7fa9cc45d6bbf45d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129060
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-01-10 10:46:17 +00:00
Jens Johansen b4a83427fd [parser] bang before type arguments
Fixes #39776.

Change-Id: If830e5d9d8fd68e98eb757f21e6c361fc496c931
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128402
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-01-10 09:53:19 +00:00
Dmitry Stefantsov c656a0596e [cfe] Synthesize null initializer for required named parameters
The initializer is required for weak mode and won't affect the strong
mode.

Change-Id: I719fad1ee73e4e7b01c6608f931c37d038db01b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130700
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-01-10 09:02:27 +00:00
Dmitry Stefantsov bf9dc4251e [cfe] Fix type inference for ?? operator in Null Safety
Change-Id: I0abda65d66c7042258cb0adc78e169aa200359ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130705
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-09 14:54:16 +00:00
Johnni Winther 008e6ae60b [analyzer,cfe,dart2js] Add skipMap to id-testing
This supports skipping tests per configuration, for instance to add
nnbd-only tests and skip these in non-nnbd configurations.

Change-Id: I7eaebaa16d67129ce60cffa3594c766ff5e5bc66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130376
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-01-08 14:47:28 +00:00
Dmitry Stefantsov 1eacac48cf [cfe] Make .{thisF,f}unctionType nullability-aware
Change-Id: I4a83f4db7d6412165882e4a1f08c7fded6b9ea3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130373
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-01-08 11:52:06 +00:00
Dmitry Stefantsov 0081dfc706 [cfe] Report error on required named parameters having default values
Bug: http://dartbug.com/39660
Change-Id: I0230d5b9f0448964ba9ad83a7adf46acfee9edcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130372
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-01-08 09:17:09 +00:00
Johnni Winther 64dae246db [dart2js] Use CFE constant evaluator for non-required constants
Change-Id: Id363332caf29e98307553ec048c2dea36c739d95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129701
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-08 08:21:59 +00:00
Jens Johansen ecae983ef3 [CFE] Fix incremental compiler and incremental serialization when package changes path
The incremental compiler doesn't initialize from dill when it finds that
something in that dill has changed path (because of a change in package
version for instance).

Before this CL, though, it still initialized the incremental serializer
from the data, leading to weird and wrong results: If a package still in
use had been changed it could output the old serialization for that
package because invalidations didn't come into effect (as the incremental
compiler was starting from scratch and there thus was no libraries that
it didn't reuse (which are the ones that are "invalidated" in the
serialization world)).

This CL fixes the issue by only initializing the incremental serializer
when the incremental compiler has sucessfully initialized from the dill.

This should fix the problem that caused #39851.

Fixes #39851.

Change-Id: Ia62c4b7d96878174e0950a0dbbcdcbc4187615c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130371
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-07 13:10:33 +00:00