Commit Graph

2821 Commits

Author SHA1 Message Date
Jens Johansen 1c3468a646 [kernel] Remove Library.isExternal
Change-Id: I6638b915c1189838e7081069a0075e4ecd9ee9d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125600
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-12-02 09:24:42 +00:00
Konstantin Shcheglov eddfaff322 Issue 39509. Support for configurable imports in AnalysisDriver.
Bug: https://github.com/dart-lang/sdk/issues/39509
Change-Id: I87cbc20c38ed93e46ae0b646ddad4d9fc28eca8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-27 18:58:02 +00:00
Nicholas Shahan 740af3c009 [dartdevc] Pass nnbd experiment to analyzer in check_nnbd_sdk.dart
Also add a help option to print the help text it already has.

Change-Id: Ifb5036ace762053b52ab7a5170da1bdb37b44ab7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126302
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-26 21:24:50 +00:00
Sigmund Cherem 42ec44a6a4 Reland "Revamp patch_sdk.dart mainly to use libraries.json."
This is a reland of 3c9e924073

Original change's description:
> Revamp patch_sdk.dart mainly to use libraries.json.
> 
> This will make it possible to use the script to create a patched sdk
> for dart2js and the vm (some followup needed), which will be useful
> to migrate their libraries to nnbd.
> 
> In the future, we should be able to leverage this new logic to
> write tests that ensure our sdk is warning-free (there are > 80 real
> warnings today even on the non-nnbd sdk)
> 
> In detail, this CL includes:
> 
> * loading the libraries data from libraries.json, this removes the need for a
>    hand-crafted libraries.dart that replicates the data in libraries.json.
> 
> * auto-generates a libraries.dart in the patched sdk that can be used to run
>  dartanalyzer or to compile an sdk with dartdevc-legacy.
> 
> * script simplifications in patch_sdk.dart
>     * removed tracking of modification stamps. This didn't appeared to be
>       used by the ninja rules. I believe it was used to reduce local
>       iteration cycles when we were first developing the sdk itself.
> 
>     * use Uri directly instead of package:path - this simplifies things,
>       especially since the libraries_specification is Uri-based as well.
> 
>     * switch to use package:args for parsing options
> 
>  * added an option to merge part files in a single file. I've noticed that the
>  analyzer provides some false positive errors in part files, but once merged
>  they are no longer shown. In particular, we are clearly hitting limitations of
>  dartanalyzer on the patched sdk. At this time the old patch-script generated
>  an sdk with 1500 warnings, this new script reduces it to 500 (not sure why),
>  with merging of part files it goes down to 80.
> 
> 
> Change-Id: I6bbaf92ef4554f00c8bf6b38d19bf79d44fb3e94
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125780
> Reviewed-by: Nicholas Shahan <nshahan@google.com>
> Commit-Queue: Sigmund Cherem <sigmund@google.com>

Change-Id: Ifcb9dbef36452e41e8e96e086761d76b5a3d988e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125998
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Sigmund Cherem <sigmund@google.com>
2019-11-26 01:40:53 +00:00
Johnni Winther 2b56db6e5d [dart2js,ddc] Enable late lowering in dart2js and ddc
Change-Id: I77d99bade4bf0e094f04f222743c5fec19495851
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126101
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-11-25 13:59:25 +00:00
Sigmund Cherem 603fd7881f (ddc) Fix deps tracking for the ddc sdk.
The compile_platform template assumes that the output will be in the root-out-dir, and because of that the generated .deps file contains relative paths that only work if the output is in that folder.

It would be nice to fix compile_platform to be more flexible about this, but for now moving the output up fixes the issue that modifications in the sdk were not triggering a rebuild.

Change-Id: Ifc1e7adb23d6911a9f71c341b7968e0a9b1d4973
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126122
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-11-23 00:21:58 +00:00
Konstantin Shcheglov b370346d60 Add 'isNonNullableByDefault' flag to TypeSystemImpl, make all parameters named required.
R=brianwilkerson@google.com

Change-Id: I262f86ba964f4970ec570dc9fa4c1a802556fa63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125924
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-21 15:37:46 +00:00
Vijay Menon 8295efc541 Revert "Revamp patch_sdk.dart mainly to use libraries.json."
This reverts commit 3c9e924073.

This CL was breaking the internal build.

Change-Id: Ic4e6df070f2a87ac88ef97f0e6b07d53c13ceadc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125925
Auto-Submit: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
Reviewed-by: David Morgan <davidmorgan@google.com>
2019-11-21 14:36:55 +00:00
Konstantin Shcheglov 615928c514 Stop referencing non-API TypeSystem in analyzer.
Replace it with TypeSystem from lib/dart/element/type_system.dart,
or (internally) with TypeSystemImpl.

We keep the old TypeSystem where its is exposed from API:
- ResolveResult.typeSystem
- AnalysisSession.typeSystem
- AnalysisContext.typeSystem

  We will make changes to these as a breaking change later.

Change-Id: I40ca53ea77e440457c6d0f3832ec3b6286bacdf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125770
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-21 01:09:24 +00:00
Sigmund Cherem 5a8c52e06a Add script that performs the tasks of creating and checking the nnbd sdk
usage: dart pkg/dev_compiler/tool/check_nnbd_sdk.dart

Now we no longer need to remember what are the individual commands, this will
generate the patched sdk and run analyzer on it. In the future I can see us
adding a flag to select the target.

Change-Id: I991668743765252411d415de4bdef5a180644afa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125840
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-11-20 23:41:34 +00:00
Sigmund Cherem 3c9e924073 Revamp patch_sdk.dart mainly to use libraries.json.
This will make it possible to use the script to create a patched sdk
for dart2js and the vm (some followup needed), which will be useful
to migrate their libraries to nnbd.

In the future, we should be able to leverage this new logic to
write tests that ensure our sdk is warning-free (there are > 80 real
warnings today even on the non-nnbd sdk)

In detail, this CL includes:

* loading the libraries data from libraries.json, this removes the need for a
   hand-crafted libraries.dart that replicates the data in libraries.json.

* auto-generates a libraries.dart in the patched sdk that can be used to run
 dartanalyzer or to compile an sdk with dartdevc-legacy.

* script simplifications in patch_sdk.dart
    * removed tracking of modification stamps. This didn't appeared to be
      used by the ninja rules. I believe it was used to reduce local
      iteration cycles when we were first developing the sdk itself.

    * use Uri directly instead of package:path - this simplifies things,
      especially since the libraries_specification is Uri-based as well.

    * switch to use package:args for parsing options

 * added an option to merge part files in a single file. I've noticed that the
 analyzer provides some false positive errors in part files, but once merged
 they are no longer shown. In particular, we are clearly hitting limitations of
 dartanalyzer on the patched sdk. At this time the old patch-script generated
 an sdk with 1500 warnings, this new script reduces it to 500 (not sure why),
 with merging of part files it goes down to 80.


Change-Id: I6bbaf92ef4554f00c8bf6b38d19bf79d44fb3e94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125780
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-11-20 22:51:42 +00:00
Konstantin Shcheglov be519e83b1 Remove XyzElementImpl.forNode() constructors.
R=brianwilkerson@google.com

Change-Id: I39332a153b6d13be7b33d3980263eb3c3e952c65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125802
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-20 22:48:43 +00:00
Vijay Menon ae34d6e233 [dartdevc] rename legacy to ddc
The old name is still supported as an arg.

Change-Id: I864c54b977f5ef0cc1be4779422efbd539b67a2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125545
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-11-20 17:52:19 +00:00
Sigmund Cherem bcc77d8605 (ddc) Generate the sdk.js files by reading a dill file directly
This is to align how we pipeline each step in the build with other tools. It
will also help with caching and incremental rebuilds when doing local development
in ddc.

Change-Id: I8ff9988927d5632301926fca173c01dd281f923f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125447
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-11-19 00:24:48 +00:00
Johnni Winther 4b5589e0cb Reland "[cfe] Use StaticTypeContext for getStaticType" and more"
This relands commits
 "[cfe] Use StaticTypeContext for getStaticType"
 45033c6ad9

 "[cfe] Move caching of thisType to CoreTypes"
 fab25cbe0c

 "[vm/bytecode] Notify static type context when entering/leaving library"
 c9f88ae253

Change-Id: I407d6b0e3b3df503cedc9fcb2c834d835cf083f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125343
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-16 05:50:58 +00:00
Johnni Winther 45996ee170 [cfe] Add late field lowering for static/top-level fields
Change-Id: I16625257251b0badbcdfc1c9504899421db8b83f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124681
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-11-15 13:29:45 +00:00
Johnni Winther ef5fb7d3f4 Revert "[cfe] Use StaticTypeContext for getStaticType" and more
This reverts commits
 "[cfe] Use StaticTypeContext for getStaticType"
 45033c6ad9

 "[cfe] Move caching of thisType to CoreTypes"
 fab25cbe0c

 "[vm/bytecode] Notify static type context when entering/leaving library"
 c9f88ae253

Change-Id: I6171f6a74b97f2f4a77a36c242330fc2db94c82f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125341
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-11-14 22:51:43 +00:00
Sigmund Cherem d2c63991ae Improve NNBD testing support
The goal of this change is to make it possible to start iterating on nnbd tests
for DDC. This keeps the current philosophy of keeping NNBD and non-NNBD build
configurations separate, except that NNBD builds are allowed to consume library
sources from the non-nnbd sdk.

This change addresses the first set of errors that are encountered when trying
to build a fully NNBD configuration:
  * CFE has issues with type promotion, for that reason we remove
    `--enable-experiment=non-nullable` in vm build rules, and we use a smaller
    training data when creating the dartdevc app-jit snapshot.
  * We'd hit compile-time errors with nnbd libraries with inconsistent
  patchfiles. To avoid that, the libarries.json points to the non-nnbd SDK
  sources for most dart:* libraries.

Change-Id: Ie6226b3bd8a92b4a1632dd84a5db2f04238fd4f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125080
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-11-14 18:28:20 +00:00
Dmitry Stefantsov fab25cbe0c [cfe] Move caching of thisType to CoreTypes
Closes #38225.

Bug: http://dartbug.com/38225
Change-Id: I0274bc390ca2d098896f578ea7ddf65527d82027
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124325
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-14 16:01:26 +00:00
Johnni Winther 45033c6ad9 [cfe] Use StaticTypeContext for getStaticType
Change Expression.getStaticType to take a StaticTypeContext instead
of a TypeEnvironment.

The StaticTypeContext provides access to the TypeEnvironment and the
current 'this type' as well as determining the nullability state of the
enclosing library.

This change is needed to support nnbd types for getStaticType and also
serves as a step towards supporting caching during static type
computations to avoid repeated computations of the same (complex)
expressions.

Change-Id: Ied974dff7f6f7c3c8f262aa80c8dea5c674662f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124683
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-11-14 09:09:26 +00:00
Nicholas Shahan a26f8402e5 [dartdevc] Branch the logic for FutureOr type tests when NNBD is enabled
Creates a baseline for the next change to show the new behavior in a small diff.

Change-Id: Ic44ae702b677880ab245c4ae6abd799831cc4d87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124287
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-11 22:34:08 +00:00
Nicholas Shahan 750a83b896 [dartdevc] Fix crash when source files contain non-UTF8 characters
* Treat the assertion condition offset as a character offset in the file.
* Allow unrecognized characters to be replaced by a placeholder character. This
  is unrelated to the fix but is just a precautionary measure.

Fixed: 39271
Change-Id: I4871ea41d3a46d26ecac5047265a1dbc1c889350
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124602
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-08 23:10:59 +00:00
Dmitry Stefantsov b4554c1215 [cfe] Make nullability a required parameter for types
Change-Id: Id787291294cafb15cf4ecad4a9db9da4c6066638
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124135
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Auto-Submit: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-07 13:24:47 +00:00
Nate Bosch fe977a4326 Rename kernel compilers methods starting with _get
https://dart.dev/guides/language/effective-dart/design#avoid-starting-a-method-name-with-get

Most are name the same without the "get" since a method named as a noun
is idiomatic in Dart. For translating between difference representations of a
location rename as "toSourceLocation".

Change-Id: I727b28da05e2c4aea054d14edd82be3e21d406d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124283
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2019-11-06 23:34:33 +00:00
Nate Bosch 0d5e633428 Fully parenthesize a boolean expression
Change-Id: I1f518627bdf9cb85d2bb99a7476c1be7fc0e5908
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124282
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-11-06 23:02:55 +00:00
Nicholas Shahan f6efefc09c [dartdevc] Move the custom type test logic to patch files
This unblocks changing this logic for NNBD since they are now forked.

The custom logic for FutureOr has been problematic to represent in the patch
files. They need to be callable from the class but they can't be static methods
in Dart because they reference the generic type argument. It is a design quirk
of the runtime representation that the type argument is captured in the wrapping
closure and in scope that allows the existing implementation to work.

In a future change I will thread an NNBD flag through the compiler to emit
different logic for the FutureOr type tests when running with NNBD.


Change-Id: I9463e3cd375f8098592ea84e956e833952f41bb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123921
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-06 22:09:31 +00:00
Jens Johansen 37d14ad2ce [ddk] Don't use Library.isExternal (second try)
We're deprecating kernels Library.isExternal as it wasn't used for
what it was originally intended. It will hopefully go away entirely
soon.

This reverts commit 689447d0fb and fixes
the reason for the revert.

Change-Id: I122b5b777a2bf7316fde48e034fa3c566458a0cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124133
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-11-06 10:05:07 +00:00
Vijay Menon 689447d0fb Revert "[ddk] Don't use Library.isExternal"
This reverts commit 48ebcdac5f.

This is breaking on internal code.

Change-Id: I9a89267d57b7cbfe94a023ca99e919cfa4ba4573
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124162
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-11-05 16:15:15 +00:00
Jens Johansen 48ebcdac5f [ddk] Don't use Library.isExternal
We're deprecating kernels Library.isExternal as it wasn't used for
what it was originally intended. It will hopefully go away entirely
soon.

Change-Id: I3a4537ab566152555095df7461516f110a533896
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123722
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-11-05 08:37:51 +00:00
Konstantin Shcheglov 9d5649175a Fix using deprecated analyzer elements in DDC.
Change-Id: I798cc91106bfc82e0e3761d1f067ce248a18f9af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124041
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-04 15:08:26 +00:00
Jens Johansen f91ef3afd7 [kernel] Deprecate Library.isExternal
We're deprecating kernels Library.isExternal as it wasn't used for
what it was originally intended. It will hopefully go away entirely
soon.

Change-Id: If363c50af5607febae68865875af452c106fff85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123721
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-04 09:24:02 +00:00
Vijay Menon e83e66111d Copy propagate on private symbol vars
Change-Id: I31ddfaee43e68cb4c264a152312804751717c953
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123922
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-11-01 22:51:09 +00:00
Paul Berry c4b6df5009 Move ID testing infrastructure into _fe_analyzer_shared.
Change-Id: I9f2692dbe750f3c31f8c86e86fe732f34e166517
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123860
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-01 12:39:00 +00:00
Mark Zhou 67a7aae567 [dartdevc] Adding logic for required named parameter runtime checks.
Change-Id: I9de1617f10306977f55807c1566630914503f830
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122720
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-10-30 21:17:13 +00:00
Nicholas Shahan f99a28407f [dartdevc] Temporarily run NNBD tests with a "hybrid" SDK
- Adds a temporary modular test suite to prevent regressions on NNBD tests.
- New modular tests build the standard SDK with the dart:_runtime library from
  the NNBD fork.
- Unblocks DDC development while the forked SDK is in a state that does not
  build.

Change-Id: If422f5d19237f9d11e26aad503f1be960b331c57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123541
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-10-30 20:10:13 +00:00
Anna Gringauze 33274b6fae [dartdevc] removed unnecessary '.bind(this)' + added doc comments.
Bug https://github.com/dart-lang/sdk/issues/38896

Change-Id: If5399c19c178e7b379d7827bde1277c2bf18062e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123470
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-10-30 18:18:01 +00:00
Anna Gringauze 32c212e3eb [dartdevc] Add binding to 'this' for spread and 'yield' expressions
DDC does not generate correct bindings for async operations in spread,
 resulting in errors on member accesses.

```
class A {
    m1() => [1, 2];
    Future run() async {
      return [await null, ...m1()];
    }
}
```

Another case with yield:

```
class C {
    List<int> m2() => [1, 2];

    Future run() async {
      return await run3().toList();
    }

    Stream<int> run3() async* {
      for(var k in [... await m2()])
        yield k;
    }
}
```

Fixes #38896

Change-Id: I6ea28080414e5843ab647516cc223fd218f8c17e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123465
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
2019-10-29 21:20:26 +00:00
Dmitry Stefantsov 9910fa8454 [cfe] Implement the first part of NNBD-aware isSubtypeOf
This CL is a squashing of the following smaller CLs:

* https://dart-review.googlesource.com/c/sdk/+/120669/
* https://dart-review.googlesource.com/c/sdk/+/120670/
* https://dart-review.googlesource.com/c/sdk/+/121331/
* https://dart-review.googlesource.com/c/sdk/+/121381/
* https://dart-review.googlesource.com/c/sdk/+/121383/
* https://dart-review.googlesource.com/c/sdk/+/121620/
* https://dart-review.googlesource.com/c/sdk/+/121707/
* https://dart-review.googlesource.com/c/sdk/+/122144/
* https://dart-review.googlesource.com/c/sdk/+/122360/
* https://dart-review.googlesource.com/c/sdk/+/122381/
* https://dart-review.googlesource.com/c/sdk/+/122783/
* https://dart-review.googlesource.com/c/sdk/+/122787/

Change-Id: I9d850f531f0fce07055ff9b5cd39abb605752005
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122868
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-10-25 16:37:39 +00:00
Konstantin Shcheglov 80b0aaf9b8 Deprecate FunctionTypeAliasElement.instantiate2(), replace with instantiate().
Change-Id: Iead94143fb3d02536309e464039493981cf853d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122965
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-25 14:38:50 +00:00
Mark Zhou e1f972cb86 Reland "[dartdevc] Making multi-root paths consistently use url-relative path separators."
This is a reland of eafe8b04c0

Original change's description:
> [dartdevc] Making multi-root paths consistently use url-relative path separators.
> 
> Fixes #38802
> 
> Change-Id: I8b0e9525d0be9a00b9189d673f2881d432de4b66
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122419
> Auto-Submit: Mark Zhou <markzipan@google.com>
> Reviewed-by: Jake Macdonald <jakemac@google.com>
> Commit-Queue: Mark Zhou <markzipan@google.com>

Change-Id: Ie5a6cb2c73ef1411dd73e12109bd406908aa5fb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122660
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-10-23 18:16:55 +00:00
Martin Kustermann e82fedc345 [vm] Remove deprecated (and untested) ARMv5 support from the VM
Since we have no CQ/CI test coverage of ARMv5 and none of our customers
uses it, a breaking change request was made (see issue further down).

The breaking change has been approved and a corresponding email has been
sent out:

https://groups.google.com/a/dartlang.org/forum/?nomobile=true#!topic/announce/vRQja7di3FQ

This CL removes any armv5 related code from our codebase.

Closes https://github.com/dart-lang/sdk/issues/36666

Change-Id: I9abf32f1980ca19a9cf882b43c9966b2127f89e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122540
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-10-23 14:44:33 +00:00
David Morgan 107546a18e Revert "[dartdevc] Making multi-root paths consistently use url-relative path separators."
This reverts commit eafe8b04c0.

Reason for revert: Breaks google3.

Original change's description:
> [dartdevc] Making multi-root paths consistently use url-relative path separators.
> 
> Fixes #38802
> 
> Change-Id: I8b0e9525d0be9a00b9189d673f2881d432de4b66
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122419
> Auto-Submit: Mark Zhou <markzipan@google.com>
> Reviewed-by: Jake Macdonald <jakemac@google.com>
> Commit-Queue: Mark Zhou <markzipan@google.com>

TBR=jakemac@google.com,markzipan@google.com

Change-Id: I5b2878b69f3d01852eb4d4429f7cd8909760d6f8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122620
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2019-10-23 07:24:59 +00:00
Nicholas Shahan 1451e9ee39 [dartdevc] Respect the NNBD experiment flag setting more often when patching SDK
Tested with the dart:math migration.
https://dart-review.googlesource.com/c/sdk/+/120060

Change-Id: Id62dd197dfa4d4e744ae581c6cd423444baeb1dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122521
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-10-22 23:00:46 +00:00
Mark Zhou eafe8b04c0 [dartdevc] Making multi-root paths consistently use url-relative path separators.
Fixes #38802

Change-Id: I8b0e9525d0be9a00b9189d673f2881d432de4b66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122419
Auto-Submit: Mark Zhou <markzipan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-10-22 20:59:58 +00:00
Robert Nystrom ed0cc81e81 Get DDC and DDK test builds working with the forked NNBD SDK.
With these changes, I can run:

  ./tools/build.py -m release --nnbd dartdevc_test

In a checkout that also includes a migrated core library that uses
NNBD features.

I haven't verified if the resulting JS is *correct*, but the build
doesn't error out.

Change-Id: I7d89efe5da8c46e2a9805743e4e61858da8097dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122280
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-10-21 17:19:59 +00:00
jonahwilliams c26d5969f7 [flutter] JavaScript support to frontend_server
Adds support to the frontend server for producing javascript when
compiling with a target model of dartdevc. This uses the ProgramCompiler
and associated types from the dev_compiler package to output the kernel
AST into a "bundle" format.

dev_compiler:
* Exposes additional types needed for JavaScript compilation.
* Allows  overriding CoreTypes instead of forcing it to be created from
Component. This is require to support compilation of the
partial Components created by the incremental compiler.
* provides extraIndexedLibraries in Target class so the CoreTypes produced by the incremental compiler have indexed them.

frontend_server:
* When the target model is dartdev, JavaScript is output instead of
kernel. For each Component we compile, we first compute the strongly
connected components and produce a List of new Components to interop
with the dev compiler. The file uri is used as module name.

Change-Id: I4cc117b20671ffd48dd43f9786961c016a02d056
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121400
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
2019-10-21 15:41:29 +00:00
Kallen Tu 531aaa9ad2 [ddk] Emit variance modifiers for classes, mixins, mixin applications.
Will be used for runtime subtype changes in future CLs.

Change-Id: I53ba10c994f13300541b3ae7a9e14d52c3836771
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121821
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-10-19 01:03:41 +00:00
Vijay Menon ffcfab3093 [dartdevc] support null-check bang operator
Change-Id: I730be139f45448e3544c79e676316eb1ad36066e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122027
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-10-18 14:23:38 +00:00
Nicholas Shahan a73eba9823 [dartdevc] Preliminary additions to support NNBD runtime subtype checks
Uses a temporary representation for nullable and legacy types that is subject to
change.

Updated subtype test to include expectations when running with strict mode
checks.

Does not yet include support for:
* Required named parameters
* Weak checking modes (currently only strict checking)
* Caching the results of a check for a later lookup

Issue: #38128
Change-Id: I60935c071affdb56c368e9555fce8f86931103e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119537
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-10-15 23:00:58 +00:00
Mark Zhou b368a6de1c [dartdevc] copying over sourcemap file from build_web_compilers
Change-Id: Id5e4554c775becc9b1313c5cd85bd02920ea52f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121440
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2019-10-15 20:03:34 +00:00