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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>