Commit Graph

1538 Commits

Author SHA1 Message Date
Mark Zhou 28e658814f [dartdevc] Implementing collection concatenation
Required for collection constants.

Change-Id: I7397cd9b84e4fc7dea4a968272269d4d1d540f23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98300
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-04-02 02:47:44 +00:00
Mark Zhou bfb99d146d [dartdevc] Adding superclass constraints to mixin init
Change-Id: Ib21279326c46d1e675b5646e4df759fa176942dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98366
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-04-02 00:23:53 +00:00
Jens Johansen b7f69e24a2 dartdevc and bazel worker can use incremental compiler
This allows dartdevc and the bazel worker to user
the incremental compiler with kernel.
Use --reuse-compiler-result --use-incremental-compiler to run in this mode.

Change-Id: I9189ce5f1a51320d9d96e071f8c95c80fe6fca84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95386
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-03-29 12:07:42 +00:00
Nicholas Shahan a9ee08051d [dartdevc] Remove redundant parameters from helper methods
These were added to unify code paths between SetLiteral, MapLiteral and
SetOrMapLiteral visitors. SetLiteral and MapLiteral nodes have been removed
so elements can be accessed safely through the node parameter.

Change-Id: Ib42cc85d2a2307115618601359e573a15a3d3f1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97944
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-03-27 16:17:49 +00:00
Mark Zhou e1a689310b [dartdevc] Generating nested functions that invoke super as arrow functions (e.g., mixins)
Issue: https://github.com/dart-lang/sdk/issues/34806
Change-Id: I7f5297dbdfbf928258146f28f85043f735acacb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97686
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-03-26 21:00:20 +00:00
Nicholas Shahan 093c2909fe [dartdevc] Add implicit casts for SpreadElement nodes
Issue: #36006
Change-Id: Ie7252f70bd62d9b2b2382335a7853f5eb7f09480
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97684
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-03-25 23:40:34 +00:00
Jacob MacDonald 775dd08ae9 add some fixes to the widget transformer so it can find the flutter libs and assume the location arg exists on widget constructors
Change-Id: I4dc119f559be2cdbeb6a673c90662a856b24e44f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97682
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-03-25 14:33:26 +00:00
Nicholas Shahan bbe8adc827 [dartdevc] Support await within all CollectionElement nodes
This does not actually fix "await for" elements by itself but should in
combination with https://dart-review.googlesource.com/c/sdk/+/97521

Issue: #36005
Issue: #36006
Change-Id: I43380d44ec50197491cfe415291e7c2b6963079d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97565
Reviewed-by: Mark Zhou <markzipan@google.com>
2019-03-23 00:08:36 +00:00
Jenny Messerly 65b92e9579 [dartdevc] fix #36253, kernel backend now emits trackLibraries call
Also fixes DDC's Kernel backend to emit source maps. There's also
some refactoring to move shared code to the shared_compiler, to unblock
hot reload implementation work and other fixes (such as exporting
private names from the module).

Change-Id: I872e221d9f266198fcc220900146c1c9c5503acb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97553
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-03-22 22:41:01 +00:00
Nicholas Shahan f5d97104e8 [dartdevc] Fix ForElement downcasts and expected run time errors
* Move implicit cast generation on the for-in statement iterator to the code generator
  so it can be reused on the for-in element.

Issue: #36005
Change-Id: I0f77ff13dae032fa7fa1248f3c9338255ec9264b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97349
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-03-21 23:04:13 +00:00
Jenny Messerly 986fbe34d7 [dartdevc] fix #36275, emit members whose names are from other libraries
Dart interfaces can contain private member names that aren't accessible
in the current library. This is represented in Kernel as a stub that
throws (similar to the stubs used when noSuchMethod is present on a
class, typically used for mocks). DDC's Kernel backend did not
understsand that private members could belong to a different library.
This CL addresses it.

Note, this fix does not fix private names across modules. That is
covered by issue #36252 and will be addressed on top of this fix.

Change-Id: Id77d5de15d8d7ec5e44fc0f1264ced5e786636ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97441
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-03-21 21:02:21 +00:00
Vijay Menon 1e405a8226 [ddc] sidestep constant regression in ddk
See https://github.com/dart-lang/sdk/issues/36285

Change-Id: Ia4cb040ad22dfe12ae4b8269c0ca5fd3a675c02a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97351
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-03-21 19:25:41 +00:00
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