Commit Graph

2216 Commits

Author SHA1 Message Date
Vijay Menon caac50d7ff [dartdevc] Fix metalet regression
Hitting this when compiling the analyzer with DDC.  I thought this was exercised
when training the DDC snapshot (it compiles itself), but it seems not.

Lost the assignment here on the recent implicit cast removal.

Change-Id: Id1a74999c75b2a36071bac3692c2022e7ad7eefe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103482
Commit-Queue: Vijay Menon <vsm@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-05-22 19:12:10 +00:00
Vijay Menon efde7dd642 [dartdevc] fix assert
Hitting this when compiling the analyzer with ddc.  Should sanity check that our bots are
running with assertions enabled.

Change-Id: I1276b936162f3adc830a79d1f014c6dccd80de86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103461
Auto-Submit: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-22 19:00:40 +00:00
Nate Bosch e15a98c4f2 Tighten types for runtimeStatement and runtimeCall
Only ~29/100 calls for runtimeCall and ~2/31 calls for runtimeStatement
were using the single value option. Change to take a `List<Object>`
always and add list literals to those calls which were previously only
passing one value.

Update pubspec SDk constraint so that the analyzer will allow the `..?`
syntax.

Change-Id: Ib8eb8eb854a8aa04e36dc5cc713016a43b8e9325
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103361
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-05-22 17:38:15 +00:00
Nate Bosch c86c277c0f Reapply "Use the full URI for DDK library debug names"
This reverts commit 3bc0ad4ee3.

Fixes #36736

The problems with hot reload are fixed in
https://github.com/dart-lang/build/pull/2280

Change-Id: I12de170423c6bfe73816172959e4bc624d9b0f13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103362
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-05-22 16:52:27 +00:00
Brian Wilkerson 7d1b54bd47 Add a minimal implementation of ExtensionDeclaration
Change-Id: I5a556ea1819b38a3130e801a3cbc4bcbad98dcdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103380
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-22 12:43:02 +00:00
Nate Bosch 2bbb2f3c1f Disallow implicit casts
Explicit casts make it easier to confidently navigate the code base and
apply refactorings which tighten types. This change exposes a number of
places where types can be tightened, but only the most trivial were
applied. For most places I added the explicit cast that would have
happened anyway and so behavior shouldn't be changing.

- Add the configuration which disallows implicit casts in the analyzer.
- Add explicit casts in almost all instances.
- Where the implicit cast was due to a local variable type on the left,
  change it to a `var` so the type is not repeated.
- In a few places add argument types where they were already applied on
  the parent type, and the subclass was unnecessarily loosening argument
  types to dynamic.
- In a few places where a method was defined with an implicit dynamic
  return but had an obvious and consistent return type, annotate the
  method instead of casting after calls to that method.

Change-Id: I90e11b1cc08ce69967ea5705b507d5758a8f668f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103381
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-05-22 00:33:39 +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
Nicholas Shahan 2fd1021326 [dartdevc] Turn on lints and cleanup violations
Working towards turning on all lints from package:pedantic. This change includes
the lints that needed cleanup and don't change any behavior.

Applied cleanup:
* Don't explicitly initialize variables to null.
* DO use curly braces for all flow control structures.
* Use `.isEmpty` instead of `.length == 0`.
* Use `.isNotEmpty` instead of `.length > 0` or `! .isEmpty`.
* Use `=` to separate a named parameter from its default value.

The remaining lints from package:pedantic will require cleanup that is less
automatic and will be addressed in later changes.

Change-Id: Ie4c3ba685f8a559209dd14ac037203ecd16252c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103086
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-05-20 20:20:47 +00:00
Nate Bosch 9adc5be551 Dartfmt all of DDC with the latest
Some changes in indentation for adjacent string literals and a case of
formatting inside string interpolation.

Change-Id: I30eb9b9e891a11a54f89351e0f2d4c0172e69066
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103161
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-05-20 19:14:37 +00:00
Nate Bosch e9b5c9ce8b Ignore todos in DDC
These aren't useful to see cluttering up diagnostic lists - they can be
found easily enough in other ways.

Change-Id: I34b800c1145ae476822afddff558d62c4ffb9b2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103141
Reviewed-by: Mark Zhou <markzipan@google.com>
2019-05-20 17:39:42 +00:00
Nate Bosch 04e329b6ed Add override annotations across DDC
Previously 36% of overrides were annotated, including inconsistent
annotations within a single class.

- Add annotations on remaining overridden methods.
- Add linter section to `analysis_options.yaml` so that missing
  annotations are visible while editing.

Change-Id: Ief1a6d5b8da6f4b630a6cfc72a6ed67db346c081
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103140
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-05-20 17:31:26 +00:00
Vijay Menon 140822aebd [dartdevc] Allow multiple summaries and experiments in ddb tool
This allows us to test modular compiles from the cli:

> ddb -k foo.dart
> ddb -k -s foo.dill bar.dart

Change-Id: Ib88e7ff1291a7db5ecd1774b9e594121a303f2d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102002
Auto-Submit: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-05-11 22:23:57 +00:00
Nate Bosch 3bc0ad4ee3 Revert "Use the full URI for DDK library debug names"
This reverts commit 8dc57acc52.

There will need to be some changes in build_web_compilers to handle this
without regressions and we want to avoid risking this getting published
before we have it all working.

Change-Id: I5b9a6684dc34c89ce55ad21710bcfa6de34a8120
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102260
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-05-10 22:15:03 +00:00
Nate Bosch d2ddf644fa Ignore deprecated analyzer import warnings
Gives a clean analyzer output for this directory.

Change-Id: Ieac655d76e1d3791c808ea809a669c7d86ff613f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102204
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-05-10 20:05:48 +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
Aske Simon Christensen 638ebcab97 Directly check for subclass-of without using a class hierarchy.
Change-Id: I4b97f4710534b637560f7ca21ad083c7d5111c30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101983
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2019-05-10 11:02:49 +00:00
Nate Bosch 8dc57acc52 Use the full URI for DDK library debug names
Fixes #36736

Change-Id: I83c8c1b07acebf0fdc39e649983133a46d8d3648
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101901
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-05-08 22:08:39 +00:00
Paul Berry 51fe641e82 Create a SynchronousSession class.
In the long term this class will take over much of the role played by
RestrictedAnalysisContext.  For now it is simply a container for the
analysis options, declared variables, type provider, and type system.

In follow-up CLs I will plumb this object through various parts of the
analyzer, especially the LinterContext; this will enable the
canBeConst... methods to be moved into SynchronousSession, and that
will allow us to stop creating a LinterContext in
BestPracticesVerifier.

Change-Id: I7ac2d386c10d2e5339d9715848b185c163e1f858
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-08 19:57:31 +00:00
Nicholas Shahan a31594b9af [dartdevc] Cleanup ddb script
* Fix possible race condition when flushing `stdout` and `stderr`.
* Add help option and usage text (saves me from digging into the file when I
  forget a flag).
* Avoid passing `enable-experiment` with an empty string.

Change-Id: Iea288a1fad43f16c494510302efbcc65a2d91502
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101744
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-05-08 17:08:55 +00:00
Mark Zhou 149d62bd80 [dartdevc] Adding support for labels in switch statements
Issue: https://github.com/dart-lang/sdk/issues/29352
Issue: https://github.com/dart-lang/sdk/issues/36345
Change-Id: Ic811d0b54784483c1ff642909acf0df1609cf407
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100570
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-05-06 22:43:12 +00:00
Chingjun Lau 51730db51b Add flutter track widget creation transform to bazel kernel worker
Had to do a few changes to make this happen:
1. Restored some of the code removed in the transformer, making class
hierarchy optional.
2. Split the "compile" method in bazel_worker.dart into two, since we
need the intermediate Component object in one of the case.

Change-Id: I0ee004467e76dff0025f7979834c62b9db328ecc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100480
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2019-05-06 19:20:08 +00:00
Konstantin Shcheglov ab5b285f82 Record InvocationExpression.typeArgumentTypes and use it directly, without need to restore type arguments.
Also remove FunctionTypeImpl.recoverTypeArguments because Analyzer
does not need it anymore.

This CL used to replace GenericFunctionTypeElement based FunctionType(s)
with synthetic FunctionType(s). But this is not enough step, because
ideally we want to do this for all FunctionType(s) in invocations. And
this is too big change that affects many parts of Analyzer to do it now.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I180eca03ed249abfafe8d6faa94050a30969f125
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98984
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-06 15:59:08 +00:00
danrubel 4679e6bf03 fix analyzer/ddc triple shift assignment
Change-Id: I7418f7bcfee2e198fc825e6d8f551a4824b8a4e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101223
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-04 00:00:39 +00:00
Nicholas Shahan e0e5c85f48 [dartdevc] Always print errors when running ddb script
This ensures that errors are printed to the console when running in node and the
main method is async. Previously errors were being swallowed because node exits
with exit code zero in this circumstance.

Other minor cleanup to remove unused variables, imports, and flags.

Change-Id: I1dac156bbe7aa204a6034cb56ef8e9353568d400
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101340
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-05-03 22:24:18 +00:00
Vijay Menon 8866165950 [dartdevc] Reify bottom as Null
Fixes https://github.com/dart-lang/sdk/issues/36832

Change-Id: Ie0869ca350d1951e0736a9d6c92da4a7984117ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101180
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-05-03 13:39:43 +00:00
Graciliano Monteiro Passos d543d2e812 Check window.MediaSource before call constructor
MediaSource is an experimental technology. Not compatible with iOS Safary, even with current last iOS version (v12 April 2019).

This JS  function (polyfill) crashes web compiled Dart load on iOS.

Closes #36683
https://github.com/dart-lang/sdk/pull/36683

GitOrigin-RevId: c18de2cc60e0c06c566e3f2f552d6543a45011fa
Change-Id: Ic36d2cb257ecccf1b94b026f40a949a74409c371
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99980
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-04-30 20:02:02 +00:00
Stevie Strickland 4028fec3b5 Reland "[vm] Finish adding support for ECMAScript 2018 features."
This work pulls in v8 support for these features with
appropriate changes for Dart and closes
https://github.com/dart-lang/sdk/issues/34935.

This adds support for the following features:

* Interpreting patterns as Unicode patterns instead of
  BMP patterns
* the dotAll flag (`/s`) for changing the behavior
  of '.' to also match line terminators
* Escapes for character classes described by Unicode
  property groups (e.g., \p{Greek} to match all Greek
  characters, or \P{Greek} for all non-Greek characters).

The following TC39 proposals describe some of the added features:

* https://github.com/tc39/proposal-regexp-dotall-flag
* https://github.com/tc39/proposal-regexp-unicode-property-escapes

These additional changes are included:

* Extends named capture group names to include the full
  range of identifier characters supported by ECMAScript,
  not just ASCII.
* Changing the RegExp interface to return RegExpMatch
  objects, not Match objects, so that downcasting is
  not necessary to use named capture groups from Dart

**Note**: The changes to the RegExp interface are a
breaking change for implementers of the RegExp interface.
Current users of the RegExp interface (i.e., code using Dart
RegExp objects) will not be affected.

Change-Id: Ie62e6082a0e2fedc1680ef2576ce0c6db80fc19a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100641
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Stevie Strickland <sstrickl@google.com>
2019-04-29 09:11:48 +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
Keerti Parthasarathy 9238e25305 Revert "[vm] Finish adding support for ECMAScript 2018 features."
This reverts commit 5ebb640a67.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [vm] Finish adding support for ECMAScript 2018 features.
> 
> This work pulls in v8 support for these features with
> appropriate changes for Dart and closes
> https://github.com/dart-lang/sdk/issues/34935.
> 
> This adds support for the following features:
> 
> * Interpreting patterns as Unicode patterns instead of
>   BMP patterns
> * the dotAll flag (`/s`) for changing the behavior
>   of '.' to also match line terminators
> * Escapes for character classes described by Unicode
>   property groups (e.g., \p{Greek} to match all Greek
>   characters, or \P{Greek} for all non-Greek characters).
> 
> The following TC39 proposals describe some of the added features:
> 
> * https://github.com/tc39/proposal-regexp-dotall-flag
> * https://github.com/tc39/proposal-regexp-unicode-property-escapes
> 
> These additional changes are included:
> 
> * Extends named capture group names to include the full
>   range of identifier characters supported by ECMAScript,
>   not just ASCII.
> * Changing the RegExp interface to return RegExpMatch
>   objects, not Match objects, so that downcasting is
>   not necessary to use named capture groups from Dart
> 
> **Note**: The changes to the RegExp interface are a
> breaking change for implementers of the RegExp interface.
> Current users of the RegExp interface (i.e., code using Dart
> RegExp objects) will not be affected.
> 
> Change-Id: I0709ed0a8d5db36680e32bbad585594857b9ace4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95651
> Commit-Queue: Stevie Strickland <sstrickl@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=lrn@google.com,kustermann@google.com,jmesserly@google.com,johnniwinther@google.com,sstrickl@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I1eda0fee4fd9e94df095944049833a67b07277e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100560
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2019-04-25 14:29:51 +00:00
Alan Knight f3bd910e10 Only use MapFormatter for SDK maps (HashMap and LinkedHashMap)
For classes that implement Map, using MapFormatter can result in many,
many custom format operations. Also, the presentation is not that
useful. We get e.g. a list of indices that then have a name and value
beside them, so it just duplicates the Object view, but with extra
non-useful data.

Change-Id: I74ed34521778bddae9cdad975339925d7c181bf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100282
Commit-Queue: Alan Knight <alanknight@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2019-04-24 22:08:45 +00:00
Stevie Strickland 5ebb640a67 [vm] Finish adding support for ECMAScript 2018 features.
This work pulls in v8 support for these features with
appropriate changes for Dart and closes
https://github.com/dart-lang/sdk/issues/34935.

This adds support for the following features:

* Interpreting patterns as Unicode patterns instead of
  BMP patterns
* the dotAll flag (`/s`) for changing the behavior
  of '.' to also match line terminators
* Escapes for character classes described by Unicode
  property groups (e.g., \p{Greek} to match all Greek
  characters, or \P{Greek} for all non-Greek characters).

The following TC39 proposals describe some of the added features:

* https://github.com/tc39/proposal-regexp-dotall-flag
* https://github.com/tc39/proposal-regexp-unicode-property-escapes

These additional changes are included:

* Extends named capture group names to include the full
  range of identifier characters supported by ECMAScript,
  not just ASCII.
* Changing the RegExp interface to return RegExpMatch
  objects, not Match objects, so that downcasting is
  not necessary to use named capture groups from Dart

**Note**: The changes to the RegExp interface are a
breaking change for implementers of the RegExp interface.
Current users of the RegExp interface (i.e., code using Dart
RegExp objects) will not be affected.

Change-Id: I0709ed0a8d5db36680e32bbad585594857b9ace4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95651
Commit-Queue: Stevie Strickland <sstrickl@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-04-24 09:24:16 +00:00
Nicholas Shahan ca9bbd39d5 [dartdevc] Remove ddc and ddk pre-compiled "legacy" sdk modules
We do not expect any client uses of the precompiled SDK in this module format. The only know use
case builds the SDK manually first.

Add simple tests that files can be compiled with `--modules legacy` option.

Issue: #35988
Change-Id: Ie2c4244e5876bb04f968b0198f5763ff3d29c01c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99921
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-04-23 21:29:15 +00:00
Jenny Messerly 2c304d997f [dartdevc] fix #36372, make JS Array constructor property usable from JS
The `new array.constructor()` pattern is occasionally used in JS
(presumably, to get the array subtype if one is available). GopherJS in
particular does this. This fixes DDC's generic `JSArray<T>` to support
this pattern, for all values of T. This also makes JSArray work like
all other "native" types in DDC, where the "constructor" property
is the JS constructor for that native type.

Change-Id: I5270bd648d3d60cf07b8548fcd8c9b9d1a3018d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99940
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-04-22 22:43:14 +00:00
Konstantin Shcheglov 714a082a5d Minimal integration of summary2 into AnalysisDriver.
There are also a couple of fixes for linking, to reduce the number
of failures.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I411ac34dd65bafd35adcbf22c1b78869ec0b5e24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99703
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-17 19:15:52 +00:00
Kevin Moore 9a5a720413 Remove dead/outdated lints from pkg/dev_compiler/README.md
Change-Id: I6f09fcc5e8627b22e2a1e14568218108501ffa8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99640
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-04-17 00:40:56 +00:00
Vijay Menon ecdbdf00b8 [dartdevc] Retry ddc incremental compile on crash
Change-Id: I00c2eb1b3bc6d9153fd2e88a8074e5670a0e082e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99442
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-04-16 20:06:05 +00:00
Vijay Menon 5319d76b5a Run ddc worker tests
Change-Id: I3555fe64bacd03a728d63a035457ca1e3398edb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98699
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-04-16 00:38:24 +00:00
Jenny Messerly 0136d96a96 [dartdevc] fix #36532, adds DDC support for CFE constant flag
This fixes DDC to work when CFE's constants flag is enabled.
The fixes are primarily due to how CFE inlines constants, and how it
handles "unevaluated constants" (these arise from modular compilation
and outline kernel files).

Specifically this CL addresses the following issues:

- private names now work across modules (landed in this CL:
  https://dart-review.googlesource.com/c/sdk/+/98926)
- correctly emit tearoffs regardless of how they're represeted
  (constant or StaticGet)
- correctly recognize the internal SDK and JS interop annotations,
  regardless of how they're represented (constants or expressions)
- change how DDC represents `undefined` in its internal SDK, so
  its detected regardless of constant inlining
- emit numeric constants as integers in JS when possible


Change-Id: I0fbda9d24578075f655ea945ed1b2ceed124af48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99240
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-04-12 01:47:57 +00:00
Jenny Messerly fe6897ab7f [dartdevc] fix #36252, export private name symbols
This adds support to DDC's Kernel backend for instance constants
inlined across module boundaries, by saving private name symbols
so they can be referred to from outside of the current module.

Change-Id: I28d45d1844f5351f506cc7606dd1c4803037304e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98926
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-04-11 23:45:17 +00:00
Vijay Menon 8f3608ca25 Enable ddb to run with experiments
Change-Id: I545fd124c212cf3e69c306609c0cff25c7c44216
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98782
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-04-08 20:43:29 +00:00
Mark Zhou e5d78513a1 [dartdevc] Hoisting covariance checks for generators outside of the body.
Issue: https://github.com/dart-lang/sdk/issues/33066
Change-Id: I77fed5a2b82e3d65436d71a4bd1461d731f8358e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97945
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-04-05 23:35:44 +00:00
Jenny Messerly f93b93dd91 [dartdevc] fix string escaping for string_literal_test
This brings some updates from dart2js' string escape function over to
DDC. Includes some small changes to work better for DDC:

- take the quote style as an input; DDC uses it for ES6 template strings.
- use ES6 escape syntax (DDC requires ES6 support).
- always use UTF-8 mode because DDC writes files as UTF-8.

Change-Id: I56e2cbb9afcebf06500185170bd9877b16f5dd92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98693
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-04-05 21:11:05 +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
Mark Zhou 600b2831ef [dartdevc] Updating nullability inference to account for unevaluated constants
Change-Id: I9982a38c8e15655d660c2e9d68fea5dc993bc962
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98455
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-04-04 02:14:19 +00:00
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
Ben Konyi ac2c934563 Reland "[ VM / dart:isolate ] Added ability to set names for spawned isolates."
This reverts commit 638f13ff3d.

Change-Id: Ib5015539b1c93791c2469be6995789f8f0362806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97845
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-03-28 16:39:50 +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