Commit Graph

20029 Commits

Author SHA1 Message Date
Tess Strickland 4f925105cf [vm] Use a hash map for larger type argument instantiation caches.
Previously, the VM used a linear array to cache previous instantiations
of a type arguments object. Now once the cache hits a certain number
of occupied entries, the VM changes to using a hash-based approach.

The InstantiateTypeArguments stubs have not yet been updated to
traverse the hash-based cache, so once the cache has grown too large,
all attempts at instantiations, even those that are in the cache, go to
the runtime. Thus, until the stubs are updated, this is only an
improvement if the cost of traversing the linear cache dominates the
cost of making a runtime call. Our benchmarks see a ~40% performance
regression for hash-based caches of size 100 but a ~400% performance
improvement for hash-based caches of size 1000. Thus, we currently
split the difference and set the maximum size of linear caches to 500.

TEST=vm/cc/TypeArguments_Cache_ManyInstantiations

Bug: https://github.com/dart-lang/sdk/issues/48344
Change-Id: I7f1376943523bb5bcd8b175cfb1936779ea73d60
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try,vm-kernel-precomp-nnbd-linux-release-simarm_x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-debug-simriscv64-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/+/265325
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-11-28 15:00:20 +00:00
Tess Strickland 333d924504 [vm/compiler] Make InstantiateTypeArgs stubs architecture independent.
TEST=ci

Bug: https://github.com/dart-lang/sdk/issues/48344
Change-Id: I7c0cee827a09d981e6e65802304a361ace7ce501
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try,vm-kernel-precomp-nnbd-linux-release-simarm_x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-debug-simriscv64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270102
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-11-28 15:00:20 +00:00
Daco Harkes 827d166ea0 [vm/ffi] Stop reifying type argument in Pointer
All `Pointer`s will now have the `Never` type argument at runtime.

TEST=tests/ffi(_2)/*

Bug: https://github.com/dart-lang/sdk/issues/49935

Change-Id: I83c8bba9461c2cab22992ba2e3cf42b7b5f43c36
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-mac-debug-x64-try,dart-sdk-mac-arm64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272201
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2022-11-28 09:45:45 +00:00
Daco Harkes da74af72c4 [vm] Fix GCC build
https://dart-review.googlesource.com/c/sdk/+/264520 caused the GCC
build to fail with ambiguous overload for ‘operator<<’ with nullptr.

TEST=luci.dart.try:vm-kernel-gcc-linux-try

Change-Id: Idf452b4de9bd956ae0d19d6355273982a7c59330
Cq-Include-Trybots: luci.dart.try:vm-kernel-gcc-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271900
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-11-24 13:02:49 +00:00
Ryan Macnak ff8caf93b5 [vm] Remove quadratic time spent zapping scoped handles.
TEST=ci
Change-Id: I7faaf61ff33ae54795db4da1b253053abea0d5a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271581
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2022-11-23 20:24:29 +00:00
Ryan Macnak b166d909c3 Import "Add the ratified portions of the B extension: Zba, Zbb, Zbc, Zbs."
TEST=ci
Change-Id: I7676dabc67762c0c2e4a1a9975100c59edcda769
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271441
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2022-11-23 18:39:07 +00:00
Ryan Macnak 97f6ac2187 Import "Add missing rounding mode for some variants of fcvt."
TEST=ci
Change-Id: I6f97eed27fe4f35575abc04910ec1c35b86b740f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270803
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-22 22:57:50 +00:00
Ryan Macnak 9f84043e69 [observatory] Fix loading class pages in AOT.
TEST=manual
Change-Id: I0de4e7eb0330233fa7571c2fbf7c3c23a15f192c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271503
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-11-22 21:30:58 +00:00
Ben Konyi 8caeaf7a6c [ VM ] Add support for heap sampling profiler
This CL introduces new embedding APIs for supporting heap sample
profiling. A registered sampling callback is invoked approximately every
N bytes based on an exponential distribution, providing information
about the isolate group the allocation occurred in, the user visible
name of the allocated object type, a weak persistent handle to the
allocated object, and the size of the allocation.

Sampling is triggered using artificial TLAB boundaries to cause
allocations to be sampled to take the allocation slow path where the
registered callback can be invoked with the allocation information.

Only new space allocations are currently traced, with old space
allocation support to be added in a future CL.

TEST=Dart_HeapSampling

Change-Id: I22bcdeec6e823bc1ab44898d4c596fbed7169fa1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264520
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-11-22 18:05:24 +00:00
Johnni Winther 6f54f6236e [cfe] Add AwaitExpression.runtimeTypeCheck
Add AwaitExpression.runtimeTypeCheck to support easy backend
implementation of runtime type check.

In response to https://github.com/dart-lang/sdk/issues/49396

TEST=pkg/front_end/testcases/general/issue49396.dart

Change-Id: I13b9b14566ebc34cdb0811c16a262421417b68e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270723
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2022-11-22 10:42:22 +00:00
Martin Kustermann 2b0a18d2ba [vm] Remove unused code in message snapshot
TEST=ci

Change-Id: I484dedb0ce31ca8341e57833477b55eb7137f5ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271100
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2022-11-22 08:33:30 +00:00
Ryan Macnak 4acfca65df [vm, compiler] Misc RISC-V codegen tweaks.
Merged push/pop, near branches, compressible register assignments.

TEST=ci
Change-Id: Ic4772a5b78e2c5440c8613aee2ae5b7a26f879e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270802
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-21 21:52:03 +00:00
Ahmed Ashour 9bea89246a Fix grammar
Fixes #50509

TEST=ci

Change-Id: I7ca115bbe6f436e9df126afddcc08eaba79af2f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270740
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-21 20:07:29 +00:00
Ryan Macnak 3dfceb5ad8 [vm, service] Fix documentation on the various flavors of reference.
These have always been able to return non-Instances.

TEST=ci
Change-Id: I13e46aae8705ea1f79ec0618cdb815a8ed9c0fdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270461
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-21 19:30:09 +00:00
Ben Konyi 50aae78e4e [ VM / AOT ] Return false from Function::is_optimizable() rather than calling UNREACHABLE()
Fixes https://github.com/dart-lang/sdk/issues/50516

TEST=Manual testing

Change-Id: Icc6df5dc82e1a8d1977b7b49af0215330554279f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271043
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-11-21 18:39:38 +00:00
Ben Konyi 3602351df0 [ VM Service ] Add support for '--[no-]serve-observatory'
To prepare for the eventual removal of Observatory, we plan on disabling
Observatory by default while providing an escape hatch to manually serve
the tool for some period of time before completely removing Observatory
from the SDK. This change adds flags that can be used to configure
whether or not Observatory is served.

Currently, '--serve-observatory' is the default behavior, but will be
changed to '--no-serve-observatory' once tooling is ready to support the
escape hatch behavior.

Part of https://github.com/dart-lang/sdk/issues/50233

TEST=run_test.dart

Change-Id: Ib6d1e1587d9fbd3c61d4a4c75d90635052835844
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267720
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-11-21 17:47:31 +00:00
Alexander Aprelev 9b5bc94343 [vm/double_hash] Avoid NaN in double hash code testing.
NaN bits are platform and toolchain specific, so hashode can't be pinned down to
a fixed value.

Fixes https://github.com/dart-lang/sdk/issues/50493
TEST=ci

Change-Id: I41a38d2e91e2dd851a3f00cb92b587414b71ddfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270360
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-11-20 14:56:49 +00:00
asiva bd8268ffd4 [Status File] Skip service weak_properties_test in AOT mode as it uses
dart:mirrors

TEST=ci
Change-Id: I24554c01ca6c9cc0b24c9c2bb3f6ad4c4e6a96f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270820
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Siva Annamalai <asiva@google.com>
2022-11-19 01:34:15 +00:00
Ryan Macnak 9a5dd4707f [vm] Remove "Impl" suffix from VM implementation classes.
This makes things nicer to read in places that display implementation names, such as stack traces, debuggers, profilers and inspectors.

TEST=ci
Change-Id: I959f70d9e51be59801c4455f8c5ccac3c214c21a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270502
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2022-11-18 21:42:59 +00:00
kanghuay 72c861358a [vm] Fix a crash in RecordCoverageInstr generated by cross-compile mode
Closes https://github.com/dart-lang/sdk/pull/50503

Tested: manually
GitOrigin-RevId: af83a95d6ba2b078d0d10addb3564cef692725e2
Change-Id: I0d72b1763a0b8d4f47a6e102959c93c42c5e38fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270562
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2022-11-18 09:46:16 +00:00
Ryan Macnak b7ae764479 [vm, service] Document past addition of InstanceKind WeakReference.
[observatory] Display WeakReference targets.

TEST=manually look at inspector.dart under Observatory
Change-Id: Ibfcc266528e28afdb9876335c0dfac94b178c1c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269982
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-17 23:37:11 +00:00
Ryan Macnak 9182d5e535 [vm] Raise the limit on the number of classes.
Some large applications are bumping up against the 16-bit limit.

The object header changes from hash:32,cid:16,size:8,gc:8 to hash:32,cid:20,size:4,gc:8.

Because the CID field is no longer a power of two, it takes two instructions to load instead of one, increasing code size. The alternative change to cid:32,hash:24,gc:8 was considered and rejected because the reduction in hash bits very noticeably affects performance in applications with large data sets.

TEST=ci
Bug: b/255934984
Change-Id: I5fa36ba48a6852359d994393cf80c6a761c5d84c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269120
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-17 20:35:47 +00:00
Liam Appelbe 7477a6cdf3 [vm] Delta encode line_starts in snapshots
TEST=Verified it fixes snapshot size regression

Change-Id: Icc6a645148481e85a3cd192d1522fac81b86f3f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270080
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-11-17 20:12:30 +00:00
Ryan Macnak b0c6f00f39 [vm] Use the right stack maps between executing catch entry moves and jumping to the exception handler.
Adds a stack map to the catch block entry pc.

The alternative would be to prevent yielding to a safepoint between these two point. For throws coming from Dart or the embedding API, this is possible by unwinding the transitions before the first point and doing only a non-yielding VM->Generated between the two points. For FFI, this does not work because the final state is Native instead of Generated, and VM->Native is a blocking transition.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/48668
Change-Id: I8164fddae018ed95d9147fafa65785b7638e5301
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269746
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-17 17:20:18 +00:00
Alexander Aprelev a83cfa0990 [vm] Replace Double_hashCode native method with graph intrinsic implementation.
Bug: https://github.com/dart-lang/sdk/issues/50265
TEST=ci
Change-Id: Icae87ce3871bb44599e0f1fa19d8becb3a6fcdec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264240
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-11-17 02:28:37 +00:00
Kallen Tu 9e922093da [cfe] Add sealed classes to AST, builders and dill files.
TEST=pkg/front_end/testcases/sealed_class/*

Change-Id: Iea7db59d2bba92e5f3594f6e89949e6ff3c85a80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269801
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-11-16 23:57:29 +00:00
Joshua Litt 2e0784a6c5 [test] Breakup named-captures_test to preserve test coverage.
Apparently the web implementation of RegExp has drifted from the native implementation in a very subtle way. To prevent further drift, this CL refactors named-captures_test into two tests, one which fails on all web backends currently(named_captures_2_test), and one that passes on all backends(named-captures_test, named unchanged to preserve history).

Change-Id: Ie94185948873fe3e592c10a45c6127dc6d0a4238
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267282
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-11-16 16:19:34 +00:00
Ryan Macnak c29f994023 [vm] Removed dead parameter from VisitPointersPrecise.
TEST=ci
Change-Id: I7ca38b2ebb659cdf1b20cc7ab7bed9b0958e6330
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269980
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-15 23:47:45 +00:00
Ryan Macnak a2de36e708 [vm] Rename the default implementation classes of Map and Set.
_InternalLinkedHashMap => _Map
_InternalImmutableLinkedHashMap => _ConstMap
_InternalLinkedHashSet => _Set
_InternalImmutableLinkedHashSet => _ConstSet

This makes things nicer to read in places that display implementation names, such as stack traces, debuggers, profilers and inspectors.

TEST=ci
Change-Id: Iec851c80ea2086cbe79934565dbf35f04809a836
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266303
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2022-11-15 17:15:58 +00:00
Ömer Sinan Ağacan a2adab7dfd Update Function class documentation:
Language spec does not require that evaluations of the same function
literal should create distinct objects. Remove the parts in `Function`
documentation to reflect that.

Also fixes formatting of markdown.

Invalid test file (with Dart 2 and 3 versions) removed: the tests assume
function literals won't be lifted to top-level.

Change-Id: Ib7a9464ad992cf461e77ef2d8ef336c7b0f4875a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269721
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-11-15 15:41:49 +00:00
blagoev 50e18b8160 [vm/ffi] Add Dart_IsNull in dart_api_dl.h
TEST=tests/ffi/vmspecific_handle_dynamically_linked_test.dart

Closes: https://github.com/dart-lang/sdk/pull/50466
Closes: https://github.com/dart-lang/sdk/issues/48331

GitOrigin-RevId: ce49a64788310a755cd9bb5c7ff6d281830bcc33
Change-Id: Ia8e23c57c76767d9e3db799b8fe6b172071582a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269742
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2022-11-15 10:32:16 +00:00
Ryan Macnak 0ac8d249e7 [vm, gc] Let mutators skip incremental marking during Dart_PerformanceMode_Latency.
TEST=ci
Bug: https://github.com/flutter/flutter/issues/113796#issuecomment-1289437787
Change-Id: I8ce23c66bd0528005bd53fe977e23191da2084d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269481
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-11-14 18:40:34 +00:00
Ryan Macnak 6ca6400cdc [vm, service] Report InstanceKind for Sets.
(The elements were already being populated.)

TEST=ci
Change-Id: I02cfa2f311e7871836f1eddd8ed131c282235d58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269383
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-14 18:38:09 +00:00
Derek Xu f310275ffb [VM/Service] Only return @Instances as values of BoundFields
We were planning on making the `value` property of `BoundField` have
type `@Instance|Sentinel|bool|int|double`, but we have decided to stick
with `@Instance|Sentinel`.

TEST=CI

Issue: https://github.com/dart-lang/sdk/issues/49724
Change-Id: Ia728586e695c14c0597f377e6c110329e553d62c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269440
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2022-11-14 18:17:43 +00:00
Ben Konyi f655eaeaff Reland "[ Observatory ] Add basic records support to Observatory"
This reverts commit 3ab116198c.

TEST=N/A

Change-Id: I19487d72532ad47210d4ff7e6a18dd709e74a62a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269740
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-11-14 18:12:02 +00:00
Vyacheslav Egorov c55f2924fe [vm] Guard against bad brand strings in CPUID
Brand string is supposed to be NULL-terminated.

However we are seeing cases in the wild where
this string is not null-terminated which
causes buffer overrun when trying to print it.

Add trailing '\0' to the brand string to guard
against such cases.

Fixes https://github.com/flutter/flutter/issues/114346

TEST=manually

Change-Id: I21e545bd2fb52336a1fcd7edacb0b867740e8d61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269720
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2022-11-14 15:42:52 +00:00
Jakub Vrána 5ea3ef268e Remove // ignore: unsafe_html.
Closes https://github.com/dart-lang/sdk/pull/50203

TEST=N/A



GitOrigin-RevId: dbdc7a784d4fabd750f305f99f138b6bc53407bf
Change-Id: Ia89f24217b4e210bb2503b624e74cf7c351ad039
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264140
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-11-14 13:21:06 +00:00
jhsware 24f12f4f94 Typo in \param doc name
Closes https://github.com/dart-lang/sdk/pull/50395

TEST=ci

GitOrigin-RevId: a6aae8cf90306a1e2a44ebdf9da269cf756515bc
Change-Id: Iec8137ffc21f5aaefdc5f5f878df5fc017e9891f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269601
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-11-14 13:06:59 +00:00
Ryan Macnak 4ee2a6bc82 [vm, service] Include "names" for type vectors in heap snapshots.
TEST=ci
Change-Id: I19ac8b75eab48e99c57e6e1c3655ce0e3a2430c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265522
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-11-11 21:45:05 +00:00
Ryan Macnak 715866aed3 [vm, compiler] Remove quadratic time spent verifying handle lifetime.
Instead of checking whether a handle is a zone handle rather than a scoped handle by iterating the zone handle blocks, reserve an extra slot in debug mode to record the handle's lifetime.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/50408
Change-Id: I121c76d02b03e5d2141450077bc6e9da3cb60a5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268801
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-11 18:37:44 +00:00
Oleh Prypin 3fe82b7cc0 Fix violations of body_might_complete_normally_catch_error hint
by converting the Future to void, seeing as the return value is not used anyway

Change-Id: Ifb4fdc6f909bc0432427b0e58d59eb10a1c7a5cd
Tested: only CI.
Bug: https://github.com/dart-lang/sdk/issues/49215
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269303
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Oleh Prypin <oprypin@google.com>
2022-11-11 11:19:47 +00:00
Ryan Macnak 426e215a91 [vm] Avoid kernel constant reader creating instances of unfinalized classes.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/50226
Change-Id: I396ffa089cf531d5bb252d00e6fce0a16f3fe723
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269263
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-11 02:09:37 +00:00
Liam Appelbe c47f15d144 [vm] Switch representation of line_starts to allow binary searching
Change-Id: Iaa43d3776f1dde10eefc6b951816a12abd5a3ce2
Bug: https://github.com/flutter/flutter/issues/100751
TEST=Added kernel_test.cc, and tested before and after the switch
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268841
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-11-11 01:59:28 +00:00
Derek Xu 3ab116198c Revert "[ Observatory ] Add basic records support to Observatory"
This reverts commit fca7813650.

Reason for revert: Broke analyzer tryjob

Original change's description:
> [ Observatory ] Add basic records support to Observatory
>
> Fixes https://github.com/dart-lang/sdk/issues/50405
>
> TEST=Manual testing
>
> Change-Id: If14f434792c89e3509895fcdd17561df810798e3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268581
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Derek Xu <derekx@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,derekx@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I30c4404adb9ac8f1851a89a0c846cb70461e410c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269220
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Auto-Submit: Derek Xu <derekx@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2022-11-10 23:42:08 +00:00
Ben Konyi fca7813650 [ Observatory ] Add basic records support to Observatory
Fixes https://github.com/dart-lang/sdk/issues/50405

TEST=Manual testing

Change-Id: If14f434792c89e3509895fcdd17561df810798e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268581
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2022-11-10 17:50:51 +00:00
Derek Xu ba503c19af [VM/Service] Clarify documentation of RetainingObject
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>
2022-11-10 17:08:45 +00:00
Alexander Markov 3bcb19455f [vm/compiler] Cleanup yield_index from Return instruction
TEST=ci

Change-Id: Ib41689681a171ec93366dc6f5a09aa7d5707c5cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268780
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-11-10 15:03:57 +00:00
Tess Strickland c1afa7f85e [vm/compiler] Strip org-dartlang-sdk URI prefix to resolve DWARF paths.
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>
2022-11-10 09:33:22 +00:00
Tom Robinson a211fe7655 Add logging to trace invalid keys.
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>
2022-11-09 21:59:28 +00:00
asiva b464175a29 [VM/Developer] Expose through the developer API a gc count for the isolate group that could potentially trigger execution of associated finalizers of objects that were collected.
TEST=reachability_test.dart

Change-Id: I27bdac49a4b7069ca428282d55d8ec572c9fc0e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266424
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2022-11-09 19:15:04 +00:00