Commit graph

84987 commits

Author SHA1 Message Date
Ryan Macnak b50396740f [build] Fix Android build for ARM64 Mac.
TEST=local
Bug: https://github.com/dart-lang/sdk/issues/48792
Change-Id: Ia43dd46f90ef5f592e324bb889c20c221f69998a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241102
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-04-20 17:15:48 +00:00
Konstantin Shcheglov dd26a0eae1 Build FunctionTypeAnnotation(s) for macros.
Change-Id: Ia18c132cb05c4a9cd1df569bb65202a8f1379596
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241801
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-04-20 17:02:48 +00:00
Daco Harkes c440a0d2bc [vm] Only use IL print functions if available
https://dart-review.googlesource.com/c/sdk/+/241607 broke product
builds.

TEST=SDK build

Change-Id: I996e0554e77798e2c5cac3521b15011da4885a62
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-product-arm64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241749
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-04-20 16:51:24 +00:00
Danny Tuppeny 147dca35a3 [analyzer] Use LinkedHashSet for recording errors to keep order consistent
Fixes https://github.com/Dart-Code/Dart-Code/issues/3934.

Change-Id: I1cd9fd35ddbbd768877e6b2b2984056ed5ec5d9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-04-20 16:03:18 +00:00
Daco Harkes 1cce5e6090 [vm/ffi] Stop writing beyond allocated stack space
This CL adds an assert to check we're not writing beyond the allocated
stack space. This assert triggers at compile-time, rather than at
runtime, and it catches cases which would sometimes go correct at
runtime because the stack is also 16-byte aligned.

This only occurred on MacOS/iOS Arm64 because structs are word-aligned
on the stack in the other ABIs.

The fix in this CL is to always add 4 bytes extra in this ABI.

The alternative fix would be to stop copying word-size chunks and use
smaller moves. However, this would require a major re-engineering of
the marshaller because it breaks structs up in word-size definitions
currently.

TEST=tests/ffi/function_structs_by_value_generated_test.dart
     (would trigger the assert without the fix on MacOS arm64)

Fixed: https://github.com/dart-lang/sdk/issues/48806
Change-Id: Ia590be76919a192fed144520ee28b1abaf3aa485
Cq-Include-Trybots: luci.dart.try:vm-kernel-nnbd-mac-debug-arm64-try,vm-kernel-nnbd-mac-debug-x64-try,dart-sdk-mac-arm64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-x64c-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-kernel-precomp-android-release-arm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241607
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-04-20 15:42:58 +00:00
Joshua Litt 84497e41ca [package:js] Add @trustTypes annotation.
Adds an experimental `@trustTypes` annotation which can be used during
migration to static interop to preserve the older semantics for JS interop.

Change-Id: Ic00a6c968b15f8c8f5d0840b82db5a6670eaf0eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241362
Reviewed-by: Riley Porter <rileyporter@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-04-20 15:24:18 +00:00
Clement Skau af2de233e5 [infra][nit] Make test.py output a little cleaner.
test.py's output is truncated to a certain length to avoid
tests flooding the terminal.
However, the way it's implemented it likely cuts off a line
of output at an arbitrary point, and then prints its own
message to let the user know the truncation happened.
This ultimately means that said message will often be hard to
spot as it flows together with the output.

This change makes sure there is always a newline at the end
of the output, ensuring the message will be on its own line.

TEST=Manual testing locally.
Change-Id: I91146ce7ce3d4fb0a35465a77aaf783df2acf4b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241742
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2022-04-20 15:21:28 +00:00
Paul Berry 8f8a63fccb Don't hoist function literals when reordering expressions to support "named arguments anywhere".
Hoisting function literals isn't necessary because evaluating a
function literal doesn't have any side effects.

This paves the way for adding support for
https://github.com/dart-lang/language/issues/731 (improved inference
for fold etc.), which will require deferring type analysis of function
literals.  By not hoisting them, we will be able to avoid a lot of
unnecessary complexity in the logic to defer them.

Change-Id: I0a49aa9f769f0506569e6029a3697898308600c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241007
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-04-20 14:24:28 +00:00
Vyacheslav Egorov d2126a3d5b [vm] Avoid deadlocks when launching subprocesses
Forked process should use _exit() rather than exit()
when exiting without exec-ing otherwise it risks
to hit an issue (e.g. deadlock) in an atexit handler.

Additionally `man fork` states:

> After a fork() in a multithreaded program, the child can
> safely call only async-signal-safe functions (see
> signal-safety(7)) until such time as it calls execve(2).

_exit is on the list of async-signal-safe functions, but
exit is not.

Fixes b/216834909

TEST=runtime/tests/vm/dart{,_2}/regress_b_216834909_test.dart

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-android-release-arm64c-try,vm-kernel-mac-release-x64-try
Change-Id: Ia67f23825fc0ee1c1918faf2d4ef3b81033263eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241608
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2022-04-20 13:55:59 +00:00
Clement Skau 1320e644d5 [infra] Make test.py --build fail fast.
Currently, running `test.py --build` will attempt to build
the necessary files, before running the tests specified.
However, the tests are run even if this build fails, which
usually means old build artefacts are used for running the tests.
This can lead to some very confusing results if you do not yourself
catch that the build failed half-way through the run.

This change makes `test.py` exit with an error code and a message,
and does not proceed with the tests, if the build fails.

TEST=Manual testing locally.
Change-Id: I4e0f1d3f8d695219f2e4c0d7b474542af136aca9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241740
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2022-04-20 13:55:58 +00:00
William Hesse f2c6a374e1 [infra] Update firefox browser to 98.0.2
The checked-in Firefox browser used for testing is updated from
version 67 to version 98.0.2

Bug: https://github.com/dart-lang/sdk/issues/48318
Change-Id: I78bfb404ad1203496e19df5b48102338b9800fc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240720
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2022-04-20 13:18:19 +00:00
Johnni Winther 6bf48988c8 [cfe] Add test for type arguments on map().toList()
This updates the analysis helpers to add a test for the `map().toList()`
problem addressed in https://dart-review.googlesource.com/c/sdk/+/241605

Included in the CL is the addition of the 'analyze.dart' tools, which
can be used for advanced code searches. This was used to find the
occurences of `map().toList()`.

Change-Id: I6e9da282e37fde4534ed5e308260f092779d0750
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241744
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-04-20 12:28:18 +00:00
Johnni Winther f26c0e2056 [cfe] Add explicit type argument to .map(...).toList()
Expressions like

  List<VariableDeclaration> variables = ...
  List<Expression> reads = variables.map((v) => VariableGet(v)).toList()

don't get the intended type argument `<Expression>` through inference,
but instead the type inferred from the return type of the closure, in
this case `<VariableGet>`.

This causes problems when used with the AST which assumes that
expressions are interchangeable wherever they are used, and is likely
the cause of https://github.com/flutter/flutter/issues/102077 .

This CL adds an explicit type argument in these cases.

TEST=general/infer_map

Change-Id: I0bcae21f06c54f290dc20686b0d84c065d8ea04c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241605
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-04-20 06:56:58 +00:00
Stephen Adams 35c78ac66b [dart2js] Migrate more of entities.dart
`entities.dart` is now a migrated library.
The definitions formerly moved to `entities_migrated.dart` have been
moved back.

There are a few methods of ParameterStructure that can't yet be
migrated.

The unmigrated methods of ParameterStructure have been moved to static
methods of ParameterStructureMethods and static extension methods in
`entities_parameter_structure_methods.dart`.

These methods will eventually be moved back into ParameterStructure.

The long file name is chosen to sort next to `entities.dart`.

Change-Id: Ie9e798315287b196db694fe66c323a92bc1a1f1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241701
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-04-20 04:46:57 +00:00
Jake Macdonald f89178147a cleanup cruft file
Change-Id: Iaeea86dbc1f0691d2a1610dda1f7c2dbe077c222
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241460
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2022-04-20 04:41:37 +00:00
Brian Wilkerson 505ea90b9c Convert remaining completion domain methods to handlers
Change-Id: I674d42d2647158d0e399298149acd95ead84ed08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241691
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-04-20 04:29:47 +00:00
Devon Carew f46b40f01b Update the sdk lower bounds for analyzer, dds.
Change-Id: Ia7814d39ecdc87bf0c445c63e100b154703cd0a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241300
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-04-20 00:10:27 +00:00
Ryan Macnak 4c7840d330 [dart:io] Publish implementations of the VM file callbacks.
TEST=ci
Change-Id: I481b6fe3e7eae02ff7f2c94fa2f60bef0a972b3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241685
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-04-19 23:27:17 +00:00
Ryan Macnak 907f7dd4ae [test] Forward flags such as --enable_asserts --no-sound-null-safety to test subprocess.
Bug: https://github.com/dart-lang/sdk/issues/48833
Change-Id: I56ecc67a21d32f881b6a0ceec05a35eab8e6e2fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241625
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-04-19 23:04:07 +00:00
Alexander Thomas 7e8ceadc03 Reland "[infra] Update checked-in SDK to 2.17.0-266.1.beta"
This is a reland of commit bf2c56afbf

Original change's description:
> [infra] Update checked-in SDK to 2.17.0-266.1.beta
>
> Bug: https://github.com/dart-lang/sdk/issues/48818
> Change-Id: Ic0658c7b60f12911f974f6580b3e378569b509c1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241516
> Auto-Submit: Alexander Thomas <athom@google.com>
> Reviewed-by: William Hesse <whesse@google.com>
> Commit-Queue: William Hesse <whesse@google.com>

Bug: https://github.com/dart-lang/sdk/issues/48818
Change-Id: I24bf97ec016594db94e3eba53fe10fc7c179fb00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241688
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-04-19 22:52:47 +00:00
Paul Berry 21b3e4f3da Consolidate common code between the two type schema environment tests.
Change-Id: I014f6024372e57577026f0a1f2dda905899c3b00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241200
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-04-19 22:25:17 +00:00
pq 97b9f3f1cf fix over-application of unnecessary_string_escapes
Follow-up from: https://dart-review.googlesource.com/c/sdk/+/240905

Change-Id: I3b05a9f7cac9f58697d2feec086bc60f44285605
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241049
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-04-19 22:16:47 +00:00
Devon Carew 2a20d4be24 [pkg] ensure each publishable package has a repository pubspec field
Change-Id: I06c0d10c87c3f329098352a7abe9ef9fa0b1532e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241504
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-04-19 22:13:51 +00:00
Stephen Adams 5620ce110f [dart2js] late field helper need global impacts
This ensures that the helpers are seen as being part of the main unit
for deferred-load compiles.

Prior to this change, debug dart2js would assert:

$ sdk/bin/dart2js_developer  --test-mode --packages=.packages benchmarks/OmnibusDeferred/dart/OmnibusDeferred.dart  --out=om1c/o.js
org-dartlang-sdk:///lib/_internal/js_runtime/lib/late_helper.dart@343+1:
Internal Error: The compiler crashed when compiling this element.
The compiler is broken.

When compiling the above element, the compiler crashed. It is not
possible to tell if this is caused by a problem in your program or
not. Regardless, the compiler should not crash.

The Dart team would greatly appreciate if you would take a moment to
report this problem at http://dartbug.com/new.

Please include the following information:

* the name and version of your operating system,

* the Dart SDK build number (build number could not be determined), and

* the entire message you see here (including the full stack trace
  below as well as the source location above).

The compiler crashed: 'package:compiler/src/deferred_load/output_unit.dart': Failed assertion: line 272 pos 12: 'unit != null': No output unit for member j:method(throwLateFieldNI)
#0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
#2      OutputUnitData.outputUnitForMember (package:compiler/src/deferred_load/output_unit.dart:272:12)
#3      OutputUnitData.hasOnlyNonDeferredImportPaths (package:compiler/src/deferred_load/output_unit.dart:306:33)
#4      KernelSsaGraphBuilder._tryInlineMethod.heuristicSayGoodToGo (package:compiler/src/ssa/builder_kernel.dart:5922:12)


Change-Id: Ic31c4894105a9a22eb0821a489c8dd2a4e3d0110
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241686
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-04-19 22:06:47 +00:00
Paul Berry 790bc74b5c Modify analyzer's techniques for fixing type parameters during inference.
Previously, the analyzer didn't actually fix the type parameters; it
simply stopped accumulating type constraints for them, and then
re-inferred them in later rounds of inference.  In theory this doesn't
actually fix the type parameters, since a type parameter can have an
"extends" constraint that causes it to depend on other type
parameters; if those type parameters change in later rounds of
inference, then the re-inferred type parameter might actually wind up
changing.  In practice I haven't been able to construct a
(non-erroneous) case where this actually occurs, but to make the code
easier to reason about, I think it's better to actually fix the type
parameters when we say we do.

This change makes the analyzer's type inference logic more similar to
the front end's type inference logic.

Change-Id: Ia1f86a27eaca98520903a2aba9d0359afd59e36f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241680
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-04-19 22:05:48 +00:00
Devon Carew 7378f6824b add a tools/OWNERS_GOOGLE3 owners file
Change-Id: I4b72b489a4057bfe1ab7b71058e853b81a13c00e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241046
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-04-19 21:31:07 +00:00
Mark Zhou b58d5f7cb6 [dart2js] Using strings for info ids for json dump info
Helps readability and ease of debugging for dump info.

Note: IDs only shadow each other for Class and ClassType info objects,
but these are already disambiguated with a serializedId that prepends
the info type to the ID.

Change-Id: Ie9862d474436cba85a972f567f606c1e3190b929
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240917
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-04-19 20:51:35 +00:00
Sam Rawlins 11a01c8fad Add a progress bar to completion_metrics
Progress bar largely taken from
https://github.com/dart-lang/sdk/blob/main/pkg/nnbd_migration/lib/src/utilities/progress_bar.dart

If there's a good common place (in package:analyzer?) to put this,
I'd be happy to do so.

Change-Id: Ic64ac98d8a8f5ae1cc036932364f37f10b837055
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-04-19 20:40:19 +00:00
Jake Macdonald aa1596735a support Set instances in macro arguments, add some more testing of various supported Argument types
Change-Id: I0d61a6d88dba41421fe8f3cbd3e14c62bbfa4843
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241682
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-04-19 20:18:38 +00:00
Alexander Aprelev e5c5963ef0 Revert "[infra] Update checked-in SDK to 2.17.0-266.1.beta"
This reverts commit bf2c56afbf.

Reason for revert: skia dart->engine autoroller still uses `pub`, which is removed in this update

Original change's description:
> [infra] Update checked-in SDK to 2.17.0-266.1.beta
>
> Bug: https://github.com/dart-lang/sdk/issues/48818
> Change-Id: Ic0658c7b60f12911f974f6580b3e378569b509c1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241516
> Auto-Submit: Alexander Thomas <athom@google.com>
> Reviewed-by: William Hesse <whesse@google.com>
> Commit-Queue: William Hesse <whesse@google.com>

TBR=whesse@google.com,athom@google.com

Change-Id: Ibf5c8a277b900c05d917d9b765f38252edb968b9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/48818
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241684
Reviewed-by: Alexander Aprelev <aam@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-04-19 19:50:37 +00:00
Devon Carew 285e40ed95 [infra] validate pkg/ dep ranges against the packages DEP'd in
Change-Id: I17eac35f0cb1c88dc838b39fa2ac352799c4fd50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241210
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-04-19 19:25:47 +00:00
Mayank Patke 7187b2efe9 [dart2js] Lower late field checks during SSA.
Change-Id: I80e7a30c6f2a461e46b4f52ebf7eb7a13fbc6227
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240501
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2022-04-19 19:01:27 +00:00
Ryan Macnak 32715d1d5b [vm] Mark ELF libraries produced directly by the VM as not requiring an executable stack.
Even if the main program disables executable stacks, dlopen'ing a library that doesn't itself disable executable stack will switch the stack to executable. (Presumably in the name of compatability with GNU nested functions.)

Dart does not need executable stacks, and executable stacks are an additional attack surface.

TEST=readelf
Bug: b/229648756
Change-Id: Ia8c234ebc6178a26528d37b1359a10dd42039a9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241540
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-04-19 18:51:47 +00:00
Stephen Adams d2eb2197a3 [nnbd_migration] Roll up proposed edit count in header
The "Proposed Edits" panel displays the number of edits, but only when
this number not immediately displayed below and would need to be
calculated.

Change-Id: I89793305876d5488c9d14b03a91470ae3f4fe4f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241340
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-04-19 18:20:57 +00:00
Paul Berry 0ae5ca163b Rework type inference logic to avoid redundant constraint gathering.
Previously, the front end would perform downwards and upwards
inference using separate TypeConstraintGatherer objects.  This meant
that any constraint gathering work performed during downwards
inference had to be repeated during upwards inference.

This change avoids the extra work by using a single
TypeConstraintGatherer object for both downwards and upwards
inference.

This should help pave the way to implementing support for
https://github.com/dart-lang/language/issues/731 (improved inference
for fold etc.)

Change-Id: Ib4031ab1397d6a8547a705f386632de0e4dd1a2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241120
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-04-19 18:08:12 +00:00
Robert Nystrom e5c83a3961 Update the set of directories scrape ignores containing language tests.
Since tests of our internal tools often deliberately contain edge cases
and unusual code constructs, scrape supports ignoring Dart files in
those directories in order to focus on more representative code.

This updates that ignore list to handle all of the various
compiler-related packages I could find.

Change-Id: I4006d2b3b14a81572f27db0b65e6c6194c4f7f54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241506
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-04-19 18:06:47 +00:00
Danny Tuppeny 84fbee066e [analysis_server] Add KEYWORD highlight/semantic token for "var" in for loop
Fixes https://github.com/Dart-Code/Dart-Code/issues/3932.

Change-Id: Ie37dfb884761e0f23c05c9eb2ec5ea7f98f02a82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-04-19 16:59:47 +00:00
Stephen Adams 47474fbcff [dart2js] Remove most of elements/operators.dart
The rich hierarchy of operators is no longer relevant since parsing
was moved to the common front-end.

All that remains is a Set of operator names that can be used to
declare instance methods.

This set is used for picking the 'operator' variety of Selector. I'm not
sure we even need operator selectors, but I am leaving that for future
consideration.

Change-Id: I7337c0cf82a3cb8f7ebf5fa17a737bac3a83f48b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241560
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-04-19 16:29:33 +00:00
Jonas Termansen effff0bbbc [benchmarks] Remove .packages from benchmark commands.
Bug: https://github.com/dart-lang/sdk/issues/48275
Change-Id: Ief3ff323726bdbb1870e989deb5372d88c3f4f3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240843
Auto-Submit: Jonas Termansen <sortie@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2022-04-19 16:22:29 +00:00
Danny Tuppeny 422c23a9db [analysis_server] Wait for analysis context rebuilds when obtaining parsed/resolved results in LSP handlers
Fixes https://github.com/Dart-Code/Dart-Code/issues/3929.

Change-Id: I3176a603785b5e9546a4c1d7c3f818396eaec4bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241606
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-04-19 16:21:28 +00:00
Sam Rawlins 9c778054d1 Suggest 'else' in an if-element
Bug: https://github.com/dart-lang/sdk/issues/36733 and https://github.com/dart-lang/sdk/issues/48837
Change-Id: I4c846426c17fa7ebc5dd544b24f1667945a9f1a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241214
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-04-19 16:08:21 +00:00
Danny Tuppeny be1caec9a0 [analysis_server] Fix textDocument/implements test
Change-Id: I6b99f4e17d19c99ad520cebd27a2cb738abdb683
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241601
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-04-19 16:07:10 +00:00
Konstantin Shcheglov 994b2e2f47 Deprecate newAnalysisOptionsYamlFile2(), use newAnalysisOptionsYamlFile().
Change-Id: Ia86808f649459e6c4c9c7d4e488273c1e593a85b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241515
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-04-19 15:49:57 +00:00
Konstantin Shcheglov 75819df327 Remove link2()
Change-Id: I2e180238c40a220c995e35e6ff2796358ceca480
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241514
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-04-19 15:48:13 +00:00
Devon Carew 9f398fd728 move runtime/tools/wiki/xref_extractor to package:lints
Change-Id: Ifdf6419bf42baa4dc6df1b4e140e6239d379fe36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240916
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-04-19 15:39:57 +00:00
Brian Wilkerson 52e7099c66 Move state out of the completion domain so that handlers can share it
Change-Id: I71381f11725af109f5c6f67fa8ec28f04ab475a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241513
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-04-19 15:37:37 +00:00
Johnni Winther bf5aa0603d [cfe] Remove JumpTarget.parent
Only the 'fileUri' property was used, so we pass it directly instead.

Change-Id: I7b47f18f7ebc2c50036c5202e469caad4ba35897
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241009
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-04-19 14:27:37 +00:00
Chloe Stefantsova 6b2ee2d01f [cfe] Apply a recovery step for 'const' for-in variables
Closes https://github.com/dart-lang/sdk/issues/48808

Change-Id: I68177a6eb7f0a5d64dee6eca9befa9957863f26c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241604
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-04-19 14:09:27 +00:00
Chloe Stefantsova e307c0b6c4 [cfe] Allow extension members with names as Object static members
Closes https://github.com/dart-lang/sdk/issues/48834

Change-Id: If756cf5b3416b2ed9953fe577b8b2e9490a70dd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241603
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-04-19 13:54:07 +00:00
Johnni Winther 4258a05798 [cfe] Remove LibraryBuilder.addBuilder
Remove LibraryBuilder.addBuilder to let the implementations in
SourceLibraryBuilder and DillLibraryBuilder to change independently.

Offset argument removed from DillLibraryBuilder.addMember and
'addX' members are in DillLibraryBuilder are made private.

Change-Id: If239ae441655d3d7f7484fd5e809cc015effd78c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241005
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-04-19 12:37:47 +00:00