Commit graph

99383 commits

Author SHA1 Message Date
Konstantin Shcheglov b6647fd9ab Stop listening AnalysisDriverScheduler stream during server shutdown.
So, that we don't send analyzing/idle during drivers dispose.

Change-Id: I589cc368b2877baa0878d405f7ab3ca7daf31f3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348763
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-27 02:23:48 +00:00
Konstantin Shcheglov c975fdf3a8 Macro. Support for macro generated files in getFilesDefiningClassMemberName()
Change-Id: I153dd67bb569ee8e6d086fae3326c7a6776195da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348724
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-27 01:45:17 +00:00
Nicholas Shahan e2f76a18f6 [test] Remove use of unwrapType() from test
This happened to work in both type systems because the property of the
same name exists in both, but technically `unwrapType()` is part of
the old type system and will be deleted soon.

Change-Id: I5620c5f409f0c6fe486b9a4c7a6872ee8deabc09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348800
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-01-26 23:56:11 +00:00
Ben Konyi d48a76e988 [ DDS ] Migrate DDS specific tests from service/ and update package:dds_service_extensions to 1.7.0
TEST=migrated tests

Change-Id: Id77f46c7e348614f707fc4d50d8a3101120b48ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347941
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-01-26 22:45:14 +00:00
Alexander Aprelev 1d1531c8d9 [vm/io] Null-terminate scope-copied CStrings.
Fixes https://github.com/dart-lang/sdk/issues/54741
TEST=standalone/io/io_override_test

Change-Id: Ie907360dc4bcea05ef6fe3a5d4626e4e31399fc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348723
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-01-26 22:08:37 +00:00
Alexander Aprelev 55310a1c70 [vm] Create a gni listing vm internal dart sources.
This is needed by flutter engine when it packages dart sdk sources.

Fixes https://github.com/flutter/flutter/issues/128880
TEST=manually flutter build

Change-Id: If3fce581e997eea44e4d377172ab9ce573bb1508
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348180
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2024-01-26 22:04:04 +00:00
Brian Wilkerson 8f48cbcccb Record the completion location in more places
This is the first of many such CLs. We need to record the completion
everywhere that `OpType` is computing it in order to eventually be able
to stop using `OpType`. I have temporary code that compares the two
computations in order to ensure that they're the same, but I can't
commit it into prod, nor will it be useful beyond this transition.

In addition to recording the completion location in more places, this
also better handles the case when the offset is immediately before the
first character of a top-level declaration. I believe that we need to
do something similar when immedately after the last character, when
before and after class members, and when before an after statements.

Change-Id: I046675c56243981762cd06db4cd35c17989ccf27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348762
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-01-26 21:17:19 +00:00
Parker Lougheed 75eb5800db [analyzer] Add some significant updates to 3.3 changelog
Too much has changed to enumerate it all, but we can highlight a few new features. This help developers know what's possible now and also can boost their confidence that Dart is continuing to improve.

Change-Id: I6aa39dbc6276dfddb7bcc595277ca40a9308371f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348541
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-26 21:10:55 +00:00
Alexander Aprelev 34484719ca [io/ssl] Better error message when security context private key is missing.
Fixes https://github.com/dart-lang/sdk/issues/54719
TEST=standalone/io/security_context_no_private_key_test.dart

Change-Id: I6619b845a9cad8913efc00fc4f012bd87b27796a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348720
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-01-26 20:49:09 +00:00
Konstantin Shcheglov 6757f8d109 AnalysisDriver. Rename to AnalysisStatusWorking.
This name better describes when the status is produced.

Inspired by https://github.com/dart-lang/sdk/issues/54712

Change-Id: I23a8f2f3f6ee500d21c8d93dd81f4f78f2b1840e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348181
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-26 20:12:57 +00:00
Nate Bosch 9bac969596 Mention future callback ordering is undefined
Closes #29168

R=lrn@google.com

Change-Id: Ia15ae8ef2977d8dde4b24674c389562d27a238cf
CoreLibraryReviewExempt: Documentation change.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310771
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2024-01-26 19:32:14 +00:00
Konstantin Shcheglov afeb4d6253 AnalysisDriver. Use MapOfListExtension for requests.
Change-Id: Icc211bd2c41bbb04cf3bfef6fece7c2983bcdf40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348721
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-26 19:30:35 +00:00
Konstantin Shcheglov 5ec8fa0b40 AnalysisDriver. Use Set<FileState> for 'knownFiles'.
Change-Id: I7187c12aae8b64a0f7db4f816066bf1df1226ec9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348760
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-26 19:21:22 +00:00
Ryan Macnak 4e6cd29eef [vm, gc] Mark through new-space.
- Initial and final marking no longer visit all of new-space, reducing the STW pause for major GC.
 - A scavenge during concurrent marking must forward / filter objects in the marking worklist that are moved / collected, increasing the STW pause for minor GC.
 - Unreachable intergenerational cycles and weak references are collected in the next mark-sweep instead of first requiring enough scavenges to promote the whole cycle or weak target into old-space.
 - Artificial minor GCs are no longer needed to avoid memory leaks from back-to-back major GCs.
 - reachabilityBarrier is now just a count of major GCs.

TEST=ci
Change-Id: I1e653c9b5d3e02e45b280302c832157a75788db6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345350
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-01-26 18:58:54 +00:00
Daco Harkes bc96411921 [vm] Fix fuchsia build
Update path to package:ffi after
https://dart-review.googlesource.com/c/sdk/+/346761.

Change-Id: If91c2b2476ba7f1c8771a9e4771f089b36847dc5
Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-arm64-try,vm-fuchsia-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348402
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2024-01-26 18:24:18 +00:00
Ryan Macnak 24f838370d [vm] Avoid querying boot time on Mac/iOS.
mach_absolute_time uses the same clock as CLOCK_UPTIME_RAW. There are privacy concerns that boot time can be used for device fingerprinting. Dart doesn't not need to know boot time, only some monotonic clock.

TEST=ci
Change-Id: I57acd080bb93ce9cf51b4b90aec09bb7cab7f7af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348044
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2024-01-26 18:21:14 +00:00
Martin Kustermann c4b9d63cf1 [dart2wasm] Fix JSCM builder (which does not have OneByteString/TwoByteString)
Change-Id: I4faa22d44e93e9669984cd24bb3573f77d32f5b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348780
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-26 18:16:10 +00:00
Konstantin Shcheglov 6b0b4d425b Macro. Keep FileState for macro file, refresh if its content changes.
Bug: https://github.com/dart-lang/sdk/issues/54713
Change-Id: I8311bddc77ea3535a66e26e241c9bac8f51d713c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348367
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-26 16:46:27 +00:00
Daco Harkes f4c3572c18 [deps] Rev native packages.
`package:ffi` has moved from dart-lang/ffi to dart-lang/native.
Stop pulling in dart-lang/ffi and update the revision for
dart-lang/native to include a revision with `package:ffi`
`tools/generate_package_config.dart` should automatically update
the toplevel `.dart_tool/package_config.json` to point to the new
checkout location the Dart SDK.

Also rolls breaking change in native_assets_cli:
https://github.com/dart-lang/native/pull/885

And rolls the move of the test projects:
https://github.com/dart-lang/native/pull/938

Change-Id: Ibc1c88026487bece2580a7d3d4ceb7ee50cd76d0
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-win-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346761
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
2024-01-26 16:12:29 +00:00
Sergey G. Grekhov f4dae88355 [co19] Roll co19 to af2ac968c0ca28b7dd94325b00a3acf569f6e858
2024-01-26 sgrekhov22@gmail.com dart-lang/co19#2485. Add constant evaluation tests for `Set` (dart-lang/co19#2509)
2024-01-26 sgrekhov22@gmail.com Fixes dart-lang/co19#2507. Fix roll failures (dart-lang/co19#2508)
2024-01-26 sgrekhov22@gmail.com dart-lang/co19#2485. Add is T constant evaluation tests (dart-lang/co19#2501)
2024-01-26 sgrekhov22@gmail.com dart-lang/co19#2485. Add `is! T` constant evaluation tests (dart-lang/co19#2504)
2024-01-25 sgrekhov22@gmail.com Fixes dart-lang/co19#2503. Update exhaustiveness_map_A02_t02.dart according to the flow analysis change (dart-lang/co19#2503)
2024-01-25 sgrekhov22@gmail.com dart-lang/co19#2420. Exhaustiveness variable tests. Add switch statement check (dart-lang/co19#2453)
2024-01-22 sgrekhov22@gmail.com dart-lang/co19#2485. Add more constant evaluation tests for record types (dart-lang/co19#2499)
2024-01-22 sgrekhov22@gmail.com dart-lang/co19#2420. Add more exhaustiveness tests (dart-lang/co19#2498)

Change-Id: If4af6cc1df4d44ad01e3578b8524748f67e7bac4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348660
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2024-01-26 16:09:08 +00:00
Devon Carew e2aac0b8e8 [web docs] add package:web to the main sdk docs - api.dart.dev
Change-Id: I858db7090563cc7366d22f191b7cd3cf49047d5e
CoreLibraryReviewExempt: doc only change to the web libraries
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348182
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2024-01-26 15:54:59 +00:00
Konstantin Shcheglov 3d4a39e9c2 Revert "Revert two CLs that remove WithoutNullSafetyMixin usages."
This reverts commit 1719ef36c4.

See https://github.com/flutter/flutter/issues/141576 for why it was
reverted.

Change-Id: I3a0a6ddf1b23cda008ae1d3a052c6daa05c10729
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348185
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-26 15:37:18 +00:00
Keerti Parthasarathy 20a27fee11 Fix for data driven rename when class is used in as expression
Change-Id: I7726b025b417278007f55af55bd2eaead0f55c94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-01-26 14:45:37 +00:00
Martin Kustermann ecb5fc2228 [dart2wasm] Improve dispatch table packing from 49% to 99%
The most important thing with dispatch table layout is to order classes
in depth-first pre-order numbers and make it only include concrete
classes.

* We only dispatch on concrete classes.
* Any selector of a base class is inherited by its subclasses
* Using DFS makes selector rows have few but wide filled blocks.

This CL orders class ids in a pure DFS pre-order numbering:

* DFS pre-order traversal for concrete classes
* DFS pre-order traversal for abstract classes

=> Increases dispatch table packing from 49% to 99%
=> Reduces GDT from 31k entries to 15k entries on Flute
=> Reduces Flute by around 2.1% code size.

It also prepares for implementing faster type checks by doing class-id
range checks.

Change-Id: I96744b114e8815904f7405dca1432cdca3c7fe30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348561
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-26 14:44:08 +00:00
Jens Johansen cdad90dfb8 [frontend_server] frontend_server_flutter_suite
Generally the test loads a big dill thats 90+% the same content as the
previous load, then verifies it.
This CL loads smarter and verifies less.

Before this CL, locally, running
pkg/frontend_server/test/frontend_server_flutter.dart took
real    24m56.080s
user    48m42.422s
sys     1m2.360s

and the suite edition (using 4 shards in isolates) took
real    15m9.196s
user    53m41.118s
sys     1m30.045s

With this CL, locally running
pkg/frontend_server/test/frontend_server_flutter.dart takes
real    5m0.206s
user    9m23.933s
sys     0m20.984s

and the suite edition takes
real    3m24.243s
user    12m0.069s
sys     0m28.131s

On the try-bot the runtime seems to have gone from ~40 minutes
to ~20 minutes, the "compile flutter tests" step from ~30 minutes to
~10 minutes and the portion of time actually running the
dart-code that compiles, loads and verifies, from ~26 minutes
to ~7 minutes.

Change-Id: I6db225c33e1c0ee817f3880327e720446150ad7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347282
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-01-26 14:28:40 +00:00
William Hesse 74672eca0a [dart2wasm] Fix jsc path in testing support for jsc
The CIPD download puts the platform-specific executable for jsc
(JavaScriptCore) directly in the third_party/jsc directory.

Follow-up to https://dart-review.googlesource.com/c/sdk/+/347283

Bug: b/322134579
Change-Id: I6af151de10e28fee06f6ba64a288f12859516151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348642
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: William Hesse <whesse@google.com>
2024-01-26 13:31:00 +00:00
Martin Kustermann b562998c14 [dart2wasm] Align semantics of -O3 with dart2js semantics
* Golem is now using -O3
   => remove `--omit-checks` from pkg/dart2wasm/tool/compile_benchmark.

* Dart CI is using -O1/-O2
  => remove `--optimize`/`--no-optimize` from
     pkg/dart2wasm/tool/compile_benchmark and `dart compile wasm`

* Align semantics of -3 with dartjs (enable `--minify`, enable
  `--omit-implicit-checks` disable  `--omit-explicit-checks`).
  => This will make us see changes in benchmarks.

What remains is

* Expose remaining flags in `dart compile wasm` that are needed for
  flutter (or add a generic `--extra-compiler-args` that forwards flags)

* Migrate flutter to use `dart compile wasm`.

* Remove `--omit-type-checks` from pkg/dart2wasm/lib/dart2wasm.dart

Issue https://github.com/dart-lang/sdk/issues/54675

Change-Id: I80654a3ae81bdc5f4c57e3fadccdf5612236102a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348500
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-26 13:26:40 +00:00
Johnni Winther 5db4f9bbd0 [cfe] Refactor isPatch, isAugmentation flags
This updates the isPatch/isAugmentation flags to use an augmentation-
centric terminology.

* We use `isAugmenting` instead of `isPatch` to
  mark that the origin of a builder is not the builder itself.
* We use `isPatchLibrary` on `SourceLibraryBuilder`s created as patches
* We use `isAugmentationLibrary` on `SourceLibraryBuilder`s created as
  augmentation libraries.
* We use `isAugmentation` on `SourceClassBuilder`s and
  `SourceMemberBuilder`s declared with the `augment` modifier.

Change-Id: If7fbf1787f2c319e71cae7521af2596dd0545fe5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348163
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-01-26 12:00:58 +00:00
Jens Johansen b6afc25769 [CFE] Replace line/column with * should also work when running with out/ReleaseX64/dart
Follow-up to https://dart-review.googlesource.com/c/sdk/+/347901 as it
didn't work when running the tests with out/ReleaseX64/dart.

Change-Id: I012d53217e87e087078de3fbff122dfca23b1e9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348261
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-01-26 10:06:00 +00:00
Martin Kustermann 8b823dc300 [dart2wasm] Allow pkg/dart2wasm/tool/compile_benchmark to run from source via --src
Normally it uses the AOT runtime & dart2wasm AOT snapshot, which takes
long to build. (similar reason why one doesn't want to use `dart compile
wasm` in dev cycle)

Fixes also bug in script that used $BINARYEN_FLAGS instead of
"${BINARYEN_FLAGS[@]}" - which caused wasm-opt to run without
any flags.

Change-Id: Id6e03dbc01f7dba22de380453260278858dc0aa9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348480
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-01-26 08:46:42 +00:00
Paul Berry fa9d376135 Improve unit test error reporting in handleDeclaredVariablePattern.
When a unit test expectation fails, it is helpful to include the
location of the test code that led to the problem in the test output.

Change-Id: I56827150be2fe75a2febee6b61af49eba5c2def9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348362
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-01-26 02:59:13 +00:00
Parker Lougheed 30b7a2f364 [analysis_server] Don't suggest adding a second late as a fix to assignment_to_final
Change-Id: I83b729e76a39759e0264a9b78947a318a782a26a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
2024-01-25 23:19:26 +00:00
Konstantin Shcheglov 662302476a Augment. More tests for augmentations, fixes.
Change-Id: I2114d1f21f5b2d89a5b95382613cc26884074930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348363
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-25 23:08:49 +00:00
Konstantin Shcheglov ce8de8a656 Use shared MemoryByteStore in analyzer/.
Without:
scheglov@scheglov-macbookpro4:~/Source/Dart/sdk.git/sdk (aa-remove-legacy)$ d-rta
06:14 +29315 ~18: All tests passed!

real  6m21.829s
user  6m24.218s
sys 0m31.477s


With:
scheglov@scheglov-macbookpro4:~/Source/Dart/sdk.git/sdk (master)$ d-rta
01:59 +30000 ~18: All tests passed!

real	2m6.424s
user	2m3.645s
sys	0m15.243s

Change-Id: I9171a99c2224cd79801b8010cda62f1e9b937745
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348366
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-25 23:08:39 +00:00
Konstantin Shcheglov cf9b25969e Macro. Issue 54713. Fix for macro-generated FileState when there are concurent access to it.
Change-Id: I399bcfd37fc4801d6222af51ce70f1dd78b687d5
Bug: https://github.com/dart-lang/sdk/issues/54713
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348202
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-25 22:52:03 +00:00
Martin Kustermann 5c06035575 [dart2wasm] Improve dispatch table call
The compiler would perform O(n) operation (where `n` is number of
classes that implement a selector) every time a GDT call is made.

Change-Id: I428a69faa0f5d83e11b3948fd7e009f49c1acba1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348400
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-25 22:16:41 +00:00
Jackson Gardner e9590179fe Revert "Refactor PubWorkspace into PackageConfigWorkspace"
This reverts commit 43fb59f4dc.

Reason for revert: Breaking Dart SDK -> Flutter Engine roller. See https://github.com/flutter/flutter/issues/142253

Original change's description:
> Refactor PubWorkspace into PackageConfigWorkspace
>
>  - use package_config.json as marker file for workspace.
>  - workspace can have multiple packages, they can be either PubPackages (marker pubspec.yaml) or BasicWorkspace.
>  - add package info (pubspec) to resolution salt.
>  - removed duplication of finding package_config.json from ContextLocator, as this is now done while creating workspace.
>  - some test/s setup/expectations were changed since we now use package config as marker for workspace instead of pubspec.
>
> Change-Id: I091a4a686c6b1d8c14858aefd9843a8d9c8efa25
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345346
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Keerti Parthasarathy <keertip@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>

Change-Id: I59adf5b26d25e360bcf962323db688156774c767
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348364
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
2024-01-25 21:00:47 +00:00
Martin Kustermann 14c0f42118 [dart2wasm] Avoid marking record class as allocated on access
Records should be marked allocated when records get created
(e.g. record literals / constants) not when fields of records get
accessed.

Change-Id: I7b7fc5cfd71da1f501551efe948ae3a44a128b6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348381
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-25 20:47:21 +00:00
Oleh Prypin ab2269ad8c Revert "[dart2js] Update remaining usages of ignoringNullability to withNullability for isSubtypeOf checks."
This reverts commit 09da72e78e.

Reason for revert: b/322326069 - new crash during dartjs compilation

Original change's description:
> [dart2js] Update remaining usages of ignoringNullability to withNullability for isSubtypeOf checks.
>
> Change-Id: Iceed58f5156a3f43bf5a08fbc598e70500ee7b52
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344763
> Reviewed-by: Mayank Patke <fishythefish@google.com>
> Commit-Queue: Nate Biggs <natebiggs@google.com>

Change-Id: I1b81caf92d9a9495cc751f816243b78c0d3a11ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348401
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Auto-Submit: Oleh Prypin <oprypin@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-01-25 20:10:14 +00:00
Konstantin Shcheglov a5ffdab226 AnalysisDriver. Update getFilesDefiningClassMemberName() to complete with FileState(s).
Change-Id: I2283acc5ecbf2bee122df74841befb71506909c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348421
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-01-25 19:58:11 +00:00
Srujan Gaddam 3b294fdab2 [dart:js_interop] Add isA helper
Closes https://github.com/dart-lang/sdk/issues/54138

Adds a helper to do better type-checks so that users don't
accidentally using is checks or have to manually do the right
typeof or instanceof checks. In order to do this, there is
some refactoring to make ExportCreator a SharedInteropTransformer
(as it's shared across all backends) so that we can reuse an
existing visitor. In the same class, we remove unnecessary setting
of parent pointers. We should clean up the fileOffsets as well,
but dart2js verifies that those are set, so we keep them as is
for now. Also adds some static errors for edge cases.

CoreLibraryReviewExempt: Helper for web-specific library.
Change-Id: I34d818ada1349b69afd15d170d3fafa0460f65fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347225
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-01-25 18:52:45 +00:00
Konstantin Shcheglov 8c7ccfafd2 QuickAssist. Support for relational operators in ConvertIfStatementToSwitchStatement.
Change-Id: Ia156566914c45688b164669a18fed5ef4237cd03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348420
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-01-25 18:03:09 +00:00
Mayank Patke 00647bfcc0 [dart2js] Default record classes to main output unit
Bug: #51016
Fixes: #51955
Change-Id: I457890c5282b3dac16b0d16e73a0c6da29553688
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348203
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-01-25 17:08:40 +00:00
Keerti Parthasarathy 43fb59f4dc Refactor PubWorkspace into PackageConfigWorkspace
- use package_config.json as marker file for workspace.
 - workspace can have multiple packages, they can be either PubPackages (marker pubspec.yaml) or BasicWorkspace.
 - add package info (pubspec) to resolution salt.
 - removed duplication of finding package_config.json from ContextLocator, as this is now done while creating workspace.
 - some test/s setup/expectations were changed since we now use package config as marker for workspace instead of pubspec.

Change-Id: I091a4a686c6b1d8c14858aefd9843a8d9c8efa25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345346
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-01-25 13:08:44 +00:00
Martin Kustermann 9e5c97dd4e [dart2wasm] Make dart2wasm bots use -O0 / -O1
We also temporarily make -O3 behave as --omit-type-checks (the current
golem behavior)

We can then make golem use -O3 and then make a Dart SDK CL that
reverts this change so we see the impact of e.g. --minify as change on
golem attributed to Dart SDK commit.

Change-Id: Ic74688de609e7ed720b1493a4236552963c53c2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348320
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-01-25 12:55:37 +00:00
Oleh Prypin 0da8f7a7b4 Remove unnecessary imports of 'package:collection' IterableExtension
* Replace `.whereNotNull()` with `.nonNulls` which is now in Dart core.
* `.firstOrNull`, `.lastOrNull`, `.singleOrNull` and `.elementAtOrNull(i)` are also in Dart core and even under the same name, so simply drop the import of 'package:collection' whenever possible.

Bug: b/322159291
Change-Id: I81eb93426680dc78a608bbcc714eb26c0eca5c62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348260
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Oleh Prypin <oprypin@google.com>
2024-01-25 11:07:28 +00:00
Martin Kustermann 92d53c426f [dart2wasm] Add -O/--optimization-level flag to dart compile wasm
We make the meaning of -O{0,1,2,3,4} to be similar to what dart2js has.
We also make the pkg/dart2wasm/tool/compile_benchmark accept the same flags.

Follow-up CLs will migrate Dart CI / Golem / flutter to use -O flags.

Change-Id: Id37476c596ec7483e633c7db9eec96438315e919
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348165
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-01-25 09:53:04 +00:00
Martin Kustermann 7b37838b6f [dart2wasm] Split --omit-type-checks into --omit-{implicit,explicit}-checks
This aligns the behavior of --omit-implicit-type-checks with dart2js

Change-Id: I453652339f23b89873d070422cf61eca77a2b68d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348164
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-01-25 09:52:25 +00:00
Parker Lougheed 7901612ea3 [vm] Remove macOS 10.14 and iOS 12 availability checks
macOS 10.14 has been Flutter's minimum for a while, and iOS 12 is the new minimum as of https://github.com/flutter/flutter/issues/140474.

Dart has not marked these platforms as supported for an even longer time.

Supported platforms reference: https://docs.flutter.dev/reference/supported-platforms

TEST=ci

Bug: https://github.com/flutter/flutter/issues/140474
Change-Id: I12377975d9c4d57e19d486898f0fcd89a1583f7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346920
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-01-25 08:23:51 +00:00
Srujan Gaddam f04e42be46 [dart:js_interop] Allow dart:html types in external signatures
Closes https://github.com/dart-lang/sdk/issues/54482

This is generally useful for users working around some limitations of
dart:html. While we want to encourage users to use package:web,
dart:html is not available on dart2wasm and users can use dart:html in
other ways already e.g. in an interop extension type, so it doesn't make
sense to disallow this. We also allow type parameters that extend these
types as well.

In order to make this a bit more performant (subtyping checks may be
expensive), code is refactored to cache more readily and separate the
notion of an allowed representation type vs interop extension type. We
also define the notion of a "core" interop type, which will be useful
when we want to efficiently query what interop type users are using
underneath the possible layers of extension types.

A few missing tests around typed_data are added and the error around
invalid types is reworded to include this change and be more consise.

Change-Id: I256b0cce4355d2a21853b0c5bf641166cafc523e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347224
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-01-25 02:10:44 +00:00