Commit graph

91431 commits

Author SHA1 Message Date
Ryan Macnak cc3bf609f2 [vm, gc] Avoid suprious race between GC helper thread exit and GC visiting roots.
A sweeper helper thread may be exiting while the scavenge is visiting thread roots. GC helpers have no reusable handle state to clear, so the race is an uninteresting one between null and null.

TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/52125
Change-Id: Iae68f8a3a938ae20e540b11c172fbc4a50a90a9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298262
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-04-25 22:10:09 +00:00
Leaf Petersen 5138a1eb38 Add test cases to cover implementing a base declaration from the
current library which itself extends a base declaration from another
library.

Change-Id: I3caf125de528d5c082c825c02055a114f732f385
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298040
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-04-25 21:59:46 +00:00
Nate Biggs 0028815f16 [dart2js] Remove experimental inferrer.
We have merged the experimental inferrer back into the main inferrer branch and therefore can clean this up.

Change-Id: I66481c51276b0ffbf79b4b41b21a3ee5c2ca9cf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298360
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-04-25 21:50:02 +00:00
Robert Nystrom 4bfb196287 Fix web_int_literals_test.dart.
This test was inadvertently broken when automatically migrated from a
multitest to a static error test.

The original intent of the test was to ensure that web compilers
reported compile-time errors on integer literals that couldn't be
represented as JS doubles. The migrated static error test doesn't have
any web expectations and thus doesn't get run on web compilers at all.
Instead, all it does is validate that the one non-web error in there is
reported.

This turns the test into a proper *web* static error test with the
web-specific test expectations in there. That ensures the test is run
on web compilers and validates that the web compilers produce those
expected errors.

Also removed the corresponding runtime test since it doesn't do
anything. There's no runtime behavior to test, and the static error
test also correctly validates that the *valid* integer literals do *not*
produce compile errors.

Removed the status file entries because they're no longer needed. Since
this is a static error test, the runtime platforms already skip it
implicitly.

Change-Id: I2776847e1acb88b1f761efb43e7bb528b27d0eee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297840
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2023-04-25 21:28:39 +00:00
Konstantin Shcheglov 80d26df2fd Issue 52160. Report BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY for implementing 'base' via 'extends'.
Bug: https://github.com/dart-lang/sdk/issues/52160
Change-Id: I47a72021a002663d04fd8ea14c11a012917e8a8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-25 20:19:38 +00:00
Konstantin Shcheglov 79bf3eedd6 Run UseOfVoidResultTest with null safety enabled.
Bug: https://github.com/dart-lang/sdk/issues/52136
Change-Id: I0a77a81d0a558e8b2450e91e6156d5fab03579a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298300
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-25 20:14:08 +00:00
Konstantin Shcheglov 00d841ee99 Issue 52060. Fix reporting CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE for Null vs. nullable FunctionType.
Bug: https://github.com/dart-lang/sdk/issues/52060
Change-Id: I5373a9a73396fbf49562131f5f801d1bceeb65f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298280
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-25 20:09:28 +00:00
Konstantin Shcheglov b81fd66ed5 Issue 52164. Include enums and mixins into types of a sealed class.
Bug: https://github.com/dart-lang/sdk/issues/52164
Change-Id: Icd6ac232d6356b7e05995b79e5f7d8b33b88a719
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298260
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-25 20:01:52 +00:00
Konstantin Shcheglov 018dadcf5b Resolve the whole unit in resolveForCompletion() when the node is a directive.
There is a quite complicated logic in resolving directives and walking
augmentations and parts. And we don't expect users write a lot of code
in directives, so there is less need for optimizations than when typing
in method bodies.

Change-Id: Id38e90f09eb5c1e84be8fc28ed4211d03762d2e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-25 20:01:25 +00:00
Polina Cherkasova 4de8a314c4 Update README.md
Closes https://github.com/dart-lang/sdk/pull/52114

GitOrigin-RevId: 1a0abe31e57c60bfeaf5bc857a08b0f6bc3986d2
Change-Id: I837ff4f5fdf9afdbd2cbce3073f87e51a62960c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296701
Commit-Queue: Polina Cherkasova <polinach@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-04-25 18:50:20 +00:00
Stephen Adams 70615d5970 [dart2js] Update TODO with issue number
Change-Id: I0191298058f8ceb68eaec91c0c00c8576799a634
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298180
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2023-04-25 18:19:06 +00:00
Stephen Adams e8832a643e [dart2js] Fix value_range_test
The fix is to enable type inference.

The old `List(n)` constructor was replaced by `List.filled`. `List(n)`
could be recognized as fixed-length purely by syntax. The test failed
after the replacement because `List.filled` is not recognized to be
fixed-length purely syntactically in the SSA builder, but rather by
type inference.

With type inference enabled, `List.filled` is recognized, but other
parts of the test need to be more realistic, as type inference also
detects the element type and length.

Bug: #52139
Change-Id: Icfaeb3e341b448bbc263efe43f48a2b76d05bf5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298020
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-04-25 17:58:29 +00:00
Valentin Hăloiu db766b37cb Fix SSL certificate check when hostname is an IP address
Closes https://github.com/dart-lang/sdk/pull/52118

GitOrigin-RevId: 7598354d2ad5baba2ed65177bdff521a637b5b65
Change-Id: I78246e423f6ee090030912576ab8202f0fa60509
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296722
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-04-25 16:06:12 +00:00
Lasse R.H. Nielsen d440905d5a Reestablish abstract on HttpProfiler.
Class used to be abstract, but lost it when made `final`.
There is no reason to allow instantiation, it's all static members.
Restablishing the `abstract` before we release 3.0, so we don't have to go through any extra steps.

The class is public, exported by `dart:io`. (Should probably also be documented.)

Change-Id: Ic1a3e1a777ecbdcf535b92dbcdd88f55a65e9cbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297463
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-04-25 14:41:19 +00:00
Danny Tuppeny a0d6b2daed [analysis_server] Switch some code from package:collection to Dart 3 APIs
- change forEachIndexed to `.indexed`
- remove `package:collection` imports for files only using `.firstOrNull`, `.singleOrNull`, `.lastOrNull` that is now available in `dart:core`
- switch from `Pair` to records
- use switch expressions

Change-Id: Id1ae22db427b4cd955f26e0d6c852944a540a05f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-04-25 14:28:26 +00:00
Danny Tuppeny 528c75acd2 [analysis_server] Support folding switch statements/expressions/cases
Fixes https://github.com/Dart-Code/Dart-Code/issues/4506.

Change-Id: Idd5924d04e9ffffc49f088ca6884393ea72e9bea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-04-25 14:18:04 +00:00
Danny Tuppeny c4d2d2d7c2 Reland "[analysis_server] Use fixDataYamlFolder constant instead of string literals"
This is a reland of commit ccb02fa8fc

Original change's description:
> [analysis_server] Use fixDataYamlFolder constant instead of string literals
>
> Follow-up from https://dart-review.googlesource.com/c/sdk/+/296801.
>
> Change-Id: I72ea8a42ec64c4bd6c6cee021a1464167ec368e6
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296862
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>

Change-Id: I202392de3444556dc2baa9ed9e1b82c3a1ede4aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-04-25 14:17:00 +00:00
Ben Konyi 8d97964e6e [ VM ] Move class name from heap profiler report callback to allocation callback
Moving the class name of the allocated object to the allocation callback
gives more flexibility to the embedder, which may decide to track all
sampled allocations, not just those that are still alive.

TEST=Updated DartAPI_HeapSampling_*

Change-Id: Iaae290e15b67ca3e47d72e1896fa6e32b2d4b081
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297761
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-04-25 13:02:49 +00:00
Paul Berry 96a346fc5e Front end: move anonymous mixin sealed/final inference to checkSupertypes phase.
Previously this step happened during `buildOutlineNodes`, but since
`buildOutlineNodes` happens in source order, this means that anonymous
mixins would only get their sealed and final attributes properly
inferred if they appeared *after* their immediate supertypes in source
order.  By moving this step to `checkSupertypes`, we ensure that the
computation is correct regardless of source order, because
`checkSupertypes` happens in class hierarchy order.

Fixes #52048.

Bug: https://github.com/dart-lang/sdk/issues/52048
Change-Id: Ib9f1f3dafded88681a26f09e4d21dfd44e70dfd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297901
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-04-25 12:26:38 +00:00
Jens Johansen dc77baa5a8 [kernel] Call Reference.node less; make it inlinable
This CL splits up `Reference.node` in to the most-often fast-case and the
has-to-load case, making the procedure smaller which makes the VM inline
it. This was "verified" by looking at the VMs optimized flow graph for
`Reference.asClass`.

This CL furthermore reduces the number of "calls" to `Reference.node`
by almost half (a reduction of over 3 mio calls when compiling
`compile.dart`) by "caching" the `.node` call in the `as*` methods.

Change-Id: I7b5497397a11f05fdeaf05d6cc420072d98dc030
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298101
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-04-25 10:21:46 +00:00
Jens Johansen e5c2dd28c7 [CFE] Allow counting method calls when instrumenting
When instrumenting one can use "--count" to instrument counting method
calls instead of instrumenting to create a flame graph.

From that I can for instance see that `Reference.node` is called 6+ mio
times when compiling compile.dart.

Example run:
out/ReleaseX64/dart pkg/front_end/tool/flame/instrumenter.dart pkg/front_end/tool/_fasta/compile.dart --count
out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart.dill.instrumented.dill pkg/front_end/tool/_fasta/compile.dart

Change-Id: I583f4b53a474c3777bb059ea89d932607b7c23ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298100
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-04-25 10:11:30 +00:00
Jens Johansen 1574e860c8 [CFE] Add instrumenter that can produce flame graph output
Could for instance be run like this:

out/ReleaseX64/dart pkg/front_end/tool/flame/instrumenter.dart pkg/front_end/tool/_fasta/compile.dart
out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart.dill.instrumented.dill --omit-platform pkg/front_end/tool/_fasta/compile.dart
out/ReleaseX64/dart pkg/front_end/tool/flame/instrumenter.dart pkg/front_end/tool/_fasta/compile.dart --candidates=cfe_compile_trace_candidates.txt
out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart.dill.instrumented.dill --omit-platform pkg/front_end/tool/_fasta/compile.dart
out/ReleaseX64/dart pkg/front_end/tool/flame/instrumenter.dart pkg/front_end/tool/_fasta/compile.dart --candidates=cfe_compile_trace_candidates_subsequent.txt
out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart.dill.instrumented.dill --omit-platform pkg/front_end/tool/_fasta/compile.dart

 * The first command compiles and instruments "compile.dart" to record
   all procedure calls.
 * The second command runs the instrumented compiler on "compile.dart"
   (but it could have compiled anything). Because every procedure is
   instrumented this will take a lot longer than a usual run.
   This produces a trace "cfe_compile_trace.txt" with every call taking
   at least 1000 microseconds. This can be displayed via Chromes
   about://tracing tool.
   It also produces a file "cfe_compile_trace_candidates.txt" with a map
   of the procedures that on average took at least 500 microseconds.
 * The third command compiles and instruments "compile.dart", this time
   only instrumenting the procedures mentioned in the map
   "cfe_compile_trace_candidates.txt".
 * The forth command runs the instrumented compiler on "compile.dart".
   This run shouldn't take significantly longer than a non-instrumented
   run. It produces a new "cfe_compile_trace.txt" which this time is
   not filtered. It also produces a file
   "cfe_compile_trace_candidates_subsequent.txt" of recorded procedures
   that on average took at least 50 microseconds.
 * The fifth and sixth commands repeats the third and forth but
   instrumenting only the procedures mention in
   "cfe_compile_trace_candidates_subsequent.txt".

The third iteration might not be needed, but if the first run was on a
smaller input (which it isn't in this example) there might be some calls
that on average took long enough to be included in the candidate list
because the first call was slow and there were only very few of them,
making the second trace very big because there are now a lot of - as it
turns out - very quick calls recorded. Adding the third iteration will
filter (at least some of) those out.

Change-Id: I702c5c9142e525502b02f37744fcdc9d2b0f9b20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296902
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-04-25 08:34:01 +00:00
Chloe Stefantsova b9b1fdff76 [cfe] Infer type and finality of joint variables in or-patterns
Closes https://github.com/dart-lang/sdk/issues/52099

Change-Id: I019e0a9e38cee35883c197ebae855b0854a0b2ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297640
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-04-25 06:31:28 +00:00
Konstantin Shcheglov 34c18da5eb Prepare to publish analyzer 5.11.1 and _fe_analyzer_shared 59.0.0
Bug: https://github.com/dart-lang/sdk/issues/52159
Change-Id: Ia603e77694d11af1045a94bdf00468d02eb5f6af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-25 01:15:05 +00:00
Danny Tuppeny 86e3305538 Reland "[analysis_server] Analyze fix data in fix_data folder"
This is a reland of commit bbacf39e9c

Original change's description:
> [analysis_server] Analyze fix data in fix_data folder
>
> Fixes part of https://github.com/dart-lang/sdk/issues/52126.
>
> Change-Id: Ib4bd7830a2f644eacedccd375c7c8dc60f040d33
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296801
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

Change-Id: I571c1e4f87fdf0095d003d496f3c5d88e5cf0ff8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297940
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-25 00:08:54 +00:00
Nate Biggs b508533666 [dart2js] Add 'CONTEXT' diagnostic level option.
Metrics are using 'INFO' level diagnostics but these do not match the stated usage for INFO. This level was originally supposed to be used for contextual info about a previous warning/hint:
https://github.com/dart-lang/sdk/blob/main/pkg/compiler/lib/compiler_api.dart#L44

These is logic that is preventing these metrics from being printed when they are logged following a hint and hints are turned off:
https://github.com/dart-lang/sdk/blob/main/pkg/compiler/lib/src/source_file_provider.dart#L259.

Instead we introduce a 'CONTEXT' for those contextual info messages and use 'INFO' as its own level of logging.

Change-Id: Ie845f30dfd7d04fa9fe1d0a866e07c834dc64b32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297280
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-04-24 23:17:09 +00:00
Konstantin Shcheglov 82cffbb38b Prepare to publish analyzer 5.11.0 and _fe_analyzer_shared 59.0.0
Change-Id: I1d841f7c12698e56bd99ed109e58795172499ed1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297842
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-24 22:08:12 +00:00
Konstantin Shcheglov 39cb6acb88 Issue 52149. Fix to support rename refactoring for declared identifier with LSP.
Bug: https://github.com/dart-lang/sdk/issues/52149
Change-Id: Ia4c5c564cc44583741722c658389ea674a5643c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-24 22:04:39 +00:00
Konstantin Shcheglov 887e6da4a5 Issue 52150. Support for unused variable patterns in logical-and patterns.
Bug: https://github.com/dart-lang/sdk/issues/52150
Change-Id: I9efb2f8ece0ccb3d3c2e276ff708a671dea80fa3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297841
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-24 21:53:38 +00:00
Konstantin Shcheglov a868a5bfa6 Issue 52148. Disable invert 'if' when 'case'.
Disable a few assists that require 'patterns', when it is not enabled.

Bug: https://github.com/dart-lang/sdk/issues/52148
Change-Id: I3c3816f4a944c59698543e37f15e024249545952
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297880
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-04-24 21:16:48 +00:00
Sigmund Cherem 8026975546 [dart2js] better help message.
Makes more prominent that you can use '-v' to show
extra details about all options.

The message after this change will look as follows:
```
Compile Dart to JavaScript.

Usage: dart compile js [arguments] <dart entry point>
(use -h -v for detailed information about all options)
  -h, --help      Print this usage information
  -o, --output    Write the output to <file name>.
  -O<0,1,2,3,4>   Set the compiler optimization level (defaults to -O1).
```

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

Change-Id: I76fe5478b4a1d4b2ae2170eca72d764bc4d120b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294164
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-04-24 20:48:14 +00:00
Nate Biggs 339399a593 [dart2js] Resolve failing web unit tests.
- variance_subtype_cast_test.dart: Pass soundNullSafety flag so @dart=2.7 flag doesn't get added to test.
- logical_expression_test.dart: Remove test as this is now covered by test added in https://dart-review.googlesource.com/c/sdk/+/297360.

Change-Id: I02d0fb816c5b41dad31014152ff3a796a528904c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297860
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-04-24 20:38:27 +00:00
Derek Xu 58b796bac9 [VM/Timeline] Disable SUPPORT_PERFETTO macro to investigate flaky Flutter crashes
Issue: https://github.com/flutter/flutter/issues/125425
Change-Id: If134e4f4efb3e3259dab421e769cc76264189ad3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297821
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-04-24 20:32:31 +00:00
Robert Nystrom 7b3c81f06d Update package:dart_internal to allow Dart SDK 3.0.0.
Change-Id: I564b60940475f40fa842e03d9b03ef0f7b06e9ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297820
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2023-04-24 19:51:09 +00:00
Nate Biggs 9a7f60b438 [dart2js] Add Dart2JS input bytes as an internal metric.
Change-Id: Ib036b0511af2a54aa049f3638d9680fca3b77385
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297701
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-04-24 19:43:04 +00:00
Konstantin Shcheglov 2cdfc05568 Issue 52146. Fix ConvertToIfCaseStatementChain for a case without statements.
Bug: https://github.com/dart-lang/sdk/issues/52146
Change-Id: I2947111a0e1a4c6e739bda851f1f91c9637a745a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-04-24 19:28:56 +00:00
Danny Tuppeny d3460e0855 [analysis_server] Don't produce diagnostics for empty/commented fix_data files
Previous changes to analyze the fix_data/**.yaml files failed to roll into Flutter because it has a template for these files that contains only comments.

See https://dart-review.googlesource.com/c/sdk/+/297320 and https://github.com/flutter/flutter/pull/125363.

Change-Id: I098a5b336371bab7f80ac84c556efe118c70e74f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-04-24 18:47:21 +00:00
Stephen Adams 073def1334 [dart2js] Add codegen test for logical operator generation
Change-Id: I5f86fdf4e58122a234dc2c7b16e1e16ec44d0d83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297360
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2023-04-24 18:47:14 +00:00
Robert Nystrom 988642a94e Remove support for "@compile-error" and similar markers in tests.
These were added during the Dart 2 test migration as a way to indicate
why a test was expected to fail. But, like negative tests, they have
very poorly granularity.

Static error tests are strictly superior.

The co19 tests have been migrated off of these markers for a couple of
years, so our own language tests were the only holdouts. I see no uses
of "@syntax-error", "@runtime-error", or "@static-warning". I have now
migrated all of the tests that contained "@compile-error" to be proper
static error tests.

This simplifies the test runner and makes our tests more precise.

Fix #45634.

Change-Id: I0f46d110b6f322d98187e734195ecba7524574af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296720
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2023-04-24 18:34:59 +00:00
Derek Xu 5978b607d2 [VM/Timeline] Make a header file for perfetto_utils
This is being done to allow us to access the utils from
profiler_service.cc.

TEST=Requested a trace using the getPerfettoVMTimeline RPC and confirmed
that it still looked correct.

Change-Id: Icfb7a5b41da0fc987a72098c4345e7e108b6566e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297740
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-04-24 18:29:23 +00:00
Konstantin Shcheglov 903be31b05 Apply nullabilitySuffix to interfaces / mixins / superclassConstraints / superclass.
Bug: https://github.com/dart-lang/sdk/issues/52133
Change-Id: Ib32d10d7736c59f93fdb1d6eb79851f3e44457b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297400
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-24 17:56:40 +00:00
Brian Wilkerson e8e4980b4c Rewrite keyword contributor tests
I did not change any of the test cases. I did change the names of the
tests to be more consistent, and in the process I found a couple of
tests where the test code was identical, so I deleted the duplicates.

I expect that there will be more cleanup that we'll want to do after
all of the contributor tests have been converted and merged together,
but I wanted this CL to be as straightforward as possible given its
size.

Change-Id: I2cbb6b5c0718fbbc36da521ee3c4fc7d00c36dcb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297720
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-04-24 17:36:22 +00:00
Brian Wilkerson 71d4e1478e Clean up some tests to make conversion of contributor tests easier
Change-Id: I801970b4b88b883b2219badcefb7e1c84517d592
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297780
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-04-24 17:35:27 +00:00
Devon Carew 4b582c4581 [deps] rev async, characters, convert, crypto, dartdoc, intl, markdown, sse, stream_channel, test, tools, usage, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

async (0127813..ce650b0):
  ce650b0  2023-04-19  Nate Bosch  Regression test for error rejecting transaction (#230)

characters (ba8d557..b306414):
  b306414  2023-04-19  Lasse R.H. Nielsen  Add tools to update and generate tables and tests. (#72)

convert (8812e40..855aeac):
  855aeac  2023-04-10  Kevin Moore  Require Dart 2.19, fix override param name, update lints (#81)

crypto (1cb1528..77491f5):
  77491f5  2023-04-19  Lasse R.H. Nielsen  Make `DigestSink` implement `Sink` (#146)

dartdoc (a0755f5..8e8b36e):
  8e8b36e3  2023-04-19  Janice Collins  Fix up documentation on comment reference parser to align with wiki (#2851)
  b9178fce  2023-04-19  dependabot[bot]  Bump github/codeql-action from 2.2.11 to 2.2.12 (#3390)
  37b981c4  2023-04-19  dependabot[bot]  Bump actions/checkout from 3.5.0 to 3.5.2 (#3389)
  dadef24a  2023-04-10  dependabot[bot]  Bump github/codeql-action from 2.2.9 to 2.2.11 (#3386)
  dda699a7  2023-04-10  Sam Rawlins  Prepare mixin-like classes for Dart 3.0.0 (#3385)

intl (a958db0..5d65e38):
  5d65e38  2023-04-19  Moritz  Update README.md
  9972a89  2023-04-19  Moritz  Update README.md
  5c14faa  2023-04-18  Copybara-Service  Merge pull request #584 from dart-lang:fixDateFormattingUrl
  4ea644e  2023-04-17  Moritz  Merge branch 'master' into fixDateFormattingUrl
  b0d5687  2023-04-17  dependabot[bot]  Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#574)
  92149be  2023-04-17  Moritz  Merge branch 'master' into fixDateFormattingUrl
  5203d6e  2023-04-17  Googler  Internal change
  bab667f  2023-04-17  Moritz  Typo
  b0896b1  2023-04-17  Moritz  Fix bug
  43507e1  2023-04-14  Googler  Internal change
  d8844a0  2023-04-14  dependabot[bot]  Bump actions/checkout from 3.3.0 to 3.5.2 (#579)
  99ed16f  2023-04-13  Copybara-Service  Merge pull request #572 from dart-lang:adaptBrowserTest
  34e824c  2023-03-30  Moritz  Adapt test to browser CLDR update

markdown (d437c85..5f98aea):
  5f98aea  2023-04-20  Jonas Finnemann Jensen  Throw, if `BlockSyntax.parseLines` loops indefinitely (#533)
  86ebc2c  2023-04-19  Zhiguang Chen  Fix `linkReferenceDefinitionPattern` (#532)

sse (11e83a0..f947c3d):
  f947c3d  2023-04-10  Kevin Moore  Require Dart 2.19, bump lints (#82)

stream_channel (74646ea..71d4690):
  71d4690  2023-04-11  Tobe Osakwe  Add example/example.dart (#52)

test (7832931..7fab079):
  7fab0792  2023-04-19  Oleh Prypin  Dart 3 compatibility: change `extends Iterator` to `implements Iterator` (#1997)
  8f7682a5  2023-04-18  Nate Bosch  Remove deprecation of test_api top level libraries (#1994)
  7151486c  2023-04-14  Simon Binder  Add support for Microsoft Edge (#1992)
  c1d686aa  2023-04-12  Parker Lougheed  Fix "Improvements" link in `package:checks` migration guide (#1991)

tools (545d7e1..5c9f45c):
  5c9f45c  2023-04-20  Elias Yishak  Move `dateStamp` getter to `utils.dart` (#83)

usage (0698711..f97752f):
  f97752f  2023-04-10  Devon Carew  update readme for deprecation (#192)

webdev (7546291..8b42c95):
  8b42c950  2023-04-21  Anna Gringauze  Cleanup record types display (#2070)
  1cfb3bd6  2023-04-20  Elliott Brooks  Update CONTRIBUTING docs (#2097)
  941eda5b  2023-04-19  Elliott Brooks  Add a test to make sure proper release procedure is followed for `dwds` and `webdev` (#2095)
  2eb7c3ee  2023-04-17  Elliott Brooks  Add Github workflow for Dart Code Metrics (#2092)
  79a9bc9b  2023-04-17  Elliott Brooks  Fix DCM analyzer warnings (#2094)
  2a625039  2023-04-14  Elliott Brooks  Add `vm_service` git package dependency override (#2078)
  1fa19603  2023-04-12  Elliott Brooks  Add CI check to remind contributor to update CHANGELOG (#2090)
  c7bb19e1  2023-04-12  Elliott Brooks  Prevent PRs labeled `do-not-submit` from being merged (#2088)
  3781ef9b  2023-04-10  Elliott Brooks  Run mono_repo generate with version 6.5.3 (#2084)
  843890c6  2023-04-10  Anna Gringauze  Refactor record shape processing out of calculating record bound fields (#2074)

Change-Id: I4ce65f9f79d5086c33c575e57eff300216392510
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297800
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
2023-04-24 17:08:01 +00:00
Danny Tuppeny d75a4e162e [analysis_server] Update LSP generated classes to latest published version of the spec
No functional changes here but there have been some refactors inside the meta model that required some minor tweaks (URI moved from a type alias to string to a spec-defined base type).

I also improved the handling of some type references in the comments we bring in so they're clickable in more places.

Change-Id: I7c725d01b6d7bc0925979b8118dbfd8952f78724
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297482
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-24 15:09:20 +00:00
Johnni Winther 3a5b06a9c3 [_fe_analyzer_shared] Handle private names in exhaustiveness checking
Closes #52041

Change-Id: I8824aeb84eb6357bd47a6111217a273c883a68d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297462
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-04-24 14:31:49 +00:00
Johnni Winther 51c7d143e0 [_fe_analyzer_shared] Handle custom list implementation
This fixes the handling of list types in exhaustiveness checking so
that custom list implementations can be exhausted as lists.

The change doesn't include handling of sealed class and enums as lists
but test for these are added.

Closes #51973

Change-Id: I66bcff99c5262a82513dbde1e5561284846ceace
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297460
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-04-24 14:29:01 +00:00
William Hesse 60fec9c720 [infra] Adjust sharding for VM JIT builders
Cutting the shards from 10 to 4 makes the shards time out after 90
minutes on the slowest builders. Even the fastest builders have shard
runtimes of 30 minutes.

Changing the sharding of JIT builder tests from 4 to 8 for both VM tests
and co19 tests.

Fixup after https://dart-review.googlesource.com/c/sdk/+/294140

Change-Id: I813aa40b6aac0fc5083a9606b71d00e78ce71ffc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297480
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-04-24 10:18:05 +00:00
Johnni Winther 8cc76bde6e [cfe] Support type inference on inline class constructor invocation
Closes #51146

Change-Id: I8fab2e999b29fbc811786e168d0e7a4c5a081418
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295363
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-04-24 10:17:54 +00:00
Jens Johansen d18893c799 [CFE] Add more benchmarking points; change how subdivides are handled
This CL adds more benchmarking points, specifically giving more insight
into where body_buildBodies time goes.

It furthermore changes how overlapping subdivides are handled.
Previously only the first subdivide was actually recorded, meaning that
if a subdivide `a` contained a subdivide `b` only subdivide `a` would
have any time recorded for it. Now instead subdivide `b` will get data
recorded for the time it runs; this time will then _not_ be added to
`a`s total. For instance if subdivide `a` spends one second, then
(while still being in subdivide `a`) we enter subdivide `b` and spend
one second there, exit it, and spend yet another second before we exit
subdivide `a` before we would just have recorded 3 seconds for subdivide
`a`, now we will instead record 2 seconds for subdivide `a` and 1 second
for subdivide `b`.

Additionally a "system subdivide" is automatically added summarizing
any unaccounted for subdivide time, and an extra entry describing the
estimated subdivide recording overhead figues too.

As an additional note, enabling benchmarking seems to add ~6-7% runtime,
and because we specifically add additional parsing phases to measure
that separately the token stream can change before doing the actual
parsing, meaning that when enabling benchmarking some errors might be
swallowed.

Change-Id: I07ef42657c385031e8bb8680738442cf04fe2263
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295540
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-04-24 09:49:12 +00:00