Commit graph

99663 commits

Author SHA1 Message Date
Ryan Macnak 8baa99a697 [vm] Fix some left shifts of negative values.
TEST=ubsan
Change-Id: I606a3c1ee0a4bf5da8e03b458ad6031dcd65ca05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350941
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-02-07 21:52:22 +00:00
Oleh Prypin 0e9cdfbc06 Reland "analyzer: Remove unnecessary FixContributor and DartFixContributor classes"
This is a reland of commit c69f4321e6.

Bug: b/318016861
Change-Id: Ic47203839e453b9fd156c8df89117c642b4a235d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350863
Auto-Submit: Oleh Prypin <oprypin@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-02-07 21:50:09 +00:00
Ryan Macnak b7e2327fe3 [test] Account for C.UTF-8 in locale test.
Change-Id: I9fda623aca715ac4209335676b30e4191e791c4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350658
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-02-07 21:30:29 +00:00
Ryan Macnak 7a9ea2f696 [test] Don't expect disassemble_test to crash.
Bug: https://github.com/dart-lang/sdk/issues/34971
Change-Id: I70c376011584e0cefd4cabeaf898aee60a26a30f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350659
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-02-07 21:30:10 +00:00
Paul Berry 7644ae5f72 Inline BinaryExpressionResolver._analyzeLeastUpperBoundTypes.
This method was called from exactly one place, and did very little
beyond plumbing. It's clearer to just inline it directly in its
caller, `BinaryExpressionResolver._resolveIfNull`.

Change-Id: I1a714206889f0eecb89b769ce2da350daa31780a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350695
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-02-07 20:53:25 +00:00
Konstantin Shcheglov f868eaea3c Legacy. Remove 'Null*' and 'Object*' from the type system.
Change-Id: I542dc4cca90e180231e2b958f8e1bab7758216a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350657
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-02-07 19:44:57 +00:00
Ben Konyi 515c14ab40 [ Service ] Unregister isolate with the service before sending an IsolateExit event
This prevents the ServiceIsolateVisitor from including the isolate
that's shutting down in a `getVM` response. This is likely the cause of
flakiness in some tests that explicitly wait for a certain number of
IsolateExit events before requesting state for all remaining isolates.

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

TEST=Existing service tests

Fixed: 54783
Change-Id: Ic990d8c64baac98d2fd67f528d6f7d0dd6009b82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349520
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-02-07 18:47:51 +00:00
Danny Tuppeny e10bc067f7 [dds] [dap] Treat "Client is closed" errors the same as "Client closed with pending request" for DAP
These errors can occur normally during shutdown and should not be considered unhandled, otherwise they will trigger crash reports.

Change-Id: I4b0071b8029e10b021af74bf0b5622c02a22eb75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350860
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-02-07 17:56:10 +00:00
Konstantin Shcheglov bd2da6274c Legacy. Remove 'nullSafe' strings from test names.
Change-Id: I7aab52e0385946079c60a0d7512e43bed43252ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350690
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-07 17:33:38 +00:00
Ben Konyi 96b29d461c [ CLI ] Make tooling-daemon command visible with --verbose
Change-Id: I298302afb628cb67887e39f616482a2071d2bc52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349020
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-02-07 17:23:52 +00:00
Konstantin Shcheglov 3e7e418589 Legacy. Remove isNullSafetyEnabled.
Change-Id: If1bdca8cfed1f787ae0fce6d57fb168ed8b913ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350650
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-07 17:14:59 +00:00
Konstantin Shcheglov 18585b17bc Macro. Record InvalidMacroTargetDiagnostic, if the target is not suitable for the macro.
Change-Id: Ic9e69e0297b76d06a2012e609750b1e0b7438093
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350687
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-07 17:13:11 +00:00
Jake Macdonald 94fb9c9f2c support custom JSON keys for fields
Change-Id: I72c2a4f09b012c4100fe9286967d182831507160
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350740
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2024-02-07 16:48:38 +00:00
Konstantin Shcheglov b6f18a8cf1 Legacy. Remove isNNBD flag.
Change-Id: Iee0004a7a897be9dd2055bdb1f87247d6fed9a82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350689
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-07 16:42:44 +00:00
Oleh Prypin 9fdb0cae90 Fix directives_ordering to sort '/' absolute paths first
Basically the code change just falls back to the behavior prior to commit aed089e45c35221ce2b82f3757132031f0344b8b when a leading slash is encountered.

Fixes https://github.com/dart-lang/linter/issues/4869

Change-Id: I61fc7915f44f043f591ea439d40d4016fc8b3d27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350861
Commit-Queue: Oleh Prypin <oprypin@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-02-07 16:23:10 +00:00
Brian Wilkerson 5b8ba3654c Add code completion support for members from augmentations
Change-Id: Iac118193be6d0d45f2144280fa2b926a305e761c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349982
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2024-02-07 16:15:49 +00:00
Alexander Markov e7eb0aaa20 [benchmarks] Add benchmark for taking tear-offs repeatedly
Issue: https://github.com/dart-lang/sdk/issues/54808
Change-Id: Ice28033bab71e30f9a586564d7e55d9c4f5ce770
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350640
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-02-07 15:16:19 +00:00
Jonas Termansen 6ee8a42a79 [infra] Document how to self-service update browsers.
Bug: b/297175436
Change-Id: I20329f0d227a798a15b9f6aaaf942e2261b5a32d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350862
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2024-02-07 14:15:39 +00:00
Paul Berry 33947151e9 Fix comments in InferenceVisitorImpl.visitIfNullExpression.
The comments were based on an old draft of a type inference
specification which was never ratified by the language team never
committed, and which did not match the implementation.

I've replaced them with a description of how the analyzer and CFE
currently handle if-null expressions.

Change-Id: I91ae2cf54b659636b9642e0aea1238d9f0684ae7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350780
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-02-07 13:35:39 +00:00
Paul Berry 3edc0b0e61 Repurpose inference-update-3 experiment for language issue 1618.
After discussion with Leaf, I believe the primary use case that
`interface-update-3` was intended to address can be better addressed
through the proposal of language issue
https://github.com/dart-lang/language/issues/1618 (instead of
https://github.com/dart-lang/language/issues/3471, which I had been
working on previously).

Since I had not made a lot of progress on
https://github.com/dart-lang/language/issues/3471, rather than set up
a brand new experiment flag, it seems better to simply back out the
work that I'd previously done, and repurpose the `inference-update-3`
flag to work on issue 1618.

Change-Id: I6ee1cb29f722f8e1f0710cbd0600cb87b8fd26a1
Bug: https://github.com/dart-lang/language/issues/1618
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350620
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-02-07 13:06:30 +00:00
Martin Kustermann eba0e68e1a [vm/ffi] Allow Pointer objects to be shared across isolates
We consider `Pointer` objects as simple value types. We may unbox them
in the future to be simple integers - at which point our message sending
code wouldn't even know they are pointers anymore. There's therefore no
reason to prevent sending them across `SendPort`s.

Owners of `Pointer`s may implement `Finalizable` and sending such
finalizables across `SendPort`s is prohibited.

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

TEST=vm/dart/isiolates/fast_object_copy*_test

Change-Id: Ia215d119c5bb0e48e2c5dc83cc82e132f46931c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350822
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2024-02-07 12:48:50 +00:00
Johnni Winther cd53c84f5a Fix frontend presubmit check on Windows
Change-Id: Ide265d78942718140d3792064694b1f83a1236a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350821
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-02-07 11:22:13 +00:00
Martin Kustermann f7e3c62e1e [gardening] Fix vm/dart/run_appended_aot_snapshot_test
The change in [0] broke the test due to some refactorings in
`package:dart2native`.

As the test isn't run from a Dart SDK but rather from the files in the
build folder, it cannot use the methods from `package:dart2native` which
now relies on being run from the Dart SDK.

[0] https://dart-review.googlesource.com/c/sdk/+/349280

TEST=Fixes vm/dart/run_appended_aot_snapshot_test

Change-Id: I74ff86f49a4fb790b407358b6493de003a89c926
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350820
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2024-02-07 10:24:09 +00:00
Martin Kustermann 967dfe6547 [dart2wasm] Fix compiler bug regarding void values that can be observed
Issue https://github.com/dart-lang/sdk/issues/54800

Change-Id: I26b8c35f60955ee46eeae19797aab7e6c84bf354
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350580
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-07 08:05:19 +00:00
Ben Konyi 5a38644295 [ CLI ] Update dart compile {exe, aot-snapshot} to allow for compilation from kernel
Also updates `dart compile kernel` to use `gen_kernel_aot.dart.snapshot`
instead of the VM's `--snapshot` flag.

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

Change-Id: Ifa6afed2428e41fdcff97183f3f3a2ddefec5042
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349280
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-02-07 02:39:02 +00:00
Kevin Moore 53056b663e js_interop[_unsafe]: update library documentation
CoreLibraryReviewExempt: just changing web libraries
changekind:NO_CODE_CHANGE
Change-Id: Idc8ab1865f43f33c3ab0824142b38fa715b1579b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350520
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-02-07 01:47:27 +00:00
Konstantin Shcheglov 14a1045f16 Legacy. Deprecate 'withNullability' in getDisplayString() methods.
Change-Id: I688f230f4189cd1fc600e4d34f07f339111c382d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350645
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-07 01:25:38 +00:00
Konstantin Shcheglov 5055a516f1 Macro. Include 'Platform.version' into kernel cache keys.
Sometimes change to SDK means that the kernel cannot be run anymore.

Change-Id: I85eb2eb5d477f1ab76218c22040e9689c574fcf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350686
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-02-07 01:24:38 +00:00
Nate Biggs 76a9d1c724 [dart2js] Remove dependency of ir.StaticTypeContext from element map constant query.
Change-Id: I1ef1d6699af7284b921c00c0faa89f2728f8f38e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348880
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-02-07 00:19:33 +00:00
Nate Biggs ccb99e6a5a [dart2js] Replace StrongModeConstraint with simple ClassEntity reference.
Change-Id: I6dbaf848196d6ad512ca366a3a4ec634c05f7fed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348542
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-02-07 00:19:33 +00:00
Nate Biggs a9fc1efe05 [dart2js] Clean up more code associated with Dart2JS static types.
The `ClassRelation` concept is no longer needed as we are only using the CFE static type. All creations of "exact" and "this" types were already removed in an earlier CL so we are already always following the 'subtype' path.

Change-Id: Iccc3d61737c5b64b3b4217f7f20b34b181cc7db2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348463
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-02-07 00:19:33 +00:00
Nate Biggs 922f0dda93 [dart2js] Delete more static type caching logic and replace with CFE equivalents.
By passing a cache to the `StaticTypeContext` we get an equivalent cache to what the `CachedStaticType` class was providing. We can create one of these for any non-synthetic member. We would never query a static type for a synthetic member.

This pattern has the added benefit of making the caches ephemeral. They are no longer stored on the closed world so they will get GCed with the member-specific builders. There's no reason to keep them around longer.

Change-Id: Id5b817e1674dd41e868d5bfaebefa48762a87ec8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348462
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-02-07 00:19:33 +00:00
Nate Biggs 9d5cb9524e [dart2js] Decouple static type visitor and impact builder.
Change-Id: Ib477d8fdcadb4f9699914aa6a2e6eb4facab61b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347944
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-02-07 00:19:33 +00:00
Nate Biggs 5ac794bf70 [dart2js] Remove Dart2js StaticTypeCacheImpl.
Change-Id: I0d2bf6b7dca2e9901a9b22ba89e33d7f12cb8ad4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347943
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-02-07 00:19:33 +00:00
Nate Biggs 780fa80d07 [dart2js] Remove largely unused Dart2js StaticTypeCache.
Change-Id: I1dcf6e3fc3eed524198e0e816c0de995c8ba2356
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348060
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-02-07 00:19:33 +00:00
Nate Biggs 63f766b64e [dart2js] Narrow type of map entries in global inference based on static type.
This helps avoid some regressions from doing less static inference and depending more on the CFE static types.

Change-Id: Id95596fab87ecc9ea0c2baf3a8c21f9c90b90f94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348221
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-02-07 00:19:33 +00:00
Keerti Parthasarathy 3b3abb233c Use package name when creating transforms instead of folder path.
This fixes the issue of creating package uri's with version numbers in them like 'package:go_router-7.0.0/...', and so failing to match the transform.

fixes https://github.com/dart-lang/sdk/issues/52233

Change-Id: I49aaf28c2294264a5f592318d1d4050c449b386c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350685
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-07 00:06:29 +00:00
Ben Konyi d9797db9ea [ VM ] Inherit system isolate property on child isolate spawn
This prevents --pause-isolates-on-start and --pause-isolates-on-exit
from impacting isolates spawned from system isolates. This should be
revisited to determine if:

- Inheriting the system isolate property is actually what we want to do
  in general
- Isolate.spawn* APIs should instead include a parameter to specify an
  isolate as a system isolate

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

TEST=Manual testing

Change-Id: Ibacdea845db6344148c11bebf001e4cac3377a62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348460
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-02-06 23:38:53 +00:00
Jake Macdonald a1d6a99dbe report better errors with targets for all cases
Once available, I will throw these diagnostics instead of just returning.

Change-Id: I64d9a1657f876328a5dce9a7e3e3ea5035a9f69e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350741
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-06 23:37:58 +00:00
Stephen Adams 7ef215a4a5 Reapply "[typed_data] Deprecate unmodifiable views"
This change, for Dart 3.4, deprecates the unmodifiable typed data constructors. Users of these constructors can upgrade the use of the constructors to instance method `asUnmodifiableView()`, or pin to Dart 3.3.

See https://github.com/dart-lang/sdk/issues/53785 for context.

CoreLibraryReviewExempt: Reviewed in https://dart-review.googlesource.com/c/sdk/+/321922
Issue: #53785
Change-Id: Icd52f2b6cd05cf3a328c82c197ef44d0b340b171
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332581
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-02-06 23:30:49 +00:00
Danny Tuppeny bdf4528871 [analysis_server] Show correct type for enum.values
Fixes https://github.com/Dart-Code/Dart-Code/issues/4877

Change-Id: Ie9b7f223f71c4c79c141ca69356340ef8b15aceb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-02-06 22:58:09 +00:00
Ryan Macnak fd2c27ff4e [vm, gc] Avoid TSAN warning for accessing Page::top_.
TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/54766
Change-Id: Ic297b426977b835d11c2a98357839f1df8cfbc39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349711
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-02-06 22:53:59 +00:00
Danny Tuppeny 69eb4e3532 [analyzer]/[analysis_server] Simplify reusing MockPackagesMixin and ConfigurationFilesMixin with non-memory resource providers
Change-Id: I0663ede821140a58fe7195603ec125d3bf9a2eb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350381
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-02-06 22:38:50 +00:00
Paul Berry 2ba038b642 Inline _analyzeLeastUpperBoundTypes and _analyzeLeastUpperBound.
These two methods were each called from exactly one place, and did
very little beyond plumbing. It's clearer just to inline them directly
in their caller, `visitConditionalExpression`.

Change-Id: Ia10b69fc2f0817319ca93c0f12b1b148ac179f33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350682
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-02-06 22:09:27 +00:00
Danny Tuppeny 5e1fb3ebb9 [analysis_server] Support folding For loops and Function expressions
Fixes https://github.com/Dart-Code/Dart-Code/issues/4780
Fixes https://github.com/Dart-Code/Dart-Code/issues/4723

Change-Id: I6a2f5eb616643df0aaec7fef1b87594f6e223c5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350581
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2024-02-06 21:57:12 +00:00
Alexander Markov 3a6e1c2554 [vm/aot/tfa] Avoid duplicate invocations when approximation is created
When the number of different invocations with the same selector is too
large (due to different arguments), TFA creates an approximate
invocation which uses raw (static) types of parameters.

A new approximate invocation was not queried in the cache and but
could match an existing invocation. This causes a problem as
_DependencyTracker keeps invocations as a Set<_Invocation>, so
duplicate approximate invocation may overwrite an existing
invocation in the dependency tracker, effectively breaking
the dependency chain and preventing invalidation, which could
cause incorrect analysis results and incorrect tree shaking.

This change fixes this bug by adding a lookup of the approximate
invocation in the cache, so duplicate invocation is not created.
Also, TFA heuristic thresholds are extracted to a separate
class to make TFA more configurable and allow writing unit tests
with approximations.

TEST=pkg/vm/testcases/transformations/type_flow/transformer/duplicate_approximate_invocation.dart
TEST=manually verified repro from b/322387862 without workaround.

Bug: b/322387862.
Change-Id: I1ff899f925d539b45f764d709e77c5800884ab4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349940
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-02-06 21:50:24 +00:00
pq b36df2bc34 Update CVE link
Change-Id: Ib9415127507ea319f94940ce0bba873188cc06eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350642
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-02-06 21:07:58 +00:00
Paul Berry 650c3cb917 Use records instead of MapPatternTypeArguments and NamedType.
These classes served no function but to wrap around two values; the
code that used them is clearer if it just uses record types instead.

Change-Id: I202dab727f27173489556ca1208e409e6a91fabd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350340
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-02-06 21:01:01 +00:00
Konstantin Shcheglov 65662d45b6 Legacy. Remove 'withNullability' parameters from analysis_server/ functions.
Change-Id: Ibe70149b6415234861b49fdc9cad58896b55d119
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350350
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-06 20:19:48 +00:00
Konstantin Shcheglov f930adbea4 Macro. Rename 'declarationBuilder' to just 'builder'.
Not a huge win of course, but I noticed that code is a bit longer
than I would like around `withAugmentations()`, and the word `declaration`
does not add much in this file.

Change-Id: I81895fa431fd1cd507e8c6d5842c14b0691a04d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350461
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-06 19:53:22 +00:00