Commit graph

1791 commits

Author SHA1 Message Date
Ryan Macnak 28c2491f8d [vm, service] Account for weakness in getRetainingPath and getRetainedSize.
We had been treating all references as strong for these RPCs. Now weak references are skipped, but ephemeron references are still treated as strong.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/49155
Change-Id: I6c4f344ce3c0df5bdbeb133a697bb26ff972f372
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302367
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-05-10 16:12:28 +00:00
Vyacheslav Egorov 54be4bc80e [vm/service] Remove Stack.awaiterFrames
This field was supposed[1] to replace Stack.asyncCausalFrames but IDEs
and other service protocol users never adopted it.

The mechanism for collecting awaiterFrames and asyncCausalFrames
was originally considerably different, but we have since unified
both[2] after we switched to lazy async stack traces[3].

Today the only differences between the two are:

- asyncCausalFrames represens async gaps explicitly, while
  awaiterFrames does not;
- when asynchronous function is running its synchronous part
  before the first suspension awaiterFrames will still represent
  the corresponding frame as an asynchronous activation, while
  asyncCausalFrames will treat the same frame as regular frame.

Consequently having this field does not add any value.

This CL removes it from the response and updates all tests to
test against asyncCausalFrames.

[1]: https://codereview.chromium.org/2692803006/
[2]: https://dart-review.googlesource.com/c/sdk/+/167561
[3]: https://github.com/dart-lang/sdk/issues/37668

Tested: pkg/vm_service, service, service_2
Bug: https://github.com/dart-lang/sdk/issues/51763
Change-Id: If2b035a8840047423b8ed8ce3b5d81155e9f38d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301062
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-05-09 13:46:56 +00:00
Derek Xu 1dd644f595 [VM/Service] Add getPerfettoCpuSamples RPC
TEST=Checked that Observatory's timeline view was still able to load CPU
samples correctly, and ensured that samples retrived using
getPerfettoCpuSamples were the same as the ones shown in Observatory.

Change-Id: I9b58cd32bc9a1c08848718f25f10db9fa6d4d241
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297760
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-05-03 19:17:11 +00:00
Alexander Markov 2ee6fcf514 [vm] Remove TypeRef
TypeRef type wraps around another type and it was used to represent
a graph of recursive types. After [0], the only use of TypeRef is
for TypeParameter.bound which may indirectly reference the same
TypeParameter.

This change replaces TypeParameter.bound with TypeParameter.owner and
removes TypeRef entirely. Various parts of the VM no longer need to
handle and support TypeRefs.

TypeParameter.owner can reference a FunctionType, Class,
or, as an optimization, it can be set to null in order to share
class type parameters among different classes.

With the exception of the 'TypeParameter.owner' back pointer,
VM types are now not recursive and can be visited without
additional tracking.

Caveats:

* Generic FunctionType cannot be cloned in a shallow way:
  when copying a FunctionType, type parameters should be cloned too
  and their owners should be updated. For that reason,
  a mapping between 'from' and 'to' function types
  (FunctionTypeMapping) is maintained during type transformations
  such as InstantiateFrom.
  FunctionType::Clone is used instead of Object::Clone where
  appropriate.

* When testing types for subtyping and equivalence, mapping
  between function types is passed to make sure
  type parameters belong to the equivalent function types.

* IL serializer needs to serialize function types as a whole before
  serializing any types potentially pointing into the middle of a
  function type (such as return type 'List<Y0>' pointing into
  the middle of a function type 'List<Y0> Function<Y0>()').

[0] https://dart-review.googlesource.com/c/sdk/+/296300

TEST=ci

Change-Id: I67c2fd0117c6183a45e183919a7847fd1af70b3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294165
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-04-28 19:29:36 +00:00
Lasse R.H. Nielsen 5573ce7b84 Make Iterable be the default implementation of itself.
Makes `Iterable` a mixin class with a `const` constructor,
and `IterableBase` and `IterableMixin` (to-be-deprecated) aliases
for it.

Combining everything in one place avoids (some) code
duplication.

Also gave the methods a quick overhaul for formatting,
removing uses of `late` and unnecessary element accesses,
and some general tweaks.

CoreLibraryReviewExempt: Refactoring of redundant types.
Tested: Refactoring. If existing tests work, it works.
Change-Id: Ie49a88f713d386d2d118c53606a71bdd50e1eb11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287600
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2023-04-04 21:45:19 +00:00
Lasse R.H. Nielsen 67797ef46f Add more class modifiers to dart:collection.
Pure interfaces made `interface`s
implementation classes which cannot/should not be extended made `final`.

A class like `HasHMap` which provides the `Map` interface,
and no implementation except factory constructors
for internal implementations, is made `final`.

Unified {List,Set,Map}{Base,Mixin} into their `Base` class.
Deprecations are retained in comments for now, to be landed
separately. Search for '// TODO: @Deprecated'.

Tested: No new test, only adding restrictions on use.
CoreLibraryReviewExempt: Everybody's on vacation, everybody everywhere.
Change-Id: Ia83b8a3bb20b5b214546b328d4492de6658253db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288240
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2023-04-04 10:39:48 +00:00
Ryan Macnak 3d8424e9fc [test] Introduce status variable $simulator, and fix some cases missing simarm_x64.
TEST=ci
Change-Id: Ie2a8ac015b2d316527d648956c86d4c7cb319d26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292962
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-04-04 03:10:26 +00:00
Ryan Macnak 70bbee75de [vm] Don't forget an isolate is shutting down when processing a resume command.
Cf. 4443d2d561

TEST=ci
Bug: b/271314180
Change-Id: I28553ef064ee603c076b69f5b887028bb81967ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292460
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-04-03 20:52:36 +00:00
Ryan Macnak 25548a912f [vm, reload] NoSuchMethodError after a static target goes missing or changes signature.
- Mostly restores the pre-kernel behavior, except that actual arguments are not passed to the NoSuchMethodError.
 - Instead of a vague error message, the call site whose target is missing is now part of the stack trace and the name/kind of the missing target is part of the exception message.
 - If the missing target is on a branch not taken, things properly succeed.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/37517
Bug: https://github.com/flutter/flutter/issues/122626
Change-Id: Ic3d5a386caa8d1627d8452a5601bc728ad519987
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291055
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-03-30 19:27:17 +00:00
Alexander Markov 3da80be140 [vm] Fix crashes on record types in mirrors and observatory
TEST=ci, manually verified tests with https://dart-review.googlesource.com/c/sdk/+/290760.

Fixes https://github.com/dart-lang/sdk/issues/51900

Change-Id: I338bc1b1f2e58d2343f6195ff9d12151edbd90dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291969
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-03-30 18:42:08 +00:00
Samuel Rawlins 77446204da Reland "[analyzer] Move 4 more HintCodes to be WarningCodes, UNUSED_*"
This reverts commit e48f35b43d.

Reason for revert: linter is fixed.

Original change's description:
> Revert "[analyzer] Move 4 more HintCodes to be WarningCodes, UNUSED_*"
>
> This reverts commit 0ef7ed2ebd.
>
> Reason for revert: Tests are failing in google3 - linter needs to be bumped
>
> Original change's description:
> > [analyzer] Move 4 more HintCodes to be WarningCodes, UNUSED_*
> >
> > Bug: https://github.com/dart-lang/sdk/issues/50796
> > Change-Id: Ib5b153bc6e64bc433df1f05c53d82f71b470bbec
> > TEST=presubmit bots
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290703
> > Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> > Reviewed-by: Alexander Aprelev <aam@google.com>
> > Commit-Queue: Samuel Rawlins <srawlins@google.com>
> > Reviewed-by: Nate Bosch <nbosch@google.com>
>
> Bug: https://github.com/dart-lang/sdk/issues/50796
> Change-Id: If1c460bdcf422033648417da5ba2f5fbc1b459c2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291460
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Auto-Submit: Oleh Prypin <oprypin@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>
> Commit-Queue: Alexander Thomas <athom@google.com>
> Commit-Queue: Oleh Prypin <oprypin@google.com>

Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: Ie503b57a19df1a50cb3dfe50c840d20779310e87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Oleh Prypin <oprypin@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-03-28 21:26:58 +00:00
Oleh Prypin e48f35b43d Revert "[analyzer] Move 4 more HintCodes to be WarningCodes, UNUSED_*"
This reverts commit 0ef7ed2ebd.

Reason for revert: Tests are failing in google3 - linter needs to be bumped

Original change's description:
> [analyzer] Move 4 more HintCodes to be WarningCodes, UNUSED_*
>
> Bug: https://github.com/dart-lang/sdk/issues/50796
> Change-Id: Ib5b153bc6e64bc433df1f05c53d82f71b470bbec
> TEST=presubmit bots
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290703
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Nate Bosch <nbosch@google.com>

Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: If1c460bdcf422033648417da5ba2f5fbc1b459c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291460
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Oleh Prypin <oprypin@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: Oleh Prypin <oprypin@google.com>
2023-03-28 07:16:42 +00:00
Sam Rawlins 0ef7ed2ebd [analyzer] Move 4 more HintCodes to be WarningCodes, UNUSED_*
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: Ib5b153bc6e64bc433df1f05c53d82f71b470bbec
TEST=presubmit bots
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290703
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2023-03-27 21:41:12 +00:00
Sam Rawlins d8613bba50 [analyzer] Move 3 more HintCodes to be WarningCodes, UNNECESSARY_*
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: I71291bfa959d7553c64d4a9e1f2918892ae012eb
TEST=trybots
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290403
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-03-23 22:52:36 +00:00
Ben Konyi 15de818977 [ Service ] Add new InstanceKind "UserTag"
Also adds a new "label" property to @Instance

TEST=pkg/vm_service/test/get_object_rpc_test.dart

Change-Id: I746d56909a55e0158896e1034665147c469109bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290920
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-03-23 17:51:03 +00:00
Ben Konyi a62bfec074 [ Service ] Allow for case insensitive URI mappings on Windows and MacOS
The Windows and MacOS file system can be case insensitive, so the following
two URIs can be equivalent:

 - file:///c:/foo/bar
 - file:///C:/Foo/Bar

Since it's possible for tooling to request a mapping for a URI that
isn't an exact case-sensitive match to that found in the URI mappings
cache, requesting a mapping for the inexact match will fail even though
the paths are potentially equivalent.

This change allows for lookupPackageUris and lookupResolvedPackageUris
to correctly handle paths that are not case-sensitive matches to entries
in the URI mappings cache on Windows and MacOS.

TEST=uri_mappings_lookup_test.dart

Change-Id: I35134c47bf3bd04bc452373b31b4eb5893ba1435
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288821
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-03-20 17:21:27 +00:00
Sam Rawlins c761de6e3e [analyzer] Move 3 more HintCodes to be WarningCodes, UNNECESSARY_N*
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: I04e8428a45428c02a05e8370a6cb1e9c4cf8030c
TEST=trybots
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289029
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-16 18:52:18 +00:00
Ben Konyi f51fedce26 [ dart:developer ] Remove Metrics related classes
Fixes https://github.com/dart-lang/sdk/issues/51668

TEST=CI

CoreLibraryReviewExempt:VM only functionality
Change-Id: I5d41863fca05e50d9c20266402c516b92f8de153
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287820
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-03-10 16:50:10 +00:00
Ryan Macnak 5c76d099a6 [build] Use relative paths.
go/remotely-cacheable

TEST=ci
Change-Id: Idee4ab56de2df15e90c5e4106b6200bf82e76155
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287320
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-03-08 22:10:42 +00:00
Nicholas Shahan d77e22a20b [dart2js] Update tests matrix entries
- Update options for existing configurations.
- Add one new configuration for running _2 test suites.
- Rename builders and update to run new configurations.

Tested: Tested with led runs.
Change-Id: I87de456b6b2e53d9e211cbd716fef18910aba69c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281348
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-03-08 08:40:57 +00:00
Ryan Macnak 90ff190627 [vm] Remove malloc profiler.
Splitting c67fac9cb4.

TEST=ci
Change-Id: Ib42d861e458648ce810be44cea0734c244703c1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287000
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-03-06 21:00:30 +00:00
Daco Harkes b1e59721d4 Revert "[vm] Remove tcmalloc and malloc profiler."
This reverts commit c67fac9cb4.

Reason for revert: Regresses `dart:io` performance and causes
failures.
https://github.com/dart-lang/sdk/issues/51639

Original change's description:
> [vm] Remove tcmalloc and malloc profiler.
>
> The standalone VM originally began statically linking tcmalloc to work around bugs in the system malloc for Fiber. Later it used tcmalloc's hooks to implement a profiler, but this is rarely used since it is only available in debug mode, misses early allocations, and often misses late allocations from an exhausted sample buffer. Removing it altogether avoids build complexity around which combinations of compiler/architecture/sysroot support tcmalloc, and reduces binary size.
>
> TEST=ci
> Change-Id: I4b259e18b82b2d12a2a60962aabf83bd8d997d19
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286120
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

Change-Id: I4395edd6f5bd7e26b4e38f4d931ad2ea67afba18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286925
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-03-06 10:28:33 +00:00
Ryan Macnak c67fac9cb4 [vm] Remove tcmalloc and malloc profiler.
The standalone VM originally began statically linking tcmalloc to work around bugs in the system malloc for Fiber. Later it used tcmalloc's hooks to implement a profiler, but this is rarely used since it is only available in debug mode, misses early allocations, and often misses late allocations from an exhausted sample buffer. Removing it altogether avoids build complexity around which combinations of compiler/architecture/sysroot support tcmalloc, and reduces binary size.

TEST=ci
Change-Id: I4b259e18b82b2d12a2a60962aabf83bd8d997d19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286120
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-03-03 23:32:12 +00:00
Jake Macdonald 4947481ff6 convert class M to mixin in observatory test
TEST= only test changes

Change-Id: If372c032ed2e84dc4c442c7cae9897b3c8ecc37e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285801
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-28 22:45:14 +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 35e9a34c3f [VM/Service] Fix SERVICE_PROTOCOL_MINOR_VERSION
TEST=CI

Change-Id: I1e67c0a8f4148aac0f70f777eb8211cbb64044b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285401
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-24 19:05:01 +00:00
Ahmed Ashour d6ceee805e [observatory] remove dead code
Bug: #51401

TEST=ci

Change-Id: Idc680edc71bc0e6842f4539a9de2ed283ce7f0ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283362
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-02-24 18:42:30 +00:00
Alexander Aprelev 2474e9363d [gardening] Fix break_on_function_many_child_isolates_test.
Only resume and confirm breakpoint works one isolate at a time. Pausing large number of isolates at once could exhaust thread pool leading to test timeout.

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

Change-Id: I7e3a85b797315d7d7f022923d51a5a1a45879880
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284421
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-02-22 22:41:54 +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
Ahmed Ashour 0ed7f7bb4d [observatory] remove unused_imports and some unused variables
Bug: #51401

TEST=ci

Change-Id: If64853565aca66105da43609fa8bea70ea65a7ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283020
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-02-15 16:49:58 +00:00
Alexander Markov 6362064134 [vm] Fix crash when pausing on unhandled exception in async function without awaiter
TEST=service/pause_on_unhandled_async_exceptions4_test
Fixes https://github.com/dart-lang/sdk/issues/51175

Change-Id: I54c2041a9eb28a9a73d608ebfa0bceca522d1287
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283128
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-02-15 15:45:48 +00:00
Ryan Macnak 1873228ebb [observatory] Fix NNBD damage to malloc profiler page.
TEST=--profiler-native-memory
Change-Id: I8333359e516d9cb30d57d85d32c4328a450c3579
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281864
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-02-09 17:29:20 +00:00
Sam Rawlins 4495ccf80d [observatory] Fix nullable catch paramter issues
`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>
2023-02-03 17:32:27 +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 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 c09d4d1c3d [vm/reload] Reject failed compilation during isolate reload
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>
2023-01-27 17:47:38 +00:00
Ryan Macnak 18c9f52aaf [observatory] Fix NNBD damage to VM flags page.
TEST=view vm flags
Change-Id: Ifaa35bef21715962774e77524618fd1ac25b4b39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279906
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-01-27 00:04:28 +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
Vyacheslav Egorov 4482709d45 [vm] Mark ListMixin.iterator with prefer-inline
This helps to improve the code quality in for-in loops
where iterable has a known List type.

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

Tested: tests updated due to line number changes in list.dart
CoreLibraryReviewExempt: no public API changes
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-product-x64-try
Change-Id: Ia5d815009a699061961c331cf43e68d2c96fc58b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279518
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-01-26 10:16:51 +00:00
Josh Soref 01b28894e7 Spelling pkg dev compiler
Closes https://github.com/dart-lang/sdk/pull/50861

GitOrigin-RevId: 71005e6f5bf5a151cb5c1aefb6a2a300fc40f592
Change-Id: Iadfafb5787a62e9a379437f6a3763d31f99ba7c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277743
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-26 09:12:41 +00:00
Josh Soref f7a2ea5e06 Spelling
Closes https://github.com/dart-lang/sdk/pull/50922

GitOrigin-RevId: 58fd7cfd5ef470a65a52ea28e0407244d853c917
Change-Id: I2e5a5ed991cb05270170a18b8f0169daa9eabdb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278537
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-24 18:00:25 +00:00
Sam Rawlins 4baa99e932 [observatory] Fix 'unused_catch_clause' issues
This is required in order to migrate Hints to Warnings This CL migrates
this code: https://dart-review.googlesource.com/c/sdk/+/279443

TESTED=presubmit

Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: I1e0c360e6ed366b6452474338679acc8b1e1399c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279458
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-01-23 19:51:48 +00:00
Josh Soref 9f6bcadb22 Spelling runtime observatory
Closes https://github.com/dart-lang/sdk/pull/50810

GitOrigin-RevId: 5edc2fb9b7b693190bc34fe1941591bdaf3405fe
Change-Id: Ia6627bc075fc5d4ab9dfaeec91da164820cdefee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276880
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-20 14:29:08 +00:00
Ryan Macnak f9524f8509 [observatory] Fix some damage from NNBD and changes to InboundReference/RetainingPath.
TEST=view allocation profile, inbound references, retaining path
Change-Id: Id72fff5eaa1f892e9d54703f2f29787067c54055
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279202
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-01-19 17:36:20 +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
Ryan Macnak 79bcad6453 [vm, compiler] Use a proper sentinel instead of a string to represent eliminated values.
- Prevents the VM from behaving incorrectly when the Dart program happens to use the string "<optimized out>".
 - Prevents the VM from executing eval functions for non-String classes with a String receiver.

TEST=<optimized out>
Bug: https://github.com/dart-lang/sdk/issues/51027
Change-Id: I4b6ee856492dee86d641a0200a40a25fa78bcb88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279261
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-01-18 23:34:12 +00:00
Ryan Macnak d23d074bb9 [vm] Fix determining the scope class for evaluation with mixin applications.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/51027
Change-Id: I02b31187c2dd81ff61db01d5922a2b283e7f2541
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279238
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-01-18 17:48:31 +00:00
Ryan Macnak cfd0c25ac3 [test] Run the service suite with --nnbd=strong.
TEST=ci
Change-Id: I6753a0a5eb9d93e4c33af0dc8d21dffe3e6aee54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278944
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-01-13 18:32:27 +00:00