Should fix the flakes seen in https://github.com/dart-lang/sdk/issues/48274 caused by Isolate PauseStart events arriving during initialization but being delayed until initialization complete, and then auto-resuming isolates that ere deliberately being left paused.
Change-Id: Iee32731b92fe96b6b41e7e78c01af2f5e843ea92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231460
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Initial support for performing precompilations based on the computation
of [NeededPrecompilations].
Currently this requires the caller to supply a `macroSerializer` that
can convert a [Component] into a [Uri] that can be passed to the macro
executor.
Also, the caller needs to supply a `macroTarget` used for the
precompilation. This is done to avoid (for now) a dependency of the VM
target inside the CFE itself.
Change-Id: I50cc25fe6632a25c0c1a8a1ac019e6d9e35ab4f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231443
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
The arguments synthesized for enhanced enums didn't ensure correct
setup of `ArgumentsImpl.argumentsOriginalOrder` needed for the
named-arguments-anywhere feature.
The CL also handles local initializers as part of constants, as needed
when combining the two features.
Included is a fix in adding synthesized enum arguments to redirecting
initializers. This was accidentally done on all classes (not just enum
classes) when enhanced enums was enabled.
Closes https://github.com/dart-lang/sdk/issues/48276
Change-Id: If911e57bb338a50f2cee1721b4e43ff343685933
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231440
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Register allocator does not need to associate always-calls
safepoints with live ranges of constant values because
constant values are never actually spilled and are rematerialized
instead.
@alexmarkov has observed that SafepointPosition objects for
constants account for large chunk of the total memory eaten by
the register allocation pass and this change addresses this issue.
With this change the total memory consumed by the register allocator
decreases from 21 Gb to 8.6 Gb on one of the examples
in https://github.com/flutter/flutter/issues/94461.
TEST=ci
Change-Id: I245f2678bc6f5c1d63fd282812d1df2b2958512f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231442
Auto-Submit: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Duplicates `_CompactIterable` and `_CompactIterator` to
`_CompactIterableImmutable` and `_CompactIteratorImmutable` to prevent
the `_data` field to store both modifiable and unmodifiable lists.
This speeds up iteration by about 20% (more info on the bug).
Does not use mixins for code sharing, because all the fields need to be
in the concrete classes anyway.
Closes: https://github.com/dart-lang/sdk/issues/48280
TEST=existing lib tests
Change-Id: I514d058d02ef3b26b475000daea3afc12f37c566
Cq-Include-Trybots: luci.dart.try:analyzer-nnbd-linux-release-try,app-kernel-linux-debug-x64-try,dart-sdk-linux-try,front-end-nnbd-linux-release-x64-try,pkg-linux-debug-try,vm-canary-linux-debug-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-checked-linux-release-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-tsan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231243
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This CL adds support for macro application on all library
and class members.
Change-Id: I792837be5c73a5353f565528b8a6dcff3e28a3d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231244
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Towards #48275
Change-Id: Idfe1de48b7f292b6c89e5b904f74c37232380c6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231065
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Change-Id: Ic7c2b3cffa62b66d5c66713958e3626fa67e1945
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231331
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
`scrollIntoViewIfNeeded` is nested within `scrollIntoView`. The latter
method is outdated and the way to access the different ways to call
`scrollIntoViewIfNeeded`. Instead of using that method, this CL
directly exposes `scrollIntoViewIfNeeded`.
Change-Id: I38d7876a7923768ae165c29a98e514e90182b77e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231047
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
This avoids the need to refer to context types after resolution is
complete.
This is part of a larger effort to elimiate the use of
InferenceContext.getContext and InferenceContext.setType entirely.
Change-Id: Ia3f15080ad8b6f90525577694fefc172faa93286
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Fixes some failing tests on the Windows bots that were getting backslashes but expecting forward.
Change-Id: Idd89a45d7be87385d497e221a1941e4c48d597af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Now that we only use InferenceContext.setType for expressions, this
change consolidates all the call sites to just two places:
- The method ResolverVisitor.analyzeExpression, which is used when
recursively analyzing subexpressions inside expressions and
statements.
- The method InferenceContext.setTypeFromNode, which is used during
AST rewrites to transfer context information from the original node
to the rewritten node.
This is part of a larger effort to elimiate the use of
InferenceContext.getContext and InferenceContext.setType entirely.
Change-Id: Id236bcb1247c09b740bbbad41cb74ecda301cc86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231181
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This change removes distinct Slots for the same field:
PointerBase_data_field -> PointerBase_data
Pointer_data_field -> PointerBase_data
TypedDataBase_data_field -> PointerBase_data
Also, the following slot is renamed to match field name:
TypedDataView_data -> TypedDataView_typed_data
The following offsets are renamed to match field names /
declarations in Untagged* classes:
PointerBase::data_field_offset -> PointerBase::data_offset
TypedData::data_offset -> TypedData::payload_offset
TypedDataView::data_offset -> TypedDataView::typed_data_offset
TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/48273
Change-Id: I602545fc43018494bcb24d8692292fdbc6a8f3e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231160
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Instead of using InferenceContext.getContext and
InferenceContext.setType to associate type inference information with
VariableDeclaration nodes, we pass the information on the stack using
a new FunctionBodyImpl.resolve method. This should be more efficient
for two reasons: it avoids a map lookup, and it avoids the double
dispatch traditionally associated with calling a visitor. It should
also make the code easier to reason about (since it makes the flow of
data in the type inference process more explicit).
This is part of a larger effort to elimiate the use of
InferenceContext.getContext and InferenceContext.setType entirely.
Change-Id: I8a3f3be940acdcd0a2c4ad8ec37b41bafe25c952
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230948
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Instead of using InferenceContext.getContext and
InferenceContext.setType to associate type inference information with
VariableDeclaration nodes, we directly look up the variable type when
we need it. This should be more efficient (since it avoids a map
lookup), and it should make the code easier to reason about (since it
makes the flow of data in the type inference process more explicit).
This is part of a larger effort to elimiate the use of
InferenceContext.getContext and InferenceContext.setType entirely.
Change-Id: I01262fb3c3e6789ee9da924e731d86d99ce3f4de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230946
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This CL adds a tool that can compare the class hierarchies of two dill files.
Currently it only checks for public classes and their public supertypes.
We could extend the tool later if needed.
Currently it gives this for flutter:
```
$ out/ReleaseX64/dart pkg/kernel/bin/compare_hierarchies.dart /path/to/flutter/bin/cache/flutter_web_sdk/kernel/flutter_ddc_sdk_sound.dill /path/to/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/platform_strong.dill "dart:nativewrappers#NativeFieldWrapperClass1"
(1): /path/to/flutter/bin/cache/flutter_web_sdk/kernel/flutter_ddc_sdk_sound.dill
(2): /path/to/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/platform_strong.dill
Missing classes in lib dart:_internal
In (2) but not in (1): [VMLibraryHooks, Lists, VMInternalsForTesting, ClassID]
Missing classes in lib dart:ui
In (1) but not in (2): [PlatformViewRegistry]
Class(ColorFilter) in dart.ui from (2) has these extra supertypes: [ImageFilter (dart:ui)]
```
where the last line is https://github.com/dart-lang/sdk/issues/48245
It gives this for the dart sdk:
```
$ out/ReleaseX64/dart pkg/kernel/bin/compare_hierarchies.dart out/ReleaseX64/vm_platform_strong.dill out/ReleaseX64/ddc_platform_sound.dill "dart:nativewrappers#NativeFieldWrapperClass1"
(1): out/ReleaseX64/vm_platform_strong.dill
(2): out/ReleaseX64/ddc_platform_sound.dill
Missing classes in lib dart:_internal
In (1) but not in (2): [VMLibraryHooks, Lists, VMInternalsForTesting, ClassID]
```
which seems fine (dart:_internal after all)
Change-Id: I03c0dbcc3e5058a0c7d6a996b511cf6d449dd4f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231100
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
In the future we might just run this as a regular thing. It doesn't take
that long.
Change-Id: I88794b37d914ba3f84b5e408009a477ec433f897
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231104
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>