Commit Graph

931 Commits

Author SHA1 Message Date
Kevin Millikin caae5ee054 Fix a Kernel representation bug (typo)
Clearing this flag would clear some other unrelated flag instead.

Change-Id: Ief0a8a9d02cca34bf6f101404ded291fe6dfe41c
Reviewed-on: https://dart-review.googlesource.com/43960
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-02-27 08:46:47 +00:00
Mike Fairhurst d0be238ca3 Add missing void annotation: refs #32161
Change-Id: Iea314e7a23513eef1823dbfe8690494f45af9185
Reviewed-on: https://dart-review.googlesource.com/42323
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-22 18:01:32 +00:00
Kevin Millikin ffc5a96074 Reland "Fix a bug in Kernel's mixin elimination"
Reland
https://github.com/dart-lang/sdk/commit/52d1b4e96d0a384b08aafc184785d1c74cb74efc
with a fix to the test so that it does not use super mixins.

Change-Id: Id1283b1066e853baca4c39402c255ceaa90662f4
Reviewed-on: https://dart-review.googlesource.com/43002
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-02-22 11:52:24 +00:00
William Hesse 7bb941a60c Revert "Fix a bug in Kernel's mixin elimination"
This reverts commit 52d1b4e96d.

Reason for revert: Analyzer and DDC do not support the super-mixin fix and flag, so the new test fails on them.  The test needs to either be marked as failing on them, or support needs to be added and work in the test framework.

Original change's description:
> Fix a bug in Kernel's mixin elimination
> 
> Mixin elimination copied factory constructors from the mixin class to
> the mixin application class.  This could be observed as an unbound
> type parameter which led to a crash in the VM.  Fixes
> https://github.com/dart-lang/sdk/issues/32267.
> 
> Change-Id: I87b70a35d11c364739d01e261adf5329d492d8cf
> Reviewed-on: https://dart-review.googlesource.com/42922
> Reviewed-by: Jens Johansen <jensj@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,jensj@google.com,kmillikin@google.com

Change-Id: I4a0bcf0b323c9adef7e5dc7d9019b6aafe40509d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/42960
Reviewed-by: William Hesse <whesse@google.com>
2018-02-22 10:09:09 +00:00
Kevin Millikin 52d1b4e96d Fix a bug in Kernel's mixin elimination
Mixin elimination copied factory constructors from the mixin class to
the mixin application class.  This could be observed as an unbound
type parameter which led to a crash in the VM.  Fixes
https://github.com/dart-lang/sdk/issues/32267.

Change-Id: I87b70a35d11c364739d01e261adf5329d492d8cf
Reviewed-on: https://dart-review.googlesource.com/42922
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-22 08:51:09 +00:00
Jens Johansen 89cec72771 [kernel] Add two new kernel tools; add error handling in existing tools.
This CL adds two new kernel tools which can answer questions about
a dill file:

* count_breakdown.dart
  Enumerates the different node types in the provided dill file and
  counts them.
  This has proved useful in the past to e.g. see how many doubles are
  included in Flutter.

* size_breakdown.dart
  Gives an overview of which parts of the dill file contributes how many
  bytes.
  This has proved useful in the past to see that the string table gets
  huge when we have many doubles (because we currently save doubles in
  kernel as strings).

It also adds error handling and usage information to existing tools.

Change-Id: Ie2ce9e4b8806d5975dba8f57445705a840be3474
Reviewed-on: https://dart-review.googlesource.com/42660
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-02-21 14:35:16 +00:00
Dmitry Stefantsov cdd228510b Move computeStrongComponents utility to pkg/kernel
Change-Id: I5f8f87875b8d65859dcbb21c74586c842389d9d1
Reviewed-on: https://dart-review.googlesource.com/42440
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-02-21 12:02:04 +00:00
Jens Johansen bd94ab5068 [kernel] Test bootstapping from dill with deferred library
This CL adds a test that bootstraps from a dill with a deferred library
in it. Before this CL it crashed, see bug #32245.

This CL "double fixes" the problem:
a) When lazy loading a dill file the _currentLibrary variable wasn't set
   properly. This has been fixed.
b) When bootstrapping from a dill file, (almost) everything in the dill
   will be included in the output so lazy loading it doesn't make sense.

Bug: 32245.
Change-Id: I94980608e19633fd31b522651a4a05b9cf7beabd
Reviewed-on: https://dart-review.googlesource.com/42600
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-02-21 09:39:24 +00:00
kmillikin b36633357c Make the Kernel clone visitor more robust
Instead of extending the TreeVisitor which provides an incorrect
implementation of all methods, merely implement the TreeVisitor to
require an implementation in CloneVisitor.

Change-Id: Ied7d3b8062ee380e766c737e844a24b0b746312d
Reviewed-on: https://dart-review.googlesource.com/41926
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-02-16 16:28:47 +00:00
Peter von der Ahé fd19dfe5f5 Remove IncrementalClassHierarchy
Change-Id: Ie141648f8fbc97a025e90cc456265a51c3da0b04
Reviewed-on: https://dart-review.googlesource.com/41823
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-02-16 09:13:46 +00:00
Jens Johansen 57f6b42313 [kernel] Buffer (all) small writes when writing dill
When writing a dill file, certain things are written to the
BufferedSink via addBytes.

In the case where the BufferedSink currently has nothing buffered and is
given a input that is deemed small, prior to this CL, the data was added
directly to the underlying sink. As such a million _sink.addBytes([42])
in a row would make at least 900,000 (the buffer size is 100,000) calls
to the underlying sink.
For `new File(path).openWrite()` that takes a while.

This CL fixes it by always buffering the small writes, reducing the
number of calls to the underlying sink to 10 in the above case.

Change-Id: I097f490d57b0a27b3175d6bb4ef513851acc503e
Reviewed-on: https://dart-review.googlesource.com/41740
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-02-15 14:01:28 +00:00
kmillikin b019045393 Front-end implementation of mixin type inference.
Infer missing type arguments to generic mixin classes in mixin
applications based on mixin supertype constraints.  The implementation
directly follows the draft feature specification at
https://dart-review.googlesource.com/c/sdk/+/38940.

Bug: https://github.com/dart-lang/sdk/issues/31984
Change-Id: I7caba037b1b0e73c44f71aaa958f3ff3e8f3c1f0
Reviewed-on: https://dart-review.googlesource.com/40661
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-02-14 22:43:24 +00:00
Janice Collins 121a8ebcb2 Prepare for analyzer 0.31.2-alpha.0.
Update changelog and versions prior to publish, primarily for the crash
in computeNode fixed by https://github.com/dart-lang/sdk/commit/3791ddb496a2d8c9ed9bc2edcc62e562c2e47eb2#diff-ff9cb85838db7a802ac5aa9c55f26d86.

Change-Id: If3bbe3238fb622d884cee5df87a06a90b401fe7e
Reviewed-on: https://dart-review.googlesource.com/41040
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-14 21:22:54 +00:00
Alexander Markov 6ed2ebf6b0 [vm/kernel/aot] Infer parameter types in type flow analysis
Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: Iea1480ce2f20b6cb08b4eb57eef5ca14a002e6e0
Reviewed-on: https://dart-review.googlesource.com/40400
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-13 01:11:18 +00:00
Vyacheslav Egorov 1796437cce [vm/kernel] Support synchronously completing futures
Slightly alter async/await transformation in such a way that
:await_jump_var/:await_ctx_var are set before _awaitHelper(...) is invoked -
just like in the AST transformer used by the legacy pipeline. This guarantees
that recursive invocations will continue from the right "jump" point (instead of
continuing from the current jump point).

Fixes https://github.com/dart-lang/sdk/issues/32098

Change-Id: I8899669ceefe3f2edba6531897834b2c275efada
Reviewed-on: https://dart-review.googlesource.com/40520
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-02-12 15:01:18 +00:00
Samir Jindel 1edbc43fec [kernel] Expose converting a single procedure from the async transformation.
Change-Id: Ie0e3b14d555b38e26289085732eb3ad5a0ccbb63
Reviewed-on: https://dart-review.googlesource.com/40523
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2018-02-12 13:38:10 +00:00
Janice Collins 75a2661f0e Prepare to publish analyzer 0.31.1 and associated packages.
Verified that the new analyzer at least smoke-tests on .21 still,
so did not update SDK constraints.  Publish is to address
dart-lang/dartdoc#1603.

Change-Id: I39320e5557344f6c1c79df50b792246fc1c29840
Reviewed-on: https://dart-review.googlesource.com/40401
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2018-02-09 18:29:29 +00:00
Aske Simon Christensen aa85b09931 Remove broken generic supertype optimization.
The class hierarchy analysis maintains, for each class, a map from raw
supertypes to actual, parameterized supertypes. As an optimization, it
can share these maps between a class and one of its subclasses.

However, the sharing/copying mechanism sometimes ends up with entries
in the map that should not have been there.

This commit removes the optimization and always uses a separate map
for each class.

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

Change-Id: I4c641d9c7d15706035791dd2b586a24045afceaa
Reviewed-on: https://dart-review.googlesource.com/39765
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-02-09 09:39:07 +00:00
Siva Chandra 6ff0951bdf Remove the use of redundant flags --dfe and --kernel-binaries.
This change helps in confining flag manipulation to just the embedder.
When we are ready to turn all dart 2 flags to true by default, the
change can be confined to just the VM.

Change-Id: I4ac550c331b1f236a2bd9d0453b7c567eb0c05d3
Reviewed-on: https://dart-review.googlesource.com/38881
Commit-Queue: Siva Chandra <sivachandra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-02-08 20:56:22 +00:00
Alexander Markov 32396138ff [CFE, VM] Improve efficiency of CHA-based devirtualization
Implemented more efficient way to iterate ClassSet in class_hierarchy.dart,
ClassSet becomes Iterable<Class>. This considerably improves speed of
ClosedWorldClassHierarchy.getSingleTargetForInterfaceInvocation() and
CHA-based devirtualization.

Time of CHA-based devirtualization on Flutter Gallery reduced
from ~13.4s to ~1.2s.

Also, ClassHierarchy used in devirtualization is configured to ignore
ambiguous supertypes to avoid crashes on Flutter Gallery.

Change-Id: Iaca251ca268aad3d8bb652247650096f19c25839
Reviewed-on: https://dart-review.googlesource.com/38960
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-07 18:32:39 +00:00
Vyacheslav Egorov fb6779d71d Alter super call resolution rules for Flutter target.
By default super method invocations look for dispatch target.

However super-mixins semantics permits super invocations to
target interface members too.

Fixes https://github.com/dart-lang/sdk/issues/31994

Change-Id: I950abb3f0fea4a9611e3dd3b90dd05415a6d2979
Reviewed-on: https://dart-review.googlesource.com/38800
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-02-06 16:12:02 +00:00
Kevin Moore ca7996f033 Prepare to publish package:analyzer 0.31.0
Includes version bumps to kernel and front_end

Fixes https://github.com/dart-lang/sdk/issues/32022

Change-Id: I2e09d9184f6446b6f442e3a4188aa15da80b9601
Reviewed-on: https://dart-review.googlesource.com/38345
Reviewed-by: Devon Carew <devoncarew@google.com>
2018-02-02 22:43:30 +00:00
Florian Loitsch 3b8e4d41a7 Reapply "Run async functions immediately."
Which was reverted in commit 032be73dbe.
Originally commited in commit 67bac0bce6.
Original review URL: https://dart-review.googlesource.com/5263

Change-Id: Ic7333c29e502a3924dc6aade8ffa46fc8aa5b04a
Reviewed-on: https://dart-review.googlesource.com/38120
Commit-Queue: Florian Loitsch <floitsch@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2018-02-02 15:50:16 +00:00
Florian Loitsch 032be73dbe Revert "Run async functions immediately."
This reverts commit 67bac0bce6.

Reason for revert: broke the bot.

Original change's description:
> Run async functions immediately.
> 
> Migrated from https://codereview.chromium.org/2478703003/
> 
> Change-Id: I1d678c01ba5876490b12c676c500171328361d31
> Reviewed-on: https://dart-review.googlesource.com/5263
> Commit-Queue: Florian Loitsch <floitsch@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Vijay Menon <vsm@google.com>
> Reviewed-by: William Hesse <whesse@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

TBR=whesse@google.com,rnystrom@google.com,vegorov@google.com,kustermann@google.com,zra@google.com,floitsch@google.com,jmesserly@google.com,vsm@google.com,regis@google.com,sigmund@google.com

Change-Id: I20c948057423c3fa5aa8c72843f8f2a17e086ad5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/37981
Reviewed-by: Florian Loitsch <floitsch@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2018-02-01 15:01:21 +00:00
Jens Johansen c3b992dcd8 [fasta] incremental compiler can initialize from dill
As requested in #31691 the incremental compiler should be able to
initialize its state from a previously generated dill file.

This CL introduces that functionally.
It is tested, but actual usage (e.g. proper invalidation of old files)
should live outside of the front-end (i.e. it's the callers responsibility).
One option would be for the caller to load the dill file and use the
included sources to invalidate changed files.

On my machine a from-scratch compile of dart2js takes ~5 seconds,
one initialized from such an output and with a single file invalidated
(though it actually hasn't changed) it takes ~1 second and the resulting
dill file is bit-perfect compared to the from-scratch compiled one.

Closes #31691.

Change-Id: I07f5efca5f2684d73f6c252f2dbc2ad04e9b5cd0
Reviewed-on: https://dart-review.googlesource.com/37260
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-02-01 14:57:07 +00:00
Florian Loitsch 67bac0bce6 Run async functions immediately.
Migrated from https://codereview.chromium.org/2478703003/

Change-Id: I1d678c01ba5876490b12c676c500171328361d31
Reviewed-on: https://dart-review.googlesource.com/5263
Commit-Queue: Florian Loitsch <floitsch@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-02-01 14:08:57 +00:00
Alexander Markov 450765c64e [kernel] Support external procedures without @ExternalName in treeshaker/findNativeName
Dart allows 'external' functions which are not connected to their body.
Calling such functions produces runtime error, but they should be accepted
at compile time. Test language_2/external_test verifies this behavior.

This CL fixes treeshaker/findNativeName to return 'null' instead of throwing
an error for 'external' functions without @ExternalName annotation (which
is used to specify native name).

Change-Id: I04ec892af29ffe064ece8fddd6f67c7acdca1139
Reviewed-on: https://dart-review.googlesource.com/37122
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-01-31 19:52:25 +00:00
Paul Berry e978cd6062 Encapsulate the handling of forwarding stub target references.
As discussed in https://dart-review.googlesource.com/c/sdk/+/34261.

Change-Id: I2af5021ad9738f6bc47bb11d2a1133f303d3ace9
Reviewed-on: https://dart-review.googlesource.com/36481
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-01-30 11:49:38 +00:00
Paul Berry 013a445a1a Create Procedure.isSyntheticForwarder getter.
The front end frequently needs to know whether a procedure is a
"synthetic forwarder", meaning that it is a forwarding stub and *not*
a forwarding semi-stub.  This CL provides a getter to compute this,
reducing the risk of front end bugs.

Change-Id: I1a9c584b7843948e7ac256dace25efa99b304bf6
Reviewed-on: https://dart-review.googlesource.com/36900
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-01-29 14:06:12 +00:00
Dmitry Stefantsov 936d8c317b Forbid super-bounded types in constructor invocations
Change-Id: I9af6b843925105da69148fcfb099e965f0e62f73
Reviewed-on: https://dart-review.googlesource.com/35180
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-29 13:19:23 +00:00
Paul Berry 6919ffb0fe Fix getFreshTypeParameters' handling of f-bounded types.
It's possible that any type parameter's bound may refer to any other
type parameter.  Therefore we need to generate the full substitution
map before trying to substitute any type parameter's bound.

Change-Id: I25bf0b26f4ae2a3896b3437057187acf5081b5ea
Reviewed-on: https://dart-review.googlesource.com/36364
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-29 13:03:22 +00:00
Mike Fairhurst dcb7ad3a10 Create a single CL to get CFE void-compliant
This is to incrementally land https://dart-review.googlesource.com/c/sdk/+/35805.

This FE code uses 'void' values where they are not allowed

Change-Id: I2c10766dbf0367a1f6db6f29db2f6f2005165f83
Reviewed-on: https://dart-review.googlesource.com/36800
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-01-26 17:46:55 +00:00
Paul Berry 1891084dec Generate fresh type parameters prior to inferring an invocation.
This is necessary to avoid confusion when a generic function or method
recursively calls itself.

Fixes #31759.

Change-Id: I4e3be2093e9d6b81f084250435ea7493ca6b2464
Reviewed-on: https://dart-review.googlesource.com/36363
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-24 19:41:58 +00:00
Jens Johansen 6fe7b74e47 [kernel] Mark synthetic constructors as such
Fixes #31143

Change-Id: I2c844e48c955234de1b03de08c12729f72db4f3a
Reviewed-on: https://dart-review.googlesource.com/35921
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-01-19 12:29:56 +00:00
Jens Johansen c1160d8cfa [kernel] Change ast to text output to use synthetic instead of default
Change-Id: Ied8777df13aa0411daf89f3ad3ec6bdda7bb4898
Reviewed-on: https://dart-review.googlesource.com/35862
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-01-19 09:58:46 +00:00
Peter von der Ahé 6e4e931309 Ensure duplicated members also have a default supertype
Change-Id: I33b6fa0fef116f20d382dd77644476d05f1378c5
Reviewed-on: https://dart-review.googlesource.com/35661
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-01-18 16:50:14 +00:00
Zachary Anderson 9c40a7e662 Reland: [dart:cli] Adds waitFor(Future)
This is a reland of https://dart-review.googlesource.com/#/c/sdk/+/28920/
with the following changes:
- It creates a new library dart:cli
- waitFor(Future) goes in dart:cli instead of dart:io
- Removes a flaky test, and adds a missing precompiler entrypoint
- Adds waitFor(Future)
- Improves doc comments

fixes #31102

Change-Id: I04d2c46fd0afac049dd4fd1353905dc20da18f90
Reviewed-on: https://dart-review.googlesource.com/29449
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Natalie Weizenbaum <nweiz@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-01-18 16:38:54 +00:00
Dmitry Stefantsov da0b6f52ed Add more abstract query methods to ClassHierarchy
Bug:
Change-Id: I7c30059a45ce7b63221fcb52e45bdd07dc1a1e71
Reviewed-on: https://dart-review.googlesource.com/35700
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2018-01-18 15:45:34 +00:00
Peter von der Ahé 3fcede3c7f Short-term hack to work around issue with duplicated interfaces.
See dartbug.com/31656

Change-Id: I017085953c5ac41d2cfd7368752918c6fcb51144
Reviewed-on: https://dart-review.googlesource.com/33884
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-01-18 14:10:15 +00:00
Peter von der Ahé 1d1cc3c4c2 Ensure library dependencies are seen by SourceLoader
Change-Id: I3fa2cbc386446172fbbb1150d351ff9282678b7a
Reviewed-on: https://dart-review.googlesource.com/35181
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-01-18 12:50:26 +00:00
Jens Johansen 188cee8b1c [kernel] Rename SyntheticDefault to Synthetic
Change-Id: Ibfa23fcde73e3482c1001bb885de86a408c66e5c
Reviewed-on: https://dart-review.googlesource.com/35580
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-01-18 11:09:35 +00:00
Peter von der Ahé 4d1adf42d3 Deprecate IncrementalClassHierarchy
See https://github.com/dart-lang/sdk/issues/31842

Change-Id: I019909831a91a4e06138dc3a6bf32f766bca1ae6
Reviewed-on: https://dart-review.googlesource.com/34880
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-17 13:30:17 +00:00
Samir Jindel ce1294fe3d [kernel] Lookup import conditions against the core library's loader.
Change-Id: Ib16d9f33a40ee25aed2a86a29a74bbc2b301d2e4
Reviewed-on: https://dart-review.googlesource.com/34940
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2018-01-16 23:21:42 +00:00
Samir Jindel a2ff93da67 [kernel] Partial support for conditional imports in CFE.
In order to un-block Flutter integration, we introduce partial support for
conditional imports into the CFE. There are two incomplete parts:

- The condition strings are evaluated by the Target.
  They should be looked up in the environment, but this introduces
  complications with modular compilation.

- Type inference and other static checks are performed with reference to
  the implementation (conditionally-imported) library rather than the
  interface library.

See issue #30143 for more details.

Bug:
Change-Id: I740b45e9d32796644837de4caefd8d6e8015f229
Reviewed-on: https://dart-review.googlesource.com/34721
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-16 17:27:19 +00:00
Peter von der Ahé 1bca76d012 Convert Platform.resolvedExecutable to URI correctly
Change-Id: I583b98277b1c62328885c775fcb712823c9ff405
Reviewed-on: https://dart-review.googlesource.com/34860
Reviewed-by: Alexander Thomas <athom@google.com>
2018-01-16 14:24:52 +00:00
Vyacheslav Egorov ff008ca37a [vm/kernel/async] Use proper type argument when createing async* controller.
Change-Id: I40e5d2d933b83a24c9d8177437fb6df1f21b5cc1
Reviewed-on: https://dart-review.googlesource.com/34741
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-01-15 22:06:30 +00:00
Paul Berry 45b02f8216 Use the new spec for Future flattening for type inference
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>
2018-01-15 07:09:36 +00:00
Samir Jindel 96381b76bc [kernel] Introduce 'forwardingStubInterfaceTarget' field for Procedures.
First step in fixing issue #31519.

Change-Id: I8df86954993ae5edd59ad2edc57179725880c1d9
Reviewed-on: https://dart-review.googlesource.com/34143
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-01-11 15:31:48 +00:00
Samir Jindel 28a0706e91 [kernel] Implement correct semantics of forwarding stubs in VM
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>
2018-01-10 07:39:31 +00:00
Peter von der Ahé bb9af782a7 Correct type arguments for NSM
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>
2018-01-10 07:13:30 +00:00