Commit graph

461 commits

Author SHA1 Message Date
Jens Johansen 856139bfc3 [VM] Add RecordCoverage to InstanceCall and StaticCall
Before this CL, becase of optimizations, coverage of some of these goes
away, making coverage unreliable.

I believe this fixes the issues for "regular" runs (at least it seems to
be stable on the CFE coverage tests).

If setting `--optimization-counter-threshold=-1` there'll still be
trouble though and we would have to also insert these calls in the start
of FunctionBody and the start of FieldInitializer for it to produce the
same results.

TEST=pkg/vm_service/test/coverage_instance_call_after_optimization_test.dart,pkg/vm_service/test/coverage_static_call_after_optimization_test.dart

Bug: https://github.com/dart-lang/sdk/issues/42061
Bug: https://github.com/dart-lang/sdk/issues/55959
Bug: https://github.com/dart-lang/sdk/issues/56018

Change-Id: I34947f0d4b123e52ce67b71a195782d31e4bda16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370501
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-06-17 10:47:58 +00:00
Ben Konyi fa89a0183e [ package:vm_service ] Prepare for 14.2.4 release
Change-Id: Ibee954dcbac5f7ac592686440e3d6a7fdc83b522
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371581
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-06-14 14:01:58 +00:00
Ben Konyi bcaf745a9b [ package:vm_service ] Add missing code to code generator
Was added originally in https://dart-review.googlesource.com/c/sdk/+/367821

Change-Id: I7873e960319c10e995e24b1bb2514ede0c3299d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371360
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-06-13 15:03:49 +00:00
Ömer Sinan Ağacan 633e7c4b15 [vm_service] Decode incoming JSON in one step instead of two
Currently we decode incoming data as a string, then parse the string as
JSON.

We can do it in one step by fusing a `Utf8Decoder` with a `JsonDecoder`,
which will be faster.

A difference between `jsonDecode` and the fused version is that
`jsonDecode` returns `dynamic`, the fused version returns `Object?`.

To keep changes as small as possible we cast the return value of the
fused verison to `dynamic` in this CL.

However using `dynamic` values is often slower than type casting it to
the right type and then using it. So it might make sense to cast it to
something like `Map<String, dynamic>` in a separate CL.

Change-Id: I76de535a72ae5532db5a27e543929519c48c701c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371080
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-13 11:53:40 +00:00
Jens Johansen 911b8d11a7 [vm] RecordCoverageInstr isn't dead code
Dead Code Elimination can remove `RecordCoverageInstr`, but shouldn't.
This CL makes it stay by returning true in `HasUnknownSideEffects`
making `MayHaveVisibleEffect` return true, making Dead Code Elimination
keep it.
Note that `RecordCoverageInstr::Canonicalize` will still let it go away
if the position is already covered which is what we want.

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

TEST=pkg/vm_service/test/coverage_closure_call_after_optimization_test.dart,vm/cc/IL_RecordCoverageSurvivesOptimizations

Change-Id: Ifd72f9071a51924fd71f3dae91687acb1467047d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370220
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-06-10 13:02:28 +00:00
Derek Xu 30b0796c8c [VM/Debugger] Fix bug where breakpoints set in compiled field initializers do not resolve immediately
TEST=verified that
pkg/vm_service/test/breakpoint_resolves_immediately_in_compiled_field_initializer_test.dart
fails without the changes in this CL and passes with them, verified that
none of the existing debugger tests got broken by this CL

Change-Id: I6acb5576a80e5d633b012c866fe90bf13d2c1ba6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369162
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-06-04 15:06:28 +00:00
Kevin Moore b981930894 vm_service: code cleanup
Change-Id: I4a53d9b4f570cf2c8b7c5bf119542a7e4702ce2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369380
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2024-06-03 21:23:38 +00:00
Ben Konyi 02f32f320e [ package:vm_service ] Prep for 14.2.3 release
Change-Id: I2a861d2021553f2cc4b0dbdc2390bff4edf49f84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368860
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-05-30 17:22:23 +00:00
Jackson Gardner a479f91e80 Throw an RPC error when calling methods on a disposed connection.
This is consistent with the way we handle outstanding requests when the
service is disposed. Note that some of the devtools code in flutter
expects and handles this RPC error in some cases.

Change-Id: I56aae14f898b6d62b77d10ef50dec63ae96d507d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367821
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
2024-05-29 20:43:39 +00:00
Derek Xu 45221e51c3 [VM/Debugger] Prevent FindBestFit from considering closures that were
compiled prior to the latest reload

TEST=verified that
pkg/vm_service/test/breakpoint_resolution_after_reloading_test.dart
fails without the changes in this CL and passes with them, verified that
none of the existing debugger tests got broken by this CL

Change-Id: Ie816a3ad65a17ef9f497f209f2203d679728cb75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366860
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-05-16 21:57:18 +00:00
Ben Konyi a7d8707a59 [ package:vm_service ] Automatically invoke VmService.dispose() when the service connection closes
Fixes https://github.com/dart-lang/sdk/issues/55559

Change-Id: I213ae3960c15bf2a68b4113a26f333090266b9c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365060
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-05-02 16:01:49 +00:00
Derek Xu 3ac8d60115 [VM/Service] Add a case that tests ReadStream.readUtf16
TEST=confirmed that the added test case fails when undoing the changes
made in package:vm_service 14.2.1

Issue: https://github.com/dart-lang/sdk/issues/55475
Change-Id: I189db9dda4c730199157432522323e34a6f87c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363441
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-04-17 19:47:29 +00:00
Ben Konyi 47a91f17cb [ package:vm_service ] Prepare for 14.2.1 release
Change-Id: Ie1a6c4f666ca7a35faff4557b03cd8eedbeccf55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363200
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-04-16 20:12:23 +00:00
Derek Xu d5bfb27945 [VM/Service] Fix alignment issues in readUtf16
Issue: https://github.com/dart-lang/sdk/issues/55475
Change-Id: Ib7b09e21096dd76cee5037c3120a7944a2b85340
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363120
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-04-16 16:36:48 +00:00
Ben Konyi 5536951738 [ DDS ] Rework client resume permissions API
This change reworks the client resume permissions API to make it easier
for clients to deal with user provided `--pause-isolates-on-start` and
`--pause-isolates-on-exit` flags.

`requireUserPermissionToResume` should be called by the tool that
launches the Dart process to indicate whether or not the user provided
`--pause-isolates-on-{start,exit}`. The default behavior is to assume
that a tool set these flags for its own use (e.g., resetting breakpoints
after a hot restart in Flutter), where isolates will resume immediately
after each client that has indicated interest in that pause event has
invoked `readyToResume`.

If a user provided one of the previously mentioned flags, isolates will
not immediately resume after each relevant client has invoked
`readyToResume`. Instead, a call to `resume()` must be made to indicate
the user has triggered the resume request instead of tooling. If the
user permissions to resume are changed while the isolate is paused and
all relevant clients have invoked `readyToResume`, the isolate will
automatically resume if the user no longer requires us to wait for a
user resume.

`resume()` now also acts as a "force resume", bypassing any required
permissions set by tooling.

This behavior change is breaking, so the DDS protocol version is being
bumped to 2.0.

`package:dds_service_extensions` has also been updated to include the
following DDS RPCs:

 - `requireUserPermissionToResume`
 - `readyToResume`

Change-Id: Id5f0806b3c56507d39eb00b6305b8896bab13ae7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357420
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-03-21 21:09:42 +00:00
Alexander Markov 17d6ba15b6 [vm] Remove external strings
This change removes support for external strings from the VM along with
Dart_NewExternalLatin1String, Dart_NewExternalUTF16String and
Dart_IsExternalString Dart C API functions.

External strings are not used by the VM nor any known embedder, but
Dart VM was paying the maintenance and performance price for
the external string implementation classes.

TEST=ci

Change-Id: I094cd2d2b7ec0840e9f09e1ca9e5a7acd4e78c28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358760
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-03-20 20:08:13 +00:00
Ben Konyi 3a62af40b3 [ package:vm_service* ] Prepare for release of package:vm_service 14.2.0 and package:vm_service_interface 1.1.0
Adds support for 4.15 of the VM service protocol to both packages. Also
adds `yieldControlToDDS` to the `VmServiceInterface` so implementers of
the service protocol can correctly handle DDS connections.

Change-Id: I9253a647c1781f4d52758ecce4984082dfbf4fa0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357720
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
2024-03-20 13:34:07 +00:00
Ömer Sinan Ağacan 361c2564f7 [vm_service] Optimize ReadStream
This adds fast paths that avoid copying bytes from the input to a
temporary array when the current chunk has enough bytes for thing being
parsed.

Also avoids allocating a temporary array when parsing a 64-bit float by
allocating a single 8-byte buffer and reusing it.

This reduces runtime of a `HeapSnapshotGraph.fromChunks` call parsing a
91M snapshot in a single chunk from 2 seconds to 1.8 seconds. The
benchmark code is compiled with `dart2js -O4`.

Change-Id: I39d9579bcf488b17ecd0d5c7a84f93748c733920
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340182
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-03-08 10:00:19 +00:00
Derek Xu 098d2f3652 [VM/Compiler] Mark instructions related to late initialization error checks as synthetic
TEST=pkg/vm_service/test/breakpoints_ignore_late_initialization_error_instructions_test.dart

Fixes: https://github.com/dart-lang/sdk/issues/53376
Change-Id: Iab7d2489f29bfc4a586b9de6e3caa0a7c1a35454
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355000
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-02-28 20:06:58 +00:00
Ben Konyi bef3373526 [ package:vm_service ] Prepare for 14.1.0 release
Change-Id: I8661dedd5c7212952a653b54f94f0df04d8de2f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354680
Reviewed-by: Polina Cherkasova <polinach@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-02-27 18:28:38 +00:00
Jonas Termansen 2f05659b62 [vm_service] Bump vm_service language version to 3.3.
Fixes: b/318347018
Change-Id: I55ad1e6b30dceef32ab32a5b70b0b9072bfc02d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344023
Auto-Submit: Jonas Termansen <sortie@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-02-23 00:29:58 +00:00
asiva 58098d3414 [VM/Service] - Launch dds from vmservice code instead of dartdev code
Currently the dds process is being launched from dartdev and
this causes problems when the dartdev commands 'run' and 'test'
are implemented by spawning child processes (this is needed
to make dartdev an AOT snapshot).
This CL attempts to lauch dds from the service isolate code.

TEST=ci

Change-Id: Iad00a17473a630659f15a5c73be0f5385ea35bdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350688
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-02-22 06:22:12 +00:00
Vyacheslav Egorov 2280b06202 [vm] Improve detection of handled async errors
Improve the handling of code where the async flow forks:
e.g. for `fut.whenComplete(c.complete)` we might proceed
unwinding through awaiters of `c.future` and forget about the
future returned from `whenComplete`. This happens because
we choose to present result of the unwinding as a single
stack and not a tree. In this situation the error will only
propagate into that future and whether or not the error will be
handled depends on that future alone.

As part of this change also start respecting ignored bit on
futures without listeners.

TEST=pkg/vm_service/test/pause_on_unhandled_async_exceptions7_test.dart

CoreLibraryReviewExempt: Comment only changes to core library
Change-Id: I27b689ab07a725e8faa8d91cf40e88ebc8c441a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352904
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-02-16 12:55:22 +00:00
Vyacheslav Egorov df6fd34f75 [vm] Improve asynchronous unwinding through Stream methods
This CL adds @pragma('vm:awaiter-link') in various places in
Stream implementation to facilitate unwinding and expands
async unwinding logic with more information about
Stream internals.

At the same time be more conservative when checking if an
exception thrown from async method handled: failing to unwind
the stack fully creates situations when we incorrectly report
caught exceptions as uncaught, which frustrates users.

To distinguish stream subscriptions with and without error
handlers we add a state bit. Otherwise, it looks like all
subscriptions have error handlers because if no error
handler is installed we eagerly install error handler forwarding
the error to `Zone.handleUncaughtError`.

Fixes https://github.com/dart-lang/sdk/issues/53334
Fixes https://github.com/dart-lang/sdk/issues/54788
Fixes https://github.com/dart-lang/sdk/issues/47985

TEST=runtime/vm/dart/awaiter_stacks/stream_methods_test.dart,pkg/vm_service/test/pause_on_unhandled_async_exceptions6_test.dart,pkg/vm_service/test/pause_on_unhandled_async_exceptions7_test.dart

CoreLibraryReviewExempt: No behavioral change. Async changes reviewed by lrhn@
Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-dwarf-linux-product-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try
Change-Id: Ic51f926867092dd0adbe801b753f57c357c7ace2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322720
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-02-15 23:00:44 +00:00
Polina Cherkasova f3d587f890 Add flags to opt out from some data parsing, to save time and memory.
Change-Id: I8144478175e1de103fcf5dc67deafe067ed72570
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351301
Commit-Queue: Polina Cherkasova <polinach@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-02-15 22:52:41 +00:00
Derek Xu 628d744391 [dart:developer][VM/Service] Add APIs to dart:developer for recording HTTP profiling information, and for later retrieving that information
The APIs mentioned above are `addHttpClientProfilingData` and
`getHttpClientProfilingData`.

This CL also makes it so that profiling information recorded using
`addHttpClientProfilingData` is included in dart:io service extension
responses.

TEST= pkg/vm_service/test/get_http_profile_test.dart

Change-Id: I892a7a8485369bb92cbb0c086b93498bcec25d5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341440
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-02-15 18:56:08 +00:00
Alexander Markov a261196ea7 [vm] Remove context allocations for tear-offs
Previously, when taking a tear-off, a separate Context object was
allocated in order to capture receiver. Now, receiver is stored directly
in the Closure object in the 'context' field. This saves 1 object
allocation per tear-off and makes tear-offs cheaper compared to
explicit closures which can share context with other closures.

Benchmarks in AOT mode:

x64:
TearOff.NotInlined +40%
TearOff.NotInlined.InTry +43%
TearOff.Inlined.InTry +47%

arm64:
TearOff.NotInlined +27-43%
TearOff.NotInlined.InTry +29-43%
TearOff.Inlined.InTry +58-94%

arm64c:
TearOff.NotInlined +71%
TearOff.NotInlined.InTry +72%
TearOff.Inlined.InTry +96%

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/54808
Change-Id: I3ad95e8a8a4fc23f856bbc0fe238da58a9d25b8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350945
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-02-13 15:33:38 +00:00
Derek Xu 83ef6bfeff [VM/Service] Add some logging to get_perfetto_cpu_samples_rpc_test
6d623f435d
did not fix the problem
(https://dart-ci.appspot.com/log/any/vm-linux-debug-x64/2320/pkg/vm_service/test/get_perfetto_cpu_samples_rpc_test)
so I'm going to add some logging and see if that reveals anything.

Change-Id: I1a0e100ff5141899a000b09c56f364c7cfc28f69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352140
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-02-12 20:17:00 +00:00
Polina Cherkasova 47f0541c99 Clean up code.
1. Add '_' to libs that are not exported.
2. Remove references from src to root libs.
3. Remove not used code.

No code changes.

Change-Id: Ie344fb7e41decb0ebf6e50d59dc843fb04ca683b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350692
Commit-Queue: Polina Cherkasova <polinach@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-02-12 17:59:57 +00:00
Derek Xu 6d623f435d Make testee pause on exit in get_perfetto_cpu_samples_rpc_test
Since it currently seems like samples are being collected even after
`testeeDo` has finished, we can give this a try and see if it changes
anything.

Change-Id: Id6f95cfb457b033d17e5e32e3fe073a2f2b9a958
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352080
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-02-12 16:14:12 +00:00
Derek Xu 60833d9cd9 [VM/Service] Update dart:io service extension spec
The main purpose of these changes is to make sure that the types in
package:http_profile are compatible with the interfaces in the spec.

See runtime/vm/service/service_extension.md and
pkg/vm_service/CHANGELOG.md for the full list of changes.

TEST=pkg/vm_service/test/get_http_profile_test.dart, DevTools tests

CoreLibraryReviewExempt: Only touches sdk/lib/io/network_profiling.dart
to update the version returned by the getVersion dart:io service
extension.
Change-Id: I1b9d0b7d43defbc857a2a8fde003012effd1ee15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341120
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-02-06 19:26:06 +00:00
Ben Konyi f4b1d59461 [ Gardening ] Fix pkg/vm_service/test/get_supported_protocols_with_dds on AOT
Fixes https://github.com/dart-lang/sdk/issues/54835

Change-Id: I1dc0c585214e8001dfb6f2f0d8f3f07252bf56f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350660
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-02-06 17:23:32 +00:00
Polina Cherkasova 166c796179 Implement toChunks and allow optimization.
1. Implement HeapSnapshotGraph.toChunks
2. Add parameter calculateReferrers, to allow to skip calculation of referrers, when they are not needed.

Change-Id: I312f01f1527e6b2bf4c8ddce6017ca6c53c8dd3a
CoreLibraryReviewExempt: minor dart:io documentation change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348802
Commit-Queue: Polina Cherkasova <polinach@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-02-06 16:55:20 +00:00
Ben Konyi 8338fc2eac [ package:vm_service ] Migrate some more tests from service/
Change-Id: I009b9ae97fb5eaeebc4bddb3813d83562302d0ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349560
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-02-05 22:17:27 +00:00
Vyacheslav Egorov 0ea5013250 [vm] Respect catchError attached to the last async frame.
Our async unwinding code used to only respect `catchError`
which occured between async frames and ignored trailing
`catchError` like in the code below

    Future(...).catchError((_) { /* handle error */ });

This CL also simplifies how we communicate the presence of the
exception handler to the debugger: the code in the debugger did
not actually care about which frame catches the error (for async
handlers), so we don't need to precisely mark async gaps with
`has_catch_error` flag. Instead we have a single boolean
produced by unwinding which signals whether there we encountered
an asynchronous error handler or not.

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

TEST=service/pause_on_unhandled_async_exceptions5

Change-Id: Id6f6a97ee5444c197b2c621f68d1e47082fc8997
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350320
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-02-05 21:09:38 +00:00
Derek Xu b3abf245a8 Reland "[VM/Debugger] Ignore optimized out variables when building scope in ActivationFrame::BuildParameters"
This is a reland of commit e727f4ecbd

We allow the arguments array in
EvaluateCompiledExpressionHelper to contain
Object::optimized_out().ptr() when we have determined that the receiver
has been optimized out but isn't used by the compiled expression. So, I
have moved the assertion that checks for optimized out arguments from
EvaluateCompiledExpressionHelper to
Instance::EvaluateCompiledExpression.

TEST=vm-linux-debug-x64 tryjob

Original change's description:
> [VM/Debugger] Ignore optimized out variables when building scope in ActivationFrame::BuildParameters
>
> TEST=pkg/vm_service/test/evaluate_optimized_out_variable_test.dart
>
> Issue: https://github.com/dart-lang/sdk/issues/53996
> Change-Id: I5e6f0b2c02455af73c2108e6996039c95d3f1f31
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347940
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Change-Id: Id6df0b0b3e0d26239068041126b034e9469b87af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347945
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-01-24 16:49:39 +00:00
Derek Xu 4a82018d88 Revert "[VM/Debugger] Ignore optimized out variables when building scope in ActivationFrame::BuildParameters"
This reverts commit e727f4ecbd.

Reason for revert: breaks some tests in debug mode

Original change's description:
> [VM/Debugger] Ignore optimized out variables when building scope in ActivationFrame::BuildParameters
>
> TEST=pkg/vm_service/test/evaluate_optimized_out_variable_test.dart
>
> Issue: https://github.com/dart-lang/sdk/issues/53996
> Change-Id: I5e6f0b2c02455af73c2108e6996039c95d3f1f31
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347940
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Issue: https://github.com/dart-lang/sdk/issues/53996
Change-Id: I0d5c94b206ea31e82240f17e9304bec1b01e3580
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347942
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-01-23 21:17:57 +00:00
Derek Xu e727f4ecbd [VM/Debugger] Ignore optimized out variables when building scope in ActivationFrame::BuildParameters
TEST=pkg/vm_service/test/evaluate_optimized_out_variable_test.dart

Issue: https://github.com/dart-lang/sdk/issues/53996
Change-Id: I5e6f0b2c02455af73c2108e6996039c95d3f1f31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347940
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-01-23 20:12:42 +00:00
Ben Konyi 5a60ceeff8 [ package:vm_service ] Fix get_isolate_rpc_test flakiness
Fixes https://github.com/dart-lang/sdk/issues/54585

Change-Id: Ie335a5cb7c2add7987d9b729d86b6a0823357775
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347140
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-01-18 20:10:40 +00:00
Ben Konyi 53af406764 [ package:vm_service ] Fix flaky get_memory_usage_test.dart
Fixes https://github.com/dart-lang/sdk/issues/54586

Change-Id: Ide277dc7db1fe85a35a2a7d8cc0ad7ec70c10688
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347141
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-01-18 18:39:42 +00:00
asiva 82c385f73a [VM/Service] Include newline in the stdout service event.
TEST=new test added

Bug:54582
Change-Id: I5e8d3aab19c37353a12e3a0a65edbb954d52bb4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346084
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-01-16 18:41:23 +00:00
Daco Harkes 8758f1f954 [vm] Bump service protocol to 4.14 and hide implementation
Follow up of https://dart-review.googlesource.com/c/sdk/+/346403.

TEST=pkg/vm_service/test/get_object_rpc_test.dart

Change-Id: I7c1d0fb565f8a128334844f7eec44eb4a4679c08
Cq-Include-Trybots: luci.dart.try:vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-win-debug-x64-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346600
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-01-16 18:25:18 +00:00
Daco Harkes f944ef16ab [vm] Fix g3 build
The file doesn't seem to have field promotion enabled in g3.

Change-Id: I1eafd191064fa24e62f60b7d29bb7468f55cfceb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346460
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-01-16 09:48:40 +00:00
Daco Harkes 7ba473f32b [vm] Support Finalizers in the debugger
TEST=pkg/vm_service/test/get_object_rpc_test.dart

Closes: https://github.com/dart-lang/sdk/issues/54615
Change-Id: I5262d756af63eb5d1677894f6a2e151cd0d65fc1
Cq-Include-Trybots: luci.dart.try:vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-win-debug-x64-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346403
Reviewed-by: Ben Konyi <bkonyi@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-01-15 23:14:56 +00:00
Alexander Aprelev 15d8187fef [gardening] Fix line numbers in service test.
Follow-up to ffdb0a2e19

TEST=ci

Change-Id: I1f1a05c6576d6913b3808fd20a2a3e21e2f6f2ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345562
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2024-01-10 20:20:51 +00:00
Alexander Aprelev ebf1456c7b [gardening] Workaround ddc issue in vmservice code in g3.
There seems to be a problem with convincing ddc that null-checking
is sufficient for late final field.

Fixes b/319411590
TEST=ci

Change-Id: I1a396201d2a1edf960c0f73e5e0d0ab5be8d9475
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345580
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2024-01-10 17:20:32 +00:00
Jonas Termansen c1581d6636 [vm_service] Fix line numbers in broken vm_service tests.
Another successful sortie commit.

Change-Id: Ie1e44f3d4c816f30d0129a193f9d360b27c1fe3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345521
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2024-01-10 16:25:32 +00:00
Jonas Termansen ffdb0a2e19 [vm_service] Bump vm_service language version to 3.2.
Remove older version tags in vm_service and clean up old experiments.

Bug: b/318347018
Change-Id: I6bf87e46878d57d05d7f9d64674ce0c573364d4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345302
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2024-01-10 12:06:57 +00:00
Jonas Termansen 8158275a94 Bump version to 3.4.
Do not revert: The main channel version must be upgraded now that the
version 3.3 beta has been cut and reverting this change puts the
release infrastructure into an unsupported state. Please fix forward
any potential problems that occur downstream and loop me into the
discussions so we can improve the release procedures in the future.

Change-Id: I8706c3d74fe0474d34a99c5cbbb8e9a88b586cdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329902
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-01-04 16:15:09 +00:00
Ryan Macnak 04d606aaff [vm] Account for --no_retain_function_objects in Code::Name.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/54344
Change-Id: Ic72b877efaf36a5b68285caa595604e203ea83b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341821
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-12-15 17:08:56 +00:00