Closes https://github.com/dart-lang/sdk/pull/50567
Co-authored-by: Jakub Vrána <jakub@vrana.cz>
Tested: Standard CQ
GitOrigin-RevId: b916722ddc03d2b57bae6f51122ee1e7af2486b4
Change-Id: I4f638e7262009744504f0b263bf7a8e23549e5bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272380
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Issue 50383 is the breaking change whereby all cyclic dependencies are
reported as an error during top-level inference.
Change-Id: I669276c2e356aeed261287a0b295971d11357950
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272781
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
TL;DR:
56c416430e vs this CL:
textDocument/implementation (non-first runs):
```
Difference at 95.0% confidence
-3.6465 +/- 0.307413
-82.3689% +/- 6.94398%
(Student's t, pooled s = 0.238983)
```
I.e. from ~4.4s to ~0.78s on non-first runs.
textDocument/references (non-first runs):
```
Difference at 95.0% confidence
-33.1856 +/- 0.789512
-91.4283% +/- 2.17515%
(Student's t, pooled s = 0.613768)
```
I.e. from ~36.2s to ~3.11s on non-first runs.
Raw data below.
Details:
When having multiple workspace folders open, sometimes the drivers
representing these folders will have overlapping files.
For instance in my "analyzer" workspace there are a total of ~7000
unique files but if just adding each drives known files there’s
40,000+ files.
When asking for all direct subtypes of a class the a
`_FilesReferencingNameTask` does a lookup in a set for every known file
of that drive, meaning that in practice, often the same set is queried
for the same thing many times.
This CL instead assigns each `Drive` the files it was to look at,
each set will therefore only be querues once per type.
This takes the number of operations (per type) from `N*M` where `N` and
`M` are number of drives and number of files respectively (as each drive
could know all the same files) to just `M`, i.e. number of files.
This CL takes the runtime for asking for implementations of 'ToJsonable'
from package:analysis_server/lsp_protocol/protocol_special.dart in my
analyzer workspace (with 8 workspace folders / drivers) from ~4.4 seconds
to ~0.8 seconds (see below for details).
It also takes a call for "find all references" ("textDocument/references")
on method "newFile" in class "AbstractSingleUnitTest" in
"analysis_server/test/abstract_single_unit.dart" from ~36 seconds
to ~3.2 seconds (see below for details).
Raw data:
HEAD as of 56c416430e
textDocument/implementation
===========================
(notice the first query taking a long time)
(restart analyzer process)
Got answer to query in 0:00:28.921389
Got answer to query in 0:00:04.270255
Got answer to query in 0:00:04.248489
(restart analyzer process)
Got answer to query in 0:00:08.319562
Got answer to query in 0:00:04.232582
Got answer to query in 0:00:04.102793
(restart analyzer process)
Got answer to query in 0:00:09.186371
Got answer to query in 0:00:04.867653
Got answer to query in 0:00:04.840468
textDocument/references
=======================
(notice the first query taking slightly longer)
(restart analyzer process)
Got answer to query in 0:00:41.916106
Got answer to query in 0:00:36.619501
Got answer to query in 0:00:36.502156
(restart analyzer process)
Got answer to query in 0:00:40.353819
Got answer to query in 0:00:37.709369
Got answer to query in 0:00:36.086530
(restart analyzer process)
Got answer to query in 0:00:40.052997
Got answer to query in 0:00:35.273826
Got answer to query in 0:00:35.589722
WITH CL
textDocument/implementation
===========================
(notice the first query taking a long time)
(restart analyzer process)
Got answer to query in 0:00:11.902654
Got answer to query in 0:00:00.742324
Got answer to query in 0:00:00.730748
(restart analyzer process)
Got answer to query in 0:00:04.966440
Got answer to query in 0:00:00.795087
Got answer to query in 0:00:00.820526
(restart analyzer process)
Got answer to query in 0:00:04.838173
Got answer to query in 0:00:00.810417
Got answer to query in 0:00:00.784124
textDocument/references
=======================
(notice the first query taking a long time)
(restart analyzer process)
Got answer to query in 0:00:07.632822
Got answer to query in 0:00:03.098794
Got answer to query in 0:00:03.008570
(restart analyzer process)
Got answer to query in 0:00:07.690932
Got answer to query in 0:00:03.062484
Got answer to query in 0:00:03.088793
(restart analyzer process)
Got answer to query in 0:00:07.786218
Got answer to query in 0:00:03.160477
Got answer to query in 0:00:03.248359
Change-Id: I18a3cbd870f62e87937f92942460baccf8bce088
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
These tests should the in the options file to enable them, but they should only be regenerated from the non-kernel dump info tests.
Change-Id: I4baf7459eb0ffce88363f1a791a585c78af73dbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272701
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Previously, we boosted the precedence of `as` inside patterns, to make
it higher than `|` and `&`. Now, we reduce the precedence of `|` and
`&` to match that of `||` and `&&`.
The new approach should make it easier to transition to using `||` and
`&&` in patterns.
Bug: https://github.com/dart-lang/language/issues/2501
Change-Id: I6658484860ef809bc9029fa75747fdd7ce986836
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272700
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS should not be reported with
patterns.
Change-Id: I37dd207199221d33c856f159b30d1d652313f4ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272545
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
There's no such node in the grammar. Pattern assignment statements
are simply expression statements whose expression is a
PatternAssignment (in the same way that a statement like `a = b;` is
an expression statement whose expression is `a = b`).
Change-Id: I09ea7deade3eb942f5ae464f72f3e217c164594e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272384
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The edit regions should not overlap and the fixes are independent.
- Add `canBeAppliedInBulk` and `canBeAppliedToFile`.
- Add a BulkFixProcessorTest with multiple fixes in the same file.
- Add a FixKind for fixing implicit call tearofffs across the file.
Change-Id: I14260e4082fcd47c3a50514416b1c15b2c7e12c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271540
Reviewed-by: Oleh Prypin <oprypin@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Overriding fields can change the type to remove nullability and
can also be final so they override the getters only.
For DDC that means there is an inherited setter that could still be nullable and a forwarding setter that should allow null even though
the type of the overriding field is non-nullable. With enhanced null
safety asserts enabled in weak mode there should be no failure when
setting the inherited field to null.
Fixes: https://github.com/dart-lang/sdk/issues/50569
Change-Id: Ie6af0d1e265a5f3b15469311fa1f7e2a184d95ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272480
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Functions returning non-nullable records of 2 fields can now return
them as separate values on 2 registers. This postpones and sometimes
eliminates creation of record instances. As other unboxing
optimizations of return values, this optimization is only
performed in AOT.
Pair of values for an unboxed record are represented using
kPairOfTagged representation, which can be now used for the input of
Return and for the output of StaticCall/InstanceCall
PolymorphicInstanceCall/DispatchTableCall instructions.
In order to combine separate values for Return, a new MakePair
instruction is added. Extracting separate values from the result of
a call is implemented using existing ExtractNthOutput instruction.
Benchmarks (AOT mode):
MultipleReturns.Forwarded.Record +45-57%
MultipleReturns.Forwarded.RecordNamed +43-57%
MultipleReturns.NotInlined.Record +58-79%
MultipleReturns.NotInlined.RecordNamed +53-76%
TEST=runtime/tests/vm/dart/records_return_value_unboxing_il_test.dart
TEST=benchmarks/MultipleReturns/dart/MultipleReturns.dart
Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I7117b19a134c1db0ba5117a1ef093867f9ba20e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269100
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Ensure padding around data and length fields for these strings is zeroed-out, allowing for comparison to be done in word-sized chunks.
For configurations where the hash is not in the header, swap the length and the hash in string class so that the length is adjacent to the data.
x64
===
LongStringCompare.2.3000reps 109.2%
LongStringCompare.32.1000reps 526.4%
LongStringCompare.1024.30reps 670.1%
===
ia32
===
LongStringCompare.2.3000reps 90.68%
LongStringCompare.32.1000reps 274.5%
LongStringCompare.1024.30reps 211.4%
===
arm64
===
LongStringCompare.2.3000reps 89.28%
LongStringCompare.32.1000reps 454.5%
LongStringCompare.1024.30reps 677.7%
===
arm
===
LongStringCompare.2.3000reps 68.76%
LongStringCompare.32.1000reps 330.9%
LongStringCompare.1024.30reps 426.8%
===
BUG=https://github.com/dart-lang/sdk/issues/50190
TEST=string_equals_test
Change-Id: Ia4ab9bcb4daca5d4f403e0ece364bb6aafb68577
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269600
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Asking for implementations of 'ToJsonable' from
package:analysis_server/lsp_protocol/protocol_special.dart takes
8+ seconds both on first request and on subsequent requests.
Turns out most of that is spent on getting line info data for each
result via `server.getLineInfo`.
This CL rewrites how the search is performed, getting all subtypes
directly via `searchAllSubtypes`, from which one can cheaply get the
line info.
On my machine, the call that always took 8+ seconds before now takes
<2 seconds (at least on subsequent runs).
Notice that the time also depends on how much is open by the editor and
that calls from my editor with many folders open still takes ~6 seconds.
This CL furthermore adds more performance measurements that's available
via the "Analysis Server Diagnostics" page "Timing" for
"textDocument/implementation" requests.
Change-Id: I2e5ef20238901fb4734cc182aeb53adfc96f79b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272360
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
I don't remeber anymore *why* I implemented it.
And it causes a failure in https://dart-review.googlesource.com/c/sdk/+/272387
because we started dropping some tokens, so we cannot restore the
same source code.
Change-Id: I886122e488715ba35347662268b207a99945cd90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This will be used from DynamicCallSiteTypeInformation nodes to get a list of receivers for dynamic calls. The InferrerEngine will also use it to calculate overrides of a given function and mark them as called.
Change-Id: I5738e393ae2de4cb93fd55c60e944a2db067b448
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266422
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Change-Id: I95c46b3e47963348daf0f4ac97cd2b2f5c6ad59e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272348
Commit-Queue: Oleh Prypin <oprypin@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Oleh Prypin <oprypin@google.com>
The new name, `looksLikeOuterPatternEquals`, is a more precise
description of what it does.
This helps prepare for adding parser support for pattern assignments,
which require the same functionality.
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: Ibfcc4c37faac1770c98a427facdffda5c40e6d08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272344
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Normally, listener methods call `LogEvent`. This helps find bugs
where a listener that extends `Listener` doesn't implement a necessary
callback.
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: Ideac739d8d63cda2244572f7d1deb83dceeced37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272346
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Change-Id: Icef5a3ba6968312c6a49dc5bedb44dbeb901ee99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272347
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
This hashCode is rarely used today so there shouldn't be any significant change from this. But in terms of code health it's better to remove this now.
Change-Id: Iff3ea93a4d82c3977ca7903888def7cbcb2f138f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272401
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Fixes https://github.com/dart-lang/sdk/issues/50542
One primary principle is keeping the cost for _most code_
extremely low. Most code does not have an `examples/api`
directory. Most comments do not have `{@tool`.
Looking for directories on disk is expensive. Walking tokens
in comment text is cheap. So we can pay the price of walking all comments, prowling for `{@tool` text which we won't likely find,
and skip the work of looking for `examples/api` in _all_ parent
directories, until we find a comment with `{@tool`.
Don't check if `$parent/examples` exists before checking if `$parent/examples/api` exists. We don't care if `$parent/examples`
exists.
Don't create an `AanlyzerConverter` instance for _every element_
in a compilation unit while we are editing it. Instead, refactor
some of the `AnalyzerConverter` methods to be extension methods.
Change-Id: I812a1a435ee075e921782c1a57e9ed77325f9387
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271863
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Revisions updated by `dart tools/rev_sdk_deps.dart`.
ffi (3ede231..17a8142):
17a8142 2022-11-21 Daco Harkes Add links to API reference and examples to README (#167)
fixnum (bca3816..62916f2):
62916f2 2022-11-24 Lasse R.H. Nielsen Split into separate libraries instead of using parts. (#97)
14d4827 2022-11-23 Lasse R.H. Nielsen Add `tryParse` methods. (#96)
http (d56141d..047d6ed):
047d6ed 2022-11-22 Brian Quinlan Fixes a bug where requests made in different Clients would fail (#827)
9dbbafb 2022-11-17 Brian Quinlan Add tests for compressed responses (#823)
markdown (37951d1..ee3f4e9):
ee3f4e9 2022-11-24 Zhiguang Chen Fix a blockquote issue (#496)
c9048c0 2022-11-16 Zhiguang Chen Optimise DelimiterSyntax (#492)
protobuf (ae90e53..c181573):
c181573 2022-11-23 Kevin Moore [api_benchmark] migrate to null-safety (#776)
648deaf 2022-11-23 Kevin Moore Standardize and fix lints (#775)
bfa4c0d 2022-11-23 Kevin Moore Fix `///` at the top of generated Dart files (#774)
ed68426 2022-11-17 Devon Carew Remove duplicate consts (#773)
sse (283568d..8d018dd):
8d018dd 2022-11-23 Elliott Brooks (she/her) Format markdown files (#68)
2f6f151 2022-11-23 Elliott Brooks (she/her) Add optional `debugKey` parameter to SSE client (#67)
eaee6a8 2022-11-23 Elliott Brooks (she/her) Use Fetch API in SSE Client (#66)
test (7756833..b25dac9):
b25dac99 2022-11-21 Kevin Moore checks: finish async tests (#1793)
3166163e 2022-11-18 Devon Carew Update scorecards-analysis.yml (#1792)
d930d5b0 2022-11-18 Nate Bosch Add support for async soft checks (#1789)
b1411a21 2022-11-18 Devon Carew blast_repo fixes (#1788)
a6aa04e0 2022-11-18 Jacob MacDonald disable wasm tests for now as they are failing (#1791)
8b5174c1 2022-11-17 Kevin Moore Starting on async tests (#1787)
Change-Id: Ic361fce7753d08d43fc827f13cb1bfa1738cc16e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272343
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Special syntax for mixin applications should be also abstract if we add the sealed modifier.
Change-Id: I3af3e997734f4bc762dc29bfc3f61f2e691ca41b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271840
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
* Stop using `implicit-casts: false`
* Don't list rules which are found in package:lints
* Fix strict-inference issues
Change-Id: Ibe350548e3d6bef486ef2ef82430cda23d684baf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271780
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>