Commit graph

90333 commits

Author SHA1 Message Date
Ömer Sinan Ağacan 0ad9f2ec66 [dart2wasm] Move covariance checks from async inner to wrapper functions
New passing test: language/async/covariant_type_test

Fixes #51601

Change-Id: Id5e807b463db67d0e44842e375d35604e35398cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286462
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-03-08 11:22:51 +00:00
Martin Kustermann 91ea353298 [gardening] Make new standalone/io/exit_works_with_blocked_isolate_test be a nop in the training run
TEST=Fixes standalone/io/exit_works_with_blocked_isolate_test in app-jit mode

Change-Id: Icd4f43dfe524b5a9f8569a520a661289214bfddf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287461
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-03-08 10:22:46 +00:00
Vyacheslav Egorov 56ad16f4de [vm] Make VM strict about min required Mac OS X version.
Refuse to initialize VM if current Mac OS X version is below
MAC_OS_X_VERSION_MIN_REQUIRED, which was configured in build
time through mac_sdk_min GN argument.

TEST=tested manually by changing return value of MacOSXVersion

Cq-Include-Trybots: luci.dart.try:dart-sdk-mac-arm64-try
Bug: https://github.com/flutter/flutter/issues/121739
Change-Id: I9d913516077dbb196e8d6ebd7fe9f3914de7c748
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286932
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-03-08 09:08:39 +00:00
Nicholas Shahan d77e22a20b [dart2js] Update tests matrix entries
- Update options for existing configurations.
- Add one new configuration for running _2 test suites.
- Rename builders and update to run new configurations.

Tested: Tested with led runs.
Change-Id: I87de456b6b2e53d9e211cbd716fef18910aba69c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281348
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-03-08 08:40:57 +00:00
Kevin Moore 252adbc593 Rename pkg/dart2wasm/dart2wasm.md -> README.md
Improve discoverability on Github, etc

Change-Id: I675d06a1b3e8e38e3bc521840b3a0a4eef21291b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287243
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
2023-03-08 07:46:15 +00:00
Johnni Winther d451cb64c0 [_fe_analyzer_shared] Only show fields of interest in exhaustiveness tests
Only the fields of a scrutinee type that are used in the cases are
now shown in the test expectations. When the field is not present,
for instance when the scrutinee type is nullable, or the fields are
only present on (some of) the subtype of the scrutinee type, the
fields are shown to be missing with a `-`.

Change-Id: I2d36b230e979dc929d083cfb8f9cdb9f1143d380
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287280
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-08 07:14:47 +00:00
Sam Rawlins 8a9188aae5 [analysis_server] Avoid future-of-implicit-dynamic types
This clears all of the implicit `Future<dynamic>` types in lib/.

Also a few `extends XyzVisitor<(implicit) dynamic>` are made into
`extends XyzVisitor<void>`.

Also a few raw Stream, StreamController, and Completer types.

Change-Id: I2471cc56d2d2d0545e5e103fff3189e745a54b49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287245
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-08 06:22:57 +00:00
Stephen Adams 66e4f27384 [dart2js] Temporarily disable inlining of methods with labeled statements
Bug: 51646
Bug: 51652
Change-Id: I3d7a722420a6ead288e19ed7a5fc017b32d6a545
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287300
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-03-08 04:13:38 +00:00
Sam Rawlins 49a3fb4f96 [analyzer] Separate the HTML parser utility from the DOM
With the parser code in the same library as the DOM classes, the
`pkg/analyzer/tool/messages/generate.dart` program, which generates all
of the diagnostic classes and diagnostics, _depends_ on a library
with a `parse` method which depends on these diagnostic classes (in
order to report errors while parsing HTML). This means that if
there is any existing error (like an unknown identifier) in the
existing error codes, it is impossible to generate the error codes.

Since we don't need the `parse` method to generate diagnostics, we
split up the library and remove the indirect dependency.

Separating the parser code out removes the loop.

Change-Id: Ifb9e9fd979e341ae64a1ed49aaf3758d3dcf1dee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-03-08 03:06:19 +00:00
Joshua Litt 25779cc933 [js] Ensure dartify / jsify have inverse semantics.
CoreLibraryReviewExempt: Minor change to the internal of a web backend specific API.
Change-Id: I450e9410af7e006b853e2d8f26dc5ede1d95f4e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245621
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-03-08 00:07:42 +00:00
Kallen Tu 627253ed83 [flip-modifiers] Make more tests use mixin instead of class.
Change-Id: I27ee447599941e7f266ae56bd6663fe1936394fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287223
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-07 23:59:39 +00:00
Brian Wilkerson b815ddc2b8 Attempt to fix the windows bot
Change-Id: I23ac16a4a3acdc5efaddf997133aa54d4f366a95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287240
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
2023-03-07 22:35:13 +00:00
Konstantin Shcheglov c084056d45 Add a few @Since annotations for mock SDK.
Change-Id: Ie2d726918b16f38261c2c848a59a0f3f1e4b3675
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287060
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-07 21:44:57 +00:00
Michael Thomsen 47b180ea89 Update wasm readme
Change-Id: Ib084c9ed28eabcdf55e1b43c6d6ef2af82e6fe76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286931
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2023-03-07 21:22:38 +00:00
pq 4c7e87888d update @reopendocs
Fixes: https://dart-review.googlesource.com/c/sdk/+/286860

Feedback welcome. I expect we'll want to iterate more on this but I see Erik's new content as a distinct improvement.


Change-Id: Iba385be6c411f2e5e3f1bd490b437dbea86e07aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286860
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Marya Belanger <mbelanger@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-03-07 21:21:01 +00:00
Devon Carew eadfedec50 [deps] rev async, dartdoc, html, http, http_multi_server, source_map_stack_trace, stream_channel, test, tools, watcher, webdev, yaml, yaml_edit
Revisions updated by `dart tools/rev_sdk_deps.dart`.

async (8deaa40..f454380):
  f454380  2023-03-02  Natalie Weizenbaum  Add `StreamExtensions.listenAndBuffer()` (#235)

dartdoc (77d5994..98fa859):
  98fa859c  2023-03-05  dependabot[bot]  Bump cli_util from 0.3.5 to 0.4.0 (#3360)

html (0b8025c..08643e9):
  08643e9  2023-03-02  Devon Carew  prep for publishing 0.15.2 (#205)

http (1500a71..805a147):
  805a147  2023-03-02  Kevin Moore  Fix some spelling (#884)
  5a2f036  2023-03-02  Kevin Moore  Move to pkg:dart_flutter_team_lints, require Dart 2.19 (#883)
  35b2cef  2023-03-02  Bahaa Fathi Yousef  Corrected the spelling of "Implements" in "/http/lib/src/io_client.dart" (#871)
  bb86cf3  2023-02-27  Brian Quinlan  Provide access to NSURLSession.sessionDescription (#881)

http_multi_server (2cd5355..7bd190c):
  7bd190c  2023-03-06  Kevin Moore  Require Dart 2.19, enable and fix new team lints (#51)

source_map_stack_trace (a60ef54..45ea368):
  45ea368  2023-03-07  Kevin Moore  Require Dart 2.19, use pkg:dart_flutter_team_lints (#35)

stream_channel (0850515..a20ccd4):
  a20ccd4  2023-02-28  Kevin Moore  move to pkg:dart_flutter_team_lints lints, fix code, bump min SDK (#87)

test (1307cc5..92da93a):
  92da93a8  2023-03-06  Devon Carew  dogfood the new setup-dart action (#1964)
  e49818ec  2023-03-01  dependabot[bot]  Bump github/codeql-action from 2.2.1 to 2.2.5 (#1963)

tools (28b7be8..a1c3506):
  a1c3506  2023-03-07  Devon Carew  dogfood the new setup-dart action (#25)
  fb46723  2023-03-07  Elias Yishak  Update pubspec.yaml (#24)
  5a72344  2023-03-06  Elias Yishak  Add `DashEvent` for toggling telemetry collection + send event whenever toggled (#23)

watcher (0ca6638..5968409):
  5968409  2023-03-07  Kevin Moore  blast_repo fixes (#139)
  e8f771a  2023-03-07  Kevin Moore  Require Dart 2.19, use new team lints (#138)

webdev (deb801b..c007560):
  c007560  2023-03-06  Elliott Brooks (she/her)  [MV3 Debug Extension] Show warning when clicking on debug extension for non Dart app (#2015)
  1a010dc  2023-03-06  Devon Carew  dogfood the new setup-dart action (#2017)
  07743a3  2023-03-06  Anna Gringauze  Fix exception mapping from JS to dart (#2004)
  eb63b31  2023-03-03  Elliott Brooks (she/her)  Create a Dart Debug Extension issue template (#2014)
  85f35d4  2023-03-01  Devon Carew  update publishing automation integration (#2002)
  e748045  2023-02-28  Anna Gringauze  Prepare to release webdev 3.0.1 (#2000)
  5355050  2023-02-27  Elliott Brooks (she/her)  [MV3 Debug Extension] Ignore page reloads for detecting navigation away from app (#1994)
  4e08276  2023-02-27  Anna Gringauze  Prepare to release dwds 18.0.0 (#1993)
  fc54d68  2023-02-27  Anna Gringauze  Fix expression evaluation failures on empty scopes (#1998)
  496a2b4  2023-02-27  Anna Gringauze  Temporarily disable publish verification (#1996)

yaml (a6d8781..1ad2f49):
  1ad2f49  2023-03-01  Kevin Moore  Require Dart 2.19, migrate to dart_flutter_team_lints, make associated fixes (#138)
  4d369fd  2023-03-01  Kevin Moore  benchmark: fix output.json (#137)

yaml_edit (998eea2..0668eb5):
  0668eb5  2023-03-02  Jonas Finnemann Jensen  Wrap recursively, prepare release (#28)
  a4ff857  2023-03-01  Mohamed Ishad  Update CHANGELOG.md (#37)
  2fdfbdb  2023-02-28  Mohamed Ishad  Fix for issue #23 (#34)
  494ad7c  2023-02-25  MikiPaul  fixed typo (#36)

Change-Id: I101c94575c20fca55c7440e84668413207073a32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287162
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-03-07 21:13:36 +00:00
Sam Rawlins 27984095de [analysis_server] Avoid Future-of-implicit-dynamic in tests
* 99% of these are `Future ` --> `Future<void> `
* There are some `test_` methods which declare a return type of `Future` which
  is non-idiomatic, I think, but in order to create a pragmatic consistency, I
  added `<void>` to the few test methods in these libraries. Later if we
  desire, we can remove all of the return types.
* Also a few `Completer ` --> `Completer<void> ` and
  `Stream ` --> `Stream<Object?> `
* There are many remaining cases in `lib/`

Change-Id: I41cd51bab6886788e15ac7065dd21e95e789d09f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-03-07 21:12:58 +00:00
Alexander Markov 55ddbe534a [vm/aot/tfa] Avoid using null as an initial value of non-nullable and late variables without initializer
TEST=pkg/vm/testcases/transformations/type_flow/summary_collector/vars.dart

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: Ie6b3bdf7069e7d6389e3a729f23b9e1912a4eed2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285061
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-03-07 20:31:14 +00:00
Mark Zhou a92274cae8 [ddc] Rolling internal dart_library.js into SDK
Change-Id: Ifb1cf1aed53b04eaa0a258668eab6b4b8f19df80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286609
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2023-03-07 19:44:26 +00:00
Mayank Patke 6414db5327 [dart2js] Disable kernel transformer when using modular analysis.
Mutating the kernel AST can cause serialization and deserialization to
go out of sync when modular analysis is enabled, crashing dart2js.

Change-Id: If19afabacf1cb120a6804bd12ef268316de41f1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286862
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2023-03-07 19:36:10 +00:00
Sam Rawlins 3c633384d3 Add a script which generates a testing package
This script has a decent description at the top, and decent comments
throughout.

Change-Id: I455c0e7b5354563750636e31a53db2caacdbf687
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286700
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-03-07 18:54:28 +00:00
Johnni Winther 6e16dad3c0 [_fe_shared_analyzer] Use internal constant-to-text
This chances the analyzer and CFE representation of constant values
to use the internal constant-to-text which doesn't include the
node type and in most cases resembles the source code corresponding
to the value.

For now, this is for creating less noise in the test. For the release
of the feature we need a more thorough handling since these texts
can be user facing when producing error messages.

Change-Id: I5b83d8b0c030e4ffb66422057acf5511619368e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287200
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-07 18:52:23 +00:00
Ryan Macnak c023db4dd0 [vm] Fix false-positive in const field removal detection.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/51526
Change-Id: I86dfa625a218dd58c2c009081230ca0d0729e807
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286959
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-03-07 18:19:07 +00:00
Brian Wilkerson 219521d9cd A small optimization for LocalDeclarationVisitor
I doubt that this will have any significant performance impact, but it
seems wasteful to invoke all of the 'generalized' visit methods when
the only important one is `visitNode`.

Change-Id: Ie574d1456a4cccb26090c36f7f6340445bba4006
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287160
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2023-03-07 18:14:23 +00:00
Alexander Markov 110b0f0eba [tfa,dart2wasm] Create separate class for each record shape in TFA
This allows us to better track all kinds of accesses to record
implementation classes in dart2wasm, which generates separate
record implementation class per record shape.

This change also allows us to remove mutable dispatch targets
which were used to implement dynamic accesses to record fields,
and make tracking of record field types more accurate
(record fields are now versioned per shape).

This is also a step towards inferring actual record types.

TEST=pkg/vm/testcases/transformations/type_flow/transformer/records.dart
TEST=pkg/vm/testcases/transformations/type_flow/transformer/records_dart2wasm.dart
TEST=language/records/simple/dynamic_field_access_test

Issue https://github.com/dart-lang/sdk/issues/49719
Fixes https://github.com/dart-lang/sdk/issues/51363

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: Icba62a7ca8cfd8ddbc7f2b7c38aeabbef5caec4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286950
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-03-07 18:06:42 +00:00
Brian Wilkerson 61775822db Add a flag to the diagnostic pages to control developer support
I would prefer to have the code uncommented because it will help prevent
it from becoming stale.

Change-Id: I86dc0c715433cbeab33b3739f826475fcc583bc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287161
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-03-07 18:06:20 +00:00
Ryan Macnak 219c4140b5 [vm] Add test that dart:io.exit should work even if isolates are blocked.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/51560
Change-Id: I6634594a19b746a9bc4c70de58e475576372eb4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287002
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-03-07 17:53:27 +00:00
Paul Berry 5f8c28e226 Patterns flow analysis: promote to non-nullable when matched value is non-nullable.
Judging by several test cases that have shown up in co19 tests and
informal discussions, it appears to be a common expectation that a
pattern like `int? x?` or `int? x!` should promote `x` to
non-nullable.  Previous to this change, this didn't work in general.
Consider:

    Object? o = ...;
    switch (o) {
      case int? x?:
        print(x.isEven); // (1)
    }

At (1), the null-check happens *before* the required type check of the
variable pattern; therefore it promotes the matched value type to
`Object`.  This is not a subtype of the required type of the variable
pattern (which is `int?`), therefore, previous to this change, `x` was
not promoted.

With this change, since the matched value type of `Object` is
non-nullable, the required type of the variable pattern is
re-interpreted as its non-nullable counterpart, `int`.

In a fully null-safe program, this is sound, because if the matched
value type is non-nullable, that guarantees that the matched value is
not `null`, and therefore it is equivalent to type check against the
non-nullable counterpart of the required type.

In a program that is not fully null-safe, the matched value might have
originated in a non-null-safe library (and thus might be `null` in
violation of its static type).  So, strictly speaking, it is not sound
to re-interpret the required type of the pattern as its non-nullable
counterpart.  However, the only way this unsoundness can manifest is
for the matched value to be promoted to non-nullable when it is in
fact `null`, and that is precisely the sort of unsoundness thta we
permit in mixed-mode programs.  So this change won't result in
unsoundness escalation.

Bug: https://github.com/dart-lang/sdk/issues/51644
Change-Id: I9479e3c29e12f2a62a9e165b32c3480d7e299c29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287040
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-03-07 17:12:22 +00:00
Sam Rawlins 10b7b0a001 [analyzer] Move 2 more HintCodes to be WarningCodes, ASSIGNMENT_*, MIXIN_ON_*
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: Ifda5fb5f9bf282d6c97fffb34318e84eb84b76c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286346
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-07 17:11:24 +00:00
Kallen Tu ef6295df67 [flip-modifiers] CFE test golden file changes from class to mixin.
Change-Id: I58fa6ea3c34dec65e9cc754aeeffbe779314bd3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286958
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-07 16:54:38 +00:00
Oleh Prypin 47cfe5f97f Roll dart_style into the SDK
Includes just one more commit - "Enable support for inline class syntax"

Change-Id: Ie230fc72b7170d3610bdd7ed7ab8c193338f8a93
Bug: b/271244238
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287020
Commit-Queue: Oleh Prypin <oprypin@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Auto-Submit: Oleh Prypin <oprypin@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2023-03-07 16:29:09 +00:00
Jakub Vrána 7e57f7cc60 Use get/setPrototypeOf instead of using __proto__
Closes https://github.com/dart-lang/sdk/pull/51617

GitOrigin-RevId: 6d6e01bf3fe0225682c7fedc53af3ef409791cca
Change-Id: I78435ae7b987e5ab9b87fb7c4700ddd7cf27c3fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286703
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-03-07 15:01:04 +00:00
Daco Harkes 7cfbfc6a25 [vm/ffi] Change late Finalizable implementation
This CL replaces `late Finalizable` variables with the original and
a nullable non-late variable. Every assignment is done first to the
late variable, and the immediately to the nullable non-late shadow
variable. The reachability fences are then inserted only for the
nullable non-late shadow variable.

The advantage of this is that the semantics are fully valid and none
of the further compiler pipeline has to know about late Finalizables.
(1) We remove the special casing in the VM.
(2) The TFA logic with finalizables is no longer blocked.

The downside of this approach is that we use more memory, we need
two fields at runtime, one storing a null and the other storing a
sentinel on initiazation. Moreover, we get some extra store
instructions.

TEST=pkg/vm/testcases/transformations/ffi/finalizable_late.dart
TEST=pkg/vm/testcases/transformations/ffi/finalizable_late_2.dart
TEST=tests/language/vm/regress_49005_test.dart

Closes: https://github.com/dart-lang/sdk/issues/51511
Change-Id: Ifedd3387a368233a2d01e1bcaa9f5e3eceb76856
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286782
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-03-07 10:10:25 +00:00
Johnni Winther e80c657dc5 [_fe_shared_analyzer] Improve support for logical and pattern
This improves the support for logical and pattern by making an
approximation of the intersection of spaces. When creating an
intersection between two [SingleSpace]s, if one of the static
types is a subtype of the other, this used for the create
intersection. Otherwise the intersection is modelled by including
an "unknown space" in the result.

Change-Id: Ia9d7324fa13f4b9850aece126de3aab3a1e63d3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286962
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-07 10:08:47 +00:00
Johnni Winther ed33495a33 [_fe_analyzer_shared] Add SpaceCreator
This adds a [SpaceCreator] mixin used to share the code that creates
the [Space] for each pattern. This is mixed into the [PatternConverter]
in the analyzer and a similar [PatternConverter] is added to the CFE.

Change-Id: I0b284b1473b464167aa84f1948264efc4120001d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286960
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-07 09:21:44 +00:00
Kallen Tu 7bae7294c9 [cfe/flip-modifiers] Remove error for Function completely. Rely on its modifier errors.
Change-Id: I2532f24b360ea0a2f7afb92f3393719a16fa15e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286957
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-07 08:13:19 +00:00
Chloe Stefantsova 82237f9483 [cfe] Support final joint variables in switch statements
Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: I741562bd37cd5f93d4a2d1ccadcb869344bc10a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286926
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-03-07 07:48:25 +00:00
Nicholas Shahan de44a23dd1 [test_runner] Cleanup unused compiler names
"dartdevc" and "dartdevk" have been replaced with "ddc".

Change-Id: I823bc029a0bbe1295fd731efcc32961e61c6c175
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282485
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-03-07 02:09:16 +00:00
Kallen Tu 3b50e0a921 [cfe] Fix bug where we emit an extra error that we don't want for mixin classes.
Would otherwise emit `CantUseClassAsMixin` and then if the supertype is final or interface, would emit `FinalMixinMixedInOutsideOfLibrary` and `InterfaceMixinMixedInOutsideOfLibrary`respectively. These errors together don't make sense so this CL fixes it.

Change-Id: I5fdf4e260b709e08af53cbda0414cff2ef93d3b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286951
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-07 00:58:22 +00:00
Keerti Parthasarathy bd42ae8637 Add tests to class_to_enum and class_to_mixin using class modifiers.
Bug: 51496
Change-Id: Ib37979b39b7c63daa89c0746ac5c231a2269ef46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286948
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-03-06 23:17:51 +00:00
Brian Wilkerson c021746bc4 Automate checking for solo tests
Change-Id: Iba0134f4b31b64d3bf3eb622c57d0e40121494f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286944
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-03-06 22:53:37 +00:00
Ryan Macnak 63e6041ca9 [vm] Update to variadic FATAL.
TEST=ci
Change-Id: Ic6bc784605e10760bb28ea6df34242336a33b4d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286947
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-03-06 22:06:59 +00:00
Johnni Winther c9e29fa85f [_fe_analyzer_shared] Include errors in analysis result
This propagates information about reported error to the caller of
a shared type analysis. This is used to properly turn errors into
invalid expressions/patterns, as is normally done in the CFE in
face of errors.

Change-Id: Ibb8adedccb8314fabfe18ecaa3559e32ad7267ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286145
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-06 22:06:00 +00:00
Robert Nystrom 91ef5b252b [flip-patterns] Update invalid assignable expression test expectations.
With pattern assignment, the error messages are now different in 2.19
libraries since a parenthesized expression looks like you might be
trying to do a pattern assignment.

Change-Id: I00105ea4cb5dbe8c8b328fb2e665200f3dc33722
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286870
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-03-06 21:57:51 +00:00
Ryan Macnak 203998d021 [vm] Timeline docs.
Change-Id: Ie9415e02adc84a1f01178f16585f2bb6e7436f3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286863
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-03-06 21:33:24 +00:00
Johnni Winther 8617cc68fa [_fe_analyzer_shared] Use subpattern for CastPattern exhaustiveness
This changes the Space computation for CastPattern to just the
Space for the subpattern. For a non-throwing cast, this is exactly
what the pattern will match.

There is still potential for handling the types rejected by the cast.
For instance recognizing that the (yet) unhandled subtypes of a
sealed type are exhausted by the throw.

Change-Id: Ia846895449f37a970f87a7f6c54a0ff8285df6b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286825
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-06 21:08:11 +00:00
Ryan Macnak 90ff190627 [vm] Remove malloc profiler.
Splitting c67fac9cb4.

TEST=ci
Change-Id: Ib42d861e458648ce810be44cea0734c244703c1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287000
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-03-06 21:00:30 +00:00
Brian Wilkerson 27e874ad26 Update selection support for patterns
Change-Id: Ib301f4afc5d0989a805b269fdca25dfa527072c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286941
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-03-06 20:52:27 +00:00
Jake Macdonald af6e1bf5a4 [flip-modifiers]: prep more tests for the class modifiers flag flip
TEST=only test changes

Change-Id: I725bd897e9e749ab6010c99ee74c20ee64e61500
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286981
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2023-03-06 20:52:03 +00:00
Johnni Winther 207174cc1b [_fe_analyzer_shared] Add Witness to delay witness text computation.
This adds a [Witness] class as the result of an exhaustiveness test.
This allows for testing exhaustiveness without having to compute the
textual representation of the witness.

Change-Id: I6225b6d35a23792ecc15ae769e4b70cab93e2229
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286824
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-06 20:42:20 +00:00