Commit Graph

1584 Commits

Author SHA1 Message Date
Konstantin Shcheglov 0e4e14a288 Build summary2 in DDC.
New summary2 will unblock fixing long standing inference issues in
Analyzer.

We build it in addition to summary1, and will switch clients to summary2
incrementally. With this CL DDC will build summary2, but will not
consume it yet for analyzing code. This will be done in a separate CL.

This change was also tested in the internal repo, and does not cause
related build failures.

Change-Id: Ic2c635e45b514a2610e938129fa7527fd8d070b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105261
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-12 16:09:24 +00:00
Terry Lucas 92dabc8491 Cache the WidgetCreatorTracker.
This fixes the problem when the flutter bots run multiple tests from the flutter tool e.g.,
  flutter test first_widget_test.dart second_widget_test.dart

The first test causes the set of libraries, particularly Flutter's framework library, to be passed
to the transformer. The transformer needs the 'Widget' class located in Flutter's framework
library. The transformer on the first test works.  Each subsequent test only the libraries not in
the prior test are passed, without the framework library, the transformer is unable to find the
'Widget' class and the widget transformer fails to run.

This fix allows the use of a nice speedup to hot-reloading Flutter applications when
--track-widget-creation is enabled and it allows us to enable --track-widget-creation by default,
for command line Flutter users.

This fixes issue https://github.com/dart-lang/sdk/issues/36640

R=jacobr@google.com,askesc@google.com

Change-Id: I9a9c9dc69995122d0f7a7a3e1dfaebf57abb4afb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105661
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2019-06-12 11:07:36 +00:00
Nicholas Shahan 80fb7891eb Cleanup violation of no_duplicate_case_values lint
Technically 'let' is an invalid identifier in ES6 strict mode.
http://www.ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors

We are never passing `strictMode = false` so either way it always returns true.

Change-Id: I7891202d76dce621ee314dc583c6a44f916ab5b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104382
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-06-07 21:59:06 +00:00
Jacob MacDonald b7aa075ca2 add a --libraries-file option to ddk
Change-Id: If0698f5b3f3736fe597fbfe0a1d13cc4205c9575
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105403
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2019-06-07 18:03:15 +00:00
Jacob MacDonald 8a57c1d463 handle range errors when getting locations
Bug: https://github.com/dart-lang/sdk/issues/37018
Change-Id: I7a9e0d4186abe37133ef29c719a81461e26cc54f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105340
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2019-06-07 14:37:20 +00:00
Vijay Menon 612a3f8978 [dartdevc] enable sdk compilation from dartdevc
Kernel mode only

Build with:
> dart bin/dartdevc.dart -k --compile-sdk dart:core --modules amd -o dart_sdk.js

For now, this doesn't support building only parts of the SDK - dart:core brings everything in.

Change-Id: I23cda3064408778dc93c9b3d4be757f1e99bae0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104811
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-06-06 21:59:21 +00:00
Nate Bosch 0241e40c15 Track Library URI for classes
Closes #36771

- Add getLibraryUri and setLibraryUri runtime utility.
- When emitting classes add a statement to set the library URI.

Change-Id: I8974c7fdd4d9986f27a35f116d9881af043c0c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104641
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-06-03 21:47:17 +00:00
Nicholas Shahan c4a1ca903f [dartdevc] Cleanup violations of unrelated_type_equality_checks lint
These violations look like actual bugs and were not simply mechanical fixes.

Change-Id: I69ae67751e48829fc4733dcb327ba0aa52602c91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104063
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-05-30 21:35:25 +00:00
Nate Bosch 2958e80671 Refactor to conditional and spread elements
Change some of the straightforward collections to use spreads, for
elements, and conditional elements. Many of the patterns in this file
can't be translated because they are more complex - keep the simple ones
with a declarative structure so that it is more clear when there are
extra computations or side effects that are meaningful.

Change-Id: I135b10641f61fc43ebbc4bbd7196c315339c3ee8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104103
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2019-05-30 01:12:12 +00:00
Nate Bosch 475d68527c Add types on overridden method signatures
We were inconsistent about using return and argument types with
overridden methods. It is technically safe to omit them since they'll be
inferred from the super class - but it's more explicit and readable to
repeat them here. We were already using types on some of the overrides -
add them to the remainder.

Change-Id: Id8529e40a80c8ff3d5feb231a37a12d3d6487b4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104160
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-05-30 00:18:09 +00:00
Vijay Menon 47e63b0eee [dartdevc] encode part file metadata
Fixes https://github.com/dart-lang/sdk/issues/37074

Hand-tested on flutter gallery.  E.g.,:
> dart.getParts('package:flutter_web_ui/ui.dart')
(15) ["src/ui/canvas.dart", "src/ui/compositing.dart", "src/ui/debug_canvas_reuse_overlay.dart", "src/ui/geometry.dart", "src/ui/hash_codes.dart", "src/ui/initialization.dart", "src/ui/lerp.dart", "src/ui/natives.dart", "src/ui/painting.dart", "src/ui/pointer.dart", "src/ui/semantics.dart", "src/ui/browser_location.dart", "src/ui/text.dart", "src/ui/tile_mode.dart", "src/ui/window.dart"]

Change-Id: Ied734d9f3739886d6679a9a9bbeae854e432bc52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103602
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-29 14:48:40 +00:00
Vijay Menon 96c2d3c303 [dartdevc] enable testing of ddc internals
Change-Id: I8f4753a9a1f2f9f61df0d045adf07ff75fe32907
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103820
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-28 19:33:05 +00:00
Vijay Menon 834587a78c [dartdevc] fix import/export declarations for es6 to add extension
d8 assumes a '.js' extension - e.g.,:
```
import { core, dart, dartx } from 'dart_sdk.js';
```

Note: this will enable Siggi's modular compilation framework to run DDC tests on d8.

Change-Id: I1167a36e1454950149fecb8abc793728a16e4591
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103780
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-28 18:48:55 +00:00
Nicholas Shahan d06592b532 [dartdevc] Add details to failed assertion messages
* Source file location
* Assertion source code

This change embeds the information as strings into the compiled source. In the
future we could reconstruct the source file location at runtime from the stack
trace.

In tests with various large applications this added roughly 1MB (0.1MB
compressed) or less to the compiled file size.

Fixes: #36995
Change-Id: I2634f7eab6e54eec209094b52429987dd62c0828
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103568
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-05-28 18:03:38 +00:00
Aske Simon Christensen 1025c5bebb [DDC] Only inline textually small constants.
Fixes https://github.com/dart-lang/sdk/issues/36535

Change-Id: I62ad6d6f7390284d0a7a52d0d4b31e57ea1fbea6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103623
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-05-27 11:45:08 +00:00
Vijay Menon 77f2603052 [dartdevc] preliminary nnbd support
For analyzer backend only:
* Implements `x!`
* Uses non-null type info where possible to elide null checks.
* Does not yet reify.

No hurry on this - starting to look at what's there.  Some notes:
* NNBD doesn't seem to be exposed directly on DartType yet.
* x!.y doesn't seem to parse - need to write (x!).y.
* Can't run existing tests yet - `package:expect`, etc., have NNBD errors.

Change-Id: I58c24c950d00f3a40d789d4a7adf049786977c50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103040
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-05-24 15:04:25 +00:00
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 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
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
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
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
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
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
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
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
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