Commit graph

89460 commits

Author SHA1 Message Date
Derek Xu
6f09cf9094 [VM] Add dependencies needed to generate protozero code
This adds dependencies on the perfetto, protobuf, and protobuf-gn repos on fuchsia.googlesource.com.

Change-Id: Ib196587e4cacb7e95c5ca284539fcd578d09d16b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278200
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-01-26 16:07:22 +00:00
Kallen Tu
7cf49ba433 [cfe] Report error when implementing a base class.
Change-Id: Iff3c31b4883d3d4fc4c392c6ac8207617ce65761
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279648
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-01-26 16:01:55 +00:00
Paul Berry
5668aa4732 Flow analysis: Add patternRequiredType.
This method is used for declared variable patterns, list patterns, map
patterns, record patterns, object patterns, and wildcard patterns to
cause the value being matched to be promoted.

As a temporary measure it's also used for cast patterns; this will be
fixed in a later CL.

Change-Id: Iccc9ce4a53e2a10753847f9ecade091f1b230111
Bug: https://github.com/dart-lang/sdk/issues/50419
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279653
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-01-26 15:54:17 +00:00
Paul Berry
e396024712 Shared inference testing: replace factor and subtype tables with an algorithm.
The tables of subtypes and "factor" results used in testing the shared
analysis logic were becoming unwieldy and difficult to maintain.
Replace them with implementations of the subtype and factor algorithms
from the spec.

Change-Id: Ic607c3fda45a69661e094292a38a7bc8fd22859a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279748
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-01-26 15:53:47 +00:00
Aske Simon Christensen
2e16241998 [dart2wasm] Specialized Map and Set for default equals and hashCode
Change-Id: I52ca1e6d5859af4f84b7990ed85d9680aaaca33d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279164
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2023-01-26 15:35:18 +00:00
Dan Chevalier
e7d8261f9a Update HTTP Profiling ids to use Strings
The internal Dart Ids can be 64 bit integers, and are passed to Dev Tools as integers. This is causing errors fetching requests as the ids can overflow once they get to dev tools.

Interaction between `getHttpProfile` and `getHttpProfileRequest` are already performed in https://dart-review.googlesource.com/c/sdk/+/279122/3/pkg/vm_service/test/get_http_profile_test.dart

https://github.com/flutter/devtools/issues/2860

TEST=The original tests test the surface of the RPCs that are updated here. Any tests that needed tweaking have also been fixed
CoreLibraryReviewExempt: Changes are only to http profiling
Change-Id: Ie560dde7629f91f4221c1fe18d153cd999691086
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279122
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-01-26 15:08:56 +00:00
Tess Strickland
2967b148ec [gardening] Fix genSnapshot detection in use_flag_test_helper.dart.
Previously handled cases:
- No cross compilation, gen_snapshot in same `buildDir` as rest.
- X64->SIMARM cross compilation, gen_snapshot in `${buildDir}_X64`.

Newly handled case:
- X64->ARM64 cross compilation, gen_snapshot in `${buildDir}/clang_x64`.

TEST=vm/dart{,_2}/analyze_snapshot_binary_test

Change-Id: I3d3a23be445496ab068926f7d76b56299e06d950
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279880
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-01-26 13:42:29 +00:00
Vyacheslav Egorov
4482709d45 [vm] Mark ListMixin.iterator with prefer-inline
This helps to improve the code quality in for-in loops
where iterable has a known List type.

Closes https://github.com/dart-lang/sdk/issues/48433

Tested: tests updated due to line number changes in list.dart
CoreLibraryReviewExempt: no public API changes
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-product-x64-try
Change-Id: Ia5d815009a699061961c331cf43e68d2c96fc58b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279518
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-01-26 10:16:51 +00:00
Johnni Winther
924cf941e9 [cfe] Add test for issue 51029
Closes #51029

Change-Id: I7ee15c5e9cde19a323b4a2778c673017cac3795f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279714
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-01-26 09:35:19 +00:00
Josh Soref
01b28894e7 Spelling pkg dev compiler
Closes https://github.com/dart-lang/sdk/pull/50861

GitOrigin-RevId: 71005e6f5bf5a151cb5c1aefb6a2a300fc40f592
Change-Id: Iadfafb5787a62e9a379437f6a3763d31f99ba7c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277743
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-26 09:12:41 +00:00
Vyacheslav Egorov
c3d8f46c5b [vm/compiler] Devirtualize calls while inlining.
Inlined functions might contain call-sites which can be devirtualized
in the context of the caller. To achieve that we add a pass which
calls canonicalization on all dynamic calls (and their data
dependencies) between rounds of inlining.

More specifically this helps cases which require interleaving
some redundancy elimination and inlining to remove the cost of
abstractions. The primary example is for-in loop with an array of
a known type which usually requires inlining `get:iterator` and
propagating iterable value through interator's fields to specialize
and inline `get:length` and `operator[]` on the `Iterable`.

See https://github.com/dart-lang/sdk/issues/48433 for example.

TEST=vm/dart/devirtualization_during_inlining_il_test

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-product-x64-try
Change-Id: I1fae50484a111f8c21c81bcf0c3d6a63a856338a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279517
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-01-26 08:52:18 +00:00
Vyacheslav Egorov
cc8877fcc7 [vm/compiler] Improve canonicalization rules
* Add rule forwarding stores to non-late final fields to
consequitive loads.
* Allow specialization of InstanceCall with an empty ICData in AOT
mode.

Additionally rewrite regression test for 836c04f using explicit
block building. The source based test was too fragile and sensitive
to various optimizations.

TEST=vm/cc/IL_Canonicalize_FinalFieldForwarding,vm/cc/IL_Canonicalize_InstanceCallWithNoICDataInAOT

Bug: https://github.com/dart-lang/sdk/issues/48433
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-product-x64-try
Change-Id: Icb766d48ebaed6626c8d010f528fa6d82c432930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279515
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-01-26 08:52:18 +00:00
Alexander Thomas
a1f6688e16 [release] Update checked-in SDKs to 2.19.0
Don't upload riscv64 checked-in SDKs unless a dev version is specified.
This means gclient will not have a checked-in SDK for riscv64 checkouts
unless pinned to a dev version of the checked-in SDK.

Change-Id: I718c022228a8430d5d6b27f8a3d0f728b616c553
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279707
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-01-26 07:26:36 +00:00
Sam Rawlins
d5bd015cac [expect] Replace @alwaysThrows with Never
Actually, for `Expect.fail`, the return type is kept as `void`, as
changing this to `Never` would apparently change a lot of static
analysis of language and co19 tests. It seems the `@alwaysThrows`
annotation is no longer (or was never) relied upon for static
analysis (usually around dead code analysis).

Bug: https://github.com/dart-lang/sdk/issues/49583
Change-Id: I6d9daaa1d290ab0322a529faaf9574fe83b9cd25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279742
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-01-25 23:02:27 +00:00
Paul Berry
6fa2f50380 Shared analysis tests: Use a map for record named fields.
This is consistent with the analyzer implementation and more intuitive
to work with.

In a follow-up CL I'll be adding logic that performs additional
manipulations on record types, and this change will make that CL
easier.

Change-Id: I4a0592e240a98f62d3730068600a84adeddfe09d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279656
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-01-25 22:26:19 +00:00
pq
4a4bca6c4e element support for @reopen
See: https://github.com/dart-lang/linter/issues/3917

Change-Id: I9652fabcbac37644cfca89227b6830e32a79576d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279657
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-01-25 22:23:27 +00:00
Brian Wilkerson
f4ee87329b Add more completion tests for case clause
Change-Id: Icb4affd42bee3c671066ee9462045aa5f690485f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279652
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-01-25 21:42:24 +00:00
Derek Xu
4e9370ae1d [VM/Service] Clean up exceptional GetVMTimeline cases
TEST=CI

Change-Id: Ic70f00ac6efde2cb32d541eb62b868a3e4645fc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279469
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-01-25 21:23:27 +00:00
Joshua Litt
8a7dd221ad [dart2wasm] Generate the bulk of the JS runtime at compile time.
Change-Id: Ib5f9bdedcda4a4ba305d7eea2e6c127f815582ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279640
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-01-25 20:19:08 +00:00
Srujan Gaddam
45817fd9c7 [Reland][pkg:js] Lower @staticInterop non-anonymous constructors
This is a reland of https://dart-review.googlesource.com/c/sdk/+/279180.
This removes the anonymous constructor lowering, as the jsify
semantics are not the same as what we have today, since we do no
conversions today. This avoids the breakage in Flutter where we
convert a Uint8List in jsify.

Change-Id: I7eb4ffbd3258abdf6c1aea2035f7dab0336d4851
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279231
Reviewed-by: Riley Porter <rileyporter@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-01-25 18:50:27 +00:00
Derek Xu
8766952c13 [VM/Service] Populate length property for PlainInstance Instances and InstanceRefs
TEST=CI

Change-Id: I0c112513849e4057a08d6068101927ee6aec6b25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279466
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-01-25 18:32:57 +00:00
Ben Konyi
b1b1c3bf78 [ VM ] Ensure heap profiler state is updated on TLAB release due to scavenge
Also fixes some race conditions and flaky test behavior.

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

TEST=DartAPI_HeapSampling_* looped in GDB under load

Change-Id: I0c1f297ecb140575e28650837158b707b9dc4b41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279590
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-01-25 17:56:39 +00:00
Chloe Stefantsova
17e366a243 [cfe] Adjust targets of continue statements in pattern switches
Closes https://github.com/dart-lang/sdk/issues/50931

Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: I9aceaec8ad14b0275f20b5d7811f861efbcbfc44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279711
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-01-25 16:51:30 +00:00
Paul Berry
61f23df80f Flow analysis for null-check/null-assert patterns.
Bug: https://github.com/dart-lang/sdk/issues/50419
Change-Id: I7fd845b0e465b63a2a9fd5e17bf254b9073a7d1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279459
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-01-25 16:37:30 +00:00
Konstantin Shcheglov
c631353906 When switch expression has no cases, make its type 'dynamic'.
Change-Id: I77358be2373ce9a70860d783b23fd671b5d021c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279339
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-01-25 16:32:00 +00:00
Sam Rawlins
f6d41b95fb [analyzer] Move 2 more Hints to be Warnings, UNUSED_CATCH_*
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: Id8b53ebef2b44d6fe1a436edf796056f60913024
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279443
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-01-25 16:04:09 +00:00
Chloe Stefantsova
87760ac53c [cfe] Support dotted names in object patterns
Closes https://github.com/dart-lang/sdk/issues/50932

Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: Ib7cbc9475a40c2d5bf4640ea1e96d1c9b2db78fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279708
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-01-25 15:57:53 +00:00
Sam Rawlins
aa5fa4c977 [nnbd_migration] Replace @alwaysThrows with Never
Bug: https://github.com/dart-lang/sdk/issues/49583
Change-Id: Ibee6625d1d5e84928aab55ffd817fcb19cd8a4c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279743
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-01-25 15:19:08 +00:00
Martin Kustermann
3378c55f7d [CFE/Analyzer] Avoid many duplicate strings in analyzer heaps
Right now the analyzer clears out the string canonicalization cache
after each file parse.

Similarly when the analyer serializes various information into
*.{unlinked2,linked,resolved} files & deserializes them again, it will
only have canonicalized strings per unit.

This means that strings that are common across compilation units will
exist many times in the heap, thereby increasing memory consumption of
the process.

This CL tries to avoid that by

  * Using one string canonicalization cache across CFE & Analyzer

  * Making the string canonicalization cache remember how often an entry
    was used

  * Pruning the cache instead of clearing it: We keep the most frequently
    used elements while maintaining a cache that is <= 5 MB.

  * Change analyzer code to use the string canonicalization in various
    places to avoid many duplicate strings in the heap.

When running analyzer on flutter (and it's transitive code), the
analyzer itself has a heap of around 610 MB.

This CL reduces the memory consumed by strings from ~43 MB to ~33 MB
(~ 20 MB are alone dart source files which are unique). We do this at
the expensive of maintaining the string cache, which costs around 2 MB.

That leads to 8 MB of savings.

TEST=ci

Change-Id: Ic28d70492ab0d376e10714c7ecf2c258c790a022
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255245
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-01-25 14:38:23 +00:00
Josh Soref
ef42a0b110 Spelling pkg analyzer lib
Closes https://github.com/dart-lang/sdk/pull/50860

GitOrigin-RevId: b27066c37f93c8c6d1123d6ebd6a4c0afcf59844
Change-Id: I15fa4aea1dad45daf168e34d1c4450320ec9b40a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277742
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-01-25 14:08:27 +00:00
Chloe Stefantsova
cb6e9fdf11 [cfe] Use the recursive algorithm for subsitutions on type builders
Closes https://github.com/dart-lang/sdk/issues/51089

Change-Id: I7f6e147ddc5efc182d9c3e29630cb632086cd45b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279700
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-01-25 14:07:48 +00:00
Martin Kustermann
9361e15353 Revert "[vm] Use a weak set to represent dependent code."
This reverts commit 391ce71a0f.

Reason for revert: This seems to be the root cause of test failures
on unrelated CLs. It also seems that this is one reason that can
make app-jit snapshots no longer deterministic.

More information will be posed on:
https://github.com/dart-lang/sdk/issues/51125

Original change's description:
> [vm] Use a weak set to represent dependent code.
>
> Fixes a scaling limitation where compiling N functions using the same guarded field or CHA guarded interface will result in O(N^2) comparisons when registering the dependencies.
>
> TEST=ci
> Change-Id: Ic48f29fa0ce8f43a6f60bc00fa95a60763d333a0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278943
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>

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

Change-Id: I823365b2c30906c40f77c6ef186b636b7fdc5691
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279760
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-01-25 13:15:14 +00:00
Sam Rawlins
bb78e4f288 [dds] Replace @alwaysThrows with Never
Bug: https://github.com/dart-lang/sdk/issues/49583
Change-Id: I247e8c81c010e37a85b938f9b8dfc6a1765bbf85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279741
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2023-01-25 11:13:49 +00:00
Ömer Sinan Ağacan
1d4e6f329c [kernel] Add some missing default visit methods to visitors
Change-Id: Ib1d4d530c18b68a869bc169d1daf5cd519c720f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279706
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-01-25 10:42:18 +00:00
Johnni Winther
68c326f455 [cfe] Refactor pattern matching generation
This enables caching during matching.

Closes https://github.com/dart-lang/sdk/issues/50934
Closes https://github.com/dart-lang/sdk/issues/50987

Change-Id: Iae1d8e0989029a193ba77f58338890d9bfa0c09f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279384
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-01-25 08:33:38 +00:00
Derek Xu
0031f67ba0 [VM/Service] Populate length property for Record InstanceRefs and Instances
TEST=CI

Issue: https://github.com/dart-lang/sdk/issues/51104
Change-Id: I4fa812c22f2ea0bdf5cc472a9e7198bf64442e6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279465
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-01-25 00:17:21 +00:00
Brian Wilkerson
6b1dca4471 Move two tests to make it easier to see the coverage
Change-Id: I43d77b9d0458efa0ac87aa9e57fad135837e1750
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279467
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-01-25 00:13:26 +00:00
Paul Berry
c90d7839eb Patterns flow analysis: don't promote scrutinee based on subpatterns.
A variable or wildcard pattern should only promote the scrutinee if
the expression is being matched is the scrutinee.  If the variable
pattern is a subpattern, no promotion should occur.

E.g. promotion occurs here:

    f(Object? x) {
      if (x case int _) {
        // `x` is promoted to `int`
      }
    }

But not here:

    f(Object? x) {
      if (x case num(sign: int _)) {
        // `x.sign` is known to be an `int`, but `x` is simply a `num`.
      }
    }

Change-Id: Iaa5bab8ce5b81db9d5496ac0bf2ee10473302371
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279641
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-01-25 00:02:21 +00:00
Kevin Moore
25fb2d6cb6 pkg:js - drop discontinued example, cleanup min SDK
Delete some very old historical files

Change-Id: I9fffc84d0c1a6b0e4731d360418599390d5470df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279649
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2023-01-24 23:02:39 +00:00
Ahmed Ashour
5c045992bc [analysis_server] associate UNNECESSARY_TYPE_CHECK_* with RemoveComparison
Fixes #47793
Fixes #51013

Change-Id: I50c080d51284cf669918d41c2aa7310b2c4a90f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279351
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-01-24 22:54:36 +00:00
Devon Carew
d70c7bc036 [deps] rev args, async, intl, mockito, test
args (ac0e2c8..04c9346):
  04c9346  2023-01-19  Devon Carew  blast_repo fixes (#230)

async (de1ce93..c9cc576):
  c9cc576  2023-01-23  Devon Carew  update changelog and pubspec version (#228)

intl (6140b60..3fcc810):
  3fcc810  2023-01-23  Copybara-Service  Merge pull request #535 from dart-lang:changeNumberOfDigitsCalculation
  07a73ca  2023-01-23  Moritz  Add license
  f0d0530  2023-01-20  Moritz  Add test
  aea7a7a  2023-01-20  Moritz  Fix bug in numberOfIntegerDigits calculation, simplifying the algorithm
  039f2b4  2023-01-20  Copybara-Service  Merge pull request #532 from dart-lang:removeTimezone
  c97ee27  2023-01-13  Moritz  Remove unimplemented timezone functionality

mockito (9cc958a..7696557):
  7696557  2023-01-22  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.3.0 (#599)
  ee68765  2023-01-20  Devon Carew  generate code before we analyze (#601)
  09aabe7  2023-01-20  Sam Rawlins  GitHub Sync (#602)
  0128352  2023-01-19  Devon Carew  blast_repo fixes

test (19582a8..53df527):
  53df5270  2023-01-23  Nate Bosch  Fix description of conditions without expectations (#1864)
  cbac7089  2023-01-23  Nate Bosch  Allow omitting the actual argument for rejections (#1861)
  af768a8f  2023-01-20  Nate Bosch  Add anyOf condition (#1859)
  387436bd  2023-01-20  Nate Bosch  Add unordered iterable comparisons (#1858)
  b3c78a4b  2023-01-19  Nate Bosch  Implement deep collection equality (#1853)
  e5a9f7d4  2023-01-19  Nate Bosch  Rename allowLateFailure -> allowUnawaited (#1854)

Change-Id: I9f82587285250f608e070d1380b836ee8238c5fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279642
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-01-24 22:31:11 +00:00
Danny Tuppeny
589876ba6a [dds/dap] Don't try to send invalid URIs to VM Service _lookupResolvedPackageUris
Fixes https://github.com/Dart-Code/Dart-Code/issues/4358.

Change-Id: I70330d8d5dd3bdcb2aa9753212cd56ff46bf4344
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279513
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-01-24 21:46:33 +00:00
Joshua Litt
d568a20906 [dart2wasm] Support tree shaking the JS runtime.
Change-Id: I1a2cd7aa384a1ead55888323987d218857f0e8fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279062
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2023-01-24 21:43:10 +00:00
Brian Wilkerson
45b01a6fe7 Add a deprecation message to the remaining contributor classes
Change-Id: I100c4fdbfdfd650dac0b40eb8f93c273bfad7d1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279464
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-01-24 21:33:18 +00:00
Brian Wilkerson
178d465521 Fix some previously added tests for completion in patterns
Change-Id: I64fc6bbda11cd1feacd541a5c3a0571f274eb277
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279647
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-01-24 21:32:37 +00:00
Ryan Macnak
06e9ff6edc [vm] Use the right size in vm/cc/StoreHalfWordUnaligned.
Fixes clobbering whatever happens to be after the test's buffer.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/51110
Change-Id: I661b643cf5f7d6a1a7781683f43ef02c4279f1e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279720
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-01-24 21:22:15 +00:00
Kallen Tu
9a0db1e197 [analyzer] Remove error checking for generative ctors on mixin classes in the with clause.
Change-Id: I0bcb33d744c948b42b3ebaca71e8ef573fc06b53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279565
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-01-24 21:16:58 +00:00
Ahmed Ashour
457aa53834 [analysis_server] enable AddExplicitCast for FixInFile.
Bug #49896

Change-Id: Ife8f60d1ce13683e9ec1b12af5d27221f3f04aea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276160
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-01-24 18:44:11 +00:00
Ahmed Ashour
0b5cd20ff2 [analysis_server] associate RemoveComparison
with `UNNECESSARY_NAN_COMPARISON`

Fixes #50481

Change-Id: I29f2a924a62cbfd5c90c9578338d111a40d9207c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-01-24 18:39:24 +00:00
Ryan Macnak
9398007084 [vm] Disable tcmalloc on RV64 to work around linker issue.
TEST=ci
Change-Id: Iaa3b03f31b158a91c3a12d1d5cb1c749c7998514
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279566
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-01-24 18:36:07 +00:00