Commit Graph

1047 Commits

Author SHA1 Message Date
Jens Johansen 28f95fcd24 [cfe] Track dependencies in the incremental compiler
The objective of this CL is to allow the incremental compiler to track
which dill input libraries it actually used (in order to - in a modular
context - be able to ignore changes to dependencies we didn't really
use).

This is done by:
* Making the dill library builder lazy (and mark if it has been used).
* Making kernels class hierarchy record which classes it has been
  asked questions about.
* Add special handling to redirecting factory constructors as they
  bypass the fasta-builders and directly use the kernel ast.

Please note that:
* This has to be enabled, but kernels class hierarchy always records
  which classes it was asked about (even if disabled,
  or not running though the incremental compiler).
  There might potentially be some overhead to this (though setting
  a bool to true is probably comparably cheap - we did just do a
  map lookup).
* This was designed to be used together with modules
  (e.g. setModulesToLoadOnNextComputeDelta) - as used via for instance
  api_unstable/bazel_worker.dart. It might not function the way you'd
  expect in other circumstances.
* The incremental compiler (potentially) gives you the full kernel tree
  despite not having marked all of those libraries as 'used'. If a
  client use such libraries it is the clients responsibility to take
  that into account when answering any questions about this
  libraries/dill files was used.
* This feature works on the library level. In practice it is most likely
  needed at the dill-filename level. A translation from library to
  dill-filename is up to the client.
* This is a new feature, and we cannot promise that 100% of actually
  used libraries are marked. If you find used but un-marked libraries
  please report a bug.

Change-Id: I01d7ff95b9baac9550b77d8e09ea772d43173641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107280
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-12 10:40:55 +00:00
Vyacheslav Egorov afac6b1d50 [kernel] Fix text serialization for Constant nodes
Make sure to use Printer methods when formatting class references
instead of going through TreeNode.toString which uses globalNames
instead of Printer's own syntheticNames.

Change-Id: I3107a1b4d5d6d2b26a9f0001f846bd74b85853df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108803
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
2019-07-12 10:20:25 +00:00
Johnni Winther d16c0a127e [cfe] Change supportSetLiterals default value to true
This aligns the NoneTarget with the raw output of the CFE.

Change-Id: Ic3a0a3de46dac389d0ade581192e392fdaba9553
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108721
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-11 08:54:19 +00:00
Alexander Markov 1eb113ba27 [vm/bytecode] Support native extensions
Change-Id: I224f740db674e20d643191605d0a7463bf85d39f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107451
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-06-27 20:24:25 +00:00
Dmitry Stefantsov bce89db6a5 Reland "Combine override checks and override-based inference in one phase"
Original CL description:

> Combine override checks and override-based inference in one phase
>
> Change-Id: I2760f72f4eaa44bd192747179e843f017db30874
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97301
> Commit-Queue: Peter von der Ahé <ahe@google.com>
> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>

Change-Id: I8408b35819a89336d10bb11e36c7b1bee707994d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100580
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov 0a4d47de3c [fasta][nnbd] Add nullability modifiers to DartType
Change-Id: Ica2e5e250831573453c1d469571d9d001e7702a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106642
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-06-21 11:43:26 +00:00
Alexander Markov 0ae10fa68d [vm/bytecode] Support --causal_async_stacks in bytecode generator
Also, standalone_2/causal_async_stack_test is updated to actually
test --causal_async_stacks after Dart 2 sync-async.

Change-Id: I28a7a281963828707461652f19494ff54bdd21c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106760
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-06-20 20:23:37 +00:00
Aske Simon Christensen 50efd7f187 [Kernel] Add list of unused arguments to InstanceCreation nodes.
During constant evaluation, unused arguments to a const constructor are
thrown away after evaluation, since their values do not affect the
resulting instance constant. If such an unused argument ends up
unevaluated, any errors that would arise in the final evaluation are
not reported.

This CL adds space in the Kernel AST for saving these unevaluated
expressions so they can be checked during final constant evaluation.

Even though this is an incompatible change, no update is needed to the
VM code (except for the version bump), since the VM does not support
InstanceCreation nodes in the first place.

Change-Id: I4752562c1164efbba79eb018c15b07ed8354ce5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105761
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-06-13 09:42:26 +00:00
Johnni Winther cbe48553c0 [CFE] Add LocalFunction as super-interface for FunctionExpression and FunctionDeclaration
+ use it in dart2js to simplify and clarify handle of local function nodes

Change-Id: I35da2dd8bd3baba6eff6ad631ebe63d572bae4d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105423
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-12 07:20:39 +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
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
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
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
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
Aske Simon Christensen f051cd5b4d [CFE] Transform spread and if in const collections early.
This makes sure that the AST before constant evaluation only contains
official kernel nodes.

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

Change-Id: Ic4e8e15adeaea8ad4700d6feb67e31f5f0a54f7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103123
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-05-21 11:07:26 +00:00
Jens Johansen 7f67e83e36 Add sanity check assert int class hierarchy
Change-Id: Iddcf2b64f745bb9385fb5b1621afa68056da89a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103127
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-05-21 08:23:08 +00:00
Jens Johansen 099af47a69 [kernel] add ability to disable offsets for bazel worker to use
This is a lightly modified version of Jennys CL @
https://dart-review.googlesource.com/100275

Change-Id: I46a1665d84d04602af1f338cf963bc25b4e6b25c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101280
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-05-21 07:55:10 +00:00
Jacob Richman e2976acd22 Add --track-widget-creation flag to frontend_server.
This is needed to activate the kernel transformer embedded with the kernel package from the flutter engine.

Change-Id: I3253e01723b662eb48b4b3743ac5bcc1b44c7d46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102920
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Jacob Richman <jacobr@google.com>
2019-05-20 22:47:28 +00:00
Aske Simon Christensen 8754351283 [CFE] Run widget transformer before constant evaluation.
Change-Id: I51ded35ecb95cb5cfbac5ecf8967e0918a48269a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101987
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2019-05-10 11:02:49 +00:00
Aske Simon Christensen 1179467a5e Move widget transformer to kernel package
Change-Id: I7f9ece029e181d380f37028ed04f97d4fdfb12b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101985
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-05-10 11:02:49 +00:00
Jens Johansen 407378879b Error reporting and ~no location data
We shouldn't crash and reporting something as being on line 1 of a file
because we don't know where in the file it is, doesn't seem right.

Change-Id: Ia8d6145e21a136903771d876633036b292ea12ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100842
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-05-01 10:24:46 +00:00
Jens Johansen ed8e4255a4 Proposed fix to #36644
TL;DR: Unbind canonical names doesn't do what you think it does and
probably shouldn't (ever) be used. This CL stops using it in a few places.

Longer version:

When loading a dill file it:
- First loads the table of canonical names. These have no references yet.
- When a canonical name is asked for its reference it creates one if it
  doesn't yet have one.
- When loading, for instance, a library, it asks for the reference.

When unbinding a canonical name:
- It removes itself (the canonical name) from the reference
- It removes the reference in itself
- Note: Whatever has a pointer to the reference keeps it, and the
  reference points to whatever node it already pointed to.

This also means, that if we have a dill file that's split in two and:
- Load #1
- Load #2
that works fine, but if we
- Load #1
- Unbind canonical names
- Binds canonical names
- Load #2
stuff is not bound correctly (and an error is thrown).

And - the cause of this bug:
- Load #1
- Load #2
everything is fine
- Unbind canonical names
- Binds canonical names
- Load #2'
stuff is not bound correctly --- references points to stuff loaded as #2,
not as #2'. On top of being weird, wrong and confusing it also caused wrong
things to be but into the class hierarchy which ultimatly caused the crash.

This CL fixes it by not calling unbind and force loading of dill files
(at specific call sites) to create new libraries
(and in the process overwriting references ".node").

Revert "[dartdevc] Retry ddc incremental compile on crash"

This reverts commit ecdbdf00b8.

Revert "[kernel_worker] retry on failure"

This reverts commit 43eebea5a3.

Fixes #36644

Bug: #36644
Change-Id: Id8f548179e6a409b01f2ebfa3219f94cb64b1c05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100380
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-04-26 07:18:28 +00:00
Jens Johansen 1555594ddb Include a per-library index of owned sources in kernel
This for instance allows the VM to include all patches
(e.g. the previously missing `runtime/lib/date_patch.dart`)
in what's returned from `LoadedScripts()`.

Over time this also allows for `LoadedScripts()` to be simplified and
become faster (it's currently something like O(m + m*n) where m is the
number of results in DictionaryIterator(*this) and n is the number of
returned scripts).

Change-Id: I4b5a6a0fe666b774fc0987d099ed02e81ac97b43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98660
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-04-11 12:40:49 +00:00
Jens Johansen 88068ebfe3 Add missing _getLocationInEnclosingFile on Typedef
Change-Id: I81fbef620fd1742fe9a6e6428596718b038b0925
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98462
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-04-11 12:34:04 +00:00
Jens Johansen 460d00616c Better printing of imports
Before a import of, say "hello.dart" was printed as
"import './hello.dart'".
Now instead it is printed as "import 'hello.dart'".

At the same time we get rid of a dependency.

Change-Id: I352f0f507168fde75358704ec9bf0e248bb8179d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98480
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-04-11 11:43:23 +00:00
Jens Johansen fe535ac27c Add missing offset to yield produced by await for
Fixes #36069.
Fixes #28916.

Change-Id: I1acc6b9f0aaba100827749a1f3653f5cc9e4fd2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98665
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-04-11 11:16:13 +00:00
Dmitry Stefantsov 4ab4545ff7 [cfe] Add type and file offset to constant expressions
Closes #36471.

Bug: http://dartbug.com/36471
Change-Id: I5ac294057f2f69f1a8edfdf1106f65908fc257ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98677
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-04-10 09:55:36 +00:00
Johnni Winther 4fc0e1f13d Use .nullType as type of null and fix null type handling in getStaticTypeAsInstanceOf
The .getStaticType results for NullLiteral and NullConstant are inconsistent. The former returns `const BottomType()` and the latter return `TypeEnvironment.nullType`.

To avoid this inconsistency and since `const BottomType()` is really the "unreachable" type, used for instance of for the type of a throw expression, the implementation is changed to consistently use the .nullType.

For this to work, getStaticTypeAsInstanceOf (and the equivalent dart2js implementation), and the `Type.fromStaticType` constructor in the VM type flow analysis have to special case the .nullType.

Change-Id: If6b806d4a39ef7b906275c43fa2089b9d140523b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98563
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-09 06:49:17 +00:00
Kevin Millikin b700223542 [cfe] Do not reset the VM async name generator
In the VM-specific async transformation, an index is used to generate
fresh temporary names for values that are live across an await.
Before it was always 0 when translating a statement because there are
no live values on entry or exit to a statement.

When translating statements nested inside block expressions there can
be live values, so the index should not be reset.

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

Change-Id: I6103d75c25f312ab1538a7c0f8fee0fea9f01b27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98664
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-04-05 09:00:24 +00:00
Aske Simon Christensen f63eaab3af [kernel] Add instance creation kernel node.
This is used in constant evaluation to represent const constructor
invocations with unevaluated field values or asserts.

Change-Id: I1d2d60a18f967a4dd195b3b5895db9a126c47803
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98561
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-04-04 12:22:50 +00:00
Jens Johansen 8ce2d7a4e1 [CFE] Better error messages on errors with user definable operators
Fixes #36383

Change-Id: I24fd51bdb3ead75973009fe515819f9c8354e1b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98332
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-04-02 10:46:18 +00:00
Kevin Millikin c71888d537 [cfe] Async translation of block expressions
Translate block expressions in the VM's async translation.  Closes
https://github.com/dart-lang/sdk/issues/36277

Change-Id: I606b155bfe1364e948d18043c167a272007411e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98339
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-04-02 10:00:53 +00:00
Johnni Winther 1a3e8dda3b Handle nested unevaluated constants in constant evaluator
The constant evaluator assumed that any ConstantExpression met during evaluation of a sub expression was not an unevaluated constant. This do occur, for instance when a field is initialized to an unevaluated constant. With the change, unevaluated constants met during evaluation are themselves evaluated.

This change also fixed handling of assert initializers in unevaluated constants.

Change-Id: Id9e676f40bc829c4d234f34a74ef0ca5c4c6ec48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98348
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-04-01 14:29:32 +00:00
Alexander Markov 61f0f5bc43 [vm/bytecode] Declare members in bytecode
This change replaces kernel AST declarations of fields and functions
with bytecode declarations.

Size of dilp files is reduced by 11-12%.

Startup latency:
Time to the first full frame: 1.945s -> 1.687s
FinalizeClass: 554ms -> 277ms
FinishClassLoading: 296ms -> 156ms

There are following regressions in bytecode mode, which will be fixed
in future:

* dart:mirrors are not supported yet (implementation of mirrors relies
  on reading kernel AST in certain cases).

  As the result, lib_2/mirrors/* tests fail.

* native extensions are not supported yet (annotations on libraries
  and classes in AST are cleaned up as they could reference members
  which are now removed from AST).

  As the result, standalone_2/entrypoints_verification_test test fails.

* language_2/spread_collections/const_error_test/* tests fail
  due to https://github.com/dart-lang/sdk/issues/36286.

Change-Id: I5130f401fd7b84038b136136e7ccc1a6e51b6cea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97561
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-03-26 21:40:10 +00:00
Vyacheslav Egorov c9ecdabe5d Revert "Combine override checks and override-based inference in one phase"
This reverts commit 9db4119b67.

Revert "Change default of 'keepFields' in constant transformation to true"

This reverts commit b1e14cbe5f.

Revert "[fasta] Don't create forwarding stub if there's already a member"

This reverts commit 51da94da76.

These commits are reverted to unblock rolls into Flutter.

b1e14cbe5f is reverted because it contained
changes that prevented clean revert of the other CLs.

Change-Id: I8d3c00f0c1b146f4debe7f1a1a7de75be154e265
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97802
Commit-Queue: Alexander Aprelev <aam@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-25 19:40:26 +00:00
Peter von der Ahé 9db4119b67 Combine override checks and override-based inference in one phase
Change-Id: I2760f72f4eaa44bd192747179e843f017db30874
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97301
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-03-22 08:59:48 +00:00
Jens Johansen e9e0daee5c Add importUri and fileUri to Source.
This will enable the VM to map URIs to package-URIs to solve problems
such as https://github.com/dart-lang/sdk/issues/35859

Change-Id: I15520325a5b81a99a7e3f56c2e35fd775d9da946
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96905
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-03-20 08:44:33 +00:00
Aske Simon Christensen c10ee9971f [CFE] Move constant evaluator to Fasta.
Reland of https://dart-review.googlesource.com/c/sdk/+/96081

Change-Id: Ie9e6a0d26703469396fa6ea4803f49ce387f495b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97224
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-18 15:42:05 +00:00
William Hesse 3b2e368376 Revert 5 changes with failures
TBR=askesc@google.com

Revert "[CFE] Move constant evaluator to Fasta."

This reverts commit 845b5b2df1.

Revert "[CFE] Always call the constant evaluator by the evaluate method."

This reverts commit 91bc4ec2b9.

Revert "[CFE] Use Fasta diagnostics in the constant evaluator."

This reverts commit c7b572aa29.

Revert "[CFE] Check for null in constant evaluation"

This reverts commit e6d2751e9c.

Revert "Rename import after moving file."

This reverts commit a6e2c5eb4c.

Change-Id: Iadfe087c0110f6f331b82d990213f95d3ef4541b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97223
Reviewed-by: William Hesse <whesse@google.com>
2019-03-18 12:25:32 +00:00
Aske Simon Christensen 845b5b2df1 [CFE] Move constant evaluator to Fasta.
This is in preparation for recognizing Fasta-specific nodes in the
constant evaluator, and for using the Fasta diagnostics framework.

Change-Id: I8535fbb68e622f1814a1d577c348d87e573b6b34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96081
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-18 10:42:14 +00:00
Aske Simon Christensen dfb6d250b1 [kernel] Better printing of string and unevaluated constants.
This makes the printed constant pool easier to read.

Change-Id: I54d8223faeed9cb92454f4f0128f60b7e839ee42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96904
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-03-14 13:54:59 +00:00
Peter von der Ahé 0cbce074ac Add toString to Substitution
Change-Id: I7fb82f781aeafb4ef4a037c405a7201e9b52ba1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96651
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-03-13 06:46:21 +00:00
Peter von der Ahé b990c503c8 Fix typo in mixin transformer
Change-Id: Ie351a9419a1957f777f229c6caf8515a90c0e6d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96649
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-03-13 06:46:21 +00:00
Aske Simon Christensen 576c4c71d9 [CFE] Always clone subexpressions of unevaluated constants.
This makes the constant evaluator entirely non-destructive.

Change-Id: I0d347b51821e393e46c8d7782f0ccbc35712f0de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96101
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-03-11 08:37:10 +00:00
Aske Simon Christensen ff55d429f6 [kernel] Collection concatenation nodes.
These arise when the constant evaluator partially evaluates collections
containing spreads or control-flow constructs with unevaluated
subexpressions. They are removed by the final constant evaluation.

Change-Id: Icdd155c4805cbcefe6aa4b45c2f85ec258e7bd36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95760
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-03-08 13:08:55 +00:00
Jens Johansen 235e5f3709 Allow component to easily adopt libraries at will
Change-Id: Ia84d56b4c7d7403467b04e90c2b63859ecee509d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96042
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-03-08 11:01:17 +00:00
Aske Simon Christensen b5a1f6c36b Reland "[CFE] Move constant evaluation number semantics handling to front end."
This is a reland of c2b466b09f

Original change's description:
> [CFE] Move constant evaluation number semantics handling to front end.
> 
> JavaScript number semantics is currently implemented as the simplistic
> version previously present in DDC. This is a starting point for fully
> detailed JS number semantics.
> 
> Change-Id: Id728b3dacec892a5cbf7ece0d9faea51427f5f9b
> Reviewed-on: https://dart-review.googlesource.com/c/94746
> Commit-Queue: Aske Simon Christensen <askesc@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>

Change-Id: I1a488ef41bda819d34cb45cd481fd8fd88bfb01e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95460
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-03-06 10:30:37 +00:00
Aske Simon Christensen c769743f67 [CFE] Transform constants in annotations on all parameters.
The constant transformer would only transform optional parameters,
since these are the only ones that can contain default values. This
caused it to miss annotations on required positional parameters.

Change-Id: I49bfc84a1a533cec87db557306fdeb3569156947
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/93981
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-03-05 10:18:37 +00:00
Aske Simon Christensen bc2b78886d [CFE] handle set literals in constant evaluator.
Change-Id: I9dc5f7a3d2e7bc0f53e0370042bc59d688a8c4b3
Reviewed-on: https://dart-review.googlesource.com/c/95021
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-04 10:20:56 +00:00