Commit graph

88841 commits

Author SHA1 Message Date
Ryan Macnak 288e524abe [test] Skip new tests with FFI on simulators.
Change-Id: I453ac23b8c07a6eedfbb1f53735bb6f6d5acdca9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273004
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-30 22:24:06 +00:00
Konstantin Shcheglov 66e37d871f Resolve SwitchExpression.
Change-Id: I46e710241198db311eab13c5a17cf507b86d1c0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-11-30 21:49:45 +00:00
Konstantin Shcheglov f62f614628 Support rewriting PatternVariableDeclarationImpl.expression
Change-Id: Ic5ede337be38f5f184a1177f4dbcd0b13e3a6fde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273001
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-11-30 21:49:18 +00:00
Devon Carew 793367c498 [pkg/dartdev] add windows support for 'dart bug'
Change-Id: Id94a4d9e4a485350cbe37f78d5395e093ccf5892
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272741
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-11-30 20:13:05 +00:00
Michael Thomsen 77d04c4ed0 [co19] Roll co19 to 7d8ce35e4263b14e2fb79c60d34dc00851b14215
2022-11-29 sgrekhov22@gmail.com Fixes dart-lang/co19#1553. Replace NullThrowError by TypeError (dart-lang/co19#1557)
2022-11-29 sgrekhov22@gmail.com dart-lang/co19#1401. [Patterns] List pattern tests added (dart-lang/co19#1552)
2022-11-29 sgrekhov22@gmail.com Fixes dart-lang/co19#1562. Remove deprecated FallThroughError tests (dart-lang/co19#1563)
2022-11-29 sgrekhov22@gmail.com Fixes dart-lang/co19#1526. [Records] Expect error for field names that start with underscore (dart-lang/co19#1527)

Change-Id: Ia99d047bc85db40b0db3448fbc0aae54ea8a16d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272641
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-11-30 18:18:38 +00:00
Devon Carew ccb092a5f4 [dartdev] remove the package:intl dep
Change-Id: Ia884172c15a61d788b175fd7b08239e72b271665
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272860
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-11-30 18:00:18 +00:00
Konstantin Shcheglov 0ddbdc64c9 Bump dart_style to migrate off deprecated analyzer APIs.
Change-Id: Ic2109e242b72875079aff635470eb82f309b0d76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272483
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-11-30 17:51:08 +00:00
Konstantin Shcheglov 212eae02de Resolve MapPattern(s).
Change-Id: I1f80c7f919018a74525948bd4dbec879fc3e0672
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272744
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-11-30 17:44:28 +00:00
Ryan Macnak f4b34ad31b [vm, gc] Add missing promotion of Finalizer external size. Remove race incrementing external size.
When a FinalizerEntry's target gets promoted, the associated external size needs to also get promoted. We were handling the cases where the FinalizerEntry itself was either already old or remained new, but not the case where it was promoted. Failing to promote the external size meant that when the finalizer was collected, external size was subtraced from old space that was still being attributed to new space, so the old space total external size became negative.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/50537
Change-Id: Id2fe2d748311de73f04de367c9cd153d87b74ad1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272350
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-30 17:14:59 +00:00
Derek Xu dba1e5fd3f [VM/Service] Fix package generator
package:markdown was updated to follow CommonMark's rules for encoding
certain special characters as HTMLEntities.
See 43bafebbe8/lib/src/util.dart (L15)

This CL updates the package:vm_service generators to handle these
changes.

Change-Id: I4e2e4c1c800a44ff1f3b9e7e163d60876cd6b013
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272522
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2022-11-30 16:25:57 +00:00
Johnni Winther be7779ae7f [cfe] Handle switch expression in BodyBuilder
Change-Id: Idf987e8bb59a11d1628fc866d677267f439ed5cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272300
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-11-30 16:21:28 +00:00
Brian Wilkerson 63b779533f Add a flag that will allow plugin support to be disabled when necessary
Change-Id: Ifa80f14a58501054a72a9e82ff66aa35de37b4fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272490
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-11-30 16:02:50 +00:00
Brian Wilkerson 5b76f1dd1a Enable generating URLs for newly documented diagnostics
Change-Id: I301d5a92a1dca5affae7706195cec1f7058c384e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-11-30 15:54:28 +00:00
Paul Berry 701a0d289f Add support for expression statements beginning with a map pattern.
Bug: https://github.com/dart-lang/sdk/issues/50035, https://github.com/dart-lang/language/issues/2662
Change-Id: Ifb141cf563848fc0035423a625e27585cce2ea57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272523
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-11-30 15:18:43 +00:00
Sigurd Meldgaard 3e00e6aecf Bump pub to 4fd2051bb8060ea2f2e02b13dfeb2f793d197994
Changes:
```
> git log --format="%C(auto) %h %s" 867ad17..4fd2051
 https://dart.googlesource.com/pub.git/+/4fd2051b Also use caret syntax for recommending when missing sdk constraint (#3674)
 https://dart.googlesource.com/pub.git/+/ad6b00d8 Use caret syntax in environment recommendations (#3673)
 https://dart.googlesource.com/pub.git/+/06ab0148 Allow caret syntax for sdk constraints (#3672)

```

Diff: https://dart.googlesource.com/pub.git/+/867ad175d81713c4e70473b1ab32107547cbdc3e..4fd2051bb8060ea2f2e02b13dfeb2f793d197994/
Change-Id: I07fc9bf5f01047a873e97e807b9c7fb9eff9fe35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272663
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2022-11-30 14:09:07 +00:00
Alexander Thomas 484c79bdd6 [spec_parser] Add OWNERS
Change-Id: Ie0946865371d9e35de0fff1c972732f96ea09e8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272662
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2022-11-30 14:01:10 +00:00
Johnni Winther a9823cdb8a [cfe] Handle views in NameScheme
Change-Id: I529e47ebfda8d1c89f80c02706b5bdf4bcfed00d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272661
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-11-30 13:14:48 +00:00
Sergey G. Grekhov 2d618d9734 [spec_parser] Allow negative numbers and symbols in a constant patterns
Change-Id: Idd0aaec42e1a92f57515dbb6bda27f1011c7d77d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272782
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-11-30 11:41:41 +00:00
Daco Harkes eba9ada49e [pkg/dartdev] Fix bug_linux_test
Makes test pass when there's snapshots in the current processes.

Makes test pass when there's more digits in the Memory column, the
header is aligned right.

Closes: https://github.com/dart-lang/sdk/issues/50583
Change-Id: Ia0445c38795b60a403b8cba26c0444e829955973
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272820
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-11-30 11:06:51 +00:00
Alexander Thomas 2a035279af [3.0 alpha] Use equals for default values in the SDK
The colons cause test failures when the language version is bumped to 3.0. This CL can be landed before the 3.0 version bump.

Bug: https://github.com/dart-lang/language/issues/2357
Change-Id: Id8396034b16adc18b476689314e28b9617d25f18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272200
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2022-11-30 10:33:31 +00:00
Johnni Winther 4758d03a4c [cfe] Remove InternalExpressionKind
This enum is no longer used.

Change-Id: I13af962bb95b0359fc979cb8c5e56753a7841563
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272780
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-11-30 10:29:37 +00:00
Alexander Thomas 3f19115234 Make code compatible with Trusted Types.
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>
2022-11-30 09:49:42 +00:00
Erik Ernst 1d7ec85d9c Add CHANGELOG entry for 50383
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>
2022-11-30 09:40:40 +00:00
Jens Johansen e70befdcbd [analyzer] Only search the same files for the same thing once
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>
2022-11-30 09:03:39 +00:00
Mark Zhou aef5a347c0 [dart2js] Re-adding dump info kernel regression tests.
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>
2022-11-30 06:42:58 +00:00
Paul Berry 9d0bca98e9 Rework computation of precedence for patterns.
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>
2022-11-30 05:12:47 +00:00
Brian Quinlan 8df8bbf0de Add PathExistsException and PathAccessException FileSystemException subclasses.
Bug:https://github.com/dart-lang/sdk/issues/50436
Change-Id: Ie2954f162c01189cd0d817f58606529acdc13416
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269240
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2022-11-30 04:54:52 +00:00
Konstantin Shcheglov cef6e432eb Remove PatternsResolutionTest, the experiment is enabled for all tests.
Change-Id: Ia6f8f269a78dc023387e2045cb903cc40ce01b70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272742
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-11-30 03:37:17 +00:00
Konstantin Shcheglov e0d7965663 Update CaseExpressionTypeImplementsEqualsTest tests for patterns.
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>
2022-11-30 03:36:29 +00:00
pq 636eec185b linter 1.31.0
Cherry-picks update of `prefer_equal_for_default_values` to be a no-op in SDKs `>=2.19`.

See: https://github.com/dart-lang/linter/pull/3865

Change-Id: I2669f0279a0913bc8b3c5b0501a9869608883a14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272543
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-11-30 02:11:07 +00:00
Konstantin Shcheglov 13531511d5 Resolve switch statement with patterns, support variables.
Change-Id: Idafdd5680beed4ea556cfd47941bfb22e5fe6797
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272521
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-11-30 01:16:06 +00:00
Paul Berry f28b2d71cd Remove the analyzer's AST representation for PatternAssignmentStatement.
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>
2022-11-29 23:24:43 +00:00
Konstantin Shcheglov 7e97d695f8 Fix highlighting FunctionTypedFormalParameter name.
Change-Id: I476711afa5c44c0eb7cb177e85bd67e57b024421
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272544
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-11-29 23:02:58 +00:00
Sam Rawlins c37fc761f5 Update changelog for analyzer
Change-Id: I2283636efd0b6c63ac047ccf703effb35e0388b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272489
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-11-29 22:47:58 +00:00
Nate Bosch b2485c549f Allow AddExplicitCall for bulk and file fixes
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>
2022-11-29 22:14:35 +00:00
Nicholas Shahan 2cbed01634 [ddc] Avoid null check on forwarding field setters
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>
2022-11-29 21:49:15 +00:00
Alexander Markov a9c11acd25 [vm/aot] Unbox 2-field records in return values
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>
2022-11-29 21:41:49 +00:00
Marya f8a0d65c70 runZoned to runZonedGuarded in docs
Closes https://github.com/dart-lang/sdk/pull/50577

GitOrigin-RevId: 5dd34da55ba6ecab73966d753ef275ddd4b4b2d8
Change-Id: Ie60ce8e57fa5cad532b776f35b82ab5470fe6d4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272488
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2022-11-29 20:28:59 +00:00
Paul Berry 7b41b6215b Add parser support for patternAssignment.
Bug: https://github.com/dart-lang/sdk/issues/50035, https://github.com/dart-lang/sdk/issues/50502, https://github.com/dart-lang/sdk/issues/50575
Change-Id: Idd3bdcae7cbb95c6f2016bb5d3efc638867f52af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272383
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-11-29 20:16:29 +00:00
Sam Rawlins e1acab8071 [analysis server] add fix for dangling_library_doc_comments
Change-Id: I5bd3ce04fc85a698983cbbd04bab61fedadfca6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-11-29 20:00:41 +00:00
Mark Zhou 8b48d7839b [ddc] Adding checks to expando setters, and extending checks to records
Change-Id: I7cd1244806fa63b880d5f6c842d1995207330db9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272462
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2022-11-29 19:51:37 +00:00
Kallen Tu 0329e7da94 [tests] Typedef, part of, and mixin 'on' language tests for sealed classes.
Change-Id: Idc72291668d72def5ec4c93ecb77eeea554628b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271502
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-11-29 17:51:34 +00:00
Polina Cherkasova d18ad3a9b7 Bump DevTools DEP to 2.20.0
Change-Id: I3c7ab280e334281e1b15ca8cd25508423344bb98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272482
Commit-Queue: Polina Cherkasova <polinach@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-11-29 17:03:47 +00:00
Devon Carew 1dd71b412f [dartdev] contribute a 'dart bug' command
Change-Id: Ib5557711df23d3a3e0485378c04ff6264194717f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269750
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-11-29 16:58:58 +00:00
Sigurd Meldgaard e9de133c2d Bump pub to 867ad175d81713c4e70473b1ab32107547cbdc3e
Changes:
```
> git log --format="%C(auto) %h %s" 6fdcdd4..867ad17
 https://dart.googlesource.com/pub.git/+/867ad175 Fix reading pubspecs from git (#3670)

```

Diff: https://dart.googlesource.com/pub.git/+/6fdcdd4357645817e7d7027ee2157ed68ef69c53~..867ad175d81713c4e70473b1ab32107547cbdc3e/
Bug: https://github.com/flutter/flutter/issues/116107
Change-Id: I6b1a2f1e4f1864c9a2658568f6dfd63383d10406
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272620
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2022-11-29 15:24:35 +00:00
Alexander Aprelev 36e8d9ab6f [vm/compare] Speed up internal one/two-byte strings comparisons.
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>
2022-11-29 14:36:19 +00:00
Sergey G. Grekhov fc4d9c6210 [co19] Roll co19 to e2e8dd01102f4856574c5cd7bed02ebfa63fed9c
2022-11-29 sgrekhov22@gmail.com dart-lang/co19#1554. Don't use colon for initializing default value (dart-lang/co19#1561)
2022-11-29 sgrekhov22@gmail.com dart-lang/co19#1401. Update logical patterns syntax to && and || (dart-lang/co19#1559)

Change-Id: I39da17a33ad828c05bd685f8064178a6b003d302
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272581
Reviewed-by: Alexander Thomas <athom@google.com>
2022-11-29 13:25:23 +00:00
Sergey G. Grekhov b6c1cecbee [co19] Roll co19 to a9a8b41a5efb6051956ef3c747efe3fa516d4a7e
2022-11-28 sgrekhov22@gmail.com dart-lang/co19#1554. Don't use colon for initializing default value (dart-lang/co19#1560)
2022-11-25 asashour@yahoo.com Remove extra space (dart-lang/co19#1550)
2022-11-25 asashour@yahoo.com Remove unrecognized character. (dart-lang/co19#1558)

Change-Id: I4812998edcd38c5695e7d6d910afcd79843542bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272363
Reviewed-by: Alexander Thomas <athom@google.com>
2022-11-29 08:39:19 +00:00
Jens Johansen 56c416430e [analyzer] LSP 'get implementations': get lineInfo directly
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>
2022-11-29 08:19:42 +00:00
Konstantin Shcheglov 2b5608d690 Fix parsing switch statement with SwitchPatternCaseImpl when the patterns feature is disabled.
Bug: https://github.com/dart-lang/sdk/issues/50553
Change-Id: Icd87d422ebf899d4a0d56ab4b7e476ab60949ad4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272387
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-11-29 03:02:30 +00:00