Commit Graph

1526 Commits

Author SHA1 Message Date
Jenny Messerly cb4b6157a2 fix #36205, static calls in dart:html should directly call the DOM
It looks like this code was implemented in the wrong place. At some
point reading the code (possibly during Kernel backend port), I noticed
this and left a TODO. This CL implements the solution described in it.

Change-Id: Iff837d471c87ec2fdb8f1a9a4afdb025af1a726f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97262
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-03-20 23:38:46 +00:00
Paul Berry 7d277c4a32 Introduce methods and classes to replace "2" variants left over from "UI as code" work.
The AST refactor for "UI as code" left behind a few things whose names
ended in "2".  This CL deprecates those things and creates
replacements that don't end in "2", so that we keep the API clean.  In
a future breaking change release of the analyzer we'll remove the
deprecated things.

The following methods and classes are added:
- ForStatement and ForStatementImpl
- ListLiteral.elements
- SetOrMapLiteral.elements
- AstVisitor.visitForStatement
- AstFactory.forStatement
- NodeLintRegistry.addForStatement

The following methods and classes are deprecated:
- ForStatement2 and ForStatement2Impl
- ListLiteral.elements2
- SetOrMapLiteral.elements2
- AstVisitor.visitForStatement2
- AstFactory.forStatement2
- NodeLintRegistry.addForStatement2

In a similar way to how we did the previous stage of AST migration,
the existing visitors have been modified so that the default
implementation of visitForStatement2 redirects to visitForStatement;
this allows clients to change their overrides of visitForStatement2 to
override visitForStatement instead.  Once all clients have been
migrated we will be able to delete the visitForStatement2 method.

Change-Id: Ife5949071fe4cb50791cd4f2f4b99a1bfaad54c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97360
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-20 22:58:55 +00:00
Konstantin Shcheglov 8556e97218 Remove ResultProvider and its implementations.
R=brianwilkerson@google.com

Change-Id: Ia946a4a68ad8a4da8a2f282a02a75fc809ec980a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97269
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-20 15:43:02 +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
Paul Berry b18b626d78 Remove deprecated AST structures related to the "UI as code" feature.
This constitutes a breaking change, so the analyzer major version
number is bumped to 36.  Clients that have stopped using the removed
data structures (and the methods associated with them) should be
unaffected.

Change-Id: Iab68ecf8d10a13013ebb6b1198c54755225d0eb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95704
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-20 03:36:42 +00:00
Alan Knight 7eabbe70cd Make the --repl-compile option visible
Change-Id: I6da7062cf9357b2c8f53b980dc33827b7147f111
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97173
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Alan Knight <alanknight@google.com>
2019-03-20 00:04:13 +00:00
Jenny Messerly 22c535ac6e [dartdevc] simplify code for emitting constants
This moves the code into a shared location (instead of being copied to
both of the Analyzer/Kernel-based backends), and removes support for
detecting type parameters in constants, which was allowed by strong
mode but is not legal in Dart 2.

Change-Id: Ic8bcf0aa1107bbb7147fd15b648a45e39478cef5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96839
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-03-19 19:45:04 +00:00
Nicholas Shahan 55f3edadbe [dartdevc] Initial support for spread collections
- Only supports ddc with analyzer front end.
- Basic support for SpreadElement nodes used in collection literals.

Issue: #36006
Change-Id: I9b78c6ff34847625c8013a8e7af9a0f05a67541b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97045
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-03-19 16:56:08 +00:00
Aske Simon Christensen 1ea717f1c9 [CFE] Use Fasta diagnostics in constant evaluator.
The constant evaluator now generates all errors as Fasta diagnostic
messages. The ErrorReporter is simplified to just accept a diagnostic
message, or a notification that the constant evaluator encountered an
invalid expression (presumably put there due to an earlier error).

Also, the flow of control between the error reporter and the internal
abort exceptions is reversed, so the error reporter is now called as a
result of an abort exception being caught by the evaluate method.

Reland of https://dart-review.googlesource.com/c/sdk/+/96300

Change-Id: I7d32b6e98962b6ee781a6c96b593b00ee7fd8a89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97225
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-18 15:42:05 +00:00
Aske Simon Christensen 22718f4d60 [CFE] Always call the constant evaluator by the evaluate method.
Reland of https://dart-review.googlesource.com/c/sdk/+/96321

Change-Id: Ifb2b955d500c18a470503bad9f62f47e4c6a1fc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97117
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-18 15:42:05 +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 c7b572aa29 [CFE] Use Fasta diagnostics in the constant evaluator.
The constant evaluator now generates all errors as Fasta diagnostic
messages. The ErrorReporter is simplified to just accept a diagnostic
message, or a notification that the constant evaluator encountered an
invalid expression (presumably put there due to an earlier error).

Also, the flow of control between the error reporter and the internal
abort exceptions is reversed, so the error reporter is now called as a
result of an abort exception being caught by the evaluate method.

Change-Id: I66f148cc4e202e328f895ae0b770f9b68c9f3c8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96300
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-18 10:42:14 +00:00
Aske Simon Christensen 91bc4ec2b9 [CFE] Always call the constant evaluator by the evaluate method.
Change-Id: I176139c98e968cd890a05c0517781f8fad4a0d7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96321
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-03-18 10:42:14 +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
Mark Zhou eeb8fc8ccd [dartdevc] Adding support for async operations in block expressions
Moving YieldFinder to shared_compiler


Change-Id: Id4d95447443929376f922005e10f66930630dfaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97040
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-03-17 22:03:22 +00:00
Jenny Messerly 68bfd72e44 [dartdevc] fix #36174, add flutter inspector transform to DDC
This is a temporary workaround to copy this file into DDC, based on
jacobr@'s suggestion. I tried to keep changes minimal.

Eventually this transform should be injected when Flutter SDK builds
DDC, rather than including it here. The transform is guarded behind
a flag, so build runner can decide whether to pass it (for now, it
could be hardcoded).

Change-Id: Id9d36456a726e6abb46b904321bc31db136d1c2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97022
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
Auto-Submit: Jenny Messerly <jmesserly@google.com>
2019-03-16 00:30:02 +00:00
Mark Zhou 90d0443848 [dartdevc] Implementing block expressions and set constants
Change-Id: I8d04a6f256f41f7810e33c22a333d4807dad7049
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95673
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-03-14 23:05:48 +00:00
Nicholas Shahan 0ee1413095 [dartdevc] Initial support for control flow collections
- Only supports ddc with analyzer frontend.
- Basic support for IfElement and ForElement nodes used in collection literals.

Issue: #36005
Change-Id: I0d93f8b5fa06c1dbbbf83eb3d9bd3a4834e32366
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95964
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-03-14 22:09:18 +00:00
Paul Berry 7c3ab264e5 Change link methods to take a DeclaredVariables object.
Change-Id: I6cc36f9152fb90642ec3261418e60ac3bdbe5acf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96922
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-14 19:52:24 +00:00
Konstantin Shcheglov eeb19b0416 Remove usages of ExtensionManager and package:plugin in general.
R=brianwilkerson@google.com

Change-Id: I489e72464474b3d40d7678f44562f65934f93288
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96863
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-14 15:31:08 +00:00
Paul Berry 31c47567dc Remove AnalysisOptionsForLink and plumb analysis options through linker.
This is a non-breaking change; the only way linking is exposed to
clients is through `SummaryBuilder`, which can get the analysis
options from the context.

Fixes #35747.

Change-Id: I273408f33a881ac32ab248cbc8f3e0644630563b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96829
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-13 22:39:53 +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
Kevin Millikin e8fa9a019b [ddc] Fix a front end test failure
This code causes a front_end test failure.  The code in question also
just looks wrong.

Change-Id: I8d3e7e4cd6fc4e919b48e5784bab84302b5639b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95657
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-03-07 08:47:13 +00:00
Mark Zhou 2f53b7913c [dartdevc] Including the current library for members from within an InstanceConstant
This resolves an issue where private fields of const objects would fail to properly initialize.

Change-Id: I587c27d2c2212929babc6b4168cffc9770ae9c86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95490
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-03-06 22:42:26 +00:00
Paul Berry 0124541d5f Deprecate AST data structures that will be obseleted by the "UI as code" feature
- ForStatement and ForEachStatement will be replaced by ForStatement2.
- MapLiteral and SetLiteral will be replaced by SetOrMapLiteral.

To ease the transition, the old classes are subtypes of the new
classes, so even though the analyzer still creates instances of the
old classes, clients should be able to start referring to the new
classes in their code.  The analyzer will stop creating instances of
MapLiteral and SetLiteral when the experimental flags for the "UI as
code" feature are turned on, and will stop creating instances of all 4
classes when we bump the major version number (which should happen
sometime in March).

For visitors, we've updated the base classes with the following default methods:
  visitForStatement(node) => visitForStatement2(node);
  visitForEachStatement(node) => visitForStatement2(node);
  visitMapLiteral(node) => visitSetOrMapLiteral(node);
  visitSetLiteral(node) => visitSetOrMapLiteral(node);

So clients should be able to start revising their visitors to override
the new visit methods rather than the old ones, and the visit methods
in the base classes will automatically forward to the new visit
methods.

Change-Id: Ifde3a2aa3c8c49ce4e65dfaabf086db4dabb73f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95665
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-06 21:43:50 +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 2b2e71770c [kernel] Add SetConstant node to Kernel.
Change-Id: I83da1afc9f15009c650a871a51ca8171b482d4df
Reviewed-on: https://dart-review.googlesource.com/c/94863
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-04 10:20:56 +00:00
Aske Simon Christensen 1471b8e444 Revert "[CFE] Move constant evaluation number semantics handling to front end."
This reverts commit c2b466b09f.

Reason for revert: Broke precompiled, DDC and others.

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>

TBR=sigmund@google.com,askesc@google.com

Change-Id: I732c75b72df0e0f084ad2784349bee346ae5b7ed
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/95027
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-03-01 14:34:15 +00:00
Aske Simon Christensen c2b466b09f [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>
2019-03-01 13:30:53 +00:00
Paul Berry c2e48195f0 Rename UiAsCodeVisitorMixin to UIAsCodeVisitorMixin
To conform to Dart style rules

Change-Id: I1cc7ef76d0d723725f6d0393ca6e2b7538fc2f3e
Reviewed-on: https://dart-review.googlesource.com/c/94900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-28 21:42:09 +00:00
Paul Berry 17195d2667 Eliminate uses of old AST node types from dev_compiler
Change-Id: I839ed26a159a48e39378e94b4884faf65e3bb028
Reviewed-on: https://dart-review.googlesource.com/c/94365
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-28 20:46:16 +00:00
Mike Fairhurst 1e2211bbb6 going to go ahead and just revert this. I don't think it is at all critical. Thanks for noticing the build failure Paul!
Revert "[DDC] Support implict casts in [ForLoopStatement2]"

This reverts commit b11cb39d66.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [DDC] Support implict casts in [ForLoopStatement2]
> 
> Change-Id: I3b34072fe5ddb9078b45802619aed374f52696f5
> Reviewed-on: https://dart-review.googlesource.com/c/94357
> Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
> Commit-Queue: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Nicholas Shahan <nshahan@google.com>

TBR=mfairhurst@google.com,nshahan@google.com

Change-Id: I8f7b5252c3377a13fcb15c927d6bc6d718488bfd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/94560
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-02-27 15:38:28 +00:00
Mike Fairhurst b11cb39d66 [DDC] Support implict casts in [ForLoopStatement2]
Change-Id: I3b34072fe5ddb9078b45802619aed374f52696f5
Reviewed-on: https://dart-review.googlesource.com/c/94357
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-02-26 22:42:25 +00:00
Mark Zhou 6532b24d71 Implementing constant visitors.
Did a couple of sweeps to discover which parts of the code will be "safe" to remove when we commit to the change (but this is incomplete).

Note: these changes don't contain some backend const checks.

experimental flag: constant-update-2018

Change-Id: Ibe1e0bc530db21dac1d678f02610cc0070340776
Reviewed-on: https://dart-review.googlesource.com/c/93720
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-02-23 00:00:31 +00:00
Nicholas Shahan d9c05534de [dartdevc] Add helper methods to emit For and ForOf loops
Creates a single code path for the each of the "for loops" regardless if you are
running with one of the experiment flags to prevent regressions in existing
behavior.

The helpers will also be used in by implementation of control flow collections.

Issue: #36005
Change-Id: Ieb62dd76488386db2214b2b6d935fcfd6e7c56b9
Reviewed-on: https://dart-review.googlesource.com/c/93930
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-02-22 23:34:11 +00:00
Nicholas Shahan 620862fb13 [dartdevc] Support SetOrMapLiteral nodes
Refactor to use a single code path for set and map literals regardless of running in an experiment mode.

Create helper method that will contain logic to handle the new control flow collections nodes.

Issue: #36005
Change-Id: I9b466bf7f987a00d3d630d7551bdc5f0b7c8a547
Reviewed-on: https://dart-review.googlesource.com/c/94041
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-02-22 23:12:31 +00:00
Kevin Millikin c9b8bae4e6 [Kernel] Add BlockExpression to the Kernel language
This is not yet used or tested.

Change-Id: Id050802926ad6452df3c39ace12ea5dd56d4faaa
Reviewed-on: https://dart-review.googlesource.com/c/87970
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-02-22 12:38:26 +00:00
Jenny Messerly 4a50b02364 [dartdevc] fix #36001, non-generic classes and recursive supertypes
When two non-generic class had supertypes with mutually recursive type
arguments, the resulting module failed at startup. The compiler detected
the recursion and attempted to defer the supertype type argument
evaluation, but did not defer it long enough. The fix is to move these
deferrals after all classes are declared.

Longer term, a better fix will be #31003 which removes the need to
evaluate supertype type arguments during module initialization.

Change-Id: Ic8c5819521b3fedfcc207e932f11ae11cb03222d
Reviewed-on: https://dart-review.googlesource.com/c/93924
Commit-Queue: Mark Zhou <markzipan@google.com>
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2019-02-21 22:48:10 +00:00
Vijay Menon c338941801 [ddc] Elide continue to next switch case
Flutter uses continue labels (see
https://github.com/dart-lang/sdk/issues/29352), but only to the next
switch case - i.e., the fall through case.

The kernel backend already elides the continue here.  This does the
same for the analyzer backend.  This gets one co19 test passing on ddc
(was already passing on ddk).

Change-Id: Ifc085415e3d1735c1a534c0683a4c89289820ba0
Reviewed-on: https://dart-review.googlesource.com/c/93462
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-02-19 21:04:41 +00:00
Brian Wilkerson bcd2c7fb96 Fix ListLiteral construction and add comments
Change-Id: I52c925f3457ea039e08b59689f850cb1d1b8ab4a
Reviewed-on: https://dart-review.googlesource.com/c/93461
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-19 16:37:30 +00:00
Jens Johansen 3638e433ce Change how DDC writes text when summarize-text is enabled
The old way is very ineffecient (many small writes to the file system).
Initial build time for (redacted?) goes from ~40 seconds to ~19 seconds.

Change-Id: Id098f51f43627c5b0768ab9686caab26ba946caa
Reviewed-on: https://dart-review.googlesource.com/c/93411
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-02-18 07:57:00 +00:00
Jenny Messerly 24928ffcef [dartdevc] hide summarize-text option and change default to off
This option was useful early in development of DDC's Kernel backend, but
it shouldn't be turned on for users (we may want to remove it entirely).

Change-Id: Ie89115f6d3b9884762968e8e40bffa67799af988
Reviewed-on: https://dart-review.googlesource.com/c/93463
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-02-16 01:50:17 +00:00
Konstantin Shcheglov 39afa4e555 Revert "Add ExecutableElement(s) based InheritanceManager3, and switch analyzer to it."
This reverts commit 5d6bab4ed2.

Reason for revert: this change is API incompatible when rolling into mono-repo.

Original change's description:
> Add ExecutableElement(s) based InheritanceManager3, and switch analyzer to it.
> 
> Change-Id: I9d87619e05ae769f4df6a6ba26cd7901c7c98510
> Reviewed-on: https://dart-review.googlesource.com/c/93141
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

TBR=scheglov@google.com,brianwilkerson@google.com

Change-Id: I98d478f56e8aea037cbcc8b6cb940c36edb732fd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/93440
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-15 16:38:08 +00:00
Brian Wilkerson 122aa43ef6 Convert ListLiteral and remove uses of ListLiteral2
Change-Id: I6c6f60ae969deb798cdbc8572341f2a51256b194
Reviewed-on: https://dart-review.googlesource.com/c/93341
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-15 16:17:28 +00:00
Alan Knight 65290f6e6a Add an option for reusing the previous compiler state in a worker
Change-Id: Iaac1aedc290611183833122fb269ee225b273e56
Reviewed-on: https://dart-review.googlesource.com/c/93144
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Alan Knight <alanknight@google.com>
2019-02-15 00:37:11 +00:00
Konstantin Shcheglov 5d6bab4ed2 Add ExecutableElement(s) based InheritanceManager3, and switch analyzer to it.
Change-Id: I9d87619e05ae769f4df6a6ba26cd7901c7c98510
Reviewed-on: https://dart-review.googlesource.com/c/93141
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-14 18:11:18 +00:00
Jenny Messerly 9ca9e66c1b [dartdevc] fix #35928, type literals are now instantiated to bounds
This only affects the Analyzer backend; DDC+Kernel was already correct.

Change-Id: Ia388ce06e67b673c90dacbc36a5db710f0436859
Reviewed-on: https://dart-review.googlesource.com/c/92921
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
Auto-Submit: Jenny Messerly <jmesserly@google.com>
2019-02-13 21:22:37 +00:00
Brian Wilkerson 30f9f5b1c7 Add SetOrMapLiteral to support the code-as-ui features
Change-Id: I6d3023855fea6da859af0815bfae6857f1546cb9
Reviewed-on: https://dart-review.googlesource.com/c/93062
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-02-13 20:14:24 +00:00
Brian Wilkerson 5fe0202b0b Unify MapElement and CollectionElement
Change-Id: Ia1be138d656d07bdf4c11640b79044abbc798986
Reviewed-on: https://dart-review.googlesource.com/c/92762
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-02-12 17:10:58 +00:00