This makes the benchmark I'm using now about 15% faster.
The benchmark keeps unlinked and linked summaries in ByteStore.
After computing errors, it removes *.resolved keys.
So, the next cycle only reads file contents, performs resolution,
and computes errors.
This helps to make profiling results more focused.
Before: Computed errors in 28202 ms.
After: Computed errors in 24025 ms.
/Users/scheglov/Source/flutter/examples/flutter_gallery
R=brianwilkerson@google.com, paulberry@google.com
files: 708
/Users/scheglov/Source/flutter/examples/hello_world
files: 49
/Users/scheglov/Source/flutter/examples/stocks
files: 69
/Users/scheglov/Source/flutter/packages/flutter
files: 911
/Users/scheglov/Source/flutter/packages/flutter_test
files: 34
/Users/scheglov/Source/flutter/packages/flutter_tools
files: 416
Change-Id: Ibcc36d60d6ffbab064e96fad5e44ed0a9bfcb929
Reviewed-on: https://dart-review.googlesource.com/77242
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
We don't really need to check that the corresponding resource is
a file. Now it is a file, or a directory, the moment later it is not.
We will try to read it, if we can - fine, if not - it does not exist.
This makes my Flutter analysis benchmark about 3% faster.
R=brianwilkerson@google.com
Change-Id: I955be276c7a694a408c70f8f2d47dce75594ebc8
Reviewed-on: https://dart-review.googlesource.com/77243
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
TFA is improved to detect if a method was called using dynamic selector,
was ever called not via this, and whether the tear-off was taken.
This information is used to remove parameter type checks in AOT.
Less accurate selector-based analysis, which was used previously to get
this information, is now used only if TFA is disabled.
Also, precompiler is improved to omit method extractors and implicit
closure functions if analysis proved that tear-off is not taken.
Flutter gallery snapshot size: -0.8%
Change-Id: Iec01257dfdc78104752104df14e2ce078d326a96
Reviewed-on: https://dart-review.googlesource.com/77005
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
It costed us about 1.2% of total analysis time.
The whole information about a unit is available in its Source.
R=brianwilkerson@google.com
Change-Id: Iffa253d1eae1a466c10766f66c6c677e19be124a
Reviewed-on: https://dart-review.googlesource.com/77220
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
I'd like to use these non-APIs in my benchmarks.
R=brianwilkerson@google.com
Change-Id: Ia85081dd6ccdfed9478a34459aadc8e802ff1072
Reviewed-on: https://dart-review.googlesource.com/77161
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
TBR
This does not fix Windows bot, but I think will help for the Mac one.
Change-Id: I13d7914e60492e4865827e6c06359440aeeff29a
Reviewed-on: https://dart-review.googlesource.com/77221
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This allows us to avoid performing normalization, and work with paths
as is. So, this speeds up SourceFactoryImpl.restoreUri() from 7.5% to 3.7%
R=brianwilkerson@google.com
Change-Id: I085f3db40af6543fbb524a82fad48aa051e87937
Reviewed-on: https://dart-review.googlesource.com/77017
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This updates the parser to recover when
* 'extend' or 'extends' is used rather than 'on' in a mixin declaration
* 'extend' or 'on' is used rather then 'extends' in a class declaration
This also introduces a new ExpectedInstead error message to better
communicate to the developer the keyword that should be used.
Fix https://github.com/dart-lang/sdk/issues/34563
Change-Id: Iafcb3d18db8ca3898c1e4dae74e5124c108ead48
Reviewed-on: https://dart-review.googlesource.com/77140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Change-Id: I20f8ab79a8dbe6f2604f64cc26c2a91f46fcd2c2
Reviewed-on: https://dart-review.googlesource.com/76600
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>
Change-Id: I6f9741c545c554ecdb62a19aeb85562213b86b13
Reviewed-on: https://dart-review.googlesource.com/76601
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
This is currently unused. We might eventually resurrect it in some
form, but for now it is not doing anything for us.
Change-Id: Ib029fa8589b345bcf44a048a8c492fce9717e034
Reviewed-on: https://dart-review.googlesource.com/77061
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Change-Id: Ie89b41be2d07bc7ca1a53dc691d0fcf71a7ee0dc
Reviewed-on: https://dart-review.googlesource.com/77040
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This regressed in https://dart-review.googlesource.com/c/74664/.
In Analyzer FunctionType.typeFormals returns TypeParameterElements
instead of TypeParameterTypes; it is not safe to assume non-null bound
for elements.
Also fixes & clarifies the intent of _canEmitTypeAtTopLevel (formerly
_typeIsLoaded). There was no reason to visit the typeFormals, as generic
function types can always be emitted into the module.
Change-Id: Ia8b9271c2d1b66dca934d032dcbbe4fe89146f1b
Reviewed-on: https://dart-review.googlesource.com/76746
Reviewed-by: Alan Knight <alanknight@google.com>
Profiler showed that it was about 5% of total Flutter repo analysis time.
R=brianwilkerson@google.com
Change-Id: I172b93aaf4c25dec2de7798249984f2ef493807c
Reviewed-on: https://dart-review.googlesource.com/77008
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
When we need to check that the concrete implementation is valid for
the class interface, we already know whether we have the required
concrete implementation, or if it is left abstract. So, we can report
corresponding errors without additional computation.
R=brianwilkerson@google.com
Change-Id: Ib6d19bab024572c26853c16f22adb8a545a2e304
Reviewed-on: https://dart-review.googlesource.com/77006
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This CL updates dartfix to make the recommended changes after
prompting the user to confirm that these changes should be made.
If the source contains errors that might affect the correctness
of the automatically applied fixes, then a warning is issued
before prompting the user.
This CL also addresses comments in
https://dart-review.googlesource.com/c/sdk/+/77020
Change-Id: Ie609247616dd033aa16af8d7e6e38a9eb4cbf0d0
Reviewed-on: https://dart-review.googlesource.com/77021
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Also fix#34360 by addressing a few remaining Analyzer issues.
Change-Id: Iac3d9ba72aa370846fced3654a376899b5938152
Reviewed-on: https://dart-review.googlesource.com/76343
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This CL fixes some bugs and regressions in the 'fasta testing sdk' tool:
* Plugs the excessive memory leak in suite.dart (thanks to jensj
for helping tracking it down)
* Fixes the signature of MultitestTransformer.bind such that it no
longer causes a type error to happen at runtime.
* Removes the code that disallows test name "none".
* Updates the exclude list in testing.json
Change-Id: Ie850139c2228550c9847883d4fdaed839a052200
Reviewed-on: https://dart-review.googlesource.com/76840
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Change-Id: I0f942389f52b8302bac8b1bd0cedee1e35811056
Reviewed-on: https://dart-review.googlesource.com/76940
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Allow super calls to occur in mixin declarations if they target a
method from any of the superclass constraint interfaces.
Instead of compiling the Dart mixin declaration
mixin M on S0, S1 {...}
to Kernel:
abstract class _M&S0&S1 = S0 with S1;
abstract class M extends _M&S0&S1 { ... }
we compile it to Kernel:
abstract class _M&S0&S1 implements S0, S1 {}
abstract class M extends _M&S0&S1 { ... }
because the former is not symmetrical with respect to S0 and S1. It
will prefer a method from the 'mixin' S1 over one from S0 which can
give a compile-time error if the method from S0 is more general.
Modify mixin inference to support the new compilation of mixin
declarations. It still has to support old-style VM super mixins until
support for those is removed from the VM.
Change-Id: Ib945aa11cc19c457b07bc802beae10d1663ff6b7
Reviewed-on: https://dart-review.googlesource.com/76141
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
This normalizes all accesses of Object properties on dynamic receivers
to target the corresponding Object members.
CFE already set the interface target on for instance `a == b` where `a`
has static type `dynamic` but didn't for the implicit call to `==` in
for instance `a?.b`.
Change-Id: I4f714766ac33a431f5ef645df7ee1bbb254c06ce
Reviewed-on: https://dart-review.googlesource.com/76123
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
- including the first benefit: Removing Class/Member definitions from the K-world.
Change-Id: I440dce2e37758dd276a417851f67a1403f6535a0
Reviewed-on: https://dart-review.googlesource.com/76641
Reviewed-by: Sigmund Cherem <sigmund@google.com>