Commit graph

41482 commits

Author SHA1 Message Date
Chloe Stefantsova 23c0ff5dba [cfe] Implement desugaring of switch expressions
Part of https://github.com/dart-lang/sdk/issues/49749

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

Change-Id: Ie2524c7e5a1fc1a25f392eecbf2e444c89229923
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277685
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-01-02 10:16:35 +00:00
Johnni Winther 7cc63e4afe [cfe] Add test for switch on generic enum
Change-Id: I9ac215a4a0e24f4d1a7a5cfe043fe071fbed5002
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277980
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-01-02 09:55:17 +00:00
Chloe Stefantsova 9383820f15 [cfe] Desugar pattern variable assignments
Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: Ibae19d0e64f023aea047b007d73f3cee9910d259
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277683
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-12-30 15:44:37 +00:00
Johnni Winther 8e07d492dd [cfe] Support generic inline class constructors
Change-Id: Ibd12b14e1e8a1811734b4773c842e72a7fcb300c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277684
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2022-12-29 23:17:39 +00:00
Kallen Tu 2083db9cdb [cfe] Emit error for mixing in class outside of its library except mixin classes.
It is an error to mix in a class declaration that does not have the 'mixin' modifier, outside of its library for class declarations in a library version lower than sealed class' release version.

Change-Id: I318bb243705748eae60482b6c3513669f1cbb90c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275440
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-29 21:26:00 +00:00
Johnni Winther bf5fa95b4e [cfe] Handle inline class method access in inference visitor
Change-Id: Ifc0b6ecafc6f9223147a0aec772d2af279cae176
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277680
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-12-29 16:46:33 +00:00
Johnni Winther 40be3ef64e [cfe] Support inline class constructor bodies
This disables the support for instance method access which needs to
be implemented differently. This will be done in a follow-up.

Change-Id: I2cd50cc4c7aba73859a7e1d81af975d87f10254a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277640
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-12-29 15:10:43 +00:00
Johnni Winther d74965e319 [cfe] Check inline class constructor initializers
Change-Id: I6872ccd948f679e1e0b04b9f59bea833df11d5a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277141
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-12-28 16:34:14 +00:00
Johnni Winther 851332b3be [cfe] Add ClassDeclaration and ConstructorDeclaration interfaces
This prepares for supporting constructors in inline classes.

Change-Id: I54e5c873f9352182fd197fe52177fc841fed426e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277101
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-12-28 14:34:10 +00:00
Ahmed Ashour f8307ed296 [cfe] fix order of pattern fields
Fixes #50826

Change-Id: I5e71c4dd0e4f937c4570e4851cd4c1e3446d888a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277003
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2022-12-28 09:50:27 +00:00
Kallen Tu cdd9e43b2c [analysis_server] Add semantic highlighting for sealed class modifier.
Enable the 'sealed-class' experiment for the highlighting test and add the highlighting for the modifier.

Change-Id: I6affdab506c29ab9d92b2d6315a93d09396bafaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277201
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-12-27 23:24:40 +00:00
Stephen Adams d5eeeb3585 [dart2js] Start using useDataKinds again
Change-Id: Ief4887873dbdb493bf164658393cd0e998e05e6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277361
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-12-27 21:37:30 +00:00
Chloe Stefantsova f1ce203361 [cfe] Add desugaring of simple cases of pattern variable declaration
The late variables aren't supported in this CL.

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

Change-Id: Iebc50f716e3575c6dd7bce915e5e294d4c8c8363
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276525
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-23 09:30:39 +00:00
Nicholas Shahan b84aa5a7f9 [ddc] Cleanup uses of ignored cli args
The `-k`, `--kernel`, and `--dart-sdk` flags are ignored by DDC.

Change-Id: Ic2bf5c87a26cab7dcbcfeafa39dae1ea1b20c711
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277180
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-12-22 21:50:08 +00:00
Siva Annamalai dcaf392d34 Revert "[3.0 alpha][VM/Service] Update VM Service spec to v4.0"
This reverts commit c21f7c847c.

Reason for revert: Appears to cause issues when flutter app is launched with VSCode or Android Studio, please see https://github.com/flutter/flutter/issues/117526

Original change's description:
> [3.0 alpha][VM/Service] Update VM Service spec to v4.0
>
> This CL updates the VM Service spec to version 4.0 in order to add
> support for records. Some deprecated procedures and properties will also
> be removed in v4.0.
>
> As described in service.md's changelog, this CL:
> Adds `Record` and `RecordType` `InstanceKind`s, adds a deprecation
> notice to the `decl` property of `BoundField`, adds `name` property to
> `BoundField`, adds a deprecation notice to the `parentListIndex`
> property of `InboundReference`, changes the type of the `parentField`
> property of `InboundReference` from `@Field` to `@Field|string|int`,
> adds a deprecation notice to the `parentListIndex` property of
> `RetainingObject`, changes the type of the `parentField` property of
> `RetainingObject` from `string` to `string|int`, removes the deprecated
> `setExceptionPauseMode` procedure, removes the deprecated `timeSpan`
> property from `CpuSamples`, and removes the deprecated `timeSpan`
> property from `CpuSamplesEvent.
>
> TEST=CI
>
> Issue: https://github.com/dart-lang/sdk/issues/49725
> Change-Id: I7bf61c1ba11a0c7fd95a10c9c02c14282062b802
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268521
> Commit-Queue: Derek Xu <derekx@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

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

Issue: https://github.com/dart-lang/sdk/issues/49725
Change-Id: Ieb2a09653192e165ea8cf68965647e346e3a318b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277181
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Auto-Submit: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2022-12-22 20:19:00 +00:00
Nate Biggs 612cc3b7af [dart2js] Prep ssa/builder.dart for null safety migration.
Change-Id: I7ff792c38bd2257bcff55186e9f6f0cabf5f9021
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277160
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-22 19:19:17 +00:00
Kallen Tu d968d14314 [analyzer/cfe] Use the 'class-modifiers' flag for the 'mixin' class modifier.
Separating the class modifiers from the 'sealed' modifier.

Change-Id: Ifec865c9f612b147706be9b7c797167ef6788e90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277043
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-22 17:49:58 +00:00
Nate Biggs 0cf81391a5 [dart2js] Migrate ssa/branch_builder.dart to null safety.
Change-Id: I8d968b65cda73e391232c2cde872424439e93bb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277081
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-22 17:44:27 +00:00
Nate Biggs 76cb3cc372 [dart2js] Migrate ssa/loop_handler.dart to null safety.
Change-Id: I0391fe611d55d63a18540ea5e3410da585a377ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277080
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-22 17:44:27 +00:00
Jackson Gardner ce741bb017 [dart2wasm] Emit closures and contexts for subexpressions of asserts.
Change-Id: Ibe0741d360caa4747ad4a3eea888b1a9661af111
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277050
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
2022-12-22 16:27:39 +00:00
Johnni Winther 3374fb5043 [cfe] Remove forEachDeclaredConstructor and forEachDeclaredField from SourceClassBuilder
+ make the iterators generic functions to filter on the member
type and use the iterators instead.

Change-Id: I24f636e37ab5e1a7f0cbdac9523d79ebc093e1bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276904
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-12-22 13:13:18 +00:00
Tess Strickland 73c639a4ba Reland "[native_stack_traces] Remove initial spaces check in stack trace lines."
This is a reland of commit ae4ee87601

Our Dart tests that check for symbolic stack traces assume the frame
number comes at the very start of the line. Thus, be lenient about
how many spaces we see before non-symbolic stack traces, but only
generate a prefix for the resulting symbolic stack traces if the
original stack trace had any initial non-whitespace content.

Original change's description:
> [native_stack_traces] Remove initial spaces check in stack trace lines.
>
> The strictness of the old "check for four spaces" was causing failures
> in `flutter symbolize`, and there's no reason to check how much initial
> whitespace we got prior to the line contents anyway.
>
> TEST=pkg/native_stack_traces/test/convert/regress_262474517_test
>
> Change-Id: I6a6e31732cb2a5b5d40a088b9a04877052726be2
> Bug: b/262474517
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276905
> Reviewed-by: Daco Harkes <dacoharkes@google.com>
> Commit-Queue: Tess Strickland <sstrickl@google.com>

Bug: b/262474517
Change-Id: I3b0753404e00d535cf438e79078736f5d9a10dbc
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277001
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-12-22 11:52:18 +00:00
Chloe Stefantsova 1f55c4ce32 [cfe] Add desugaring of non-matching rest pattern
Closes https://github.com/dart-lang/sdk/issues/50797

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

Change-Id: Ide77d1ee262f8778de7eb8743b04508ee290ee10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276940
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-12-22 11:25:05 +00:00
Nate Biggs e53332946a [dart2js] Migrate ssa/jump_handler.dart to null safety.
Change-Id: I23475740209738302e17ef298394bccb847a341f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277060
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-22 00:21:28 +00:00
Nicholas Shahan b9469f452a [ddc] Always explicitly pass null safety mode
Add explicit mode flags for DDC related compiles.

Change-Id: Icb9e21a4b8786a0de620bcc387cafbe8d27d0e86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277042
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2022-12-21 23:35:45 +00:00
Chloe Stefantsova 90b799a3b1 [cfe] Implement desugaring of ObjectPattern for simple cases
This CL doesn't cover, among other, the following

* Non-class identifiers
* Some erroneous cases

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

Change-Id: I9c6aa9194c09cc2b10b438892b26a01c260e1baf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275923
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-21 22:10:45 +00:00
Nicholas Shahan 1c3a92cdb9 [test] Explicitly pass sound mode flag
Change-Id: I1e6f7fbc96cddbb8a98a5a3f32bfeab792ce1bbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277041
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-12-21 21:50:48 +00:00
Kallen Tu 9c8749db96 [analyzer/cfe] Add an experiment flag for class modifiers.
Flag for 'base', 'final', 'interface' and mixin classes.

Change-Id: I51037678826527a36b6dae731f43c8f36fead215
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276765
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-21 21:44:32 +00:00
Nate Biggs 69d60f72c4 [dart2js] Migrate ssa/locals_handler.dart to null safety.
Change-Id: Ie01a5451ecfe2acda124d89cb2c59f78ffccccf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276980
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-12-21 21:39:48 +00:00
Nate Biggs 5440e8fa02 [dart2js] Migrate ssa/string_builder.dart to null safety.
Change-Id: Iff1fe6e9fb1a6090546f01e00dc2155b69afc272
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276962
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-12-21 19:57:40 +00:00
Nate Biggs a7a0d6e30a [dart2js] Migrate ssa/type_builder.dart to null safety.
Change-Id: Idfb9485214112eae4a95b44a7361874eae9acc64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276961
Reviewed-by: Stephen Adams <sra@google.com>
2022-12-21 19:57:40 +00:00
Nate Biggs 19c3e21a3c [dart2js] Prep SSA builder and associated files for null safety migration.
Change-Id: I7c1c9a816d380cf566690747ee9a64784c8f185a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276960
Reviewed-by: Stephen Adams <sra@google.com>
2022-12-21 19:57:40 +00:00
Jackson Gardner 061a9fbefb [dart2wasm] Add --enable-asserts flag.
Change-Id: I4cc9a55673374926e8b19cccf2be9888f166553d
Bug: https://github.com/dart-lang/sdk/issues/50801
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276772
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-12-21 19:53:14 +00:00
Ahmed Ashour 60a8ba16de [analysis_server] offer fixes for TEXT_DIRECTION_CODE_POINT_*
Fixes #50790

Change-Id: Id8f135e090406f235f488a497ba277032cb1e900
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276644
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-21 17:20:52 +00:00
Tess Strickland ba8db1976c Revert "[native_stack_traces] Remove initial spaces check in stack trace lines."
This reverts commit ae4ee87601.

Reason for revert: Broke integration tests on precompiled bots.

Original change's description:
> [native_stack_traces] Remove initial spaces check in stack trace lines.
>
> The strictness of the old "check for four spaces" was causing failures
> in `flutter symbolize`, and there's no reason to check how much initial
> whitespace we got prior to the line contents anyway.
>
> TEST=pkg/native_stack_traces/test/convert/regress_262474517_test
>
> Change-Id: I6a6e31732cb2a5b5d40a088b9a04877052726be2
> Bug: b/262474517
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276905
> Reviewed-by: Daco Harkes <dacoharkes@google.com>
> Commit-Queue: Tess Strickland <sstrickl@google.com>

TBR=dacoharkes@google.com,sstrickl@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I83bfa2d09570d8ae4d244b987bd5acf855e57306
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/262474517
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277000
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-12-21 17:13:48 +00:00
Tess Strickland ae4ee87601 [native_stack_traces] Remove initial spaces check in stack trace lines.
The strictness of the old "check for four spaces" was causing failures
in `flutter symbolize`, and there's no reason to check how much initial
whitespace we got prior to the line contents anyway.

TEST=pkg/native_stack_traces/test/convert/regress_262474517_test

Change-Id: I6a6e31732cb2a5b5d40a088b9a04877052726be2
Bug: b/262474517
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276905
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-12-21 12:47:54 +00:00
Ömer Sinan Ağacan 7155cf140d [dart2wasm] Fix return values of dynamic sets
New passing tests:

- language/optimize/allocation_sinking_inlining_test
- language/rewrite/compound_assign_test

Change-Id: I633f0c9bbdcdbcb0b9aa3109a8704edf4f765cb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276903
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2022-12-21 11:07:43 +00:00
Aske Simon Christensen e148f7f386 [dart2wasm] Defer the generation of closure trampoline bodies
This avoids a cyclic dependency for constant instantiation when a
tear-off constant is used as a default value in the torn-off function.

Change-Id: I4257f2a5313a4dbed91eb555944031eb0dadd65d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276501
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2022-12-21 10:53:28 +00:00
Aske Simon Christensen 15e0a1542a [dart2wasm] Put types of exported functions in singleton rec groups
This is necessary for compatibility with Binaryen's requirement that
publicly visible function types are not allowed to be in the same
recursion group as a GC type in closed-world mode.

Change-Id: Ia826ecaf2a0c0cfe3af3c322dec3d8fb60cd16be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276083
Reviewed-by: Ömer Ağacan <omersa@google.com>
2022-12-21 08:25:28 +00:00
Nicholas Shahan 34b5537c18 [test] Compile .dill file with sound null safety
- Migrate the file being compiled to sound null safety.
- Use sound null safety and the sound SDK outline to compile the
.dill file used in this test.
- Removed the assumption that test runs on an x64 processor.
- Added a simple throw to echo the errors from running the
compile.

Change-Id: Iec6bda8c981c1e69603313e4d74f1eb491734b09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276801
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-12-20 22:45:38 +00:00
Sam Rawlins e38a7046fb Revert "Revert "Remove preview-dart-2 option in analysis options""
This reverts commit 6d05f249ff.

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

Change-Id: I6f0d177708d88a4cfd52710684642d03fee8743a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276761
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-12-20 19:25:37 +00:00
Ahmed Ashour dc3b2025af [analysis_server] associate UNNECESSARY_QUESTION_MARK
with `RemoveQuestionMark`

Fixes #50793

Change-Id: Idd2131c4a305c6d224bf80e79fd6986feb0a4587
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276645
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Oleh Prypin <oprypin@google.com>
2022-12-20 17:03:04 +00:00
Nate Biggs 398d47cd10 [dart2js] Add priority to dartDeferredLibraryLoader hook.
Change-Id: Ib77b20fc56aa67b4f3318f9dcd8fa65b62c56509
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275800
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-20 15:39:09 +00:00
Josh Soref 419df9d3e5 Spelling pkg compiler
Closes https://github.com/dart-lang/sdk/pull/50774

GitOrigin-RevId: 41028b5de4e2e0719e08f180e32ccc1f2bef8dac
Change-Id: I5e6675d490a44feb0ea008582879266e421939f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276561
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2022-12-20 13:06:29 +00:00
Jens Johansen 6bce0d6b7a [parser] Breaking change for metadata parsing
https://github.com/dart-lang/language/blob/master/accepted/future-releases/records/records-feature-specification.md#ambiguity-with-metadata-annotations

Change-Id: I47e584868f2a12a2553cbd57e3e5b8fbacaa5f27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272600
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-12-20 11:22:58 +00:00
Ömer Sinan Ağacan f74929e8e6 [dart2wasm] Check argument types for covariance
Fixes 53 tests.

Change-Id: Ibdf919e3db3aceda7cec12cf3d9f765c8f0680bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276085
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2022-12-20 11:10:44 +00:00
Chloe Stefantsova e724a13cd3 [cfe] Implement desugaring for simple switch statements
This CL doesn't cover the following features, among others.

* Guard clauses.
* Multiple patterns per case body.
* Labels.

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

Change-Id: I8de86785c44eecbe6e2167dc7a97d9281249af3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276524
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-12-20 10:12:52 +00:00
Ömer Sinan Ağacan 29ea94227b [dart2wasm] Remove redundant null check in throw expressions
Change-Id: I90ddbc675b2caf24853ac4270099587281b6fd4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276420
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-12-20 07:43:32 +00:00
Konstantin Shcheglov 468123d066 Report UNCHECKED_OPERATOR_INVOCATION_OF_NULLABLE_VALUE when the matched type of a relational pattern is nullable.
Change-Id: I7532eaa772f0af6e0612efdcdb2c098923d363b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276580
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-12-20 04:45:03 +00:00
Stephen Adams 9e115addbf [dart2js] Fix slow analysis of word widths #50759
The `bitWidth` computation sometimes visits a large dependency DAG a
tree. This change fixes the performance problem.

- Cache results from previous visits. This fixes the occasional
  exponential time.

- Move computation earlier 'instruction selection'. This allows the
  result to be used for detecting when assignment-ops can be used. I
  didn't see any changes due to this.

- Strengthen bitWidth computation to fall back on type inference results.


Bug: 50759
Change-Id: I482cc7d3b8a1e9af5798d22252cd9bc111be711d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276301
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-19 23:51:09 +00:00