Commit graph

98225 commits

Author SHA1 Message Date
Nicholas Shahan 30b530bce7 [ddc] Handle Object members on extension types
Erase extension types when deciding to dispatch directly or to a helper
method for Object members.

Issue: https://github.com/dart-lang/sdk/issues/49735
Change-Id: I31081bf4ec64a0f667c8d40b08b94773e229ebe1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335601
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-11-17 22:24:37 +00:00
Nate Biggs 2b4b9cb753 Reland "[dart2js] Move Dart2js const conditional simplifier to phase 0b, the CFE linker."
This is a reland of commit fdfca11d39

Original change's description:
> [dart2js] Move Dart2js const conditional simplifier to phase 0b, the CFE linker.
>
> Change-Id: I9ed7f46c5641c28dc71b7712dbd4e8d2062b1f4d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332820
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Mayank Patke <fishythefish@google.com>

Change-Id: I0ddf00c551196085e2a17936d15d6bc46c76efad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336580
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-11-17 21:46:02 +00:00
Nate Biggs 193db9b70e [dart2js] More lenient source code handling for diagnostic reporting.
Should avoid exceptions as thrown in https://github.com/flutter/flutter/issues/138326

Only register source code if there is content in the byte array so we know when we should try to read from file. And when trying to read contents of a file for diagnostics, if we fail to read the file then fail gracefully by using position information.

Change-Id: Ic7e2bdcba0b093a48735aa26670509354f953861
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336480
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-11-17 21:40:42 +00:00
Konstantin Shcheglov e6b02b5895 Extension type. Update nullability, remove implied interfaces.
2edfa84697

Change-Id: I108d57aa2b601ccc3de0e7097507f6115b430d94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337000
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-11-17 20:59:48 +00:00
Nate Biggs 1941a8f463 [dart2js] Manually add braces for dangling else.
Rather than emit a different node than what is expected (the Block rather than the enclosed statement), we can manually emit the necessary braces.

Change-Id: I0bf2a27a56828cb6d292479c73fdaec8f4072116
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336980
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-11-17 20:48:27 +00:00
Devon Carew 765c0b3ab8 [deps] rev lints, mockito, sse, tools
Revisions updated by `dart tools/rev_sdk_deps.dart`.

lints (f58fd77..3810f8b):
  3810f8b  2023-11-14  Devon Carew  add a section on upgrading to the latest lint set to the readme (#171)

mockito (fcb9779..fb8a2b5):
  fb8a2b5  2023-11-16  Kevin Moore  No public description
  2f41028  2023-11-16  Copybara-Service  Merge pull request #719 from dart-lang:latest_lints
  8b5036b  2023-11-16  Kevin Moore  release later
  ecc62f6  2023-11-16  Kevin Moore  Update to the latest lints, require Dart 3.1, prepare release
  dc3eb65  2023-11-15  Ilya Yanok  Generate valid functions with optional non-nullable arguments

sse (8ddb95f..0f6ca11):
  0f6ca11  2023-11-15  Kevin Moore  Require Dart 3.2, use pkg:web (#92)

tools (2e36b8d..4649307):
  4649307  2023-11-15  Elias Yishak  Add terminal info to flutter command event (#204)
  4e75286  2023-11-13  Devon Carew  remove duplicate settings from analysis_options files (#201)

Change-Id: Ie0d8c1897e22ca04563bdc0320cf7485f6e63f7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336825
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-11-17 20:39:08 +00:00
Robert Nystrom 2ee771a4f6 Remove the legacy "_2" tests. \o/
I also cleaned up a bunch of places that referred to them.

Change-Id: I45f68818c892f8620ea04257885ffa3763374bb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335863
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-11-17 20:17:23 +00:00
Stephen Adams 87d9b9d946 [js_ast, dart2js] Unwrap trivial blocks in the compiler, not printer
Simplify the js_ast printer - it should not transform the program
while printing.

js_ast:

- Don't skip blocks containing a single statement.

- Don't rewrite arrow functions.


dart2js:

- Fix rewrite_async.dart to avoid a few singleton blocks.

- Static initializer thunks are transformed in arrow functions with expression bodies.

Change-Id: I4ab75c6ca7f580835a6c9d4eb45240d76df9d895
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336820
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2023-11-17 19:23:27 +00:00
Alexander Aprelev 02c1493288 [io/win] Ensure isDST is correctly determined for pre-1970 dates on Windows.
Bug: https://github.com/dart-lang/sdk/issues/44656
Change-Id: Icf4925986430a1a6d149f362679bc68d01ea8746
TEST=ci
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336803
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-11-17 19:11:57 +00:00
Ryan Macnak ef89de9dc1 [standalone] Symbolize si_code in crash dumps.
TEST=remove PROT_EXEC, see ACCERR
Change-Id: I99bb5b2aba4f40dd8b6e074ed652f8cbbd69cdd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336280
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-11-17 19:02:33 +00:00
Ryan Macnak 8598086c7f [vm] Don't include the header when checking if PcDescriptors, etc are equal.
The header includes the mark bit, which may change if concurrent mark or sweep runs during deduping.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/49649
Change-Id: I9b99e42009aba06c9c5b5730dbe96d1c02550f5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336623
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-11-17 18:07:13 +00:00
Brian Wilkerson d86a114d49 Move the generation of type parameter suggestions
Change-Id: I3ab850747ab9c12360ffcccd80120b7723af8420
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336840
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-11-17 17:26:38 +00:00
Konstantin Shcheglov d2c7d9d412 Macro. Support for Diagnostis, without target yet.
Change-Id: I8a3cf3cae193bd3da07afa20e48a408ad3c45ea2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336802
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-11-17 17:12:13 +00:00
Parker Lougheed 4f0417d8cc [analysis_server] Don't offer convert_to_if_case_statement_chain assist when body is empty
Fixes https://github.com/dart-lang/sdk/issues/54077

Bug: https://github.com/dart-lang/sdk/issues/54077
Change-Id: Id0efda426308d5eb42564c696f52a21fa0d62a55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336783
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-11-17 16:26:25 +00:00
Keerti Parthasarathy 5ed46e624e Fix exception when running dart fix against flutter examples.
Ran against the code used in flutter customer_testing.

Change-Id: I330e528b3184c7a05ab34f9040a802dc06146b97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336801
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-11-17 15:56:20 +00:00
Tess Strickland 904354f108 [vm/compiler] Convert index checks in TypedData methods to CheckBound.
Create a _typedDataIndexCheck abstraction for the conditional throwing
of IndexError in TypedData indexing operations. Recognize that
abstraction in the inliner and replace it with the equivalent CheckBound
instruction.

Do the same for byte offset checking in ByteData operations.

TEST=vm/dart/typed_list_index_checkbound

Change-Id: Ia6c4a3b7ae4667af69aa5bf214d4f187557dac06
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-linux-debug-x64-try,vm-eager-optimization-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330800
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-11-17 15:35:42 +00:00
Sergey G. Grekhov 55a2b1cbfb [co19] Roll co19 to 460758bf4c298812d47b24f7e5040c75088c3ebf
2023-11-17 sgrekhov22@gmail.com Fixes dart-lang/co19#2381. Fix roll failures (dart-lang/co19#2382)
2023-11-16 sgrekhov22@gmail.com Fixes dart-lang/co19#2379. Update expected error position for CFE (dart-lang/co19#2380)
2023-11-16 sgrekhov22@gmail.com Fixes dart-lang/co19#2377. Add missing Float32x4List.setAll_A04_t01 test (dart-lang/co19#2378)
2023-11-16 sgrekhov22@gmail.com Fixes dart-lang/co19#2373. Expect additional errors in CFE for member conflicts tests (dart-lang/co19#2375)
2023-11-16 sgrekhov22@gmail.com dart-lang/co19#2359. Fix existing extension types tests according to the new nullability rules (dart-lang/co19#2372)
2023-11-16 sgrekhov22@gmail.com Fixes dart-lang/co19#2356. Fix nullability in dynamic_semantics_member_invocation_A03_t02.dart (dart-lang/co19#2368)
2023-11-16 sgrekhov22@gmail.com dart-lang/co19#2371. Add tests for factory constructor generating an enum value (dart-lang/co19#2376)
2023-11-15 sgrekhov22@gmail.com dart-lang/co19#2371. Add missing enhanced enums tests, update assertions (dart-lang/co19#2374)
2023-11-14 sgrekhov22@gmail.com Fixes dart-lang/co19#2369. Static type of == operator is always bool (dart-lang/co19#2370)
2023-11-14 sgrekhov22@gmail.com dart-lang/co19#2303. Add more File.create()/createSync() tests (dart-lang/co19#2337)
2023-11-10 sgrekhov22@gmail.com dart-lang/co19#2339. Add test for extension named type and a record type (dart-lang/co19#2366)

Change-Id: If608421c5a4f614187a66dc05fa5d8d90c9e363d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336901
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-11-17 15:12:26 +00:00
Johnni Winther ced5b4e25d [cfe] Ensure nullable result type for ??= for effect
Closes #54069

Change-Id: I4caaad1b86f9ef68f1d36d7b2f9afc92364ce83c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336662
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-11-17 14:06:50 +00:00
Daco Harkes c6f70abd3e [gardening] Fix status file
Fix typo on https://dart-review.googlesource.com/c/sdk/+/336882.

Change-Id: Ic59ecea2f6632f0c686e36f66c33e2c934a4cc5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336883
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2023-11-17 14:06:22 +00:00
Lasse R.H. Nielsen a1783a9c34 String.fromCharCodes allows start and end after end of iterable.
The current `String.fromCharCodes` behavior, throwing if `start`
or `end` is larger than the length of the `charCodes` iterable,
is inconsistent with the argument being an `Iterable<int>`,
which the user is not expected to know the length of.

Most other operations that accepts or produces an `Iterable` and
restricts it to a range, will allow the range to exceed the length
of the iterable, acting like `.take(end).skip(start)`, just without
needing to create wrappers that hide the original value.

(`List.setRange` is another exception, and should probably be fixed
by allowing the range to be partially filled, since it's too hard
to change it to require a `List` argument.)

Fixes #50253, #53937

Tested: Added to `corelib/string_fromcharcodes_test.dart`
Bug: https://dartbug.com/53937, https://dartbug.com/50253, https://dartbug.com/23282
Change-Id: Ie19c5fa8e715ea1c58c9c77c247f2a563654c1aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333921
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-11-17 13:34:22 +00:00
Lasse R.H. Nielsen 5543293a16 Reland "Expire 3.0.0 experiment flags."
This is a reland of commit 6f29e7fce4

Original change's description:
> Expire 3.0.0 experiment flags.
>
> TEST=Existing tests covers.
> Change-Id: I161eefdc28c74f63ba1ee926800a01eea03d9930
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331960
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

TEST=Existing tests covers.
Change-Id: I384e77744c74774a250be413358a7fa176117167
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332684
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-11-17 13:10:01 +00:00
Alexander Thomas cc161c4e5c [infra] Restore pkg test coverage on analyzer builders
These were unintentionally removed in go/dart-reviews/335442.

Bug: b/310114753
Cq-Include-Trybots: luci.dart.try:analyzer-mac-release-try
Change-Id: I55e69fdef0acfe68fe0ade92a20fbc296e09f3a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336900
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-11-17 11:48:36 +00:00
Daco Harkes 4f5a6c8530 [ffi/test] Skip handles test on Win AOT
Closes: https://github.com/dart-lang/sdk/issues/54072
Change-Id: Id9babd0ca9e4c6de35104b975bf7acbd9b1564ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336882
Reviewed-by: Tess Strickland <sstrickl@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-11-17 10:54:02 +00:00
Alexander Thomas d8177eff7e [infra] Turn off legacy tests for the Dart VM
Bug: b/310114753
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-linux-release-x64-try,vm-kernel-linux-debug-x64-try
Change-Id: Ib9b9de26068d719769643f413019260cacc5e837
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335460
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-11-17 09:13:13 +00:00
Alexander Thomas 15a79bad53 [infra] Turn off legacy tests for the CFE
Bug: b/310114753
Cq-Include-Trybots: luci.dart.try:front-end-linux-release-x64-try
Change-Id: Ie02447da524b5cd0656db434ee8472434daeb3c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335441
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-11-17 09:04:42 +00:00
Alexander Thomas 37744978a0 [infra] Turn off legacy tests for the analyzer
Bug: b/310114753
Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,analyzer-mac-release-try,analyzer-win-release-try,analyzer-analysis-server-linux-try
Change-Id: I9fafc524a3f6f461e17c456f7a53570c74ebffa0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335442
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-11-17 09:00:36 +00:00
Alexander Thomas 43b4c2bb03 [infra] Turn off legacy tests for web compilers
Bug: b/310114753
Cq-Include-Trybots: luci.dart.try:dart2js-hostasserts-linux-unsound-try,ddc-linux-chrome-unsound-try,dart2js-unit-linux-x64-release-try
Change-Id: Ia2c1b64981de75cf3051e215794767abb3250e2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335440
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-11-17 08:27:02 +00:00
Dan Chevalier 272b9d28a8 Improve DSPS Readme and remove todos.
Change-Id: Id82ad846dd566306d41db211d9ae9a9370192306
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336540
Commit-Queue: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-11-16 21:00:29 +00:00
Ryan Macnak dd03188661 [vm, compiler] Also don't go out-of-bounds for PointerToMemory.
TEST=windows-x64
Bug: https://github.com/dart-lang/sdk/issues/53829
Change-Id: Ic7a3cd6e1e8d49a138a74a67c9d30680e91a86a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336620
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-11-16 20:56:29 +00:00
pq 07c77f59a2 Final todo updated format fixes
This should tidy up the last ones. 🤞

Sorry for the noise!

Change-Id: I7104fc33282184acb0c843eae6e73f6fcc77d892
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336723
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-11-16 20:18:32 +00:00
Konstantin Shcheglov c2e3f9dfa9 Augment. Support for constructor elements.
Change-Id: Id9a44580fc6c13cfa6c2af6a0783a92be662ac57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336722
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-11-16 19:21:40 +00:00
pq 4aefa448c2 fix todos in analyzer
Change-Id: Ib5b5351637a07d1530eb96e100613de4fcabe6f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336720
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-11-16 19:03:58 +00:00
Ryan Macnak fb1d821bbe [vm] Fix flaky race with --runtime_allocate_spill_tlab.
TEST=tsan
Change-Id: Ib37a3812a122e3688a1fd9310d4cfda5f4780c21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336602
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-11-16 18:43:24 +00:00
Siva Annamalai 02db5b95e6 Revert "Call tzset() before localtime_r()."
This reverts commit 6027bcb1e2.

Reason for revert: We are seeing TSAN failures in the bot runs

Original change's description:
> Call tzset() before localtime_r().
>
> POSIX and glibc do not guarantee that tzset() is called by localtime_r(). tzset sets the timezone name, UTC offset and whether or not it is daylight savings time.
>
> Android <= 7.1.1 did *not* call tzset() in localtime_r(), which means that users will see their timezone as "GMT".
>
> macOS/iOS seem to guarantee that tzset() is called by localtime_r() but the wording is vague:
>
>   localtime_r() and gmtime_r() functions provide the same functionality
>   as localtime() and gmtime()...
>
> N.B.: localtime() is guaranteed to call tzset().
>
> tzset() must be called before each localtime_r() to catch the case where the user changes the timezone while the application is running.
>
> Bug:https://github.com/dart-lang/sdk/issues/53276
> Change-Id: I0503a0a109aa6c281c9a3aefe8ba0b54841a42a7
> Tested: manually tested on Android 7.1.1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336240
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Brian Quinlan <bquinlan@google.com>

Bug: https://github.com/dart-lang/sdk/issues/53276
Change-Id: I4bbadf2b69eeac583b7da605c0686bcc6f72081f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336721
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-11-16 18:24:38 +00:00
Paul Berry 18b5f25052 Use OWNERS files to restrict editing of tests/language to language team.
Also tests/language_2 (which hopefully we can delete soon).

Change-Id: I4c7086ecb1b374c2068be9d1366f76323435e57f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336624
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-11-16 18:18:00 +00:00
Brian Wilkerson c7458baa7a Add tests of shadowing in code completion
I'm fairly sure the failing tests are recent breakages. I was only able
to break it without noticing because we didn't have adequate testing.

The next CL should fix the tests.

Change-Id: I69f5fde6e7cd2e872b2ffab38905467d366caa9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336625
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2023-11-16 17:45:09 +00:00
Daco Harkes c6a85b81f4 [vm/ffi] Tests with Handles and constants
Adds tests to cover constant values flowing into `Handle` parameters
of `@Native external` functions.

The first test is a repro of the failure from
https://dart-review.googlesource.com/c/sdk/+/333840

The other tests construct more extreme cases.

Handles can't be passed to leaf functions, so no `isLeaf`.

Split off reland:
https://dart-review.googlesource.com/c/sdk/+/333841

TEST=tests/ffi/ffi_native_handles_test.dart

Change-Id: I89d31a940f5a63793a03a9eb364231a54164a328
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336661
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2023-11-16 16:44:59 +00:00
Ben Konyi f039d50437 [ package:vm_service ] Fix flakiness in should_pause_on_exit_test.dart
This test would sometimes fail when trying to resume the main isolate in
the target program when it was not yet runnable. Waiting for the main
isolate to pause at start before resuming should fix this.

Change-Id: Ie242a222199a01e2c84d7c7be56376e616f9989e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336700
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-11-16 16:24:11 +00:00
Aske Simon Christensen 4b880aec60 [dart2wasm] Avoid using _Closure as a type
`_Closure` is the implementation class for function objects. When used
as a type, it translated to the same Wasm type as the `Function` type,
but in the type system it missed the special property of `Function`
that it is a supertype of all functions. Instead, it was translated
into an interface type, leading to incorrect type check results.

Thus, we must always use the `Function` type when referring to any
function.

The problem was hidden by the type check specialization for simple
interface type checks and exposed by `--verify-type-checks`.

Change-Id: I384d35506c0c8cd932ba789e977f8257e684b8d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336423
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2023-11-16 15:04:58 +00:00
Aske Simon Christensen c605dfc4e8 [dart2wasm] Bypass list indexing checks inside type checks
Apart from improving the performance of type checks, this avoids type
checks inside type checks, which could lead to infinite recursion.

The recursion problem was hidden by the type check specialization for
simple interface type checks and exposed by `--verify-type-checks`.

Change-Id: Icbaebd6d68e6576a784fe3efaee81d4479adba5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336422
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-11-16 15:04:58 +00:00
Aske Simon Christensen 80a69223e0 [dart2wasm] Add option to verify type check implementations
This adds a `--verify-type-checks` option to dart2wasm to instrument
the code such that whenever we are able to generate specialized code
for a type check, we generate both the specialized code and also call
the general fallback path, then compare the results.

This can be used to expose bugs in the type check specializations, or
in the reference implementation, as it may be.

Change-Id: I081540a8eedc7d029b332919283810220b21b3ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336023
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-11-16 15:04:58 +00:00
Johnni Winther 1e981c48a2 [cfe] Add test for issue 54070
Closes #54070

Change-Id: Ib3f081e0bb5c8d7fea16f30752a7e7a7bd6b339d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336640
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-11-16 14:52:29 +00:00
Ömer Sinan Ağacan 4c34b6534d [dart2wasm] Fix Float32x4List, Float64x2List, Int32x4List setRange
In the current slow implementation of SIMD lists we can't check for
aliasing (as we don't know the storage type) and can't do `memmove`, so
for now we copy the iterable to a list before setting the elements.

Fixes #52979.

Change-Id: I2ebf69c6e0cef32b762cf9f35534d03fb9918f39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336363
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-11-16 14:37:48 +00:00
Johnni Winther 346662457d [cfe] Handle extension type constructor access through typedefs
Closes #53531
Closes #53563

Change-Id: Ibaf99f4255547d17545223ded58eba9e31d30175
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336421
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-11-16 11:47:57 +00:00
Johnni Winther 56a86e599e [cfe,ddc] Add tests for scopes in extensions, extension types and mixins
This adds support using experimental features in id testing in DDC and
uses it to add tests for scopes in extensions, extension types and
mixins.

The tests show that the DartScopeBuilder and DartScopeBuilder2 differ
on the scope on instance members in extensions and extension types for
the synthetic #this variable.

Change-Id: Iec0f3b938da567578b1245ada885370fb2a8b33f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335824
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-11-16 09:37:31 +00:00
Ömer Sinan Ağacan 817adbc7cc [dart2wasm] Use bitwise-and instead of modulo in typed data ops
Generated code for modulo is not as good as bitwise-and, even after
inlining modulo as we inline truncating division in [12e0690][1].

Bitwise-and saves 0.3% binary space in the TypedData benchmark. It
should also be faster.

[1]: 12e0690dfe

Change-Id: I4ebac592d7c93d0e81e8b28e789f671ce261780a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336361
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-11-16 09:00:48 +00:00
pq fe6950eceb enable flutter_style_todos
Change-Id: Ic82963b754404d54e37f5fb03819aebc3fa67954
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336502
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-15 23:04:19 +00:00
Brian Wilkerson 974b97ca3f Fix the semantic highlighting for both extension types and mixins
Change-Id: Ie64494adbe9d54810b0b156b4884734bdb801309
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336601
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-11-15 23:01:13 +00:00
Konstantin Shcheglov c06f69c442 Macro. Introspection for constructors.
Change-Id: I4589bd9b3eb152427360818e4ba2fac7540dcf46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336621
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-11-15 21:59:35 +00:00
Konstantin Shcheglov 5dbb5960ef Extension type. Issue 53918. Fix type literal constant type.
Bug: https://github.com/dart-lang/sdk/issues/53918
Change-Id: I941332f30bdc681dd10c8471e1710f2e9dde4c68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336501
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-11-15 21:10:48 +00:00