Commit graph

90711 commits

Author SHA1 Message Date
Ryan Macnak
2cc96bfa0b [vm] Add an ABI for Fuchsia RISC-V.
https://fuchsia.dev/fuchsia-src/contribute/governance/rfcs/0211_fuchsia_on_risc-v

TEST=./tools/build.py -mrelease -asimriscv64 gen_snapshot_fuchsia gen_snapshot_product_fuchsia
CoreLibraryReviewExempt: VM-only
Change-Id: Ie62addda6c15a5b44e814c49b543319aef4fc5e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281869
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-20 20:46:27 +00:00
Paul Berry
bbc5ce328d flow analysis: eliminate unused field _scrutineeSsaNode.
This field is no longer used; the SSA node for the scrutinee is now
looked up using the scrutinee's promotion key.

Bug: https://github.com/dart-lang/sdk/issues/50419
Change-Id: I67768fa1311cecf62508844d3074758fbf55b426
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287941
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-03-20 20:30:11 +00:00
Konstantin Shcheglov
19e64e3dc1 Fix FunctionBody.isPotentiallyMutatedInScope() for 'PatternAssignment'.
Change-Id: I11eac50b22a82e2b3afe07ba886c28682f258752
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289884
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-20 20:14:47 +00:00
Konstantin Shcheglov
9674f63f13 Issue 51792. Simplify tests for FunctionExpressionInvocation on RecordType(s).
Bug: https://github.com/dart-lang/sdk/issues/51792
Change-Id: Ib63fa571905d41eed1f59e260bf47118ef1b05c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289882
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-20 20:10:19 +00:00
Derek Xu
d7a26dc078 [VM/Service] Prevent VmServerConnection from converting SentinelExceptions into RPCErrors
TEST=CI, ran `flutter run -d chrome --debug` with the changes in this CL
applied to the vm_service directory in the pub cache and ensured that
this if-statement was entered
8679aeb235/packages/flutter_tools/lib/src/vmservice.dart (L1020-L1024)

Fixes: https://github.com/dart-lang/sdk/issues/51752
Change-Id: I2cec21bbb065b697fa34bd37c80b38f5eb9f493f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289940
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-03-20 20:03:48 +00:00
Johnni Winther
980486f386 [cfe] Add test for issue 50897
Closes #50897

Change-Id: Ic538d8cb1f7c3f5c09a6d1e2a9367577bb1856d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289820
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-20 19:58:47 +00:00
Brian Wilkerson
3a7c7909a2 Specify the message request for the legacy protocol
Change-Id: Iecfa9228f3f17451da3efb403f54a3be17166353
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289541
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-03-20 19:26:07 +00:00
Nate Biggs
75be947317 [dart2js] Do some simple null safety clean ups.
- Mostly just removes asserts that are redundant with sound null safety. - Moves 3 classes `ClassRelation`, `DataSink` and `DataSource` back into their original files.
- Removes StrongModeConstraintInterface which was only needed for migration.
- Adds a couple simple late finals.

Change-Id: I921ac84a22cebd509f629f88be6bbb19d3c0a9e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289720
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-03-20 19:14:27 +00:00
Stephen Adams
73a8e6d970 [dart2js] Account for labels with switch-continue loops
A switch containing switch-continue statements is compiled to a loop
to re-enter the switch. This needs to be accounted for in determining
if a break or continue needs a label.

Fixes:
co19/Language/Statements/Continue/async_loops_t10
co19/Language/Statements/Labels/scope_t04

Bug: #51696
Bug: #48791
Bug: #46290

Change-Id: I4d96d2cb0958052c737b25f0ad55c3c350c304c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289660
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2023-03-20 18:56:38 +00:00
Danny Tuppeny
53319cf221 [dds/dap] Remove breakpoints and resume when trying to terminate test runs
Fixes https://github.com/Dart-Code/Dart-Code/issues/4447.

Change-Id: I9c18fccde101596135d3ea7324bbbd24fb5330c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289825
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-03-20 18:21:50 +00:00
Devon Carew
00972339e6 [pkg/vm_snapshot_analysis] update the readme for tool name changes
Change-Id: I0ea1f228d7d3405b0da24858fd5f03aa7e2c8ce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289442
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-03-20 17:57:51 +00:00
Devon Carew
c61241f926 [deps] rev args, benchmark_harness, clock, csslib, dartdoc, protobuf, shelf, tools, vector_math, webdev, yaml_edit
Revisions updated by `dart tools/rev_sdk_deps.dart`.

args (9305d5a..7a5e3b0):
  7a5e3b0  2023-03-14  Devon Carew  update readme; add contributing doc (#237)

benchmark_harness (a6a0891..725534a):
  725534a  2023-03-14  Kevin Moore  Spelling fixes, latest lints, move to minilibs (drop parts) (#85)

clock (5abb481..984642e):
  984642e  2023-03-15  Kevin Moore  Require Dart 2.19, use and fix recommended lints (#46)

csslib (b671738..d32bdd4):
  d32bdd4  2023-03-14  Devon Carew  refactor the package example (#170)

dartdoc (98fa859..7fde7a4):
  7fde7a4d  2023-03-13  dependabot[bot]  Bump github/codeql-action from 2.2.5 to 2.2.6 (#3363)

protobuf (75bc380..b90a4c4):
  b90a4c4  2023-03-16  Mahdi K. Fard  Sort message constructors first. (#807)
  00fd975  2023-03-15  Kevin Moore  Fix formatting with latest SDK (#808)
  a67bbb3  2023-03-15  dependabot[bot]  Bump actions/cache from 3.2.4 to 3.2.6 (#804)

shelf (e3cfe79..9a792b4):
  9a792b4  2023-03-13  Kevin Moore  Update format for latest v3 SDK (#340)
  c8094b7  2023-03-13  Kevin Moore  Update no-response.yml - once a day (#339)

tools (e5353aa..8d18d01):
  8d18d01  2023-03-15  Elias Yishak  Implement fake ga client (#37)

vector_math (1e4d000..7dec984):
  7dec984  2023-03-16  eoineoineoin  Add operator== to Quaternion (#288)

webdev (cfe9753..c2c8b17):
  c2c8b17  2023-03-16  Elliott Brooks (she/her)  Prepare Webdev version `3.0.2` for release (#2037)
  d124fa5  2023-03-16  Elliott Brooks (she/her)  Prepare extension for release (#2036)
  aef715d  2023-03-15  Elliott Brooks (she/her)  Prepare DWDS 18.0.1 for release (#2035)
  a15fde0  2023-03-15  Anna Gringauze  fix matching record types (#2032)
  05031da  2023-03-14  Anna Gringauze  Update build_daemon constraint and log errors (#2029)
  49013b8  2023-03-09  Elliott Brooks (she/her)  [MV3 Debug Extension] Fix authentication issue for the Dart Debug Extension (#2026)
  c8d4439  2023-03-09  Elliott Brooks (she/her)  Support `Set` inspection in DWDS (#2024)
  442639d  2023-03-08  Elliott Brooks (she/her)  Handle unexpected extension debugger disconnection events without crashing app (#2021)

yaml_edit (6abc42a..fbc5cb3):
  fbc5cb3  2023-03-09  Kevin Moore  Require Dart 2.19, update to latest lints
  c9e82f0  2023-03-09  Mohamed Ishad  Fix YamlEditor.update method leaving trailing spaces at eol (#42)

Change-Id: Icf15fc0ffd3ee36e0380751d18fd491de071040e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289881
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-20 17:45:37 +00:00
Srujan Gaddam
65e0bd3fca Reland "[dart:js_interop] Add literal constructors for inline classes"
This reverts commit 49f85335d5.

Reason for revert: Fixes the original breakage by adding an explicit
cast for the map function that's used to compute positional args
of the stub. Adds refactoring to better separate out the logic
between procedure-level and invocation-level lowering configs.

Also refactors optional argument functions so that they can use the
invocation-level lowering configs created in this CL. Also fixes
a small issue where object literal constructors wouldn't work in
dart2js if the surrounding library didn't have a @JS annotation.

Original change's description:
> Revert "[dart:js_interop] Add literal constructors for inline classes"
>
> This reverts commit 1f6d4ae1a8.
>
> Reason for revert: Broke Flutter with dart2wasm
>
> Original change's description:
> > [dart:js_interop] Add literal constructors for inline classes
> >
> > Adds @ObjectLiteral annotation to denote object literal constructors,
> > and implements it in all the backends. For dart2js, this involves
> > modifying the SSA and for dart2wasm, we create a one-per-shape
> > forwarding procedure to a specialized JS method that returns the
> > literal. This also modifies @anonymous semantics in dart2wasm to
> > be consistent with the other backends.
> >
> > CoreLibraryReviewExempt: Backend-specific, just adding annotation.
> > Change-Id: I4d7a9ea9ed097f4f378709b40f8bd74f02e26b23
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283922
> > Commit-Queue: Srujan Gaddam <srujzs@google.com>
> > Reviewed-by: Joshua Litt <joshualitt@google.com>
>
> Change-Id: Ifce611e1150d8aa275f9e312743bded56a572176
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285342
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Joshua Litt <joshualitt@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>

CoreLibraryReviewExempt: Reland.
Change-Id: Iac52e9ff152dc06788d78b7b18549c7005921b74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285346
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-03-20 17:41:49 +00:00
Nate Biggs
765dbf7f32 [dart2js] Stop emitting dill by default during global inference serialization.
This dill is a duplicate of the one emitted during closed world since the Kernel AST is not modified any more.

In case someone were to want to run the closed world and global inference phases together (e.g. `dart2js --write-data-uri=global.data main.dart`), keep the option to write the dill file with global inference results by allowing them to manually provide the `--out` flag.

Change-Id: Icac6a510ed74a6d095b54ba398897818f1a1efe6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289581
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-03-20 17:37:34 +00:00
Devon Carew
baff2375c3 [dds] updates to the dart devtools app size cli flags
Change-Id: I049a98452ec5f8e4e322e2cb9687aaa702819937
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289449
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-03-20 17:33:46 +00:00
Jake Macdonald
2fc9ea5ad7 copy language/mixin tests to language/mixin_legacy with 2.19 opt out
Change-Id: Ice509ea1f0efec8153fb2380ab0e980fed552b0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289580
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-03-20 17:29:31 +00:00
Devon Carew
d9fdec8129 [sdk] no longer generate <sdk>/lib/_internal/strong.sum
Change-Id: I54d9e8751508db2602a142d0977c4e3b9381ac33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289443
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-03-20 17:25:43 +00:00
Ben Konyi
a62bfec074 [ Service ] Allow for case insensitive URI mappings on Windows and MacOS
The Windows and MacOS file system can be case insensitive, so the following
two URIs can be equivalent:

 - file:///c:/foo/bar
 - file:///C:/Foo/Bar

Since it's possible for tooling to request a mapping for a URI that
isn't an exact case-sensitive match to that found in the URI mappings
cache, requesting a mapping for the inexact match will fail even though
the paths are potentially equivalent.

This change allows for lookupPackageUris and lookupResolvedPackageUris
to correctly handle paths that are not case-sensitive matches to entries
in the URI mappings cache on Windows and MacOS.

TEST=uri_mappings_lookup_test.dart

Change-Id: I35134c47bf3bd04bc452373b31b4eb5893ba1435
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288821
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-03-20 17:21:27 +00:00
Konstantin Shcheglov
4faf18deaf Issue 51718. Support for function expression invocation on RecordType(s).
Bug: https://github.com/dart-lang/sdk/issues/51718
Change-Id: I1f4b52eb6f5a741b77b2d1b5e7d9131531c4c00a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289740
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-20 16:03:11 +00:00
Jake Macdonald
f5321673ad [macros]: Add new class modifiers to ClassDeclaration
Change-Id: I9aa2b0156a99674cd377bb7686a9f70c38642ff6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289084
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2023-03-20 15:55:04 +00:00
William Hesse
39ecf5f9d2 [io] Calling flush after close on File.open's IOSync should not throw an exception
The documentation of IOSync states that calling flush on a closed IOSink may have no effect:
https://github.com/dart-lang/sdk/blob/main/sdk/lib/io/io_sink.dart#L109
The future returned by close in the new implementation does not complete until after
a call to flush has completed.
The previous implementation of File.open did not throw when calling flush after close.

CoreLibraryReviewExempt: IO only, restoring previous semantics
Bug: b/274405250
Change-Id: I56bbe02e886085cc8156e60264f5b77593c8a075
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289823
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
2023-03-20 15:33:04 +00:00
Johnni Winther
6d2e6f9452 [cfe] Improve switch encoding
Addresses https://github.com/dart-lang/sdk/issues/51554#issuecomment-1466946211

Closes #51391

TEST=existing

Change-Id: Idec105dcfde4a91d0a21a1907777d6c07e5f01b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289224
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-03-20 15:21:52 +00:00
Lasse R.H. Nielsen
b2f4cf3e01 Add class modifiers to dart:convert.
The usual approach:
Pure interfaces marked `interface`.
Pure implementation classes marked `final`.
Base classes marked `base` or nothing, and `mixin class` if reasonable.
Combined X/XBase/XMixin where possible.

CoreLibraryReviewExempt: Aske is away
Change-Id: I927f9bd488fb385ff9c17c8fc94920a1f5076347
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289200
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-03-20 13:27:17 +00:00
Lasse R.H. Nielsen
82d91ea541 Add class modifiers to dart:_internal.
The only exported type is `BytesBuilder`, which is a pure `interface`.

CoreLibraryReviewExempt: Aske is away
Change-Id: I1756e066689192ac4ea8485c3e1259d79473c583
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289320
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-03-20 13:16:06 +00:00
Lasse R.H. Nielsen
162ff41b0e Add class modifiers to dart:async.
* Pure interfaces marked `interface`. That's most public classes.
* `Stream` made `mixin class`, as a proper skeleton/base implementation.
* `Zone` classes made all `final`.

Added some `<void>` to raw `Future` types.

CoreLibraryReviewExempt: Aske is away.
Tested: No functionality change, only added restrictions.
Change-Id: I91d09fbcdba7d0dfdff3887bc7c9d54364c88b05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289221
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-03-20 12:12:46 +00:00
Zach Anderson
7471994270 Revert "[vm/ffi] Add class modifiers"
This reverts commit 1755f89092.

Reason for revert: This is a breaking change and is blocking the Dart -> Flutter roll. See https://ci.chromium.org/ui/p/flutter/builders/try/Mac%20Unopt/26896/overview.

Original change's description:
> [vm/ffi] Add class modifiers
>
> Adds class modifiers to `dart:ffi`.
>
> Migrates all user-defined subclasses of `Struct`, `Union`, `Opaque`,
> and `AbiSpecificInteger` to be `final class`es.
>
> Does not remove the manual error checking, so some errors will show up
> twice now in language version 3.0. In language version <3.0, only the
> FFI-specific error will show up.
>
> In a follow-up CL, we will try to make the language-errors to show up
> also <3.0 so that we can remove the FFI-specific errors.
>
> Examples of duplicated errors:
> pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart
>
> TEST=pkg/analyzer/test/ (for the analyzer)
> TEST=pkg/front_end/testcases/ (for the CFE)
> TEST=test/ffi/ (for the VM)
>
> CoreLibraryReviewExempt: No need for dart2js to review.
> Bug: https://github.com/dart-lang/sdk/issues/51683
> Change-Id: I2964ceccb7db59fbdaf6be5319f5e4ec2dabe0f3
> Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289223
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Devon Carew <devoncarew@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Jackson Gardner <jacksongardner@google.com>
> Reviewed-by: Lasse Nielsen <lrn@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>

Bug: https://github.com/dart-lang/sdk/issues/51683
Change-Id: Ie5b8a08aea6d64b1991ace4814322b21ffb670c7
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289640
Commit-Queue: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-03-20 11:15:59 +00:00
Martin Kustermann
171744589a [vm] Mark _registerServiceExtension entrypoint conditional on being non-product mode
The runtime should only call this in non-product mode, we should be able
to tree shake it in product mode.

TEST=ci

Change-Id: Ic8628b1e239f123894efc5a79253b8d6a9b56a73
CoreLibraryReviewExempt: Doesn't change API
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289780
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-03-20 11:00:53 +00:00
Alexander Markov
2d5c46c871 [vm/compiler] Do not assume that LoadField is performed from a record of a compatible shape
Compiler can see an unreachable code like this:

v1 <- Constant(Record (C, C))
if v1 is (C, C, C) {
  v2 <- LoadField (v1.$3)
}

So it should check that record type of the receiver has enough fields
before querying field type in LoadField.

TEST=co19/LanguageFeatures/Patterns/matching_record_*

Fixes https://github.com/dart-lang/sdk/issues/51767
Issue https://github.com/dart-lang/sdk/issues/49755

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: Iac42c8edf3d22dce0061b6d75e8bdf51b7bf88e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289540
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-03-20 08:30:36 +00:00
Robert Nystrom
10f53cb4c6 Remove incorrect part of int-to-double test.
Switch statements on ints aren't required to be exhaustive.

Change-Id: I85701b098cacf9d01241dab821ae4c70f04a0710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289450
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2023-03-18 01:54:56 +00:00
Sam Rawlins
9833cb477c [analyzer] Move 4 more HintCodes to be WarningCodes, NON_CONST*, NULL_CHECK*, STRICT_RAW_TYPE
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: Idcac3ddb582e5b46263fd017c39402b1c11914d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289447
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-18 01:48:49 +00:00
Konstantin Shcheglov
35b7f2dd97 Update to expect either 'dynamic' or a subtype in irrefutable context.
https://github.com/dart-lang/language/pull/2926

Change-Id: Ic9fd0b097ca70c15a184269a10e8a87eb34bb79d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289440
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-03-18 00:30:08 +00:00
Srujan Gaddam
9ce261faec [pkg:js] Update SDK upper constraint to 4.0.0
Change-Id: Ia41ee7f1f8705e06c4d75f7a2c4e673d92d64af2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289446
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2023-03-17 23:08:31 +00:00
Robert Nystrom
6de72778ff Add tests for where coercions do and don't happen in patterns.
These tests reflect the intended behavior after
https://github.com/dart-lang/language/pull/2926 lands.

Change-Id: I7ce1991dfc9b247b0c6ce6ee2714b5f207a4040d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289404
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2023-03-17 23:04:25 +00:00
Nate Biggs
71a6e8be8f [dart2js] Add unit tests for RecordTypeMask operations.
Change-Id: I03d988ffda39fa2416f429f464cb23aedbd1f44f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289083
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2023-03-17 22:50:44 +00:00
Nate Biggs
a2719b5552 [dart2js] Make use of new RecordTypeMask for creation of record literals/constants as well as record field accesses.
All calls on records are no longer treated as essentially dynamic calls.  So a call to `record.foo` will not pull all `foo` members into the program (including unused ones). For example in the below test the getter `any` was causing `JSArray.any` to be included in the program. After this change it is no longer pulled in.
https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Records/members_A04_t02.dart#L39

Change-Id: If1f9eac1abadeeed80dca917a8912129d090643e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287681
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2023-03-17 22:50:44 +00:00
Nate Biggs
2e05ad2fda [dart2js] Add RecordTypeMask to type mask domain.
This implements all the subtyping relationships for records as well as any other predicates needed for the abstract value domain.

In the next CL we make use of this new mask when constructing the types for record literals and when accessing fields of a record.

Change-Id: Ibf12b95e439e2c12be9e4db51f5023df379d48f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288101
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2023-03-17 22:50:44 +00:00
Mayank Patke
0d583f707c [dart2js] Add failing test for issue #49588.
Bug: #49588
Change-Id: If19b956642ff55ca6d54e7b9df21cbc516d05d93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253710
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2023-03-17 21:32:22 +00:00
Nicholas Shahan
bd62be296c [tests] Avoid imports across null safety suites
Updates imports in `tests/lib_2` from `tests/language` to use the
version in `tests/language_2` instead.

I think it is also a little awkward to import libraries across
tests suites period but that is an issue for another day.

Change-Id: Ib61bb1e1790926f92ee2650a6497916f2edce7ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289407
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-03-17 20:03:37 +00:00
Mayank Patke
a2307a1110 [dart2js] Use CFE static types for variables in null-safe libraries.
Fixes: #49588
Change-Id: Ib0de059f17660450385253061dc1e313a5671309
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289060
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-03-17 19:44:34 +00:00
Mayank Patke
62e3c47e45 [dart2js] Don't rely on == null promoting to Null in rti.dart.
Although the true branch of `x != null` and the false branch of `x ==
null` promote `x` to non-nullable, the opposing branches do not promote
`x` to `Null` in the current flow analysis spec, which applies to the
CFE.

When switching from the dart2js static type computation to the CFE
static type computation, attempting to use `x` in these branches may
generate an unintended type check, which can overflow the stack if this
occurs in code responsible for performing type checks. The fix is fairly
straightforward - we can simply use an unchecked cast (via `JS`) instead.

See https://github.com/dart-lang/language/issues/1505 for discussion on
why the expected promotion does not (yet) occur.

Change-Id: Ia9cca4e1aa8e9c67b42c60189f0d3811afb61360
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289061
Reviewed-by: Stephen Adams <sra@google.com>
2023-03-17 19:44:34 +00:00
Nate Bosch
6f45c8534e Bump matcher to dc310d95663da10a90e7898cd4e322695f693d4f
Changes:
```
> git log --format="%C(auto) %h %s" c1a0704..dc310d9
 https://dart.googlesource.com/matcher.git/+/dc310d9 Export more APIs through the expect library (213)
 https://dart.googlesource.com/matcher.git/+/7538872 Make the arguments to `expect` dynamic again (212)
 https://dart.googlesource.com/matcher.git/+/52e232e Fix import and broken tests (211)
 https://dart.googlesource.com/matcher.git/+/985e4ef Improve mismatch description of `contains` (206)
 https://dart.googlesource.com/matcher.git/+/5bc765d Copy expect and async matchers from test package (210)

```

Diff: https://dart.googlesource.com/matcher.git/+/c1a07043de3da4968e1736fcde1c521802821859..dc310d95663da10a90e7898cd4e322695f693d4f/
Change-Id: I11b074e97c9c49ba46760da44a99f795523d3008
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289445
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2023-03-17 19:44:30 +00:00
Daco Harkes
1755f89092 [vm/ffi] Add class modifiers
Adds class modifiers to `dart:ffi`.

Migrates all user-defined subclasses of `Struct`, `Union`, `Opaque`,
and `AbiSpecificInteger` to be `final class`es.

Does not remove the manual error checking, so some errors will show up
twice now in language version 3.0. In language version <3.0, only the
FFI-specific error will show up.

In a follow-up CL, we will try to make the language-errors to show up
also <3.0 so that we can remove the FFI-specific errors.

Examples of duplicated errors:
pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart

TEST=pkg/analyzer/test/ (for the analyzer)
TEST=pkg/front_end/testcases/ (for the CFE)
TEST=test/ffi/ (for the VM)

CoreLibraryReviewExempt: No need for dart2js to review.
Bug: https://github.com/dart-lang/sdk/issues/51683
Change-Id: I2964ceccb7db59fbdaf6be5319f5e4ec2dabe0f3
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289223
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-03-17 19:29:41 +00:00
Mark Zhou
80c2b02bd0 [ddc] Adding a runtime flag for real deferred loading in DDC
Change-Id: If50f7437c827a32829f5093cb3a14cbc5e55f7a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289340
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
2023-03-17 18:04:48 +00:00
Jake Macdonald
2cec283bd0 update covariant setter test to test mixin class behavior also
Change-Id: I8f87f5d2d7745719462e0782176b04a595cdd5f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289521
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-03-17 17:38:49 +00:00
Ilya Yanok
d190e16766 Fix handling of @Injectable functions
Recent changes that made migration tool more conservative affected
functions used in Angular's DI: functions annotated with `@Injectable`
must have non-nullable non-annotated arguments. Previously that
worked just because there was no reason to make them nullable.

Make such functions' arguments explicitly non-nullable.

Bug: b/250862403
Change-Id: I27207994b058ba845aafd7776d14380e8104e8f8
Tested: added a test
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289505
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
2023-03-17 17:28:41 +00:00
Johnni Winther
7cc2553fa1 [_fe_shared_analyzer] Use real exhaustiveness checking algorithm
This changes the analyzer and CFE to use the real exhaustiveness
checking algorithm. The fallback algorithm is kept and will be
removed once we know that the real exhaustiveness algorithm sticks.

Change-Id: Ic9df92c1ca9f7dec4cbdfa138dc6ed39ef2d4df5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288703
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-17 16:45:35 +00:00
Konstantin Shcheglov
771042f5ca Prepare to publish analyzer 5.8.0 and _fe_analyzer_shared 56.0.0
Change-Id: I09c65e9897fb8fe77c668fac8044da9b73b0f41a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289441
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-17 16:36:59 +00:00
Nicholas Shahan
cf7d78cc2c [dart2js] Run modular steps with sound null safety
Update the dart2js and kernel worker steps themselves to run
with sound null safety. This is separate from the code being compiled
in the step which will be migrated in another change.

Change-Id: Idbaaeb255209e79bb34aa34aedeb020be097c1c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289408
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2023-03-17 16:26:10 +00:00
Ivan Inozemtsev
4c70caf4df [deps] rev http
http (805a147..74f9d3d):
  74f9d3d  2023-03-09  Brian Quinlan  Add conformances test that verify that the Client works in Isolates (#889)
  ee03604  2023-03-09  Brian Quinlan  Add a flag to allow the default Client to be tree shaken away. (#868)
  2039fb3  2023-03-09  Brian Quinlan  Fix a reference count race with forwarded delegates. (#888)

Change-Id: I56faf5cf41ad16f6a365db66265b02e66adbc59f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289502
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
2023-03-17 16:25:08 +00:00
Jake Macdonald
3b06df241f Clean up a number of 2.19 opt outs in language tests.
This is less than half of them, will send some other chunks later.

Bug:51557
Change-Id: I4e80812a689fde99e23c34b6405aaf57cd431ce8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289261
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-03-17 16:17:50 +00:00