The object graph copy code assumed kImmutableCid is used only for
list constants but it turns out our List.immutable([]) implementation
isn't using a wrapper-view, but instead a fixed-length immutable list as
with constants:
factory List.unmodifiable(Iterable elements) {
final result = new List<E>.from(elements, growable: false);
return makeFixedListUnmodifiable(result);
}
The list constants should already be handled via canonical bit.
Issue https://github.com/dart-lang/sdk/issues/51302
TEST=vm/dart{,_2}/isolates/regress_51302_test
Change-Id: I5924084ff004dc52bf675897455453d728484d1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281421
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This reverts commit 881825980e.
Reason for revert: The Fuchsia build of Flutter engine is broken by this change, since it uses the analyze_snapshot target.
Original change's description:
> [build] Make `build_analyze_snapshot` consistent between the host and target toolchains.
>
> Bug: https://github.com/dart-lang/sdk/issues/51242
> Change-Id: I7a0ad1f0bc94c4593412945e4887f9045693fd40
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280782
> Reviewed-by: Daco Harkes <dacoharkes@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
TBR=rmacnak@google.com,dacoharkes@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: I3f069274fdef9366fea347ae5f452d2eb2267f70
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/51242
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281423
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Auto-Submit: William Hesse <whesse@google.com>
This reverts commit 87810072db.
Reason for revert: breaks hot reload test case in Flutter,
reverting as temporary workaround to https://github.com/flutter/flutter/issues/120091.
Original change's description:
> [vm] Account for changes in the implicit getters due to load guards
>
> Hot reload may mark certain fields as 'needs_load_guard', meaning
> types of their values should be checked on access, in the implicit
> getters.
>
> Unoptimized code for implicit getters of such fields should be
> forcefully recompiled during hot reload in order to update their
> code. This ensures that optimized code in future can deoptimize
> into the updated unoptimized code of implicit getters.
>
> TEST=vm/cc/IsolateReload_ImplicitGetterWithLoadGuard
> TEST=corelib/string_fromcharcodes_test, lib/convert/json_utf8_chunk_test
> and vm/dart/string_equals_test on vm-reload-linux-{debug,release}-x64
> configurations.
>
> Fixes https://github.com/dart-lang/sdk/issues/51215
> Fixes https://github.com/flutter/flutter/issues/103268
>
> Change-Id: I1afbeabb4a60b7a5f69ed055f40beeb6d3dcf359
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280401
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ia7dba382547cceb38524707f9ecef892016108de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281220
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This reverts commit 3787601dd0.
Reason for revert: Introduces a crash that's blocking the Dart->Flutter roller: https://github.com/flutter/flutter/issues/120012
Original change's description:
> [VM/Timeline] Improve handling of track metadata
>
> The track information that we send over the service is currently
> incomplete. Since we only iterate over the threads that exist at the
> time when getVMTimeline is called, we're missing information about any
> threads that were joined before that. This CL fixes this issue.
>
> TEST=CI, ASAN, and I manually checked that more track names are
> populated when the changes in this CL are applied
>
> Change-Id: Ic4edc9910884c3f4743dc0ca65aa7d2a695ff09d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280058
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>
TBR=bkonyi@google.com,derekx@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: I920c8d439a3b253c331dd730b637dbfeaad62157
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281000
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Auto-Submit: Brandon DeRosier <bdero@google.com>
TEST=ci (existing test which was failing and should pass now)
Bug:51209
Change-Id: Ia156200af2b1271677f0a8ff576998b255adc964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280600
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Hot reload may mark certain fields as 'needs_load_guard', meaning
types of their values should be checked on access, in the implicit
getters.
Unoptimized code for implicit getters of such fields should be
forcefully recompiled during hot reload in order to update their
code. This ensures that optimized code in future can deoptimize
into the updated unoptimized code of implicit getters.
TEST=vm/cc/IsolateReload_ImplicitGetterWithLoadGuard
TEST=corelib/string_fromcharcodes_test, lib/convert/json_utf8_chunk_test
and vm/dart/string_equals_test on vm-reload-linux-{debug,release}-x64
configurations.
Fixes https://github.com/dart-lang/sdk/issues/51215
Fixes https://github.com/flutter/flutter/issues/103268
Change-Id: I1afbeabb4a60b7a5f69ed055f40beeb6d3dcf359
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280401
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
The track information that we send over the service is currently
incomplete. Since we only iterate over the threads that exist at the
time when getVMTimeline is called, we're missing information about any
threads that were joined before that. This CL fixes this issue.
TEST=CI, ASAN, and I manually checked that more track names are
populated when the changes in this CL are applied
Change-Id: Ic4edc9910884c3f4743dc0ca65aa7d2a695ff09d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280058
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
`NULLABLE_TYPE_IN_CATCH_CLAUSE` is becoming a warning, so these must be
fixed (or ignored).
TEST=presubmit
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: I8343f3e1f49ed3c05dcf2d99a98cef8a953afc7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280563
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
A larger element size results in larger mov instructions. This reduces
code size and increase performance.
The element size can only be increased if
* src_offset, dest_offset, and length parameters are const,
* and if they contain a common denominator (powers of two).
TEST=runtime/vm/compiler/backend/memory_copy_test.cc
Bug: https://github.com/dart-lang/sdk/issues/51031
Change-Id: If35fb419aa118c497b15c122bdf6279266e2294a
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-kernel-nnbd-mac-debug-arm64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-ia32-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-reload-rollback-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279506
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Removes loops with constant lenght taking code-size into account.
On ia32 and x64 only removes single iteration (removing the branch).
This speeds up single byte copies.
On arm, arm64, and risc-v, removes loops up to 4 iterations,
shrinking code size.
No speedups were measured on these platforms.
TEST=runtime/vm/compiler/backend/memory_copy_test.cc
Bug: https://github.com/dart-lang/sdk/issues/51031
Change-Id: I292ebde023b3ec2c3a9ce872e0c9543ac43371b9
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-kernel-nnbd-mac-debug-arm64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-ia32-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-reload-rollback-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279178
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This CL removes a Smi untagging by taking an unboxed input for the
length in the memory copy instruction or changing the loop decrementor
to 2 instead of 1.
Unboxing required implementing the method in the inliner because
unboxed representations cannot be used in the method recognizer.
Reduces code size slightly.
Does not measurably improve speed.
TEST=runtime/vm/compiler/backend/memory_copy_test.cc
Bug: https://github.com/dart-lang/sdk/issues/51031
Change-Id: Ie311929af25b76c3b899ff2791bfaf4e40b1f06f
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-kernel-nnbd-mac-debug-arm64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-ia32-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-reload-rollback-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279172
Reviewed-by: Alexander Markov <alexmarkov@google.com>
When constants are passed in to the source and destination start,
no registers are needed for these. The constants are directly compiled
into the machine code. If the constant happens to be 0, no machine
code is emitted at all.
I did not measure any speed improvements. Likely the micro-code
schedulers in the CPUs already noticed the no-ops.
I have verified manually that we emit smaller machine code with
these changes on x64.
TEST=runtime/vm/compiler/backend/memory_copy_test.cc
Bug: https://github.com/dart-lang/sdk/issues/51031
Change-Id: I70f12c9ae299b44a8f5007ca3a8c5ee56a9aff40
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-kernel-nnbd-mac-debug-arm64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-ia32-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-reload-rollback-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279170
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This is a reland of commit e7d8261f9a
Original change's description:
> Update HTTP Profiling ids to use Strings
>
> The internal Dart Ids can be 64 bit integers, and are passed to Dev Tools as integers. This is causing errors fetching requests as the ids can overflow once they get to dev tools.
>
> Interaction between `getHttpProfile` and `getHttpProfileRequest` are already performed in https://dart-review.googlesource.com/c/sdk/+/279122/3/pkg/vm_service/test/get_http_profile_test.dart
>
> https://github.com/flutter/devtools/issues/2860
>
> TEST=The original tests test the surface of the RPCs that are updated here. Any tests that needed tweaking have also been fixed. https://github.com/flutter/devtools/pull/5127 is being submitted to Devtools and G3, and the regressions have been tested against vm_service:10.0.0 and vm_service:11.0.0
> CoreLibraryReviewExempt: Changes are only to http profiling
> Change-Id: Ie560dde7629f91f4221c1fe18d153cd999691086
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279122
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Dan Chevalier <danchevalier@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>
TEST=The original tests test the surface of the RPCs that are updated here. Any tests that needed tweaking have also been fixed. https://github.com/flutter/devtools/pull/5127 is being submitted to Devtools and G3, and the regressions have been tested against vm_service:10.0.0 and vm_service:11.0.0
CoreLibraryReviewExempt: Changes are only to http profiling
Change-Id: I132f30111ca9c4c53dec377f6038453cacfc6243
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280020
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
TargetFlags.enableNullSafety is set to true by default and
also renamed to TargetFlags.soundNullSafety to better reflect its
meaning.
TEST=ci
Change-Id: I2c2f30c2af6502fd9a96141dc60e4afbf8c524fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280216
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
This change fixes assertion
../../runtime/vm/object_reload.cc: 942: error: expected: old_target_.is_static() || old_target_.kind() == UntaggedFunction::kConstructor
which happened when updating a target of static call from
record field getter to Record._fieldNames.
TEST=language/records/simple/dynamic_field_access_test
(on vm-reload-linux-debug-x64 configuration)
Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I0e80a91969778ca5a14805d79f4127ba53bc4aa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280246
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This CL updates the VM Service spec to v4.1 and adds the optional
`includeSubclasses` and `includeImplementers` parameters to the
`getInstances` service procedure.
This CL also adds `pkg/vm_service/test/get_instances_rpc_test.dart`
which is based on
`runtime/observatory/tests/service/get_instances_as_array_rpc_test.dart`
TEST=CI
Fixes https://github.com/dart-lang/sdk/issues/51003
Change-Id: Ia1ebec0ebeb6cba274621853e6486bab7cb7eb78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279201
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Some fields of `OSThread` are initialized by retrieving information by
calling OS functions. For example, `trace_id_` is initialized by calling
`OSThread::GetCurrentThreadTraceId()`. Similarly, this CL adds the
`OSThread::GetCurrentThreadName()` method and uses it to initialize
`name_`.
TEST=CI
Change-Id: Iee121d71e660be01ff684a298144fa7d59e3b61d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278662
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
When lowering patterns, front-end can add multiple distinct local
variables with the same name into the same local scope.
Previously, VM identified local variables in a local scope by name.
However, this no longer works with patterns.
With this change, local variables are now identified by pair (name,
kernel offset). Name is still taken into account as compiler can add
extra variables which do not correspond to kernel variables,
such as 'this'.
TEST=runtime/tests/vm/dart/regress_51091_test.dart
Fixes https://github.com/dart-lang/sdk/issues/51091
Issue https://github.com/dart-lang/sdk/issues/49755
Change-Id: I0263769cb31f3f8d9652f5d6534800510ac882fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279650
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Bug: https://github.com/dart-lang/sdk/issues/51071
Change-Id: Ia64d803c9709b106e52a1c671c1c3288c051bd85
Tested: ci + new test
CoreLibraryReviewExempt: bug fix only for vm
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279204
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
The public API is the zx_thread_state_general_regs_t typedef,
not the zx_thread_state_general_regs struct tag.
TEST=ci
Change-Id: I4ce2f3dd08b5873378326fe4d162add33317a9c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280047
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Roland McGrath <mcgrathr@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
It could happen that an isolate gets stuck unable to exit if paused on exit when using Isolate.exit.
Fixes https://github.com/dart-lang/sdk/issues/51164
TEST=isolate_exit_resume_test
Change-Id: I114686ce0637434827e56988821932cb91238032
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280044
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
When building SSA form for callee graph during inlining, numbering of
SSA values starts with the number of SSA values in the caller graph.
However, parameter stubs may contain constants which are already added
to the callee graph and occupy certain range of SSA numbers. If that
number is larger than number of SSA values in the caller graph, then
numbers, already assigned to constants, can be incorrectly reused
during SSA construction.
The fix is to adjust number of SSA values in the callee graph
before parameter stubs are created, and then use current number of
SSA values as a starting point when building SSA.
TEST=runtime/tests/vm/dart/regress_flutter119220_test.dart
Fixes https://github.com/flutter/flutter/issues/119220
Change-Id: I7efd52e626b63bf64fb47861ec210b291911ef28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280041
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
An update for co19 is available at https://github.com/dart-lang/co19/pull/1759
TEST=Existing tests run after change, two new tests for edge cases.
Change-Id: I408e398d532ba2c2e8e60777bb4f7bd0057e27fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278912
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
This applies only to isolates running on the VM's thread pool.
TEST=manually inspect timeline in program with very large heap
Bug: https://github.com/dart-lang/sdk/issues/51125
Change-Id: Ib70cee7c163231b7aef4d723f35d056d4cb1cbf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279477
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This is needed so that the expression evaluation works correctly after attempt to reload to bad source code.
Bug: https://github.com/dart-lang/sdk/issues/45846
Change-Id: Ib9fccc54141433bc662cbca923037fd12616ccd2
TEST=bad_reload_test
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278664
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This should make vm/dart_2/analyze_snapshot_binary_test pass on
dartkp-linux-release-arm64 & dartk-linux-release-arm64
by ensuring arm64 `gen_snapshot` & `analyze_snapshot` binaries
are available on the device when running tests on arm64 HW.
Change-Id: Icd814ff6df22a33b651733e4c3dc99873cf56a58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279970
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>