Commit graph

85797 commits

Author SHA1 Message Date
Devon Carew 2acf036023 move the third_party/pkg_tested packages into third_party/pkg
Change-Id: I7e2499aafb1ae85da4699358909ac67337593a11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247927
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-06-13 17:04:36 +00:00
Stephen Adams 1c442cf9f0 [dart2js] Move ClassTypeVariableAccess to own file
Moving this enum to its own file breaks a dependency of the element
maps on SSA.

Change-Id: If66d1ddf0af6ccdc5380b4f65d5e447e3cebd8de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248081
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-06-13 16:53:57 +00:00
Konstantin Shcheglov 484a80d5cb Use exportedReferences directly for PrefixScope.
Initial: https://dart-review.googlesource.com/c/sdk/+/247604
Revert: https://dart-review.googlesource.com/c/sdk/+/247605

Google3 presubmit looks green:
https://fusion2.corp.google.com/presubmit/tap/454521926

Bug: https://github.com/dart-lang/sdk/issues/23067
Change-Id: I9e404e069defdff17beb96555725223184b9adf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248062
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-06-13 15:42:47 +00:00
Johnni Winther 7900e9071a [cfe] Remove support for old super-mixins feature
This CL remove the support for mixing in classes that don't extend
Object. An error has been report by the analyzer for some time and
now also by the CFE.

This puts the breaking change https://github.com/dart-lang/sdk/issues/48167 into effect.

TEST=pkg/front_end/testcases/general/issue48167.dart

Change-Id: Ia7715a27dc1aa18a7c85b24ed86d19a91b6924d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247551
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-06-13 15:30:57 +00:00
Brian Wilkerson d876b2b48d Prepare to collect data about workspace folders
Let me know if there are other parameters that we should collect
information about. I thought about open/close, to correspond to the
number of priority files tracked for the legacy protocol, but I thought
it would be too noisy. Happy to discuss if you think otherwise.

Change-Id: Id1b8bc043052570c706dc19ea31c33c2b19177ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247480
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-06-13 15:23:49 +00:00
Phil Quitslund 9a48d1b82f Reland "[data driven] support moving symbols across packages"
This reverts commit f111a2df54.

Reason for revert: this change was mistakenly associated w/ a windows bot breakage (https://github.com/flutter/flutter/issues/105641)

Original change's description:
> Revert "[data driven] support moving symbols across packages"
>
> This reverts commit 3290d7a137.
>
> Reason for revert: flutter engine breakage (https://github.com/flutter/flutter/issues/105641)
>
> Original change's description:
> > [data driven] support moving symbols across packages
> >
> > See: https://github.com/dart-lang/sdk/issues/48997
> >
> > Change-Id: Iad16b9eae0523bc4bc14537af642b05efa75b6f7
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246663
> > Commit-Queue: Phil Quitslund <pquitslund@google.com>
> > Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Change-Id: I4a83d50497d6208b7f518ca1b381ece3aab192ad
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247606
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Keerti Parthasarathy <keertip@google.com>
> Commit-Queue: Phil Quitslund <pquitslund@google.com>
> Reviewed-by: Phil Quitslund <pquitslund@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

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

Change-Id: I769dec0d85fc0a41048b21deec0724d8509ef8e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-06-13 14:45:06 +00:00
Chloe Stefantsova 56b013fed8 [cfe] Adjust the parameter number for enum constructors
Closes https://github.com/dart-lang/sdk/issues/49216

Change-Id: Id3ad8f10632fc87075fef45f2f60b21016ade20f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247965
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-06-13 12:48:56 +00:00
Johnni Winther 2b97a2fb57 [cfe] Remove state from InferenceVisitor
This adds a _MapLiteralEntryOffsets class used to collect information
during map entry inferences instead of passing it through fields
on the visitor itself.

Change-Id: Id575bc56b8fce707fb038a695bfe347ca4d6432d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247964
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2022-06-13 11:00:16 +00:00
Sigurd Meldgaard 2aa637afce Bump pub to c4e9ddc888c3aa89ef4462f0c4298929191e32b9
Changes:
```
> git log --format="%C(auto) %h %s" 51435ef..c4e9ddc
 https://dart.googlesource.com/pub.git/+/c4e9ddc8 Extend retries for file-ops on windows (#3451)
 https://dart.googlesource.com/pub.git/+/6aeb1795 Upgrade package:lints to 2.0.0 (#3445)
 https://dart.googlesource.com/pub.git/+/73ea9a98 Roll tar to 0.5.5+1 (#3447)
 https://dart.googlesource.com/pub.git/+/2dc887fe Add env var for writing golden files (#3222)
 https://dart.googlesource.com/pub.git/+/764500b8 List all files in pub publish (#3440)
 https://dart.googlesource.com/pub.git/+/0b52e6a8 Remove debug print (#3441)
 https://dart.googlesource.com/pub.git/+/ea070238 Merge pull request #3443 from jonasfj/master
 https://dart.googlesource.com/pub.git/+/bffd1267 Merge branch 'cherry-pick-for-2.17.2'
 https://dart.googlesource.com/pub.git/+/c66381c5 Make `name` field of `_UserInfo` nullable. Fix #3424 (#3442)
 https://dart.googlesource.com/pub.git/+/cecc8e3c Handle broken response from userinfo_endpoint (#3427)
 https://dart.googlesource.com/pub.git/+/6c635040 Make `name` field of `_UserInfo` nullable. Fix #3424 (#3442)
 https://dart.googlesource.com/pub.git/+/6f20a94b Handle missing pubspec.lock in dependency_services list (#3439)
 https://dart.googlesource.com/pub.git/+/0ad17e84 Handle broken response from userinfo_endpoint (#3427)
 https://dart.googlesource.com/pub.git/+/153ef061 `pub add` create top-level attribute in block-style if possible. (#3423)
 https://dart.googlesource.com/pub.git/+/3b96f910 Handle error code 183 on windows (#3426)
 https://dart.googlesource.com/pub.git/+/9eb6428c Ignore `pubspec_overrides.yaml` for `publish` command (#3419)

```

Diff: https://dart.googlesource.com/pub.git/+/51435efcd574b7bc18d47a5dd620cb9759dea8f8~..c4e9ddc888c3aa89ef4462f0c4298929191e32b9/
Change-Id: I6dacb3e95c6399d3fb5cf340b5d0e5cded270684
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247962
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2022-06-13 08:39:56 +00:00
Konstantin Shcheglov fb5884324a Rename methods of CiderByteStore.
Change-Id: Ief2d3308f1284a2c0529758beeb6776e3ef8bb8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247935
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-06-13 05:04:16 +00:00
Konstantin Shcheglov 1b9554d481 Add 'textToMatchOverride' for 'setState' completion.
Bug: https://github.com/dart-lang/sdk/issues/49233
Change-Id: I74fd86fc7f49c932e6698e474842078ff823f3cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247933
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-06-13 00:54:16 +00:00
Ahmed Ashour 503e7232ab [analysis_server] have a single function for union
Bug: #49229
Change-Id: I6141c48e48fbe88812c10d7fcc3541af28ec36c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247966
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-06-12 17:31:57 +00:00
Ahmed Ashour 57b192f3a6 [analyzer] RemoveTypeAnnotation to handle type arguments
Fixes #49227

Change-Id: I0f754d84e3e4e89800abdec26925229587202bca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247968
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-06-12 17:24:06 +00:00
Ahmed Ashour 4ecc7ff67e [analysis_server] AddAwait to handle NON_BOOL_CONDITION
Fixes #49114

Change-Id: Id6b345a946ec124e4518c7bb526c510ae0cb92c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-06-12 17:23:55 +00:00
Brian Wilkerson 02049223fd Enable lints to have context messages
Change-Id: I2f0b50fb088e0f367b4f4ade797b873a1278e182
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247936
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-06-12 15:31:55 +00:00
Konstantin Shcheglov 5263e15e99 Add changeFiles(), use instead of changeFile().
I would like to remove releaseAndClearRemovedIds(), so that methods
of FileResolver call it when necessary, as linkLibraries2(),
dispose() do it.

Change-Id: I494abaffa7a5b8a8360c2750efb5b88b4b5535e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247926
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2022-06-10 17:48:44 +00:00
Konstantin Shcheglov 6ff161cc33 Also remove libraries in removeFilesNotNecessaryForAnalysisOf().
Change-Id: I99076e24e4f0382df208c145e83ce010a06f1117
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247924
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-06-10 16:45:55 +00:00
Devon Carew 55d9f34dcc Migrate several files in tools/.
Change-Id: I30ff886916205ab266208ab98fa97ea41cbe06e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247624
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-06-10 16:31:04 +00:00
Devon Carew fa4321da38 [tools] make the generate_package_config.dart script more robust
Change-Id: I3b3edc9c1c7be468e236d911b4ecb7e41c65e2c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247841
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2022-06-10 16:17:27 +00:00
Ahmed Ashour 8bb3a10e40 Fix typos
Fixes #49228

TEST=ci

Change-Id: Idcc625554bcf07807bae9791ea37b73ae9394b87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247960
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-06-10 15:48:54 +00:00
asiva 6970e0907b [VM | VMService] Fix expression evaluation when recursive types are used.
Bug:49209
TEST=pkg/vm_service/test/eval_issue_49209_test.dart
Change-Id: I7da8a195a624b34519aa64fffc248cad0fb7e6fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247901
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-06-10 15:03:04 +00:00
Jake Macdonald b878294e06 Migrate parts of package:frontend_server to null safety.
This is a re-land of https://dart-review.googlesource.com/c/sdk/+/247601 with some additional changes to allow for certain null uris in some previously migrated package:front_end code.

Note that nulls were flowing through these apis already, this just acknowledges that fact :).

Bug: https://github.com/dart-lang/sdk/issues/49212
Change-Id: I4528bfdec1bc9114715afd3fea06d1249054d2a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247765
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-06-10 14:56:45 +00:00
Alexander Markov 6b3d1752fa [vm] More efficient 'await' of not Future and completed _Future
When awaiting a value which is not a Future or a completed
built-in _Future, 'await' implementation can bypass heavyweight
_Future/_FutureListener machinery and schedule micro-tasks directly.

Benchmarks:
JIT, x64:
AsyncLiveVars.* +46-54% (bigger is better)
Calls.AwaitAsyncCall -46% (less is better)
Calls.AwaitAsyncCallInstanceTargetPolymorphic -46%
Calls.AwaitAsyncCallClosureTargetPolymorphic -45%
Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits -45%
Calls.AwaitFutureOrCall -60%
Calls.AwaitFutureOrCallInstanceTargetPolymorphic -60%
Calls.AwaitFutureOrCallClosureTargetPolymorphic -59%

JIT, ia32:
AsyncLiveVars.* +43-52% (bigger is better)
Calls.AwaitAsyncCall -42% (less is better)
Calls.AwaitAsyncCallInstanceTargetPolymorphic -42%
Calls.AwaitAsyncCallClosureTargetPolymorphic -41%
Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits -39%
Calls.AwaitFutureOrCall -55%
Calls.AwaitFutureOrCallInstanceTargetPolymorphic -54%
Calls.AwaitFutureOrCallClosureTargetPolymorphic -53%

JIT, arm:
AsyncLiveVars.* +64-71% (bigger is better)
Calls.AwaitAsyncCallInstanceTargetPolymorphic -51% (less is better)
Calls.AwaitAsyncCallClosureTargetPolymorphic -47%
Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits -48%
Calls.AwaitFutureOrCall -64%
Calls.AwaitFutureOrCallInstanceTargetPolymorphic -64%
Calls.AwaitFutureOrCallClosureTargetPolymorphic -59%

JIT, arm64:
AsyncLiveVars.* +65-78% (bigger is better)
Calls.AwaitAsyncCall -51% (less is better)
Calls.AwaitAsyncCallInstanceTargetPolymorphic -51%
Calls.AwaitAsyncCallClosureTargetPolymorphic -50%
Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits -49%
Calls.AwaitFutureOrCall -69%
Calls.AwaitFutureOrCallInstanceTargetPolymorphic -68%
Calls.AwaitFutureOrCallClosureTargetPolymorphic -67%

AOT, x64:
AsyncLiveVars.* +55-61% (bigger is better)
Calls.AwaitAsyncCall -47% (less is better)
Calls.AwaitAsyncCallInstanceTargetPolymorphic -46%
Calls.AwaitAsyncCallClosureTargetPolymorphic -47%
Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits -46%
Calls.AwaitFutureOrCall -59%
Calls.AwaitFutureOrCallInstanceTargetPolymorphic -59%
Calls.AwaitFutureOrCallClosureTargetPolymorphic -58%

AOT, arm:
AsyncLiveVars.* 54-66% (bigger is better)
Calls.AwaitAsyncCall -46-51% (less is better)
Calls.AwaitAsyncCallInstanceTargetPolymorphic -46-50%
Calls.AwaitAsyncCallClosureTargetPolymorphic -46-52%
Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits -45-50%
Calls.AwaitFutureOrCall -63-68%
Calls.AwaitFutureOrCallInstanceTargetPolymorphic -63-66%
Calls.AwaitFutureOrCallClosureTargetPolymorphic -63-67%

AOT, arm64:
AsyncLiveVars.* +53-66% (bigger is better)
Calls.AwaitAsyncCall -50-51% (less is better)
Calls.AwaitAsyncCallInstanceTargetPolymorphic -50%
Calls.AwaitAsyncCallClosureTargetPolymorphic -50-51%
Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits -49-50%
Calls.AwaitFutureOrCall -66-68%
Calls.AwaitFutureOrCallInstanceTargetPolymorphic -66-68%
Calls.AwaitFutureOrCallClosureTargetPolymorphic -63-67%

TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/48378

Change-Id: I65e3702fcd816ee3fee876ff442b9887c035b1ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243102
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-06-10 14:38:28 +00:00
Alexander Markov 213ae5429b [vm] Always complete Future synchronously when returning non-Future value from async functions
From Dart language specification (17.15 Function Invocation):

If execution of the body returns an object, o is completed with that
object. If it completes normally or returns without an object,
o is completed with the null object (17.4), and if it throws
an exception e and stack trace t, o is completed with the error e and
stack trace t. If execution of the body throws before the body suspends
the first time, completion of o happens at some future time after the
invocation has returned. The caller needs time to set up error handling
for the returned future, so the future is not completed with
an error before it has been returned.

So far, implementation of async functions in Dart VM postponed
completion of the Future both with the value and with an error
if execution has not reached the first await. This change modifies
the behavior to compile future with value immediately even if
the first await was not reached. Completion with an error is still
postponed.

This change in behavior will let us improve performance of
async/await in certain cases.

The new behavior still conforms to the Dart language specification.

TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/48378

Change-Id: I0e80a1d0dd0c3cd6acbc640681e7b06bbf81c19c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243101
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-06-10 14:35:14 +00:00
Alexander Markov de43a7c16a [vm] Cleanup --lazy-async-stacks VM option
This option was enabled by default in https://dart-review.googlesource.com/c/sdk/+/149288
This change removes old logic behind --no-lazy-async-stacks
and makes --lazy-async-stacks/--no-lazy-async-stacks options no-op.

TEST=ci

Change-Id: I5726690e90e78dd2ac37d8c5944e388042fc3acf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247780
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2022-06-10 13:41:24 +00:00
Aske Simon Christensen 90a45668d5 [dart2wasm] Support all import and export kinds in wasm_builder
Also makes table type explicit and fixes a bug in element serialization
for tables beyond index 0.

Change-Id: I7c27071e00331c41010da771ae0075e798e457a9
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247545
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-06-10 12:41:45 +00:00
Aske Simon Christensen b6e912d9f0 [dart2wasm] Use super parameters in wasm_builder
Change-Id: Idfcec5f78aaba230758e06682326af0755dfaa87
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247388
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-06-10 12:41:45 +00:00
Konstantin Shcheglov 5004883476 Deprecate AnalysisDriver.configure(), accept 'contextRoot'.
This is rework of https://dart-review.googlesource.com/c/sdk/+/247626

Change-Id: Ic6cb6210eae26f5a7338532c80572e2654fad0a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247862
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-06-10 05:26:53 +00:00
Johnni Winther cc9b825974 [cfe] Include phase-specific source in macro application test
Change-Id: I91b655170adaa567679a872ed6fe32f587b99c00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247550
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-06-09 21:21:13 +00:00
Konstantin Shcheglov c5e725578a Revert "Add AnalysisDriver.contextRoot, deprecate configure()."
This reverts commit 3b111d5e0d.

Reason for revert: Wrong design, will rework.

Original change's description:
> Add AnalysisDriver.contextRoot, deprecate configure().
>
> In the future AnalysisDriver.analysisContext will be removed, and
> AnalysisDriver will implement AnalysisContext. At the same time we
> will remove DriverBasedAnalysisContext.
>
> Google3 looks green.
> https://fusion2.corp.google.com/presubmit/tap/453818030
>
> Change-Id: Iaa6bf85e27c3be5d0ecb40126d6b857fe6f2aa64
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247626
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

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

Change-Id: I2eb567c6343636d3affd48bb4bfb0b4b1aa788b6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247861
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-06-09 20:53:03 +00:00
Siva Annamalai 855e1cd975 Revert "Avoid computing the URI scanner tables at runtime."
This reverts commit 5875a9ba9d.

Reason for revert: We seem to have some cbuild failures, logs can be found here 5875a9ba9d

Original change's description:
> Avoid computing the URI scanner tables at runtime.
>
> Precompute the table and store it as a String literal.
>
> Fixes #49108.
>
> Bug: https://dartbug.com/49108
> Change-Id: I33d3e768ad2013ad2edec3558fcd3da39b3f4f32
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247383
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Auto-Submit: Lasse Nielsen <lrn@google.com>

TBR=lrn@google.com,vegorov@google.com,kustermann@google.com

Change-Id: I3c2609aad7944ea9118af14733c3e99db9902297
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://dartbug.com/49108
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247860
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2022-06-09 20:28:53 +00:00
Ahmed Ashour eda47496d7 [analysis_server] Removing ignoring hash_and_equals lint
Bug: #48785
Change-Id: I9007eb2388adac3f5f33ae81346e4bc0485a405f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247556
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2022-06-09 19:36:43 +00:00
Sigmund Cherem f80ad75e76 [ddc] emit full dill as part of modular tests.
This small change brings the modular test closer to the behavior we have
internally in our bazel rules.

Turns out that recently we discovered a bug in the static erasure
transformation when emitting the full dill generated by DDC. This change
will allow us to detect these kind of failures in our SDK repo as well.

Change-Id: I9032d2563f741692ae03035b9fc9be59ab4b3a38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247761
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2022-06-09 19:34:48 +00:00
Brian Quinlan d32a274c90 Add a breaking change note for #49045
Bug: https://github.com/dart-lang/sdk/issues/49045
Change-Id: I9ac976545c0505a20a90f12333a424d0ed8cf96f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247820
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2022-06-09 19:28:25 +00:00
Ahmed Ashour a3d8800c9d [analyzer] ChangeTo to handle SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_NAMED
Fixes #48480

Change-Id: I234ccb0cd170a78f5686048a294536d434e84eb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-06-09 19:20:13 +00:00
Konstantin Shcheglov 283a66da00 Move a few mixin inference tests to element model tests.
Bug: https://github.com/dart-lang/sdk/issues/49208
Change-Id: I2e3fba9ef4d8023549486e7dc810c57dc8e1eaa1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247800
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-06-09 19:18:43 +00:00
Daco Harkes a855030120 [vm/ffi] Allow struct nesting with looser packing
C compilers don't enforce nesting rules. `dart:ffi` was enforcing these
rules causing issues for binding to C libraries having looser packing
for nested structs than outer structs.

This CL completely removes the error from the analyzer and CFE.
(As an alternative we could have kept a hint/lint, but this might create
more noise than value.)

TEST=pkg/analyzer/test/src/diagnostics/packed_nesting_non_packed_test.dart

Closes: https://github.com/dart-lang/sdk/issues/46644
Change-Id: Iae2d5c885546f7799bc6dea2f8cd7dd508216a0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247382
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-06-09 19:08:43 +00:00
Ahmed Ashour e11d6b4a62 [analysis_server] simplify generated equals
Fixes #49222

Change-Id: I430ff02a4721d7d937b701bf0137096f314a6860
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247557
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-06-09 18:30:33 +00:00
Alexander Markov a765ba1006 [vm] Handle dropped pragma class in Library::FindPragma
AOT compiler can remove pragma class from ObjectStore.
This change fixes Library::FindPragma to handle this situation.

TEST=service_2/pause_on_unhandled_exceptions_catcherror_test

Change-Id: I5f58ebcb0f1e3b1c2e658ad19bfdea4c72577a7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247763
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-06-09 17:52:19 +00:00
Ahmed Ashour e86635968d [analyzer] AddNullCheck to handle non nullable target
Fixes #49152

Change-Id: I010755baa441a213f927a963972fed108f861baf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247555
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-06-09 17:44:03 +00:00
Devon Carew 49f348e654 Revert "[deps] rev to the latest package:http"
This reverts commit 8d2541fa44.

Reason for revert: This breaks the CBUILD: 8d2541fa44

Original change's description:
> [deps] rev to the latest package:http
>
> Change-Id: I922d9e5d108748ee6de21d9e8a4f7734437b385a

TBR=devoncarew@google.com,nbosch@google.com,bquinlan@google.com

Change-Id: Ia6ec0b2eec24f9de8335264995f532a48127a034
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247764
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-06-09 17:33:44 +00:00
Konstantin Shcheglov 3b111d5e0d Add AnalysisDriver.contextRoot, deprecate configure().
In the future AnalysisDriver.analysisContext will be removed, and
AnalysisDriver will implement AnalysisContext. At the same time we
will remove DriverBasedAnalysisContext.

Google3 looks green.
https://fusion2.corp.google.com/presubmit/tap/453818030

Change-Id: Iaa6bf85e27c3be5d0ecb40126d6b857fe6f2aa64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247626
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-06-09 17:24:14 +00:00
Nicholas Shahan d50097a4ec [ddc] Break import cycle in shared_command.dart
Reduces the number of libraries that must be migrated to null safety
atomically.

Change-Id: I498f2956471be0435558c1b1a4badcba619f15de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247521
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-06-09 16:55:45 +00:00
Siva Annamalai 5cb3b37c74 Revert "Refactor _Future."
This reverts commit 69f32d6ad7.

Reason for revert: We seem to have a number of tests failing with timeouts in CBUILD after this change, please see logs at
69f32d6ad7

Original change's description:
> Refactor `_Future`.
>
> This is a major rewrite of the `_Future` class,
> which is the default implementation of the `Future` interface.
>
> The main goal was to reduce the number of expensive type checks
> in the internal passing around of data.
> Expensive type checks are things like
> * `is _Future<T>` (more expensive than just `is _Future`, the latter
>   can be a single class-ID check.
> * Covariant generic parameter checks (using `T` covariantly in a
>   parameter forces a run-time type check).
>
> Also removed some plain unnecessary casts and turned some
> implicit casts from `dynamic` into `unsafeCast`s.
>
> This seems to be an success, at least on very primitive benchmarks, according to Golem:
> FutureCatchErrorTest    41.22% (1.9 noise)
> FutureValueTest         46.51% (2.8 noise)
> EmptyFutureTest         59.15% (3.1 noise)
> FutureWhenCompleteTest  51.10% (3.2 noise)
>
> A secondary goal was to clean up a very old and messy class,
> and make it clearer for other `dart:async` how to interact
> with the future.
>
> The change has a memory cost: The `_FutureListener<S,T>` class,
> which represents a `then`, `catchError` or `whenComplete`
> call on a `_Future`, now contains a reference to its source future,
> the one which provides the inputs to the callbacks,
> as well as the result future returned by the call.
> That's one extra memory slot per listener.
>
> In return, the `_FutureListener` now does not need to
> get its source future as an argument, which needs a covariant
> generic type check, and the methods of `_Future` can be written
> in a way which ignores the type parameters of both `_Future`
> and `_FutureListener`, which reduces complex type checks
> significantly.
>
> In general, typed code is in `_FutureListener`, which knows both
> the source and target types of the listener callbacks, and which
> contains the futures already at that type, so no extra type checking
> is needed.
> The `_Future` class is mostly untyped, except for its "public"
> API, called by other classes, which checks inputs,
> and code interacting with non-native futures.
> Invariants ensure that only correctly typed values
> are stored in the untyped shared `_resultOrListeners` field
> on `_Future`, as determined by its `_state` integer.
> (This was already partially true, and has simply been made
> more consistent.)
>
> Further, we now throw an error in a situation that was previously
> unhandled: When a `_Future` is completed with *itself*.
> That would ensure that the future would never complete
> (it waits for itself to complete before it can complete),
> and may potentially have caused weird loops in the representation.
> In practice, it probably never happens. Now it makes the error
> fail with an error.
> Currently a private `_FutureCyclicDependencyError` which presents
> as an `UnsupportedError`.
> That avoids code like
> ```dart
> import "dart:async";
> void main() {
>   var c = Completer();
>   c.complete(c.future); // bad.
>   print("well!");
>   var d = Completer();
>   d.complete(c.future);
>   print("shucks!");
> }
> ```
> from hanging the runtime by busily searching for the end of a cycle.
>
> See https://github.com/dart-lang/sdk/issues/48225
> Fixes #48225
>
> TEST= refactoring covered by existing tests, few new tests.
>
> Change-Id: Id9fc5af5fe011deb0af3e1e8a4ea3a91799f9da4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244241
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>

TBR=lrn@google.com,kustermann@google.com,sra@google.com,sigmund@google.com,nshahan@google.com

Change-Id: I455be5a04b4c346df26d4ded0fa7388baccb0f8c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247762
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-06-09 16:51:55 +00:00
Sigmund Cherem 83b50a70c8 [owners] Add Nate to OWNERS_WEB
Change-Id: Iabd88356bde7c90b7853f821683ca808fa8761da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247242
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-06-09 16:47:43 +00:00
Devon Carew 8d2541fa44 [deps] rev to the latest package:http
Change-Id: I922d9e5d108748ee6de21d9e8a4f7734437b385a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247607
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2022-06-09 16:43:53 +00:00
Johnni Winther bcf350e2ea [cfe] Support triggering inference through TypeBuilder.build
This adds the capability to trigger inference through
TypeBuilder.build when it is passed a ClassHierarchyBase object.

TypeBuilder.isExplicit is added to signal when a type can be built
without the need for inference. NamedTypedBuilder and
FunctionTypeBuilder are split into _Explicit* and _Inferred* subtype
the latter of which support late building of the type.

The new _Inferred* builders are not used yet.

Change-Id: I66fd669ae47e6eb3079461af31477215c262dcbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247220
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-06-09 16:32:15 +00:00
Ahmed Ashour 894b1da29d [analyzer] correct range for ABI_SPECIFIC_INTEGER_MAPPING_UNSUPPORTED
Fixes #49134

Change-Id: I4e34d5a2b9c2b55b96417463cd79f865f8dd10be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246242
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2022-06-09 16:26:43 +00:00
Jake Macdonald d7accf27b8 Revert "migrate package:frontend_server/compute_kernel.dart to null safety"
This reverts commit 4894ae493f.

Reason for revert: Breaks google3

Original change's description:
> migrate package:frontend_server/compute_kernel.dart to null safety
>
> unblocks https://github.com/dart-lang/language/issues/2274
>
> Bug: https://github.com/dart-lang/sdk/issues/49212
> Change-Id: I8d6b055dbc00dadce5efee57692ee1f21e8fde77
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247601
> Commit-Queue: Jake Macdonald <jakemac@google.com>
> Auto-Submit: Jake Macdonald <jakemac@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

TBR=johnniwinther@google.com,jakemac@google.com

Change-Id: I824374df31721fe60a08195b90f545e28460a982
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/49212
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247760
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2022-06-09 16:24:03 +00:00
Danny Tuppeny 5b3bfe4137 [analysis_server] Add snippet for function definitions
Fixes https://github.com/Dart-Code/Dart-Code/issues/4017.

Change-Id: I1017be3abe73a8cfcd6354f1c2ca99ad729dcf47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247553
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-06-09 16:07:43 +00:00