Commit graph

90403 commits

Author SHA1 Message Date
Daco Harkes 675d0dc6fc [benchmarks/ffi] Generate repetitive FfiCall benchmark
This makes it easier to maintain and extend this benchmark.
Benchmark results should not change by this CL.

Deletes the legacy version of this benchmark.

Satisfies lints in this benchmark.

Closes: https://github.com/dart-lang/sdk/issues/37581
Change-Id: Icf03d0f4f0e668f9d4a843b11d8ef1565b404ca4
Cq-Include-Trybots: luci.dart.try:benchmark-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284142
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-02-23 20:50:09 +00:00
Konstantin Shcheglov 61f7ea1f2b Use textual dumps to test Search.references()
Change-Id: I934197b5b9f800286ac2501950e376b12592224a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-23 20:04:08 +00:00
Brian Wilkerson fac43ed0ba Update the tools packages to the latest commit
Change-Id: I0c58a4a677b3c0bbfded304a69a5bfdfb6c2b441
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284960
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2023-02-23 20:01:25 +00:00
pq 4435e15649 add quick fix for single element record literal parse errors
Follow-up from https://github.com/dart-lang/sdk/issues/51446

Change-Id: I22de580e9a163dd371825a494ce92e2332edbb79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-02-23 19:18:58 +00:00
Ryan Macnak 3583c63b18 [infra] Remove old configurations for the "compressed" group.
Change-Id: I7c49fa13f67eb0f2f662f1a393cdf5614644604a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284483
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-02-23 19:16:30 +00:00
Mayank Patke bff851ce7e [dart2wasm] Refactor ConstConditionalSimplifier and related classes
This will allow them to be used with other compiler backends, including
dart2wasm.

Change-Id: I42182545eeb035af8a3a6e2eba209ba2601a52d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281923
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
2023-02-23 18:54:29 +00:00
Ryan Macnak 024d354a60 [vm] Avoid linear scan of runtime entries when collecting a profile sample.
TEST=ci
Change-Id: Id8e9176e73c9e2dc0a251685711fd8bd8df7f41e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284742
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-02-23 18:03:57 +00:00
Derek Xu c0c523122b Reland "[VM/Service] Start indexing positional record fields at 1"
This is a reland of commit 1be893c507

Patchset 2 fixes the failure that was in
pkg/dds/test/dap/integration/debug_variables_test.

TEST=CI

Original change's description:
> [VM/Service] Start indexing positional record fields at 1
>
> TEST=CI
>
> Fixes: https://github.com/dart-lang/sdk/issues/51451
> Change-Id: I0e00e0ffb35aeb40affbbd5544542723bafc747c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284722
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Change-Id: I4cdee610646b3389d7d02ee6d905a66ae6e0329d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284862
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-23 17:04:10 +00:00
Devon Carew ae2aaf83e9 [deps] rev dartdoc, http, markdown, shelf, test, tools, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (dba6f94..e4cdbd6):
  e4cdbd6f  2023-02-21  Janice Collins  Record rendering simplification (#3344)

http (c13a3f8..1500a71):
  1500a71  2023-02-23  Devon Carew  contribute a pull request labeler workflow (#875)
  e2c4e6f  2023-02-21  Brian Quinlan  Add a link to cronet_http_embedded from cronet_http. (#874)

markdown (4befe66..ecbffa9):
  ecbffa9  2023-02-22  Kevin Moore  Use latest lints, require Dart 2.19 or later (#524)

shelf (707c8b2..e3cfe79):
  e3cfe79  2023-02-22  Devon Carew  contribute issue templates and a pull request labeler (#332)

test (e56c643..2cc4144):
  2cc4144e  2023-02-22  Nate Bosch  Avoid exceptions for iterable getters (#1954)
  f7fe4f06  2023-02-22  Nate Bosch  Include stack trace for exception in has (#1953)
  ba8e43af  2023-02-22  Nate Bosch  Only grab the first failure in softCheck (#1949)
  34df652b  2023-02-22  Nate Bosch  Flush stdin before test (#1950)
  ae015ef6  2023-02-22  Nidal Bakir  Add Concurrency Testing section to README (#1944)
  4e23d036  2023-02-21  Nate Bosch  Mention .having and .has in migration guide (#1948)
  438c2274  2023-02-21  Nate Bosch  Annotate `has` with `@useResult` (#1947)
  3ddecafd  2023-02-21  Nate Bosch  Add async examples to README (#1946)

tools (a53933c..c7518f7):
  c7518f7  2023-02-22  Elias Yishak  Update to regex to look for underscore delimited labels (#12)

webdev (ae7eb80..1e7f9b7):
  1e7f9b7  2023-02-22  Anna Gringauze  Create copying sdk configuration provider (#1984)
  26910ba  2023-02-22  Anna Gringauze  Pass SdkLayout to the frontend server (#1986)
  784e28b  2023-02-22  Anna Gringauze  Remove unnecessary awaits (#1982)
  3cbaf37  2023-02-22  Elliott Brooks (she/her)  [MV3 Debug Extension] Support Bolt workflow (#1983)
  0f893e6  2023-02-22  Anna Gringauze  Move project definitions into a separate class (#1975)
  a942b5f  2023-02-22  Anna Gringauze  Add unnecessary_lambdas lint (#1978)
  3774cf8  2023-02-21  Anna Gringauze  Add 'avoid_void_async' lint (#1977)
  705e0ac  2023-02-21  Elliott Brooks (she/her)  [MV3 Debug Extension] Show a warning if multiple Dart apps are in a single page (#1976)

Change-Id: Iea264a18a154e71cd0990e1363951648bec5ceba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284940
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-23 17:02:53 +00:00
Derek Xu d128fea646 [VM/Service] Improve documentation of getInstancesAsList
This CL addresses some of the feedback in https://dart-review.googlesource.com/c/sdk/+/283380/comment/b86443cf_5d0f91bf/

TEST=CI

Issue: https://github.com/dart-lang/sdk/issues/51497
Change-Id: I26622287df8834bbacbe3fdfb95490350cecd4bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284724
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-23 16:52:47 +00:00
Konstantin Shcheglov be76c1be51 When FileSystemState.changeFile() release data from unlinkedUnitStore.
This fixes b/269188397 in Cider because now unlikned data is present
in both ByteStore and UnlinkedUnitStore, or absent in both. Before
this change we would get it from UnlinkedUnitStore, but expected
that these bytes were also requested from ByteStore, so we attempted
to release them (and got "underflow" of reference counter).

Also, we now put the unlinked data into UnlinkedUnitStore not only
after reading bytes, but also after building it. So, we second use
will get it from the store, not the third.

Change-Id: I89bf554511d3be82f67ef1f237061ba8a4693592
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284745
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-23 15:59:38 +00:00
Derek Xu c1f3a5aad4 Revert "[VM/Service] Start indexing positional record fields at 1"
This reverts commit 1be893c507.

Reason for revert: Broke pkg/dds/test/dap/integration/debug_variables_test

Original change's description:
> [VM/Service] Start indexing positional record fields at 1
>
> TEST=CI
>
> Fixes: https://github.com/dart-lang/sdk/issues/51451
> Change-Id: I0e00e0ffb35aeb40affbbd5544542723bafc747c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284722
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Change-Id: Ib82f3fa8ca970eb4accb8f6a86b9ce36e72d9bc8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284861
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-23 15:51:32 +00:00
Johnni Winther 84a0424afd [_fe_analyzer_shared] Remove old exhaustiveness checking algorithm
This removes the old algorithm for exhaustiveness checking and
ports the relevant tests to use the new algorithm.

Change-Id: I7aee3c991e2735299ab4ddc743848b4845fb9250
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284882
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-02-23 15:21:24 +00:00
Derek Xu 1be893c507 [VM/Service] Start indexing positional record fields at 1
TEST=CI

Fixes: https://github.com/dart-lang/sdk/issues/51451
Change-Id: I0e00e0ffb35aeb40affbbd5544542723bafc747c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284722
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-23 15:00:28 +00:00
Sergey G. Grekhov 22f797b25a [co19] Roll co19 to 8db40c0c17735ac9f84cbc7d014bfde9f14240fd
2023-02-22 sgrekhov22@gmail.com Fixes dart-lang/co19#1884. Typo in scope_A02_t06.dart fixed (dart-lang/co19#1885)
2023-02-22 sgrekhov22@gmail.com dart-lang/co19#1401. Pattern type inference. Tests for Never added (dart-lang/co19#1883)
2023-02-22 sgrekhov22@gmail.com Fixes dart-lang/co19#1879. Wrong use of `var` and `final` fixed (dart-lang/co19#1882)
2023-02-21 sgrekhov22@gmail.com dart-lang/co19#1401. Type checking and pattern required type tests (dart-lang/co19#1855)
2023-02-21 sgrekhov22@gmail.com Fixes dart-lang/co19#1865. Change expected error message in analyzer (dart-lang/co19#1866)
2023-02-21 asashour@yahoo.com Correct `a` and `an` (dart-lang/co19#1863)
2023-02-21 sgrekhov22@gmail.com Fixes dart-lang/co19#1864. Fix shared_case_scope_A04_t01.dart to work on web-platforms (dart-lang/co19#1867)
2023-02-21 sgrekhov22@gmail.com Fixes dart-lang/co19#1868. Make switch statement exhaustive (dart-lang/co19#1869)

Change-Id: I67d1a9a992e0485cad649f9a64a5d554b4ac05a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284880
Reviewed-by: Alexander Thomas <athom@google.com>
2023-02-23 14:00:17 +00:00
Chloe Stefantsova 48868d5953 [cfe] Use intermediate variables to avoid name clashes in desugaring
Change-Id: I5a986a88dfdafbea14d636b13166f444a5e293a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284700
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-02-23 12:36:49 +00:00
Johnni Winther fa0eb1eeec [cfe] Support implements clause on inline classes
Closes #51445

TEST=pkg/front_end/testcases/inline_class/implements.dart

Change-Id: I1214afd8fe8f87ca516be018129e1629c91af289
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284704
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-02-23 08:07:44 +00:00
Chloe Stefantsova 6a38a69c83 [cfe] Support set/map disambiguation in pattern-for elements
Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: I7ee8fa434522d1361dad3f81a62412256f36089b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284780
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-02-23 07:58:10 +00:00
Johnni Winther 624ff0b356 [cfe] Update checkState to handle some error cases
Change-Id: Iadce61ac289b956f6f6012ec2bab5bf0bd1db15b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284702
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-02-23 07:57:41 +00:00
Alexander Aprelev 4f30b5c9b5 [vm/isolates] Include retaining path into an illegal send argument exception.
The exception contains retaining path that looks like this:
```
Invalid argument(s): Illegal argument in isolate message: (object extends NativeWrapper - Library:'dart:io' Class: _RandomAccessFileOpsImpl@14069316)
 <- Library:'dart:io' Class: _RandomAccessFile@14069316
 <- Library:'file:///vm/dart/isolates/send_unsupported_objects_test.dart' Class: SomeLog
 <- Library:'file:///vm/dart/isolates/send_unsupported_objects_test.dart' Class: SomeState
 <-  Class: Context
 <- Library:'dart:core' Class: _Closure@0150898

```

BUG=https://github.com/dart-lang/sdk/issues/51115
BUG=https://github.com/dart-lang/sdk/issues/48592
TEST=send_unsupported_objects_test

Change-Id: I022e693adccf43a7d2c95e1c7283fd7f210cf1d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280523
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-02-23 03:11:08 +00:00
Srujan Gaddam 1f6d4ae1a8 [dart:js_interop] Add literal constructors for inline classes
Adds @ObjectLiteral annotation to denote object literal constructors,
and implements it in all the backends. For dart2js, this involves
modifying the SSA and for dart2wasm, we create a one-per-shape
forwarding procedure to a specialized JS method that returns the
literal. This also modifies @anonymous semantics in dart2wasm to
be consistent with the other backends.

CoreLibraryReviewExempt: Backend-specific, just adding annotation.
Change-Id: I4d7a9ea9ed097f4f378709b40f8bd74f02e26b23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283922
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2023-02-23 01:14:39 +00:00
Johnni Winther 4cd0ca7693 [_fe_analyzer_shared] Support generic types in exhaustiveness
This adds support for generic types in exhaustiveness checking.

There are two main obstacles:

 1) Types that are not Dart subtypes might be related in the context
    of exhaustiveness. For instance

       sealed class A<X> {}
       class B extends A<num> {}
       method<T>(A<T> a) {
         switch (a) {
           case B(): ...
         }
       }

    Here B is not a Dart subtype of A<T> but must still be a subtype
    in the context of exhaustiveness since T could be num at runtime.

 2) It is non-trivial to compute the subtypes of a generic sealed class
    that is both sound and precise enough to be useful. For instance

      sealed class A<X> {}
      class B extends A<num> {}
      class C<X> extends A<X> {}
      class D<X extends num> extends A<X> {}
      class E<X extends E<X>> extends A<X> {}

    Computing the subtypes of A<F> for some type F, we would like to
    exclude B (assuming F is not a supertype of num) because it
    cannot be inhabit A<F>, and include C<F> so that we recognize
    that C<F> exactly covers all C instances of A<F>. We would also
    like to include D<F> but if we don't include the added `extends
    num` bound, we might conclude that D<num> is _not_ sufficient to
    cover D<F>. And what to do about E, can we even come up with a
    type that represents the valid values?

The solution is threefold:

1) We add an 'overapproximate' function of types, which
replaces all type variables with their default types. This will compute
A<dynamic> for A<T>, A<int> for A<int>, A<List<dynamic>> for A<List<T>>,
and E<dynamic> for E<T extends E<T>>. This is similar to instantiate-
to-bounds, but is recursive.

We use this to test whether a type without type variables is a potential
subtype. For instance testing B <: overapproximate(A<F>) = A<F> shows
that B _cannot_ be a subtype of A<F>, and testing
B <: overapproximate(A<T>) = A<dynamic> shows that B _can_ be a subtype
of A<T>.

2) For finding subtypes of a sealed type, we recognize the case
when a type is a trivial subtype in which all type variables are passed
directly to the superclass, for instance like C<T> in the example. For
other cases we overapproximate the this type of the subclass.

3) To ensure that the [StaticType] can be subtype in the normal Dart
sense but also handle the overapproximation when computing sealed
subtypes, a new [WrappedStaticType] is added. This bridges the subtype
relation such that for instance B, when created as a sealed subtype
of A<T>, is both a subtype of A<num> (as it normally is) and of A<T>,
which it is by construction.

Change-Id: I9970c46009938ef15625e1193faf916b7544ce0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284681
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-02-23 00:16:50 +00:00
Nate Biggs 552fbd0e97 [dart2js] Fix memory usage for linearized inferrer.
This reduces the memory increase of linearization from ~800MB to ~100MB while still maintaining ~11.5% improvement in runtime.

Change-Id: Ifb30deed9c0104c68adc39a849c656d41229b62d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284600
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-02-22 22:50:55 +00:00
Kallen Tu dbd6401865 [cfe] Anonymous mixins -- propagate class modifiers and fix with base on clause
Implements the proposed spec for dart-lang/language#2830 and along the way, fixes another change with anonymous mixins erroring in on-clauses.

Change-Id: I15ed7370f9099d9de89d80f5844db76f58fbd216
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284481
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-02-22 22:44:26 +00:00
Alexander Aprelev 2474e9363d [gardening] Fix break_on_function_many_child_isolates_test.
Only resume and confirm breakpoint works one isolate at a time. Pausing large number of isolates at once could exhaust thread pool leading to test timeout.

Fixes https://github.com/dart-lang/sdk/issues/48523
TEST=ci

Change-Id: I7e3a85b797315d7d7f022923d51a5a1a45879880
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284421
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-02-22 22:41:54 +00:00
Kallen Tu b34f480e0d Reland "[analyzer/cfe] Report an error when declaring a mixin class with final, interface, or sealed."
This is a reland of commit f17e9732c5

Original change's description:
> [analyzer/cfe] Report an error when declaring a mixin class with final, interface, or sealed.
>
> Change-Id: Ia1393851dffaab55c31d04d4e81bfae83a7bd67f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283126
> Commit-Queue: Kallen Tu <kallentu@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

Change-Id: Ic8185f38477b2eeff624ee391868d7260e0ed4cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284486
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-02-22 22:18:51 +00:00
Johnni Winther d412939c3b [cfe] Use isNonNullableByDefault instead of [Library]
This replaces the [Library] parameter from bounds checks and
type inference methods with a `isNonNullableByDefault` parameter,
enabling usage of these algorithms in library-agnostic code, like
features only available post-nnbd.

Change-Id: Id565d00e1c20d25e7e3388badbb2d7f11c015802
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284642
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-02-22 21:28:28 +00:00
stuartmorgan dd128e7634 Replace flutter/plugins analysis
Closes https://github.com/dart-lang/sdk/pull/51494

GitOrigin-RevId: 8e0394371fbe65e2c56096b081c22122bf36e2a0
Change-Id: Ib89119b1bcbcae558d8f1a5884c4baf22c99d672
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284741
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-02-22 20:52:10 +00:00
Ben Konyi 5ee55a8b6d [ CLI ] Rename compile-server-shutdown to compilation-server with start and shutdown subcommands
This will make compilation server related commands more consistent with
other commands in the CLI.

In order to make use of the compilation server for faster runs, users
will still need to pass `--resident` to `dart run` until we decide if we
want this functionality made more visible.

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

Change-Id: If9855ce1cc614c1c3ea6c4426dd4fad8f45c2495
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284500
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2023-02-22 20:40:48 +00:00
Danny Tuppeny b8dc676292 [analysis_server] Fix a NPE when moving first item w/ DartDoc to another file
`firstMember.beginToken.previous!.offset` isn't safe when `firstMember.beginToken` is the first Dartdoc, because it's `previous` is null.

Change-Id: I4944da3ffd8b7b43dd5c48db1e8738d787d205a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284703
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-02-22 18:40:55 +00:00
Derek Xu 87d0fbdf5f [VM/Service] Update VmServiceTest.java to work with current VmService class
TEST=ran `ant test` target

Change-Id: I90de4113f90a637e46fdb09ebd3f70ee8b06b0ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284721
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-22 18:10:05 +00:00
pq 43fbb1db5e trailing comma fix for single element record literals
See: https://github.com/dart-lang/sdk/issues/51446

Change-Id: I372f05c6e87a5ee4b55edcb05cf05c035107f250
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284549
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-02-22 17:39:28 +00:00
Ryan Macnak 3ff9699185 [infra] Add configurations to migrate the "compressed" group.
Change-Id: I15018b1c50b7c3a75b9b0c958ee7cb439b3cd350
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284482
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-02-22 17:27:46 +00:00
Chloe Stefantsova 5b0dc36334 [cfe] Add basic support for c-style pattern-for map entries
Part of https://github.com/dart-lang/sdk/issues/49749

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

Change-Id: I039a2dbb6e5b7f86a6f776d673761b1f9d5d5620
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284683
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-02-22 17:27:25 +00:00
Nate Biggs 5969da51d9 [dart2js] Update build infrastructure to move Dart2JS onto sound null safety.
Change-Id: Id172ab72e5d36899f699bb48f8ceb3609964efbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280221
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-02-22 17:19:43 +00:00
Paul Berry 6b33d5f42a Flow analysis: test parenthesized patterns.
This unit test makes sure that parenthesizing a variable pattern
doesn't destroy its ability to track the flow analysis consequences of
a boolean expression.

No code changes were are required, since the implementation passes the
test.  But prior to
https://dart-review.googlesource.com/c/sdk/+/282482 this test would
have failed, so it seems reasonable to include it as a unit test to
prevent regressions.

Change-Id: If5595a346757e608bc133846062ec37f47bc3e1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284485
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-02-22 17:19:17 +00:00
Derek Xu ad632cc8eb [VM/Service] Fix accessors of fields of simple types in generated Java classes
TEST=ran `ant test` target

Fixes https://github.com/dart-lang/sdk/issues/51448
Change-Id: I7099c1662b30378c6895f1f0e8f702f678aba884
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284720
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-22 17:11:41 +00:00
Danny Tuppeny 3d39175f5d [dds/dap] Improve display of errors calling toString() in debug views
Fixes https://github.com/Dart-Code/Dart-Code/issues/4400.

Change-Id: I46b36bcacdd0f8a33f296569fbc2e4ebece9d0f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284701
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-02-22 17:11:12 +00:00
Konstantin Shcheglov 67e7c96962 Fix parser to use correct begin token, to get documentation comments from it.
Change-Id: I9505353c9c6c00082e588aced34e8151c7ab22b7
Bug: https://github.com/dart-lang/sdk/issues/51447
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284441
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-22 17:03:38 +00:00
Konstantin Shcheglov 5b55ed416f Update documentation for ByteStore.putGet(), update MemoryByteStore implementation
This brings it in sync with the existing implementation in Cider.

In Cider we cannot enfore no-putGet-when-data-exists because of possible
race condition, when data did not exist during `get` by isolate1, but
was put shortly after by isolate2, before isolate1 computed data and
attempted to `putGet`.

Change-Id: I36d9083f204be48e529e675a3f046784375f6fbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-22 17:03:09 +00:00
Paul Berry 8a4f638b07 Shared type analysis: stop tracking MatchContext.initializer
It turns out that some time ago I got rid of the logic that depends on
this; the associated functionality is still there, but it's tracked
automatically by flow analysis via
`_PatternContext._matchedValueInfo`, so we no longer need to track it
in the shared analysis logic.

Change-Id: Ia38e0baf5f599c929aa2000aade41473b997f80a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284480
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-02-22 16:41:59 +00:00
Kevin Moore fd836d3b34 vm_service: fix a bunch of comment references
also fix a couple of typos in service.md

TEST=re-ran generate script

Change-Id: I6fb6dbbc3780af14e5721817e20ec0e6370bfc1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284440
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-22 16:32:28 +00:00
Danny Tuppeny 658e34ee2a [analysis_server] Fix ordering of parameter+type InlayHints at the same position
Parameter name hints should always come before any other hints at the same position:

```
f(a: <int>[]);
  ^  ^^^^^
```

Change-Id: I8ae06c562e80df441fee9d3a8079c0048d01f903
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284641
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-02-22 15:38:32 +00:00
Sam Rawlins 61e1808e2f [analyzer] Move 5 more HintCodes to be WarningCodes, SUBTYPE_*, UNDEFINED_*, UNNECESSARY_*
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: I7d15e27697093ecbdb958900f57e40d01753fdb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284541
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-02-22 15:24:39 +00:00
Ömer Sinan Ağacan b13f03dd4d [dart2wasm] Throw NoSuchMethodError in unimplemented external members
New passing tests:

- co19/Language/Functions/External_Functions/not_connected_to_a_body_t01
- co19/LanguageFeatures/Abstract-external-fields/static_analysis_external_A01_t03
- co19/LanguageFeatures/Abstract-external-fields/static_analysis_external_A02_t04
- co19/LanguageFeatures/Abstract-external-fields/static_analysis_external_A03_t03
- co19/LanguageFeatures/Abstract-external-fields/static_analysis_external_A03_t06
- co19/LanguageFeatures/Abstract-external-fields/static_analysis_external_A05_t03
- language/bool/has_environment_not_new_test
- language/constructor/external_constructor_test
- language/external_abstract_fields/external_fields_test
- lib/math/random_secure_unsupported_test

Change-Id: I74a430af37d3f138387a942ef028639224c312d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284622
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-02-22 13:35:34 +00:00
Ahmed Ashour 8ef5104d05 [cfe] create a Procedure
with a distinction between `inlineClassMember` and `extensionMember`.

Fixes #51338

Change-Id: I169c285537754137d5b32effc9697c2b9f4eb5c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283864
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-02-22 08:03:38 +00:00
Joshua Litt db076454e9 [js] Bump dependency after removing dependency on package:js.
Change-Id: Iecbdc301ed54dc25057c19b451c76ea8cf466983
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283720
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-02-22 02:49:37 +00:00
pq b0078ad057 + RECORD_TYPE_ONE_POSITIONAL_NO_TRAILING_COMMA diagnostic
See: https://github.com/dart-lang/sdk/issues/51446

Change-Id: I4ebb0a8978bd98fc658737f69b790c2039c17d52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-02-22 02:07:53 +00:00
Sam Rawlins 85154631c9 Bump linter to dcf3a079c573487b6ab64518604e5686be899601
We need the fix for https://github.com/dart-lang/linter/issues/4077 in
order to land https://dart-review.googlesource.com/c/sdk/+/282661

Change-Id: I472455dd24e6ef49095c20b1ab9912051a942d5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284540
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-02-22 02:00:48 +00:00
Alexander Markov 143e4e9dc8 [vm/aot/tfa] Static weak references to method tearoffs
TEST=pkg/vm/testcases/transformations/type_flow/transformer/weak.dart
TEST=language/vm/static_weak_reference_test
TEST=language/vm/static_weak_reference_error_test

Bug: b/269223463
Change-Id: I23c8229c39217aa1c3f9fb576d8eefa5ceb1d8ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283421
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-02-22 01:01:29 +00:00