Commit graph

91431 commits

Author SHA1 Message Date
Robert Nystrom cd5883fa85 Migrate "n" through "p" directory language tests off @compile-error.
The "@compile-error" comment is an old not-great way of defining static
error tests.

Change-Id: I6564643302f66c5920b38d2269c160099322560b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296421
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2023-04-20 17:56:18 +00:00
Robert Nystrom 924b9f55ba Migrate "l" and "m" directory language tests off @compile-error.
The "@compile-error" comment is an old not-great way of defining static
error tests.

Also fix a test to use a mixin declaration instead of a class for declaring a mixin. This was
broken by class modifiers but the breakage was masked by @compile-error treating a test as
passing if any compile error, even an unrelated one, is reported.

See: https://github.com/dart-lang/sdk/issues/45634
Change-Id: I5d1d387002d886cb87340e2559bf8ed01c3f2d6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296409
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2023-04-20 17:51:42 +00:00
Martin Kustermann 9bdd2ff1de [vm] Cleanup unused include, unnecessary fields on [Thread], rename mutator thread, ensure setjmp drains sticky error
Some cleanups factored out of a larger CL (which refactors enter/exit of threads):

  * remove unused `#include "vm/thread_registry.h"`
  * remove unused/unnecessary fields from [Thread] object
  * rename IsMutator() -> IsDartMutator()
  * make tests using setjmp() drain the sticky error
    => to ensure there's no sticky error on isolate shutdown

TEST=ci

Change-Id: I53935e8bd0628ab3768627d6d5e01c3f0e3a57ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296582
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-04-20 17:42:06 +00:00
Derek Xu 32c595ea89 [VM/Timeline] Add getPerfettoVMTimeline Service RPC
TEST=Loaded the response from a getPerfettoVMTimeline request in the
Perfetto trace viewer and made sure everything looked correct.

Change-Id: I8d4bc35fb36601701976c28653db92b2161e4724
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288066
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-20 16:42:23 +00:00
Derek Xu 4b2f4c6977 [VM/Timeline] Update CLI options to make it clearer that the Perfetto file recorder records to a file
TEST=Manually verified that the modified CLI options worked as expected, CI

Change-Id: Ibaa308e5c9c3b96c939e2007ee2eaaca30eae280
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288063
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-20 16:42:23 +00:00
Derek Xu 6785f8ece7 [VM/Timeline] Add a heap-buffered packet as a class member of TimelineEventRecorder
This CL removes the packet_ member in TimelineEventPerfettoFileRecorder
and adds a packet_ member to TimelineEventRecorder. This member will be
used when sending Perfetto traces through the VM Service.

TEST=manually verified that traces recorded with the Perfetto file
recorder still contained correct information, CI

Change-Id: I796369ea0832c265a04e37d91bc09f93967979a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288061
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-20 16:42:23 +00:00
Derek Xu 20a8899318 [VM/Timeline] Factor out the parts of recorders' PrintJSON methods that iterate over events
This will allow us to reuse the shared logic when returning Perfetto
traces through the service. This CL also changes some pointer parameters
to const reference parameters.

TEST=manually verified that traces recorded with the JSON file
recorder still contained correct information, CI

Change-Id: I70ac5183959dd8c6efeb55d4891a8e00d3550ca5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288060
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-20 16:42:23 +00:00
Derek Xu ac415f30c5 [VM/Timeline] Add PopulateTracePacket method to TimelineEvent
TEST=manually verified that traces recorded with the Perfetto file
recorder still contained correct information, CI

Change-Id: I4bd132dd9e703274ffc262eb7e000e6ee6df4bf8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287923
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-20 16:42:23 +00:00
Derek Xu f62620d361 [VM/Timeline] Create perfetto_utils namespace
TEST=CI

Change-Id: Id6f1df83f5d7e34b8ff1f2c5ab9891d0ab3326a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288022
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-20 16:42:23 +00:00
Derek Xu 6fb71e7237 [VM/Timeline] Add AsyncTimelineTrackMetadata class
TEST=manually verified that traces recorded with the Perfetto file
recorder had correct async track names, CI

Change-Id: Icca1b92d164299140565972b4be8c6c9b7338159
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288021
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-20 16:42:23 +00:00
Derek Xu afa3594ca1 [VM/Timeline] Support flow events in the Perfetto file recorder
This supports flow events reported through dart:developer, but does not
support ones reported with Dart_TimelineEvent in dart_tools_api.h. That
will have to be supported in a future CL.

TEST=CI, manually verifying that flow arrows appeared on flow events in
the trace viewer for traces recorded with our Perfetto recorder

Change-Id: Ic75a8ce277b436a609c027c2c0d4e94b51031aa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280740
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2023-04-20 16:42:23 +00:00
Ahmed Ashour 6e821873fd [analysis_server] renameParameter data-driven fix
to handle a method with a diagnostic

Fixes #51198

Change-Id: I6a1921747912318d81121d58c88fccc35d1f809a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282261
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-04-20 16:22:54 +00:00
Konstantin Shcheglov e8622f2d63 Issue 52059. Don't suggest final/var in ObjectPattern in ForEachPartsWithPattern, suggest getters instead.
Bug: https://github.com/dart-lang/sdk/issues/52059
Change-Id: If5e1c40fa75735077b2b77a5941d16fe2c767f3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-20 16:14:58 +00:00
Ryan Macnak 8eeb03cec2 [vm] Prefix assembler tests so they can be run as a group.
TEST=ci
Change-Id: Ibd004d72e761334b3f1a12c82123f8e0ea179de2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296380
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-04-20 16:14:51 +00:00
Jonas Termansen 6585fcf1d2 Delete promote script.
The promote script has been replaced by the promote recipe.

Remove unused code from bot_utils.

Bug: b/277727317
Change-Id: I6a087c11d6e98480d346017c97be82bf23438aed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296260
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2023-04-20 15:41:11 +00:00
Ryan Macnak 1aed900be7 [infra] Migrate Android JIT FFI builders to sound NNBD.
Change-Id: Ifa93f7329bf988a73e406e7978488a0abbc06ae4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296020
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-04-20 15:37:20 +00:00
Danny Tuppeny facfcf0f92 [dds/dap] Handle some additional error causes when resuming isolates
Fixes https://github.com/flutter/flutter/issues/125064.

Change-Id: I521fe29d0f269694dc6c2b993d1e400c495b0605
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296560
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-04-20 14:55:23 +00:00
Konstantin Shcheglov 493f36690f Allow analysis_server/ access not yet imported libraries from src/ in analyzer/.
Change-Id: I0b4119965bdb83149117a02f885fe8362f69915f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296502
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-20 14:32:38 +00:00
Alexander Thomas 9814aaf662 [infra] Mark new vm-dwarf/obfuscate configs as sound null safe
Without this, they will run _2 suites by default.

Change-Id: Ica435675c467875a7f3dbab6cf05994835dd0ab5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296583
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-04-20 14:19:51 +00:00
Daco Harkes 4cb4d5d036 [pkgs/native] MacOS support + CI
Pulls in a new versions of https://github.com/dart-lang/native with
support for MacOS and enables the tests for these on the MacOS pkg
bots.

Fixes the clang paths in pkg/test_runner/lib/src/options.dart for
mac and win.

Since a relatively recent XCode is available on the bots, use XCode
to build rather than the clang from DEPS.

test/native_toolchain/recognizer_test was refactored to only
run tests for tools installed on the host. So it's unskipped.

Bug: https://github.com/dart-lang/sdk/issues/50565
Change-Id: I3804b01da7a4e74d3e49a1b2ba3c8425132417d7
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296180
Reviewed-by: Liam Appelbe <liama@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-04-20 14:17:39 +00:00
Alexander Thomas 4e8b58ceb9 [infra] Update checked-in SDKs to 3.0.0-417.2.beta
Change-Id: Ic8667dd0be2a03c8bb57424904c545b4ec335ccc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296540
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
2023-04-20 09:20:10 +00:00
Konstantin Shcheglov 1df4267a7e Issue 47562. Suggest only *.dart files in 'package:' URIs.
Bug: https://github.com/dart-lang/sdk/issues/47562
Change-Id: I4f575bca1377b8f5065d4c4ff95f326b6a2a168b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296442
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-04-20 01:28:53 +00:00
Brian Wilkerson 2da2520bd6 Stop suggesting methods in object patterns
Fixes: 52058
Change-Id: I031fcd2b48975729cca48f640c3d86f5d2cfc0b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296420
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-04-20 00:52:20 +00:00
Sam Rawlins 398a3d377c Bump linter to 82e7147cee2a62b881bcf9cc26f06e531510a92d
This bump brings in two false-negative fixes:

* 4c2af04303
* 82e7147cee

These have been tested in google3 and are clean.

Change-Id: I8cba338b91b4b5a383506216b7362352132b48f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296382
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-04-20 00:40:17 +00:00
Stephen Adams b3fbb59d60 [dart2js] Construct _SyncStarIterator outside of transformed code
In the old scheme, sync* generators would have an entry and a
body. The entry contained typed checks and the body had injected code
to call a 'factory' helper method to construct the _SyncStarIterable.
It was necessary to pass the element type to the body to be passed to
the factory.

    int foo(T a, T b) sync* {yield f(a); yield f(b);}

is compiled to something like

    foo(a, b) {
      T._as(a); T._as(b);
      return foo$body(a, b, type$.int);
    }
    foo$body(a, b, R) {
      return _syncStarFactory(function(){BODY}, R);
    }

When type checks were disabled (`-O3`), it was often possible to
generate a single function by merging these as there were no checks.

The new scheme keeps the entry and body separate, and constructs the
_SyncStarIterable in the entry:

    foo(a, b) {
      T._as(a); T._as(b);
      return _syncStarFactory(foo$body(a, b), type$.int);
    }
    foo$body(a, b) {
      return function(){BODY};
    }

This keeps the typed Dart 'level' distinct from the untyped JavaScript
level.

The new scheme is a bit more verbose but has the advantage that the
call to `_syncStarFactory` can be inlined and optimized.

Change-Id: I13802d9c9eefd9323841670d059b75a81569d6cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296140
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-04-20 00:38:10 +00:00
pq 76f76b05bb use existing CorrectionUtils instance
Change-Id: Ia9c20fb70cd665b6c4a024c2f83d6e7ca5b0220a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296422
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-04-20 00:05:02 +00:00
Robert Nystrom 27ef9f0762 Migrate "r" directory language tests off @compile-error.
The "@compile-error" comment is an old not-great way of defining static
error tests.

See: https://github.com/dart-lang/sdk/issues/45634
Change-Id: I5dd012381390ef2c00d674308db3fe099ecc6a4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296423
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2023-04-19 23:35:16 +00:00
Konstantin Shcheglov 6dcca7824a Produce InvertIfStatement only when both then/else branches are Block(s).
Other cases are outliers and nobody actually want it there.
Specifically, the way it works for if-then-elseIf does not make sense.

Change-Id: I8d16e689e057fa79ecfaa2c3155086cf36f1954c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296406
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-04-19 23:21:36 +00:00
Robert Nystrom c305279e0d Migrate "g" - "i" directory language tests off @compile-error.
The "@compile-error" comment is an old not-great way of defining static
error tests.

See: https://github.com/dart-lang/sdk/issues/45634
Change-Id: I65c446e00b25239960d421489e6cf87a88d875d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296408
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2023-04-19 22:09:18 +00:00
Konstantin Shcheglov 1d718fc7e9 Issue 52051. Fix a crash, add a branch for RecordLiteral in _argumentListContext()
Bug: https://github.com/dart-lang/sdk/issues/52051
Change-Id: I2c8c2271cc51fbe1c013c6ac324052c347dd379b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296361
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-19 22:07:59 +00:00
Konstantin Shcheglov 6a50756f98 Remove 'Introduce new local with tested type' assist.
If the type checked expression is a local variable, it is useless.
The variable is already type promoted.

If the type checked expression is not a local variable, it produces
code that has a compile-time error because of downcard, which does
not work anymore with null safety.

Even generating `final x = expression as MyType` would be bad IMHO.
Unproven type casts are dangerous.
What the user should do, it to extract into a local variable, and
type check it. Or use patterns. But this is a different story.

Change-Id: Ifd3dc71894d17c5a07b7f1389a8143363697eda2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296384
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-19 21:53:09 +00:00
DEPS Autoroller 4a4163f703 Roll gn from ffeea1b1fd07 to 5a004f9427a0
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/gn-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com,dart-engprod@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in gn: https://bugs.chromium.org/p/gn/issues/list
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try;luci.dart.try:dart-sdk-mac-try;luci.dart.try:dart-sdk-mac-arm64-try;luci.dart.try:dart-sdk-win-try
Change-Id: Ib61c36726ad2d0b1c3557df99dc7d446c18e0be2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296240
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-04-19 21:39:47 +00:00
Nicholas Shahan 2a56d8ba84 [ddc] Fix RecordImpl instanceof test
The `instanceof` operator needs a reference to the JavaScript class
instead of the Dart Type. This avoids an issue when changing the
type representation in the new runtime type system where the two
are no longer interchangeable.

Update the parameter name for `_jsInstanceof()` which which was
probably the remnants of a copy paste.

Change-Id: I1d3fcf1915fb3e189ad7f3e130e101009ee50381
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296341
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-04-19 21:32:33 +00:00
Stephen Adams 0698c194ae [dart2js] Fix impact test by adding @dart=2.19
Rerun with `-g` to update stale impacts.

Change-Id: I6aa8140c41d4478fa12c006e94f6a3618bfb3d17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296404
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-04-19 21:09:57 +00:00
Srujan Gaddam 91f2d6a621 [dart:js_interop] InlineExtensionIndex should handle multiple libraries
Since we no longer only do lowerings at the declaration site, the
InlineExtensionIndex class needs to handle libraries besides the
current library. This is because when lowering at the invocation
site, the target might not be in the current library.

Change-Id: Ifcf6cc63ce7e6f86b3408c9830e1244215598bf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296381
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-04-19 20:18:47 +00:00
pq 4451d5d9f5 follow ups from https://dart-review.googlesource.com/c/sdk/+/296066
(The last change was prematurely merged.)

Change-Id: Idc161ef596fa43927cf7eda223635a798d3292af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296402
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-19 20:13:03 +00:00
Konstantin Shcheglov d84f9dca32 Ensure that ExecutableMember.returnType uses the same type parameters.
Change-Id: I72d900da7e0d6b791e7801af72961cf4c23c4fc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296340
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-04-19 19:01:57 +00:00
pq 45ec8be7aa reference rewriting for destructured object pattern variables
I'll do some tidying up and restructuring when I add similar support for records...

Change-Id: I4124cdc5e6ecb12e54ab4570636e1f8cc9afa6c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296066
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-04-19 18:59:59 +00:00
Alexander Markov cf3e602869 [test harness] Handle non-zero exit code of a test as a test failure, not infra failure
Sometimes failing tests crash or terminate with arbitrary exit codes.
For example, MSAN can abort a test with exit code 1.
This should not be treated as an infra failure by the test harness,
and should not prevent running other tests.

Change-Id: I97450d9cfb1e117451c35ab8a8cd01074fbef8db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291304
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-04-19 17:49:22 +00:00
Lasse R.H. Nielsen b0260187e7 Remove base from StreamView.
It's not *needed* for safety or soundness, and it forces
subclasses to be `base` whether they want to or not.

Bug: https://github.com/dart-lang/async/issues/238
CoreLibraryReviewExempt: Removes a modifier, no implementation effect.
Change-Id: I72ec1ddb3b05b746c08437b0b8173c9e71673fc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296280
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2023-04-19 17:41:29 +00:00
Alexander Markov 7247a1b3b7 Reland "[vm] Avoid expanding/flattening type arguments vectors in Type objects"
This is a reland of commit 135443706b

Original change's description:
> [vm] Avoid expanding/flattening type arguments vectors in Type objects
>
> Previously, vectors of type arguments were expanded to include type
> arguments corresponding to superclasses both in the instances of
> generic classes and in Type objects (after type finalization).
> As a result, Type objects after finalization could be recursive and
> need to use extra TypeRef objects to break loops. The finalization of
> types was very complex and sometimes slow.
>
> This change simplifies the representation of Type objects: now they
> always have short type argument vectors, corresponding only to
> the type parameters of their own classes (both before and after
> finalization). Vectors of type arguments in the instances of generic
> classes are still expanded/flattened.
>
> This greatly simplifies type finalization, makes Type objects
> non-recursive and removes the need to create and handle excessive
> TypeRefs for type arguments corresponding to superclasses,
> as those type arguments are no longer included into types.
> The only remaining use of TypeRefs is for bounds of type parameters.
>
> In order to expand/flatten type arguments, new methods Type::GetInstanceTypeArguments / Class::GetInstanceTypeArguments
> are introduced. They build canonical declaration type arguments
> once (for each class), and then instantiate them as needed.
>
> There are also simple helper methods to shrink type arguments (TypeArguments::FromInstanceTypeArguments) and expand type arguments without filling type arguments corresponding to superclasses (TypeArguments::ToInstantiatorTypeArguments).
>
> Time of edge case 'regress_51960_test' 15min -> 300ms.
>
> TEST=ci, runtime/tests/vm/dart/regress_51960_test.dart
>
> Fixes https://github.com/dart-lang/sdk/issues/52022
> Fixes https://github.com/dart-lang/sdk/issues/51960
>
> Change-Id: I75b466b74698a33c0bb5e1dcbd29542e413812a1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295060
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Alexander Markov <alexmarkov@google.com>

TEST=runtime/tests/vm/dart/regress_b_278841863_test.dart
Fixes b/278841863.

Change-Id: Ib1e20055bfb26e1df0a077300c69f0bec7152480
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296300
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-04-19 17:25:31 +00:00
Konstantin Shcheglov ac1bdebff7 Support for converting 'if' statements with bool conditions into patterns.
Bug: https://github.com/dart-lang/sdk/issues/52068
Change-Id: I187b3e3cad66eff7a266478df0c09ffb3d642e34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296067
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-19 17:24:54 +00:00
Konstantin Shcheglov dc34fe9f86 Deprecate IfElement/IfStatement.condition, use 'expression'.
Change-Id: If43b4b71a21fd256ce8d1367d4b233e1cff764b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296122
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-04-19 17:17:28 +00:00
Konstantin Shcheglov ad30add7a3 Don't use PubWorkspace for 'third_party/dart' locations.
These should be treated as BlazeWorkspace.

Bug: https://buganizer.corp.google.com/issues/273584249
Change-Id: Id7bf03d14d3304eb062be0d539cfac0c282ecec6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-19 17:16:51 +00:00
Konstantin Shcheglov 7880fd4ce5 Remove UnwrapIfBody assist.
After using DAS with it for a few days, I find it more distracting
than useful.

Change-Id: I20da35e06958c79a6d458546937b616d45b0c909
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296281
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-19 16:56:43 +00:00
Joshua Litt 8158de08b2 [dart2wasm] Cleanup js interop logic a bit more.
Change-Id: Ibb814b3312c877a62351ec6f26412c84380b8359
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294700
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2023-04-19 16:54:15 +00:00
Daco Harkes 2847541a74 [infra] owners for third_party/pkg status files
Change-Id: I5baa813a75181f371636b44ee0b98141b641226f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296202
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-04-19 16:44:59 +00:00
Stephen Adams a6162d1ff0 [dart2js] Fix missing source location on null-check in async method
Change-Id: Idd2530b3cae582819a823132c9777086035e386a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296027
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-04-19 16:31:22 +00:00
Ryan Macnak 8a5c3d9e3d [infra] Add configurations to migrate obfuscate and stripped modes.
Change-Id: I62581c6874b211c57da61639f460685790acb40d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296021
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-04-19 16:26:59 +00:00
Robert Nystrom 105a0f30d6 Migrate standalone tests off @compile-error.
The "@compile-error" comment is an old not-great way of defining static
error tests.

Note that the behavior of the code under test here had changed
significantly, but the test didn't catch it at all because
"@compile-error" is too coarse-grained.

See: https://github.com/dart-lang/sdk/issues/45634
Change-Id: I4b6c4e1fd36770e13f7b5ca100b42b0b8b2983ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296121
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2023-04-19 14:17:39 +00:00