The original change is available in patchset 1.
The changes since then are just status file updates.
Change-Id: I0c45c4b09a187bdd60c6a38bf23f6b7a0cf80c97
Reviewed-on: https://dart-review.googlesource.com/34400
Reviewed-by: Jens Johansen <jensj@google.com>
Change Fasta type inference and Kernel type checking to use the new
definition for Future flattening, which is really unwrapping (peeling
off one layer of Future or FutureOr). Use this for inferring types of
`await` expressions and return types from `async` functions.
Ensure that we are using the same notion of flattening for inference
and checking. (Maybe it was a red flag that we weren't.)
This fixes await_test so that it produces a runtime error rather than
a compile time error - see #31541.
A similar change will need to be made to the analyzer - see #31887.
Change-Id: I7d936e9788969a48fdc216628eaa793389fb5e30
Reviewed-on: https://dart-review.googlesource.com/34504
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
- fix some discrepancies between old and new deferred loading.
* Kernel is now using the correct world impact
* For the old FE, I'm more careful about avoiding metadata nodes when mirros
are disabled as well.
* Better approximate when a constant is deferred in the kernel codegen
- make 'dump()' independent of the IR, so we can easily compare them side by
side.
- exclude primitives in kernel since we don't need to track them. I
didn't change the old front end because it is not as easy to do. I did this
change because kernel was processing many more constants than the old frontend
(the old frontend skipped constants that were never evaluated, we have no way
to do it selectively like that in the new front end).
Change-Id: I337d3fd818753125476b7390da5d900ebdc02709
Reviewed-on: https://dart-review.googlesource.com/34509
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Some additional optimization work will need to be done at the end so
that we take out these functions when they are not needed (when we
don't have type variables).
Bug:
Change-Id: I28d59d04844ec18510b9befe45f26f4109d86ffa
Reviewed-on: https://dart-review.googlesource.com/32667
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Conceptually this is a port of analyzer/nullable_type_inference.dart.
It contains some refactoring and other improvements, as well as tests.
Change-Id: I448440793f11e2e87583d9d47c0e6a1e54ae21f7
Reviewed-on: https://dart-review.googlesource.com/34308
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
This CL fixes two minor flaws in the type inference of closure return types:
- inferReturnType needs to call _wrapAsyncOrGenerator prior to
checking whether the inferred return type is a subtype of the
context. This is necessary because for async and generator
functions, the context type is the "wrapped" type (FutureOr<>,
Iterable<>, or Stream<>).
- _updateInferredReturnType needs to perform implicit downcasts before
storing the inferred return type. This is necessary because if in
implicit downcast is added, the inferred type that should be stored
is the type that was downcast to. In order to make this work, the
"unwrapping" logic needed to be moved from
_updateInferredReturnType's two call sites into
_updateInferredReturnType itself.
These flaws were benign because they were masked by the looseness of
the future flattening operation. They need to be fixed so that future
flattening can be made more precise.
Change-Id: I2b5ea3f63632638b5fadbce7d52c5d028acda5ab
Reviewed-on: https://dart-review.googlesource.com/34480
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This linked in kernel service dill file will be used to load the kernel
isolate if the attempt to lookup the kernel service snapshot fails. The
kernel service snapshot is looked up in the following order.
1. If the "--dfe" option is specified, the file specified is used.
2. If the kernel service snapshot is found next to the executable,
then it is used.
3. If the kernel service snapshot is found in the "snapshots" directory
next to the executable, then it is used.
Change-Id: I5a0e757eb27b26a274b22b4bc36350fee59a100f
Reviewed-on: https://dart-review.googlesource.com/32446
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Chandra <sivachandra@google.com>
A fairly internal case, so I ended up guarding it semi-heavily with
asserts, which could go against convention, but seems fairly safe here.
Two tests: One that sanity checks some edge cases & exemplary values,
and another one that checks each combination programmatically. Together
they should be the best coverage; both the reliance of computers and
the simplicity of specific cases.
Should be very easy to pop in the void type here next.
Bug: 28513
Change-Id: Id20811a77b4de3f2c4ede7a77e1da5a114432e97
Reviewed-on: https://dart-review.googlesource.com/34305
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
- closed world is incomplete anyway; we're missing the call methods from static and instance tear-off.
Change-Id: Ibd3fc9d80220bef3ee651bf529a487b617de7a6b
Reviewed-on: https://dart-review.googlesource.com/34144
Reviewed-by: Sigmund Cherem <sigmund@google.com>
In addition to updating test expectations, this CL also
* Streamlines parsing modifiers in 2 places
* Addresses comment in https://dart-review.googlesource.com/c/sdk/+/33500
Change-Id: Ia3d4b7db8a908455b533c1360d107d3557fbb36f
Reviewed-on: https://dart-review.googlesource.com/34200
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
solves the generic function type scoping problem (fixes the test).
Includes further failures documented here:
https://github.com/dart-lang/sdk/issues/31804 with @failingTests.
These do seem to fail today as is, so it should be safe to land.
Bug:
Change-Id: Ice384b6fee35f1b1c4235bb0e4de7a90e2379937
Reviewed-on: https://dart-review.googlesource.com/33582
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Global type flow analysis is a whole-program type inference on
strong-mode kernel AST which is aimed at inferring various properties
useful for optimizations, such as non-nullability, exact types and
monomorphic call targets.
Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: Ie2e6e642dfacdb562a3341f8d2bbaf69ca829319
Reviewed-on: https://dart-review.googlesource.com/30903
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
See #31649 for more details about forwarding semi-stubs.
Change-Id: Iaf1153be5ac7f66503b93a362b66ac9585462f6c
Reviewed-on: https://dart-review.googlesource.com/33820
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Change-Id: I5ebf49427ac4ddd005c490d1f04880f005211d26
Reviewed-on: https://dart-review.googlesource.com/33943
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Change-Id: I656880ceb89bfe3e5588d035d2c1a452580c2e95
Reviewed-on: https://dart-review.googlesource.com/34104
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Preparation for data URI support. For clarity, this is just a rename.
Change-Id: Ibbd8da05d1a7106b5ec7c0ea9c1e13a95a89d1bd
Reviewed-on: https://dart-review.googlesource.com/33460
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Issue 28698 updated 3 status file entries. 2 entries are now gone,
and the last one doesn't seem to be current anymore.
This CL removes the remaining - unnecessary - entry.
Bug:
Change-Id: I38c8339e83c00d4be33ce84abc1c12f0b5ebe181
Reviewed-on: https://dart-review.googlesource.com/32771
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Directory.current.path on Windows uses "\" and not "/" and does not
start with a slash.
Bug:
Change-Id: Id1b75ee0e3962c3531ba964aee9300025cdbcdca
Reviewed-on: https://dart-review.googlesource.com/34101
Reviewed-by: Jens Johansen <jensj@google.com>
Directory.current.path on Windows uses "\" and not "/".
Bug:
Change-Id: I6ef789d586622f78d0401c1a892f6a475bf6d93a
Reviewed-on: https://dart-review.googlesource.com/34100
Reviewed-by: Jens Johansen <jensj@google.com>
- Added JS_GET_FLAG('STRONG_MODE') allow the code to be tailored to
the type system version.
- Split type stringifying code into V1 (existing logic) and V2
(strong mode Dart 2.0 logic).
The V1 code will eventually be deleted.
Change-Id: I78db91796040b6ecfa1bd5d6a9d64bd4c2bc4bcf
Reviewed-on: https://dart-review.googlesource.com/33680
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This CL extracts parsing modifiers from parsing types so that
parseModifiers just parses modifiers and a separate call is made
to parseType.
* Discard the ModifierContext object sooner
* Remove some places where findMemberName output was being
used to determine which modifiers are present.
Currently, modifiers are parsed once by findMemberName,
again by parseModifiers, and sometimes a third time
by isFactoryDeclaration. This CL sets the stage for
improved modifier recovery and parsing modifiers exactly once.
Change-Id: Ieb8cd1156ed090ca4653258bd40afbac843b9b7c
Reviewed-on: https://dart-review.googlesource.com/33500
Reviewed-by: Peter von der Ahé <ahe@google.com>
Change-Id: I59764334cb1befda9e0db0fd09fc83f6398f61da
Reviewed-on: https://dart-review.googlesource.com/32960
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
This revision has been factored out of Revision 29300.
Change-Id: Idf579f0e5ffeea5764e2a9654c6812d69f6977c7
Reviewed-on: https://dart-review.googlesource.com/31921
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Change-Id: I28623bed9d5d203e82d50c4b057803a89e76757d
Reviewed-on: https://dart-review.googlesource.com/33380
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>