Commit Graph

22344 Commits

Author SHA1 Message Date
Jenny Messerly 65951ef508 [dartdevc] fix debugger extension console, take 2
This change fixes the (internal) debugger console test so it passes.

A few of the fixes did not make it into the previous CL
(CL https://dart-review.googlesource.com/c/sdk/+/83140).

Change-Id: I58df9024b96e73a13a5c13b801be237450cfe3cb
Reviewed-on: https://dart-review.googlesource.com/c/83522
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Alan Knight <alanknight@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2018-11-07 23:39:17 +00:00
Stephen Adams ff433daa03 Access more code via hunkHelpers
Change-Id: I0c43ea0903ee05b3c130e38f73bba9ce30b3506b
Reviewed-on: https://dart-review.googlesource.com/c/83540
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-11-07 22:02:31 +00:00
Konstantin Shcheglov 493e9d3dce Issue 29134. Un-skip analysis_server/analyzer_plugin check_all_test.
I have no idea if something was fixed, but given that we guessed that
it is caused by formatting, maybe things are changed enough that it
is not flaky anymore.

I will revert, or a gardener can revert, if it is still flaky.

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

Bug: https://github.com/dart-lang/sdk/issues/29134
Change-Id: Ide76d50af921b04ce8cd6b96a0ee43f2a7734911
Reviewed-on: https://dart-review.googlesource.com/c/83321
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-07 15:35:17 +00:00
Peter von der Ahé c24073f442 Add events for grammar-term forInitializerStatement
Change-Id: I2876085cca0e8c7e553fa14d786a2b4bd7f18470
Reviewed-on: https://dart-review.googlesource.com/c/83380
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-11-07 13:21:15 +00:00
Jenny Messerly fceae8524d [dartdevc] fix #34531, optimize covariance checks in the kernel backend
This is similar to the analyzer backend's optimization for fields, but
it also supports private methods and accessors.

Also fixes #34769, checks were missing for explicit covariant fields
and those are now generated (this is for fields of the form
`covariant SomeType fieldName`--implicitly covariant fields in generic
classes were already checked correctly).

Change-Id: I5ce3ed7944bdc5a9799c731c5f95e199b461b079
Reviewed-on: https://dart-review.googlesource.com/c/79432
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Alan Knight <alanknight@google.com>
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Alan Knight <alanknight@google.com>
2018-11-07 01:56:35 +00:00
Stephen Adams 3be0d61793 Split installTearOff into static and instance versions
We will move other methods into `hunkHelpers` at a later stage.

Change-Id: Id37a0bddb81cc47af55baa2896dc5716ccacf3e1
Reviewed-on: https://dart-review.googlesource.com/c/83220
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-11-07 00:44:34 +00:00
Stephen Adams e9ba30a4b4 [dartjs] Shorten "call*" when minified
We can do this now 'mirrors' is not longer supported.

Change-Id: I469710df4c3d7e7f17b5a6ed9569f9e991f8bba6
Reviewed-on: https://dart-review.googlesource.com/c/82960
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-11-07 00:10:22 +00:00
Jenny Messerly d8d6835849 [dartdevc] fix debugger extension console
This change fixes the (internal) debugger console test so it passes.

Change-Id: Iaae1ec189d6744158ebea4dd55e187146adf9039
Reviewed-on: https://dart-review.googlesource.com/c/83140
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Alan Knight <alanknight@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-11-06 23:31:11 +00:00
danrubel 7e6a39fd91 Generate analysis server notification handler
... and generate the analysis server protocol version

Change-Id: I585e50cc854d5ae1aa7440a14f856c983bbfc93a
Reviewed-on: https://dart-review.googlesource.com/c/83180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-11-06 23:04:53 +00:00
Konstantin Shcheglov a13c22f90a Backport Parsed/ResolvedLibraryResultImpl and ElementDeclarationResult into master.
There are more Impl classes in src/dart/analysis/results.dart than
required, I decided to keep them anyway - they don't hurt anything.

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

Change-Id: I83aee3ed7423bbafcc91fba49339f5cfd9b778e9
Reviewed-on: https://dart-review.googlesource.com/c/83080
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-06 20:11:11 +00:00
Peter von der Ahé 09d2740247 Honor verbose mode when running test directly
Change-Id: Ice090b54789c011e627715c5e6ecb58901b304e3
Reviewed-on: https://dart-review.googlesource.com/c/82995
Commit-Queue: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-11-06 13:39:20 +00:00
Peter von der Ahé f882af1c33 Include file name in scanner test chain
Change-Id: Ifca81ba39d14895cbe025f349d97a02e6b07856f
Reviewed-on: https://dart-review.googlesource.com/c/82994
Commit-Queue: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-11-06 13:18:40 +00:00
Peter von der Ahé 0fd4a51e2c Recover from default values in function types
Fixes https://github.com/dart-lang/sdk/issues/35035

Change-Id: I29fe0d792998c43f49877d97b61b3afc16c43cef
Reviewed-on: https://dart-review.googlesource.com/c/82984
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-11-06 11:39:32 +00:00
Jens Johansen 3e56b7ec3a Exercise loadComponent of sdk more when training kernel_service
By exercising loadComponent more we speedup the loading of the sdk.
This is going to be noticable when executing small scripts.
On my machine execution of a hello-world script is speed up by ~15-20%.

More data from local experiments:

Before:

$ perf stat -r 25 -d out/ReleaseX64/dart hello.dart

 Performance counter stats for 'out/ReleaseX64/dart hello.dart' (25 runs):

        389.268166      task-clock:u (msec)       #    2.035 CPUs utilized            ( +-  0.91% )
                 0      context-switches:u        #    0.000 K/sec
                 0      cpu-migrations:u          #    0.000 K/sec
            19,278      page-faults:u             #    0.050 M/sec                    ( +-  0.65% )
       979,345,922      cycles:u                  #    2.516 GHz                      ( +-  1.31% )  (48.75%)
     1,120,493,995      instructions:u            #    1.14  insn per cycle           ( +-  0.73% )  (61.28%)
       207,470,248      branches:u                #  532.975 M/sec                    ( +-  0.84% )  (60.76%)
         4,439,025      branch-misses:u           #    2.14% of all branches          ( +-  1.00% )  (61.00%)
       387,461,284      L1-dcache-loads:u         #  995.358 M/sec                    ( +-  1.38% )  (49.12%)
        18,764,375      L1-dcache-load-misses:u   #    4.84% of all L1-dcache hits    ( +-  2.94% )  (26.43%)
         5,713,192      LLC-loads:u               #   14.677 M/sec                    ( +-  2.13% )  (25.71%)
         1,266,848      LLC-load-misses:u         #   22.17% of all LL-cache hits     ( +-  3.74% )  (37.01%)

       0.191278504 seconds time elapsed                                          ( +-  1.10% )


$ runxtimes 25 sudo chrt -f 99 /usr/bin/time -f "%e" out/ReleaseX64/dart hello.dart > /dev/null 2>> before.txt

After:

$ perf stat -r 25 -d out/ReleaseX64/dart hello.dart

 Performance counter stats for 'out/ReleaseX64/dart hello.dart' (25 runs):

        311.248543      task-clock:u (msec)       #    1.981 CPUs utilized            ( +-  0.91% )
                 0      context-switches:u        #    0.000 K/sec
                 0      cpu-migrations:u          #    0.000 K/sec
            18,055      page-faults:u             #    0.058 M/sec                    ( +-  0.84% )
       727,169,504      cycles:u                  #    2.336 GHz                      ( +-  1.66% )  (48.89%)
       875,097,166      instructions:u            #    1.20  insn per cycle           ( +-  0.74% )  (60.69%)
       164,966,288      branches:u                #  530.015 M/sec                    ( +-  0.82% )  (59.50%)
         3,403,794      branch-misses:u           #    2.06% of all branches          ( +-  0.93% )  (59.61%)
       272,404,305      L1-dcache-loads:u         #  875.199 M/sec                    ( +-  1.53% )  (47.62%)
        11,115,851      L1-dcache-load-misses:u   #    4.08% of all L1-dcache hits    ( +-  1.70% )  (27.55%)
         4,154,542      LLC-loads:u               #   13.348 M/sec                    ( +-  2.22% )  (26.40%)
         1,225,723      LLC-load-misses:u         #   29.50% of all LL-cache hits     ( +-  2.75% )  (37.49%)

       0.157151348 seconds time elapsed                                          ( +-  1.12% )



$ runxtimes 25 sudo chrt -f 99 /usr/bin/time -f "%e" out/ReleaseX64/dart hello.dart > /dev/null 2>> after.txt

$ ministat -A before.txt after.txt
x before.txt
+ after.txt
    N           Min           Max        Median           Avg        Stddev
x  25          0.17           0.2          0.18        0.1816         0.008
+  25          0.13          0.19          0.15         0.152   0.013844373
Difference at 95.0% confidence
        -0.0296 +/- 0.00643101
        -16.2996% +/- 3.5413%
        (Student's t, pooled s = 0.0113063)



Notes:

$ type runxtimes
runxtimes is a function
runxtimes ()
{
    number=$1;
    shift;
    for i in `seq $number`;
    do
        $@;
    done
}

Change-Id: I760759976136195da00e3719663bdadbfe962e70
Reviewed-on: https://dart-review.googlesource.com/c/82581
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-11-06 10:59:27 +00:00
jonahwilliams b5caca143d Add dart_runner and flutter_runner as supported targets to frontend_server
Bug: 35057
Change-Id: Icecd75bf6304c355af70d05d896bccb6d03a92f5
Reviewed-on: https://dart-review.googlesource.com/c/82920
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-11-06 03:17:09 +00:00
Jenny Messerly be815e1a86 [dartdevc] fix #35013, move DDC off Analyzer task model
The new file pkg/dev_compiler/lib/src/analyzer/driver.dart handles
building the linked summary for a build unit, and then is capable of
doing analysis using LibraryAnalyzer.

The algorithm is very similar to analyzer_cli's build mode. The
biggest difference is that `dartdevc` has existing support for
discovering source files from the explicit source list (rather than
requiring every source to be listed on the command line). We don't want
to break that support, so there's a bit of logic to follow imports,
exports, and parts.

After the linked summary is produced, DDC gets the analysis results
(errors and resolved AST) for each library, and compiles it into a JS
module.

Change-Id: I7bf1ce1eca73fd036002e498de5924c488b534dc
Reviewed-on: https://dart-review.googlesource.com/c/82469
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-11-06 00:52:24 +00:00
pq d150268321 doc typo
Change-Id: I5dffd69a1bd983db5e23d0e72ed8cf6baba1b004
Reviewed-on: https://dart-review.googlesource.com/c/82886
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2018-11-05 22:14:20 +00:00
Stephen Adams 36874154b4 [dart2js] Simplify defaulting bool.
The small diamond from `boolOrNull ?? false` can become a fast comparison:

    boolOrNull == null ? false : boolOrNull  -->  boolOrNull == true

The straight-line code is then available for other optimizations, e.g. generate-at-use placement.

Change-Id: I7a14705a82eda4c716ee600ccca44e6658187649
Reviewed-on: https://dart-review.googlesource.com/c/56160
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-11-05 21:43:01 +00:00
Stephen Adams 19659b399d Use '==' in more cases.
Change-Id: I06b576e88cb97e819cd238970c03b7908451e010
Reviewed-on: https://dart-review.googlesource.com/c/82100
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-11-05 19:43:08 +00:00
Sigmund Cherem db2c9eeb76 dart2js_tools cleanups from the previous CL comments
TBR=johnniwinther@google.com

Change-Id: I252751d8163a056784b10dcb58633c4206a849a0
Reviewed-on: https://dart-review.googlesource.com/c/82883
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-11-05 19:35:16 +00:00
Sigmund Cherem 61df5fdec8 Encode dart2js source-map extensions in strings.
This reduce the memory footprint and cost of parsing these extensions.  Another
advantage is a reduction on the size of the .map files.  On a large customer
app, this was a 11% reduction, and the frames section was about 1Mb (excluding
the extra names and uris added on the existing tables).

The encoding works as follows:
 - minified names are written as a list of names and indices, in pairs.

    {'n1': 1, 'n2': 2} => 'n1,1,n2,2'

 - frames are encoded using a sequence of values with markers for the different
   kind of frames. Numbers are encoded using VLQ deltas. We use VLQ because it's
   already available to any parser that deals with the mappings).

This change also uses the dart2js_tools parser implementation for all unit tests.

Change-Id: Iacc2833c6517eb473955cc618adec501c610870f
Reviewed-on: https://dart-review.googlesource.com/c/82780
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-11-05 18:24:33 +00:00
Sigmund Cherem 0e35e41121 Upstream recent changes to dart2js tools
Changes include:
  * Added a couple no-such-method decoders.
  * Apply deobfuscation rules more than once per line
  * Fixed pattern matched for minified names.
  * Added support for expanding the call signature from call selectors
  * Fix backward search to find the function declaration
  * Refactor trace deobfuscation logic:
    * add dependency on stack\_trace to parse frames
    * add library to expose trace deobfsucation and keep that separate from
      printing the results
  * Fix off-by-one error when extracting the name of a function whose index is 0.
  * Avoid crash if we can't get a function name.

Change-Id: I016a293efadbdd8ddf66a007b182d5485eb2311f
Reviewed-on: https://dart-review.googlesource.com/c/82711
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Sigmund Cherem <sigmund@google.com>
2018-11-05 18:24:33 +00:00
Paul Berry 97a51b2af2 Revert "Import path as p, in Workspace impl libraries"
This reverts commit feba863557.

Reason for revert: for now, we want this change on the analyzer branch only.

Original change's description:
> Import path as p, in Workspace impl libraries
> 
> In package_build.dart, there are several spots (builtFile(),
> builtPackageSourcePath(), ...) where `context` is called, in cases
> where I imagine the author thought there was a class member at hand
> (as is the case with PackageBuildPackageUriResolver), but these
> locations are actually using the top-level const `context` from the
> path package.
> 
> I think it is super confusing to have class members, and local
> variables, that shadow an imported top-level const. Better to import
> with a prefix.
> 
> Additionally, I unified relative/absolute checking in these files as
> assert() calls, with helpful messages.
> 
> Change-Id: I6d409636dab41959cabf392c80f64c4ec5270f7b
> Reviewed-on: https://dart-review.googlesource.com/c/82560
> Commit-Queue: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

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

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

Change-Id: I03ee1a3d3f358f8a7ac6ddad5f1b3a2e5991468f
Reviewed-on: https://dart-review.googlesource.com/c/82900
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-11-05 17:59:20 +00:00
Dan Rubel 11707cab41 Add edit.dartfix test for moveTypeArgument
... and address comments in
https://dart-review.googlesource.com/c/sdk/+/82741

Change-Id: Icbe7e2e2157bc31579204e9d0202c2e37cdb4be0
Reviewed-on: https://dart-review.googlesource.com/c/82881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-11-05 16:31:10 +00:00
Dan Rubel c7e6cdf81c Update RemoveTypeArguments priority for edit.dartfix
Change-Id: I2b3b52916a4eb08a47f40e1adc2ce21985649ba3
Reviewed-on: https://dart-review.googlesource.com/c/82880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-05 16:31:10 +00:00
Johnni Winther 9a1a7763f1 Skip checking of casts in metadata
This avoids assertion failure on js-interop class computation.

Change-Id: I040c6d63dbc427d239eb97c22dc8c3c67a6fb9fd
Reviewed-on: https://dart-review.googlesource.com/c/82722
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-11-05 10:40:58 +00:00
Matan Lurey c8fd361478 Stop using deprecated package:collection/*.dart
where `*.dart` isn't `collection.dart`.

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

GitOrigin-RevId: 40f025bcf9ef71f6ccef5bc318f9862518aa0692
Change-Id: I95be4e7b31d269921a9ebbb91e5cdb2aa6702ec6
Reviewed-on: https://dart-review.googlesource.com/c/48460
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2018-11-05 10:13:06 +00:00
Kevin Moore 475eaee3c2 Cleanup some dynamic/Object promotion confusion from 5226b5c307
And make tweaks to Uri and StreamController equality

Change-Id: I63f85f67209442684e50b7c2e0011531893f294e
Reviewed-on: https://dart-review.googlesource.com/c/82781
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2018-11-03 14:05:15 +00:00
danrubel 68e2cdc3e6 Add edit.dartfix test
Change-Id: I71b886e0b15914585ef6a65e30145fee38b4b077
Reviewed-on: https://dart-review.googlesource.com/c/82741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-11-03 00:17:43 +00:00
Johnni Winther 672a049303 Move KClosedWorldImpl to its own library
+ and merge it with its mixin

Change-Id: Ib0eea07cee0bed602be90cf4a324bd423cba0a86
Reviewed-on: https://dart-review.googlesource.com/c/82720
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-11-02 21:11:31 +00:00
Johnni Winther b9a67ee27d Merge ClosedWorldBase and JsClosedWorld
Change-Id: Iab026a163a7a63ab0dad2026f43f79e0eaa8da01
Reviewed-on: https://dart-review.googlesource.com/c/82680
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-11-02 20:54:54 +00:00
Johnni Winther ad07f8a9e0 Explicitly import dart:async
This makes the dart2js code version 2.0 compliant

Change-Id: I65565222b641841b6eead9d43f81b3d52c3e962e
Reviewed-on: https://dart-review.googlesource.com/c/82642
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-11-02 17:46:16 +00:00
Johnni Winther 73eadf53c2 Move JsClosedWorld and JsClosedWorldBuilder to their own libraries.
Change-Id: I5bf75fcb443a591d460fd9e0f7c2258e345fff40
Reviewed-on: https://dart-review.googlesource.com/c/82640
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-11-02 17:34:33 +00:00
Sam Rawlins feba863557 Import path as p, in Workspace impl libraries
In package_build.dart, there are several spots (builtFile(),
builtPackageSourcePath(), ...) where `context` is called, in cases
where I imagine the author thought there was a class member at hand
(as is the case with PackageBuildPackageUriResolver), but these
locations are actually using the top-level const `context` from the
path package.

I think it is super confusing to have class members, and local
variables, that shadow an imported top-level const. Better to import
with a prefix.

Additionally, I unified relative/absolute checking in these files as
assert() calls, with helpful messages.

Change-Id: I6d409636dab41959cabf392c80f64c4ec5270f7b
Reviewed-on: https://dart-review.googlesource.com/c/82560
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-02 16:44:07 +00:00
Peter von der Ahé da93e27833 Improve position on field initializers.
Change-Id: Id62a0c6bbef46fc4745036c63c1cbe93eeb105a3
Reviewed-on: https://dart-review.googlesource.com/c/82585
Commit-Queue: Peter von der Ahé <ahe@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-11-02 14:32:31 +00:00
Dan Rubel 9df2772e41 tests for issue 34850
Change-Id: Ief5eb826b990b47cd7341d66f06beebbbdf50bac
Reviewed-on: https://dart-review.googlesource.com/c/82260
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-11-02 14:31:51 +00:00
Paul Berry 31d0896a8b Introduce API so that the linter can be migrated away from Element.context.
The API change requires adding a "context" parameter to
NodeLintRule.registerNodeProcessors.  If we did this naively it would
be a breaking change since the existing linter code overrides this
method with an implementation that doesn't accept such a parameter.
So to avoid making this a breaking change, we introduce a new
interface NodeLintRuleWithContext that extends NodeLintRule, and adds
the context to the registerNodeProcessors method as an optional
parameter.  The analyzer will only pass in the new parameter if the
lint rule implements the new interface; otherwise it will call the
method in the old way.  This will allow the linter to be migrated to
use the new API at its pace.

The next breaking change version of the analyzer will change both
NodeLintRule and NodeLintRuleWithContext so that the context parameter
is required, and will pass in a context unconditionally.  At a later
date, after the linter has been fully migrated to the new analyzer
version, we will be able to switch back to NodeLintRule and deprecate
NodeLintRuleWithContext.

Change-Id: I75ada0e94e26f831d6f2cb82cddfa706100eb185
Reviewed-on: https://dart-review.googlesource.com/c/82522
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-11-02 14:22:12 +00:00
Johnni Winther 556dd9a345 Add support for serialization on command-line
Change-Id: I4fa85c3e06e1f142265cecff83ff1b8db74bfe65
Reviewed-on: https://dart-review.googlesource.com/c/82445
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-11-02 14:12:18 +00:00
Dan Rubel 44b5c30165 fasta parser test for 33672
Change-Id: I09839ed98cbcee499d3bbb40285ddc5f1fb8a1ea
Reviewed-on: https://dart-review.googlesource.com/c/82481
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-11-02 13:51:06 +00:00
Lasse R.H. Nielsen 5226b5c307 Remove some unnecessary dynamic invocations in the platform libraries.
Change-Id: Ia72033e37c4d8292eabd95aeff97e4cb29e81823
Reviewed-on: https://dart-review.googlesource.com/c/82204
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-11-02 11:32:03 +00:00
Kevin Millikin ad2db25ce6 Do not add constructors to mixin declarations
Mixin declarations cannot be instantiated or extended, so they should
not have constructors.  Adding a compiler-generated constructor causes
us to try to add an invocation of the default superclass constructor.
Because the superclass constraint is encoded as a superclass this can
cause a spurious error that is impossible to fix.

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

Change-Id: Ia8f99d00b1a5b042da233d54f3cc1f0c6345e779
Reviewed-on: https://dart-review.googlesource.com/c/82447
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-11-02 10:45:10 +00:00
Jens Johansen 993f7260c1 Labeled variable declarations shouldn't introduce a new scope
Before, e.g.
```
main() {
  L: var x, y;
  x = 42;
  y = x;
}
```

would produce something like
```
static method main() → dynamic {
  {
    dynamic x;
    dynamic y;
  }
  x = 42;
  y = x;
}
```

i.e., the variable declaration was in another scope, and their usage
isn't legal.

This CL fixes that by either
a) (the normal case) not wrapping it --- the label is not used anyway.
b) (the case that cannot happen) put a label on the first part so the
   output would be something like
```
  L: dynamic x;
  dynamic y;
  x = 42;
  y = x;
```

Fixes #34943.

Change-Id: I24132665dab53fb8fb024f73dd11e0d1f1945812
Reviewed-on: https://dart-review.googlesource.com/c/82063
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-11-02 10:20:42 +00:00
Jonas Termansen c0db4903cf Merge remote-tracking branch 'github/master'
Close unpaired opening parenthese and fix mispelling (#30406)


Create experimental flags documentation (#34921)

* Create experimental-flags.md

* 80 cols

* Review feedback from Devon

* Update experimental-flags.md

* Remove short form (-e)

Change-Id: I808296c4517e621ba21520bb94cb9b9778e6fd1e
Reviewed-on: https://dart-review.googlesource.com/c/82582
Reviewed-by: Michael Thomsen <mit@google.com>
2018-11-02 10:15:26 +00:00
Martin Kustermann 8953788993 [VM] Convert const Symbol("..") to SymbolConstants in kernel2kernel transformation
Issue https://github.com/dart-lang/sdk/issues/34911

Change-Id: Ib504d57b5a529a04f511f737af4cec0ff0590250
Reviewed-on: https://dart-review.googlesource.com/c/82069
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-02 09:28:15 +00:00
Dan Rubel 8c20adffe6 Increment analysis server protocol version
Change-Id: I470a51b035c765d710e920f3fe77dfa11a7aca92
Reviewed-on: https://dart-review.googlesource.com/c/82480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-11-01 19:17:04 +00:00
Dmitry Stefantsov c560ee9399 [fasta] Remove temporary map typedefInstantiations
Change-Id: Ife72d3b9a2b4f150e5d4e3548409fadec1dc3146
Reviewed-on: https://dart-review.googlesource.com/c/82226
Auto-Submit: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-11-01 18:55:04 +00:00
Alexander Markov 056fdb8734 [vm/kernel] Fix kernel tree shaker after FunctionType.typedefType change
Fixes https://github.com/dart-lang/sdk/issues/34995

Change-Id: Ieef2696ea9cfe689a661dc7d1ebd86b257b49bbb
Reviewed-on: https://dart-review.googlesource.com/c/82261
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-11-01 15:41:12 +00:00
Peter von der Ahé 5896627fb8 Handle when being asked to compile a part
Change-Id: I64499d36c0b8f2b5d6d87786a16040b7cfeedae9
Reviewed-on: https://dart-review.googlesource.com/c/82221
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-11-01 09:29:11 +00:00
Sigmund Cherem 6004c8a187 Ensure generatedSize takes into consideration empty fragments
This fixes a crash in dump-info. We should investigate more closely why are we
reaching the empty output units in the first place, since we expect dump-info
wouldn't need to report data about any entity that used to be there.

Change-Id: I8c996c4ea4a86531bec28f0f294fe48086177219
Reviewed-on: https://dart-review.googlesource.com/c/82280
Reviewed-by: Harry Terkelsen <het@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-10-31 20:27:15 +00:00
Dan Rubel a074bcf93c Update dartfix package for publication
Updates to dartfix for publication including:
* add changelog, readme, and license
* update pubspec version and executables

along with a collection of smaller changes including:
* test cleanup
* remove duplicate time value from verbose output
* read dartfix pubspec version and pass that to analysis server

Change-Id: Ifa94df45e6cbcf9a98f7bf393c22e06eaab48c38
Reviewed-on: https://dart-review.googlesource.com/c/82240
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-31 17:36:51 +00:00