I checked if the retaining paths displayed on Observatory currently made sense, and they do. So, I think that the `getRetainingPath` responses currently being produced are correct, but they are not described well in the spec.
TEST=N/A
Change-Id: I6809ea9ea20574fd18bf5ee3d7d2c190aad62e7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268820
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Before, we only stripped `org-dartlang-sdk:///` as a prefix when it was
followed by `sdk/...`, which happens for code compiled with the Dart
SDK. However, the same prefix can show up in Flutter code (e.g.,
`org-dartlang-sdk:///third_party/dart/sdk/...`). Thus, except for one
case, just strip the prefix at all times when `--resolve-dwarf-paths`
is set, leaving a relative path.
The one case is `org-dartlang-sdk:///flutter/`, which appears in the
resolved version of `dart:ui` (`org-dartlang-sdk:///flutter/lib/ui`),
where the `flutter` isn't part of the actual filesystem path. In this
case, we strip off the `flutter/` as well.
TEST=vm/dart{,_2}/use_resolve_dwarf_paths_flag
Bug: https://github.com/dart-lang/sdk/issues/44325
Change-Id: Ia9abca877e41657089a438d4723ff08a2e16fe69
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try,vm-kernel-precomp-nnbd-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268762
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Per b/253491057, there are invalid keys (i.e. keys with value 0) being
passed around on occasion. These keys are resulting in flaky test.
This change adds additional error logging to help determine when the
zero-valued keys are originating from.
This change also removes the zx_assert to avoid crashing when a
zero-value key is encountered, and instead an error is logged.
TEST=built for fuchsia and tested on nest hub device.
Bug: b/253491057
Change-Id: Ic94a3f526318ef2873d3af7a3ceab064b67859d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268603
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Thrown by when an operation fails because a file is not found.
TEST=updated unit tests
Issue: https://github.com/dart-lang/sdk/issues/12461
Change-Id: I2e6e3986f92d5bf9f3922f4e2c6bbba67cc102bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267280
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
'is' tests against record types are split into series of 'is' tests of
record fields. This is more efficient as record instances cannot be
added to subtype test caches (because type of a record instance
depends on types of its fields).
This change also adds canonicalization and constant evaluation of
LoadFieldInstr for record fields.
Performance on a trivial micro-benchmark (on x64):
JIT (RunTime): 4519104.5 -> 20031.5
AOT (RunTime): 4352583.0 -> 26281.6
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I2ed464cd3b31f365b17805f4e7debe1d6d1051fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268080
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
When many concurrent requests come in, it was possible to leak http servers, leading to hanging dart vms.
Fixes https://github.com/dart-lang/sdk/issues/50389
TEST=developer_server_launch_test
Change-Id: Icc59987a1a60af5ec72e0cb1ca7b43dea7f0c5e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268181
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
All other architectures have a LoadImmediate that works with any uword, but x64's truncated to 32-bit, causing surprising x64-only failures when LoadImmediate is used from architecture-independent parts of the compiler.
TEST=ci
Change-Id: Ia2b2cfd1df7396833e4508ed21b4995fc9af464b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268040
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Previously repetetively parsing some string valued
flags would cause their values to leak.
This change makes sure that we delete the previous
value when we assign a new one.
vm/cc/ParseFlags is extended to catch this when running
under ASAN.
TEST=tools/test.py -n dartk-asan-linux-release-x64 vm/cc/ParseFlags
Change-Id: I7478cdb48063dcae35d4129a4c9a2829dddae729
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267821
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
This CL adds the parameter `bool include_id` to
`PrintSharedInstanceJSON()` and makes it default to true. This CL also
removes `AddServiceId()` calls that are now unnecessary due to this
change.
TEST=CI
Change-Id: Ica53757a7fc23c70946be71f88408963e5aeae04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265041
Reviewed-by: Ben Konyi <bkonyi@google.com>
In the heap snapshot writer, Pass1Visitor assigns object ids both to
heap objects and to Smis, and Pass2Visitor uses that information when
writing the heap snapshot. However, their logic for visiting slots in an
object with unboxed fields varies slightly. Pass1Visitor does not visit
each individual slot, but Pass2Visitor does. This means that SmiPtrs
that are only reachable via an object with unboxed fields are not added
to the writer in Pass1Visitor, and thus have an object id of 0 during
Pass2Visitor. This CL fixes this difference in visiting behavior.
TEST=vm/dart_2/heap_snapshot_regress_49711_test
vm/dart_2/heap_snapshot_test
Fixes: https://github.com/dart-lang/sdk/issues/50341
Change-Id: Id238771af18ee098f39e6d1cc80e021dc8e117fe
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267580
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This change introduces specialized stubs and IL instruction for
allocating records with 2 or 3 fields. This makes allocation of
small records slightly faster compared to a construction of similar
class instances and makes code size of record allocation smaller.
Benchmark:
MultipleReturns.NotInlined.Record(RunTime) 77150 -> 66222
MultipleReturns.NotInlined.RecordNamed(RunTime) 78073 -> 67044
MultipleReturns.Forwarded.Record(RunTime) 97130 -> 77635
MultipleReturns.Forwarded.RecordNamed(RunTime) 96495 -> 77904
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I8ed7add06b39ba79dfd78bbe2afaefe606cc505b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266420
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Flags parsing currently leaks string flag values
which is not a problem because users are not
expected to be calling SetVMFlags multiple times.
TEST=manually
Change-Id: Ie6e18a1142341b90c5345384a16b03a2947d69b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267361
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
These are needed for the 'views' feature. No nodes are created yet.
TEST=existing
Change-Id: I0c7a34e460a4d17bd39ee23e7aa6bd8851f4275e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266620
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This makes VM Service responses involving records comply with
https://docs.google.com/document/d/1gq7ZlH9My2qIrlFY7-pceNmabOPLLeLVMt6Z44KE7_8.
service.md and package:vm_service are not yet updated by this CL. They
will be updated in a future CL that makes as much of the service comply
with the above proposal as possible without introducing breaking
changes.
e.g., the future CL will make it so that both the `decl` and `name`
properties will be populated for fields of `PlainInstance`s.
TEST=CI
Issue: https://github.com/dart-lang/sdk/issues/49724
Change-Id: Iff798e391d28f137a000352c15e180f32e3d3969
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264782
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This adds the 'views' feature flag together with parser support
for 'view class'. If the feature is not enabled, an error is reported.
TEST=pkg/front_end/parser_testcases/views/...
Change-Id: I813ac86a0e7de9f0a5729c6d7ae35b82d1258ae5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265780
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: William Hesse <whesse@google.com>
The old `native "<name>"` syntax was lowered to `@ExternalName()`
annotations. Those have been deprecated in favor of
`@pragma('vm:external-name')`. Users have now been migrated and we can
therefore remove the VM support for `@ExternalName`.
Issue https://github.com/dart-lang/sdk/issues/28791
TEST=ci
Change-Id: I69febe49f59627659c540dd50ad0fbf704b6c3a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266387
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
The main benefit of this is that it avoids cls.EnsureIsFinalized for
skipped classes. In some cases (eg very small tests with dependencies
on very large 3rd party packages, such as flutter) this can reduce
coverage collection time by 20%.
Change-Id: Id756af7f2d2ecdd07a5d1d05a400cea4de7ec408
Bug: https://github.com/flutter/flutter/issues/100751
TEST=CI
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266640
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
We have many tests that explicitly use --optimization-counter-threshold=
flag. We also have a CI builder that uses this flag for all tests.
This is an issue for cases where `kernel-isolate` is not AppJIT'ed,
which is the case for simulators and ia32. Especially in debug builds
this causes a very-very slow time-to main due to JIT'ing the CFE code in
`kernel-isolate` and running flow graph checker etc (in debug mode).
This causes various tests to sporadically hit the timeout limit, become
flaky and require gardening attention.
As workarounds: the actual threshold was modified in tests, status files
were updated to mark tests as Pass,Slow etc.
=> This Cl will make `kernel-isolate` no longer be affected by the
`--optimization-counter-threshold`
=> This should make the cycle times faster on those modes and avoid
flaky timeouts that gardeners constantly have to pay attention to.
TEST=ci
Change-Id: Ia58e807b22f69f924315a43c6764427afe398ee6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266683
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
- Check against sending arbitrary classes via types.
- Stop allowing any object from dart:core, dart:collection, dart:typed_data (effectively reverts 807eacae30).
`SendPort.send` does not require such objects are sendable, and there is no guarantee the receiving isolate can represent them.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/50243
Change-Id: I7e9b0e9d83080d44a98b257cd8f2a58da5443a87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264725
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Unlike retained size, owned size is a partitioning, so it can be naively summed. This replaces an almost quadratic step with a linear step.
TEST=load a large snapshot, such as from dart2js
Change-Id: I49479f6e17b911965def62e9b44fc202ce6a9b9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265961
Reviewed-by: Derek Xu <derekx@google.com>
We only have 16bits for cids so class table
can't contain more than 65535 classes.
TEST=ci
Bug: b/255934984
Change-Id: I79d45f4f28399b0a61293ace40b8718f2569ef3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266320
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Compare Observatory's object_graph.dart.
TEST=load a large snapshot, such as from dart2js
Change-Id: Ifea2ff4c06f5103d6f1f709fa79183398df90687
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265404
Reviewed-by: Derek Xu <derekx@google.com>
For single argument FFI calls:
- reduces trampoline size significantly (up to 50%, 150-170 bytes),
- reduces the compressed size of GPay by 2.5kb on arm64,
- regresses performance on arm64 (up to 2.5%).
For more arguments, percentage-wise size gains and speed regressions
are smaller.
Only applied on arm and arm64, we care about code size for these.
Note: On Raspberry Pie (arm), the performance regression on single-
argument calls regresses up to 30%.
TEST=tests/ffi/*
Design doc: https://go/dart-ffi-outline-state-transitions
Closes: https://github.com/dart-lang/sdk/issues/50094
Change-Id: I8b8d7da45f69be6ac1432b11b695de71e56acfd1
Cq-Include-Trybots: luci.dart.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
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262343
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
The error has not been thrown since Dart 2.0,
where being able to reach the end of a switch case
became a compile-time error.
TEST=Removes tests depending on discontinued behavior.
Change-Id: I76292e7c73f2b3aaf071bbb290e97db493b75477
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261860
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Auto-Submit: Lasse Nielsen <lrn@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
This CL makes `FfiNative`s use `DynamicLibrary.process()` lookup if
resolving with the resolver set by `Dart_SetFfiNativeResolver` fails.
Also moves the implementation over from ffi.cc to
ffi_dynamic_library.cc so the implementation can be shared with
`DynamicLibrary.process()`.
Moves the implementation behind non-simulator and non-precompiler.
However, the implementation is tested in vm/cc tests which are in
precompiler mode. So enables the implementation if TESTED is defined.
This CL massages the build files so that TESTED is properly
defined when compiling the runtime for the vm/cc tests, and links
the ole32 symbols on windows for vm/cc tests.
(And some unrelated small cleanup changes here and there.)
TEST=tests/ffi/native_assets/process_test.dart
Change-Id: I25395d381db1d9b4b7a5759171a798a1140a6140
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,dart-sdk-win-try,vm-kernel-win-release-x64-try,vm-kernel-win-release-ia32-try,vm-kernel-precomp-win-product-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264982
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This change adds all necessary support for allocation sinking and
materialization of record instances.
TEST=vm/cc/AllocationSinking_Records
Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I040ce8b1ed3220f87a767b590050de3e50573170
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265380
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Intra-group messages are now always handled by the copier instead of the serializer, so the serializer no longer needs to handle all types.
TEST=ci
Change-Id: Iabe3e464cc2a5bc9e3296660a5d15124fbede3bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265160
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>