Commit graph

303 commits

Author SHA1 Message Date
Konstantin Shcheglov 895540889e Update SDK constraints for SDK packages.
https://dart-review.googlesource.com/c/sdk/+/287660 implements it.
I want to fix pre-existing violations before enabling.

Bug: https://github.com/dart-lang/sdk/issues/34978
Change-Id: Ie7731162c643018a2312b265f444bc00534c0a51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287664
Reviewed-by: Leon Senft <leonsenft@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-09 19:52:47 +00:00
Derek Xu db556df468 [VM/Service] Start testing mixins in get_object_rpc_test.dart
Change-Id: I1a2f83c197398abc7a568840ba73f63c55f9e9f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286024
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-03-03 17:48:21 +00:00
Kallen Tu 22de5b34f2 [cfe] Report an error when a subtype of a base or final type is not base, final or sealed.
Change-Id: I54c9e3edcc0ae7e61f48ff7e3b42d83e0556af7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286101
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-01 19:10:56 +00:00
Derek Xu 67f3e1f4a0 [VM/Service] Add support for class modifiers
TEST=CI

Fixes https://github.com/dart-lang/sdk/issues/50742
Fixes https://github.com/dart-lang/sdk/issues/50743
Fixes https://github.com/dart-lang/sdk/issues/51296
Fixes https://github.com/dart-lang/sdk/issues/51297
Change-Id: I52de34219883ca8680b1a8968ac9f4183fc5e970
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285360
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-27 21:07:41 +00:00
Derek Xu 9a6c8ed50b [VM/Service] Fix accessors of fields of simple types in generated Java classes
TEST=Modified VmServiceTest.java locally to make it exercise
BoundField.getName()

Fixes https://github.com/dart-lang/sdk/issues/51514
Change-Id: I232d98a2efffbaf82a0101a20405f48fe4ba03d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285700
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-27 16:51:26 +00:00
Derek Xu c0c523122b Reland "[VM/Service] Start indexing positional record fields at 1"
This is a reland of commit 1be893c507

Patchset 2 fixes the failure that was in
pkg/dds/test/dap/integration/debug_variables_test.

TEST=CI

Original change's description:
> [VM/Service] Start indexing positional record fields at 1
>
> TEST=CI
>
> Fixes: https://github.com/dart-lang/sdk/issues/51451
> Change-Id: I0e00e0ffb35aeb40affbbd5544542723bafc747c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284722
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Change-Id: I4cdee610646b3389d7d02ee6d905a66ae6e0329d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284862
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-23 17:04:10 +00:00
Derek Xu d128fea646 [VM/Service] Improve documentation of getInstancesAsList
This CL addresses some of the feedback in https://dart-review.googlesource.com/c/sdk/+/283380/comment/b86443cf_5d0f91bf/

TEST=CI

Issue: https://github.com/dart-lang/sdk/issues/51497
Change-Id: I26622287df8834bbacbe3fdfb95490350cecd4bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284724
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-23 16:52:47 +00:00
Derek Xu c1f3a5aad4 Revert "[VM/Service] Start indexing positional record fields at 1"
This reverts commit 1be893c507.

Reason for revert: Broke pkg/dds/test/dap/integration/debug_variables_test

Original change's description:
> [VM/Service] Start indexing positional record fields at 1
>
> TEST=CI
>
> Fixes: https://github.com/dart-lang/sdk/issues/51451
> Change-Id: I0e00e0ffb35aeb40affbbd5544542723bafc747c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284722
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Change-Id: Ib82f3fa8ca970eb4accb8f6a86b9ce36e72d9bc8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284861
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-23 15:51:32 +00:00
Derek Xu 1be893c507 [VM/Service] Start indexing positional record fields at 1
TEST=CI

Fixes: https://github.com/dart-lang/sdk/issues/51451
Change-Id: I0e00e0ffb35aeb40affbbd5544542723bafc747c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284722
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-23 15:00:28 +00:00
Derek Xu 87d0fbdf5f [VM/Service] Update VmServiceTest.java to work with current VmService class
TEST=ran `ant test` target

Change-Id: I90de4113f90a637e46fdb09ebd3f70ee8b06b0ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284721
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-22 18:10:05 +00:00
Derek Xu ad632cc8eb [VM/Service] Fix accessors of fields of simple types in generated Java classes
TEST=ran `ant test` target

Fixes https://github.com/dart-lang/sdk/issues/51448
Change-Id: I7099c1662b30378c6895f1f0e8f702f678aba884
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284720
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-22 17:11:41 +00:00
Kevin Moore fd836d3b34 vm_service: fix a bunch of comment references
also fix a couple of typos in service.md

TEST=re-ran generate script

Change-Id: I6fb6dbbc3780af14e5721817e20ec0e6370bfc1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284440
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-22 16:32:28 +00:00
Derek Xu 41be8d54b5 [VM/Service] Make _getInstancesAsArray public
This CL updates the VM Service spec to v4.2 and adds the
`getInstancesAsList` service procedure.

This CL also adds `pkg/vm_service/test/get_instances_as_list_rpc_test.dart`
which was based on
`runtime/observatory/tests/service/get_instances_as_array_rpc_test.dart`
and `pkg/vm_service/test/get_instances_as_list_rpc_expression_evaluation_on_internal_test.dart`
which was based on
`runtime/observatory/tests/service/get_instances_as_array_rpc_expression_evaluation_on_internal_test.dart`

TEST=CI

Fixes https://github.com/dart-lang/sdk/issues/51393
Fixes https://github.com/dart-lang/sdk/issues/51003
Change-Id: I0faae80553ec397a1e89be0a714aab30e7854fec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283380
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-21 17:26:52 +00:00
Devon Carew 5a53de5b14 [pkg/vm_service] use package:lints/recommended.yaml
Change-Id: Icf2b33ed47c5006c72bb4809fca230845cf51908
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282383
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-02-10 17:59:33 +00:00
Derek Xu 5cc3c3b96a [VM/Service] Reduce number of generated is checks in package:vm_service
TEST=CI, manual testing

Change-Id: I4865ab71714f1b4bc7af55ed485cccc970e11989
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281540
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-08 19:12:12 +00:00
Derek Xu c25308d003 [VM/Service] Fix generation of toJson() calls on dynamic variables
TEST=CI, manual testing

Issue: https://github.com/dart-lang/sdk/issues/51188
Issue: https://github.com/dart-lang/sdk/issues/51100
Fixes https://github.com/dart-lang/sdk/issues/51100
Change-Id: I4b7122df2e24534ed919aa0665dcf2a777c5deed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281463
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-07 21:28:36 +00:00
Dan Chevalier deca6a66e7 Reland "Update HTTP Profiling ids to use Strings"
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>
2023-02-02 19:22:49 +00:00
Derek Xu f971bb30c4 [VM/Service] Fix generation of code for serializing objects with multiple simple types
Fixes https://github.com/dart-lang/sdk/issues/51141

Change-Id: I1b9503bb76781779f29b7125082a9d9ac370a442
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280040
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-01 22:04:29 +00:00
Derek Xu 68c0ebe48a [VM/Service] Add optional parameters to getInstances
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>
2023-02-01 22:04:29 +00:00
Alexander Aprelev 4443d2d561 [vm/isolate] Ensure that isolate can correctly resume and exit if paused on exit.
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>
2023-01-31 17:15:38 +00:00
Oleh Prypin 74849bae46 Revert "Update HTTP Profiling ids to use Strings"
This reverts commit e7d8261f9a.

Reason for revert: will not be able to roll devtools_app (at least in google3) with this backwards-incompatible change

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

TBR=bkonyi@google.com,asiva@google.com,sigmund@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com,danchevalier@google.com

Change-Id: I9b6c9ec1cb00cca56816959fc83a70ec35ac9b21
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279980
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Oleh Prypin <oprypin@google.com>
2023-01-26 16:42:26 +00:00
Dan Chevalier e7d8261f9a 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
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>
2023-01-26 15:08:56 +00:00
Derek Xu 8766952c13 [VM/Service] Populate length property for PlainInstance Instances and InstanceRefs
TEST=CI

Change-Id: I0c112513849e4057a08d6068101927ee6aec6b25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279466
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-01-25 18:32:57 +00:00
Josh Soref ef42a0b110 Spelling pkg analyzer lib
Closes https://github.com/dart-lang/sdk/pull/50860

GitOrigin-RevId: b27066c37f93c8c6d1123d6ebd6a4c0afcf59844
Change-Id: I15fa4aea1dad45daf168e34d1c4450320ec9b40a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277742
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-01-25 14:08:27 +00:00
Derek Xu 0031f67ba0 [VM/Service] Populate length property for Record InstanceRefs and Instances
TEST=CI

Issue: https://github.com/dart-lang/sdk/issues/51104
Change-Id: I4fa812c22f2ea0bdf5cc472a9e7198bf64442e6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279465
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-01-25 00:17:21 +00:00
Derek Xu d81b48c6b1 [VM/Service] Add private _getImplementationFields procedure
TEST=CI

Change-Id: I4e4871ac4df74cb4daca7ef42a66489b2afbdc64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270260
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-01-23 21:07:23 +00:00
Josh Soref 84e3c8b50f Spelling tests
Closes https://github.com/dart-lang/sdk/pull/50920

GitOrigin-RevId: fa87531bd0f52b69485c9d02ff9e44a4a29c6a91
Change-Id: I0ae8574a5b77087895e004079f221201bb550cf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278535
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-19 16:24:29 +00:00
Josh Soref 9e4dc755cb Spelling pkg
Closes https://github.com/dart-lang/sdk/pull/50921

GitOrigin-RevId: 6b1ca502b6722b0a987f33ace66f65cbd2c24e23
Change-Id: I74e4ff3c8e759c576036d6b791bd7734ebd215d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278536
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-19 10:06:29 +00:00
Derek Xu 168b975299 [package:vm_service] Update pubspec for 10.0.0 release
Change-Id: Ifa5ad91ee8e2edfd5e25fc08476c0adb7a60ea10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278671
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-01-11 15:50:31 +00:00
Derek Xu 2c35445714 [package:vm_service] Update changelog for 10.0.0 release
Change-Id: Id1c515b1a556fdfe8f4c1acb7ca32105e4e87768
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278667
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-01-10 19:51:30 +00:00
Derek Xu e738858aae [3.0 alpha][VM/Service] Update VM Service spec to v4.0
This is a reland of commit c21f7c847c,
BUT the `setExceptionPauseMode` procedure is no longer deleted in this
commit. We are not ready to delete that procedure yet, because deleting
it breaks IDE support: https://github.com/flutter/flutter/issues/117526.

TEST=CI

Original change's description:
> [3.0 alpha][VM/Service] Update VM Service spec to v4.0
>
> This CL updates the VM Service spec to version 4.0 in order to add
> support for records. Some deprecated procedures and properties will also
> be removed in v4.0.
>
> As described in service.md's changelog, this CL:
> Adds `Record` and `RecordType` `InstanceKind`s, adds a deprecation
> notice to the `decl` property of `BoundField`, adds `name` property to
> `BoundField`, adds a deprecation notice to the `parentListIndex`
> property of `InboundReference`, changes the type of the `parentField`
> property of `InboundReference` from `@Field` to `@Field|string|int`,
> adds a deprecation notice to the `parentListIndex` property of
> `RetainingObject`, changes the type of the `parentField` property of
> `RetainingObject` from `string` to `string|int`, removes the deprecated
> `setExceptionPauseMode` procedure, removes the deprecated `timeSpan`
> property from `CpuSamples`, and removes the deprecated `timeSpan`
> property from `CpuSamplesEvent.
>
> TEST=CI
>
> Issue: https://github.com/dart-lang/sdk/issues/49725
> Change-Id: I7bf61c1ba11a0c7fd95a10c9c02c14282062b802
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268521
> Commit-Queue: Derek Xu <derekx@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

Change-Id: Ieb96d426b622745e653afd6ca8c9718b1deae0a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278160
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-01-03 16:16:18 +00:00
Siva Annamalai dcaf392d34 Revert "[3.0 alpha][VM/Service] Update VM Service spec to v4.0"
This reverts commit c21f7c847c.

Reason for revert: Appears to cause issues when flutter app is launched with VSCode or Android Studio, please see https://github.com/flutter/flutter/issues/117526

Original change's description:
> [3.0 alpha][VM/Service] Update VM Service spec to v4.0
>
> This CL updates the VM Service spec to version 4.0 in order to add
> support for records. Some deprecated procedures and properties will also
> be removed in v4.0.
>
> As described in service.md's changelog, this CL:
> Adds `Record` and `RecordType` `InstanceKind`s, adds a deprecation
> notice to the `decl` property of `BoundField`, adds `name` property to
> `BoundField`, adds a deprecation notice to the `parentListIndex`
> property of `InboundReference`, changes the type of the `parentField`
> property of `InboundReference` from `@Field` to `@Field|string|int`,
> adds a deprecation notice to the `parentListIndex` property of
> `RetainingObject`, changes the type of the `parentField` property of
> `RetainingObject` from `string` to `string|int`, removes the deprecated
> `setExceptionPauseMode` procedure, removes the deprecated `timeSpan`
> property from `CpuSamples`, and removes the deprecated `timeSpan`
> property from `CpuSamplesEvent.
>
> TEST=CI
>
> Issue: https://github.com/dart-lang/sdk/issues/49725
> Change-Id: I7bf61c1ba11a0c7fd95a10c9c02c14282062b802
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268521
> Commit-Queue: Derek Xu <derekx@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Issue: https://github.com/dart-lang/sdk/issues/49725
Change-Id: Ieb2a09653192e165ea8cf68965647e346e3a318b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277181
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Auto-Submit: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2022-12-22 20:19:00 +00:00
Derek Xu c21f7c847c [3.0 alpha][VM/Service] Update VM Service spec to v4.0
This CL updates the VM Service spec to version 4.0 in order to add
support for records. Some deprecated procedures and properties will also
be removed in v4.0.

As described in service.md's changelog, this CL:
Adds `Record` and `RecordType` `InstanceKind`s, adds a deprecation
notice to the `decl` property of `BoundField`, adds `name` property to
`BoundField`, adds a deprecation notice to the `parentListIndex`
property of `InboundReference`, changes the type of the `parentField`
property of `InboundReference` from `@Field` to `@Field|string|int`,
adds a deprecation notice to the `parentListIndex` property of
`RetainingObject`, changes the type of the `parentField` property of
`RetainingObject` from `string` to `string|int`, removes the deprecated
`setExceptionPauseMode` procedure, removes the deprecated `timeSpan`
property from `CpuSamples`, and removes the deprecated `timeSpan`
property from `CpuSamplesEvent.

TEST=CI

Issue: https://github.com/dart-lang/sdk/issues/49725
Change-Id: I7bf61c1ba11a0c7fd95a10c9c02c14282062b802
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268521
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-12-19 19:41:41 +00:00
Brian Wilkerson e113df3da5 Remove some unnecessary ignore comments in vm_service
Change-Id: I9b869a82932bf242c7df3045ca4ca888c2fb3fbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274732
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-12 20:03:59 +00:00
Alexander Thomas 7e0d92d69d [3.0 alpha] Bump version to 3.0.0
Tested: Standard CQ.
Bug: https://github.com/dart-lang/sdk/issues/49529
Change-Id: I329b9940db7309c7e48f17eecd7a66d5b853a484
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271922
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-06 02:40:36 +00:00
Derek Xu dba1e5fd3f [VM/Service] Fix package generator
package:markdown was updated to follow CommonMark's rules for encoding
certain special characters as HTMLEntities.
See 43bafebbe8/lib/src/util.dart (L15)

This CL updates the package:vm_service generators to handle these
changes.

Change-Id: I4e2e4c1c800a44ff1f3b9e7e163d60876cd6b013
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272522
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2022-11-30 16:25:57 +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
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
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
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
Chloe Stefantsova e25e532900 [cfe] Allow 'new' as constructor name on enum elements
Additionally, add some missing compile-time errors and adjust error
text expectations.

Closes https://github.com/dart-lang/sdk/issues/49327

TEST=Covered by existing tests.

Change-Id: Ie62211650633beb26abdf735e0dd36c4de4e24c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266740
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2022-11-11 11:13:35 +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
Derek Xu 40defeeb44 [VM/Service] Support records in the VM Service
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>
2022-11-02 19:32:54 +00:00
Ahmed Ashour 931961eac8 [analyzer] dead code with for statement updaters
TEST=ci

Bug #43511

Change-Id: Ie7ad75b1810d1483558ea18818f30c02730da312
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263940
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-10-26 20:31:00 +00:00
Derek Xu fcd36b6db0 [Service] Migrated get_object_rpc_test to package:vm_service
TEST=CI

Issue: https://github.com/dart-lang/sdk/issues/45037
Change-Id: Ie050734c3f24ffd90a4a5e988963d86dafbb1cdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265520
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2022-10-26 19:52:22 +00:00
Liam Appelbe 875922a88f [vm]: Rewrite library_filters in source_report
When library_filters were given, we used to prefill the script_table_,
then just assume that any scripts not in the script_table_ must have
been filtered out. We wrote it this way to avoid checking the filters
in every GetScriptIndex call. But in some cases (eg mixins),
lib.LoadedScripts() can miss some scripts, so they'd be incorrectly
omitted from the table.

The new implementation lazy loads the scripts, the same way it works
when there are no library_filters. Skipped scripts are still placed in
the script_table_, but given an index of -1, and omitted from
script_table_entries_.

Bug: https://github.com/dart-lang/sdk/issues/49887
Change-Id: Ide938ddfa9a3750c72c615e296b1a23875e46ab8
TEST=CI (also manually tested that the bug is fixed, but it's a really fiddly setup and I'm not sure how to put it in a unit test. See bug for details)
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260076
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2022-09-26 23:03:18 +00:00
Martin Kustermann 6b1e9bbdfe Extend HeapSnapshotGraph API to support incoming references in package:vm_service
Currently the HeapSnapshotGraph represents the objects in the Dart VM
heap and how they relate to each other. They effectively form a directed
graph with a specific root node.

The API does allow traversing the graph by following an object's
outgoing references.

Though in certain situations it can be very useful to know the set of
objects referencing a given object (i.e. incoming references).

This CL adds such support, thereby allowing traversing edges in both
directions: Finding what an object references and who references an
object.

When loading a snapshot we therefore have to also compute the reverse
edges and store them. To offset any additional computation time and
memory consumption, we optimize the existing implementation by not using
growable List<int> objects for outgoing edges but rather typed-data
views into the existing Uint32List of edges.

Due to this optimization we make loading of snapshot faster and smaller,
in a simple benchmark we seem to get:

  * JIT: 10% faster, 40% less RAM
  * AOT: 30% faster, 40% less RAM

despite the additional compute & data structures of this API.

TEST=vm/dart{,_2}/heap_snapshot_referencees_test

Change-Id: Ief30bfb58c70364744eeb7f69967dd1f72ece807
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260524
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-09-23 10:11:41 +00:00
Devon Carew 8e0f4f4191 [pkg/vm_service] turn on a few more lints for this package
Change-Id: I8eef00c606e713e252db8834f730f1655cdd57a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259509
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-09-19 17:02:14 +00:00