Commit Graph

995 Commits

Author SHA1 Message Date
Ben Konyi 493560a419 [ VM ] Disable sdk_break_with_mixin_test on AOT bots
Fixes https://github.com/dart-lang/sdk/issues/45781

TEST=N/A

Change-Id: I3a624078183eaa2bc283bd9f2363b65dfdf781d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196341
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-04-21 16:59:04 +00:00
Vyacheslav Egorov f88ce677e1 [vm/debugger] Avoid treating a try/finally as a catch
There is a synthetic try/catch within a try/finally block.

When trying to assess whether an exception is caught, the debugger
should skip such generated try/catch blocks. Otherwise, it considers
that try/finally actually handles the exception, which is wrong.

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

TEST=runtime/observatory{,_2}/tests/service{,_2}/regress_45684_test.dart

Change-Id: I60e8837204cf97ee1ab02ffd03364e7f69857004
Fixed: 45684
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196124
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-04-20 23:14:38 +00:00
Ben Konyi 302e42da44 [ VM / Service ] Allow for resolving breakpoints in multiple Script
objects

It's possible for scripts to appear in multiple components provided by
the front end in certain situations (e.g., mixin applications in
different libraries). Previously when trying to set a breakpoint, if
multiple scripts were found matching the target URI the debugger would
give up and not set the breakpoint.

This change allows for multiple Scripts to be associated with a
BreakpointLocation.

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

TEST=runtime/observatory_2/tests/service_2/sdk_break_with_mixin_test.dart

Change-Id: I935721f4753675a9a2051a71cc1720e590f8d4f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195664
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-04-20 22:34:38 +00:00
Ryan Macnak f54bb55244 Reland "[vm, service, observatory] Add ability to retrieve the set of all instances of a class, implementation hierarchy or interface hierarchy as an array."
Filter Class::direct_subclasses/implementors_ to remove tree-shaken classes.

TEST=ci, manual UI interaction
Bug: https://github.com/dart-lang/sdk/issues/45564
Change-Id: Ia2a46e9701745ce88dffa95a86b7756f3ab0921d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194110
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-04-14 19:40:20 +00:00
Martin Kustermann 3f7614f56f [gardening] Skip service tests that require expression evaluation in AppJIT
In AppJIT mode we run from a snapshot and won't have an incremental
compiler available. That also means expression evaluation is not
supported.

The specific test that was failing was

  service_2/evaluate_activation_in_method_class_test/service

though this CL skips all evaluation tests.

The CL also align the service and service_2 status files more.

TEST=Only updates status file to skips tests.

Change-Id: I8dbb3aeeb686370d898c59da3729f5e0c52df411
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194685
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-04-09 09:58:43 +00:00
Ben Konyi d18d3d837f [ dart:developer ] Add serverWebSocketUri to ServiceProtocolInfo
Adds a convenience getter to ServiceProtocolInfo which transforms the VM
Service HTTP URI into a valid web socket URI that can be used to connect
to the VM service.

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

TEST=runtime/observatory/tests/service/developer_server_control_test.dart

Change-Id: Ib15de1f1a9b26ac5cf45f55a53014761a6fa7900
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194209
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2021-04-07 20:02:17 +00:00
Ben Konyi 2a2d83e9e9 [ VM / Service ] Add support for enabling/disabling breakpoints
This change adds a `setBreakpointState` RPC which allows for breakpoints
to be enabled or disabled without needing to remove and recreate
breakpoints.

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

TEST=set_breakpoint_state_test.dart

Change-Id: I1a04e6028d4e4560fdb8d3d26420c9a05da06b4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193896
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-04-06 22:16:06 +00:00
Alexander Aprelev abdca81fa0 Revert "[vm, service, observatory] Add ability to retrieve the set of all instances of a class, implementation hierarchy or interface hierarchy as an array."
This reverts commit 170bda2b74 as it breaks ffi test.

See https://github.com/dart-lang/sdk/issues/45564

TEST=rollback

Change-Id: Ie27cfa7c3bc093c1e8d46722942d1f2e5e3cb77e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193882
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-04-02 16:46:11 +00:00
Ryan Macnak 170bda2b74 [vm, service, observatory] Add ability to retrieve the set of all instances of a class, implementation hierarchy or interface hierarchy as an array.
Allows developers to perform arbitrary filtering or analysis of instances, such as finding the largest strings, degreeses of duplication, histograms of various properties, etc.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/44479
Change-Id: I0b4005b5778038945e5f1b2d7858806c8e0dbbff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176381
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-04-01 20:53:22 +00:00
Ben Konyi 0ab30e584b [ Service ] Mark pause_on_exception_from_slow_path_test as Slow
TEST=N/A

Change-Id: I570d977a84e60c478e08e933abf184a227231d05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193441
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-03-29 16:45:06 +00:00
Ben Konyi 3b76190e02 [ Service ] Skip sigquit_starts_service_test on AppJIT configurations
TEST=N/A

Change-Id: If118d8254b1f918306723e7677680fffefe836e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193060
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-03-25 17:02:31 +00:00
Ben Konyi 45c4f589a1 [ Service ] Skip sigquit_starts_service_test on precompiled and simarm
configurations

TEST=N/A

Change-Id: I286abb3e76aab0019fe838b65097b2d07651b52b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192950
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-03-25 01:20:52 +00:00
Ben Konyi 4faadf1bdd [ VM / Service ] Fixed Observatory URI not being printed when service is
started via SIGQUIT

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

TEST=service/sigquit_starts_service_test.dart

Change-Id: I4e7b818d60b18e0a3bc2ce4cea670accf4bbd115
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192604
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-03-24 23:59:23 +00:00
Ben Konyi c4bfca9b6a [ dart:io / package:vm_service ] Add HTTP request profiling service
extensions

This change adds HTTP request profiling support to the dart:io service
extensions and removes HTTP request/response body logging to the
timeline due to memory constraints.

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

TEST=pkg/vm_service/test/get_http_profile_test.dart

Change-Id: I85642296c3d6595197f3365022477c7685c452bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189881
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
2021-03-24 23:01:03 +00:00
Daco Harkes 043ea3b4f4 [vm/service] Fix tests in obfuscation
Added entry-point pragmas to prevent obfuscation of global vars.

Removed expectation checking for standard library `Expando` class name.

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

TEST=Fixes various service_2 tests in obfuscation mode.

Change-Id: I91bb856c7f1ff44afe1cceec8e94e3b97ab56e44
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-obfuscate-linux-release-x64-try
Fixed: 45422
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192681
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-03-23 13:28:36 +00:00
Ben Konyi 3b49fd862b [ VM / Service ] Add identityHashCode to @Instance and Instance
responses

Allows for comparing @Instances and Instances with allocation traces and
heap snapshot entries.

TEST=pkg/vm_service/test/get_allocation_traces_test.dart

Change-Id: I6d021b0267f1595332475470961df6e35321ce80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188600
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-03-22 22:45:57 +00:00
Alexander Aprelev 2c5b320b14 [vm/concurrency/debugger] Fix pool patching synchronization for lightweight isolates breakpoints.
TEST=service/break_on_function_many_child_isolates_test

Issue https://github.com/dart-lang/sdk/issues/36097

Change-Id: I15b9d9db938042c89f21700876bf75d932f044a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191781
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-03-19 20:24:48 +00:00
Martin Kustermann 3930eb8fce [gardening] Mark class as entrypoint to preserve name in obfuscation mode
Fixes https://github.com/dart-lang/sdk/issues/45385

TEST=Fixes service/allocation_test in obfuscation mode.

Change-Id: I80ac204866c5224cf88d2f5f2079655e224691c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192143
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-03-19 13:15:29 +00:00
Alexander Aprelev 7b94d56d67 [observatory] Provide isolate for send data events because observatory expects it for write events.
_ConsoleStreamPrinter::onEvent expects isolate on WriteEvent. It's absence causes exceptions in Observatory. This started with https://dart-review.googlesource.com/c/sdk/+/190303

TEST=updated capture_stdio_test with isolate expectations; run observatory to ensure to exceptions are generated

Change-Id: I73efe9c1ab5b0d779d9432fd64ad5ccc5fcc14ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191661
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-03-17 23:30:47 +00:00
Alexander Aprelev 4baf7e5e3d [vm/concurrency] Introduce GroupDebugger that takes CodeBreakpoints management away from isolate Debugger.
CodeBreakpoint class tracks patching of the call targets for the purpose of routing the call to the debugger runtime.
With this CL CodeBreakpoint instance is managed by GroupDebugger, debugger class owned by IsolateGroup, and can be associated with multiple BreakpointLocation, one location per isolate that set a breakpoint at particular code location.

TEST=observatory/tests/service/break_on_function_child_isolate_test

Issue https://github.com/dart-lang/sdk/issues/36097

Change-Id: I3b3d0974a0fb9668742e5c1e2a2ce13b84b1d630
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190732
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-03-17 18:03:14 +00:00
Clement Skau f2dfe3a8be [vm/debugger] Fixes async CollectAwaiterReturn()
The async, off-stack part of DebuggerStackTrace::CollectAwaiterReturn's
stack unwinding incorrectly looked on the stack instead of following
the Closure's awaiter chain.
This caused the async stack traces to be truncated and missing any
async frames, in turn causing ShouldPauseOnException to incorrectly
conclude no handler frame existing.
This would affect any case where the exception handling was located
around any except for the inner most awaiter.

TEST=Added regression test to pause_on_unhandled_exceptions_catcherror_test

Closes: https://github.com/dart-lang/sdk/issues/37953
Bug: https://github.com/dart-lang/sdk/issues/37953
Change-Id: I34a2b5ce3c7532032b2ef3dfbc2af7294d13a4c7
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187405
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-02-26 06:46:36 +00:00
Ryan Macnak 5a385890b9 [test] Apply simarm64 status file entries to simarm64c.
Remove references to the removed simarmv6 architecture.

TEST=ci
Change-Id: I10e9fc8291c3e5b6b9a4bd71ca05de95e53f22c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187500
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-02-25 21:18:02 +00:00
Jens Johansen bbb24d3364 [observatory] Properly handle expression compile time errors
In observatory there are two different ways to do expression evaluation.
One calls `evaluateInFrame` and catches the ServerRpcException thrown
when there's a compilation error. Another calls `evaluate` and does not
catch the ServerRpcException thrown when there's a compilation error.

This means, for instance, if evaluting an expression on an instance
and makes a typo there's suddenly a big box with scrambled javascript
on the top-right of the screen.

This CL:
* Handles the ServerRpcException thrown when there's a compilation error
  for `evaluate` as well.
* Makes both `evaluate` and `evaluateInFrame` unpack the `details` sent
  by the VM instead of printing out the textual representation of a map.
  This means that you get an error message like

```
org-dartlang-debug:synthetic_debug_expression:1:1: Error: Getter not found: 'test'.
test
^^^^
```

instead of

```
{details: org-dartlang-debug:synthetic_debug_expression:1:1: Error: Getter not found: 'test'.
test
^^^^}
```

TEST=Existing test suites.

Change-Id: I2dc3f19f024e918e8d0e9b0f4166a4ef2c6cbd9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186292
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-02-24 10:34:35 +00:00
Ben Konyi 7315480f5d [ VM ] Skip get_allocation_traces_test on AppJIT, SIMARM, and AOT
AOT lacks debugger() support and AppJIT/SIMARM allocation traces don't
exactly match those listed in the test.

Follow up to https://dart-review.googlesource.com/c/sdk/+/182666

TEST=N/A

Change-Id: I74a4d124c5e2ec10e28521b46f553eae87fea540
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184845
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-02-12 23:52:00 +00:00
Ben Konyi 3e83400e0f [ VM / Service ] Added getAllocationTraces and setTraceClassAllocation RPCs and identity hash support
This change adds two new RPCs and various new properties:
  - getAllocationTraces
  - setTraceClassAllocation
  - classId and identityHashCode properties in CpuSample
  - traceAllocations property in Class

TEST=get_allocation_traces_test.dart

package:vm_service has been regenerated for 3.43 of the service protocol
and is ready for a 6.1.0 release.
Change-Id: Ia8ed055423798d7d17fe9f5fd74efb4239b875fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182666
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-02-12 21:15:35 +00:00
Martin Kustermann 2439c412f0 [vm/concurrency] Make main Kernel loading independent of current isolate
Since loading kernel will affect all isolates within a group, there
should be nothing isolate-specific inside the kernel loader. To ensure
we don't have (or introduce) any accidental uses, we add a
NoActiveIsolateScope to the main parts of kernel loading.

Only loading of native extensions - done by the kernel loader -
currently requires an active isolate. The reason for this is that
loading native extensions happen by calling out to embedder, which calls
back into the VM using the our embedding API (which currently requires
an active isolate)

Issue https://github.com/dart-lang/sdk/issues/36097

TEST=Refactoring of existing implementation.

Change-Id: I96e64dbfe7148b76b8fa006fe5dbde8c1f904504
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184269
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-02-12 19:45:05 +00:00
Martin Kustermann 4e84c97af7 [gardening] Mark service{,_2}/valid_source_locations_test as slow
TEST=Attempt at making timing out tests pass.

Change-Id: Id972bf437eef103b5e923a0ab7fdeb4b6433c727
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184781
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-02-12 16:57:53 +00:00
Martin Kustermann 92af830255 [vm/concurrency] Move background compiler related state from Isolate to IsolateGroup
As part of making the compiler independent of `Isolate` we have to move
various state from `Isolate` to `IsolateGroup`. This CL moves background
compiler and related state.

One background compiler will be shared for all isolates within a group.

Issue https://github.com/dart-lang/sdk/issues/36097
Fixes https://github.com/dart-lang/sdk/issues/44938

TEST=Mainly refactoring, stress tests for --enable-isolate-groups with JIT will come in the future.

Change-Id: I66e863651d0b37c431ce1864e505b5413850cbde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183401
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-02-12 03:40:14 +00:00
Ben Konyi c039ff268f [ VM ] Fix crash when accessing metrics page when no metrics have been
logged

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

TEST=regress_44859_test.dart

Change-Id: I7aa6b54f8f8d04b630d0ffe64d5414a6a9e56de2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183041
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-02-05 00:31:47 +00:00
Clement Skau 2236883ff2 [SDK] Removes non-exiting tests from .status
TEST=Tested all configurations.

Change-Id: Iec00d7e6ea56221ffebcf044de22647907f598f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182500
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-02-04 06:46:13 +00:00
Ben Konyi f7cc17fb7e [ package:vm_service ] Fix issue where null was returned instead of @Instance of type Null
Also includes some cleanup for next release.

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

TEST=pkg/vm_service/test/regress_44842_test.dart

Change-Id: I250fac7c52d6d5344bd5c3ec1c143deaa97419d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182369
Reviewed-by: Gary Roumanis <grouma@google.com>
2021-02-03 21:10:28 +00:00
Ben Konyi 565dc5b6a2 Reland "[ VM / Service ] Report identity hash codes of objects at end of heap snapshot"
This reverts commit 7083692624 in order to
reland commit 8d99d295da.

TEST=N/A

Change-Id: I06c80a666a9307caf0313fef1fde212ec801203c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182600
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-03 19:13:40 +00:00
Ben Konyi 7083692624 [ package:vm_service ] Prepare for 6.0.1 stable null-safe release
There is no diff between this version and 6.0.1-nullsafety.1.

This temporarily reverts commit 8d99d295da.

TEST=None

Change-Id: I3597b3543c9ea9122865604b9ba07c99683a5355
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182580
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-03 18:16:27 +00:00
Clement Skau ee2f0702e9 [VM] Removes #35505 status file exception.
Issue #35505 has been closed, and the test is no longer failing.
This is causing test runs to fail because this test _isn't_ failing.

TEST=Tested previously failing test locally.

Bug: https://github.com/dart-lang/sdk/issues/35505
Change-Id: I0664683ec26e40a42ad60340718c78b1392b823d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182267
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Clement Skau <cskau@google.com>
2021-02-02 13:55:24 +00:00
Clement Skau dfd5413952 [VM] Adds Debugger break for Future.catchError
TEST=Added new Future.catchError pause-on-unhandled-exceptions test.

Bug: https://github.com/dart-lang/sdk/issues/37953
Change-Id: Ieb3cf834eacad4f9b98ab2db0e5813e9bfa09747
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180840
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-02-02 06:59:54 +00:00
asiva 34f9734b41 Revert "[cfe] Handle conditional await in CFE"
This reverts commit 14032a6209.

Reason for revert : Several customer flutter tests are failing because
of the change in behavior.

TEST=revert of previous CL.

Change-Id: Ia235aa93b9c81fbab066803dc0625856f93acceb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181860
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-02-01 23:41:01 +00:00
Ben Konyi 8d99d295da [ VM / Service ] Report identity hash codes of objects at end of heap
snapshot

TEST=pkg/vm_service/test/object_graph_identity_hash_test.dart

Change-Id: I71eff4e8bb2153d8ef1117bc90d078f678f358ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180484
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-02-01 22:37:21 +00:00
Clement Skau c3ec3e53a1 [VM] Adds Future.then stack unwind. (3)
TEST=ASAN; Various 'causal' tests updated below.

Issues addressed in this revision:
- https://github.com/dart-lang/sdk/issues/44708 ASAN
- https://github.com/dart-lang/sdk/issues/44700 SegFault

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-asan-linux-release-x64-try,analyzer-linux-release-try,analyzer-analysis-server-linux-try,analyzer-nnbd-linux-release-try
Bug: https://github.com/dart-lang/sdk/issues/40815, https://github.com/dart-lang/sdk/issues/37953
Change-Id: I8b8f6ee2e5d4ca2e6bea988ec1cd9f912ddf8240
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180186
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-26 14:02:39 +00:00
Johnni Winther 14032a6209 [cfe] Handle conditional await in CFE
This converts `return e` in async methods in opt-in libraries into

   return let v = e in v is Future<FTV> ? await v ; v

where FTV is the future value type of the enclosing function.

Closes #44395
Closes #44396
Closes #44397
Closes #44399

TEST=existing tests

Change-Id: I59687039bfe4a97ffdaa55ac0f193ca4fb208f44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175310
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-01-22 19:12:24 +00:00
Ryan Macnak 54402fb7e0 [test] Skip new reload test on AOT configurations.
TEST=ci
Change-Id: I5bffa2964d3e695c016fa6e86d7e8b2f6079ce45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180267
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-01-21 01:53:23 +00:00
Ryan Macnak 9fd4b10fe5 [vm, reload] Allow reload of libraries containing deferred imports.
Previously, deferred imports were really deferred, and the VM would have needed to trigger more loading as part of checking the validity of a reload and handle the re-entrancy of the tag handler and restart the checking a reload: all messy control flow that was side-stepped by just erroring-out. Currently, the language and kernel are incapable of truly deferred imports, so we need only propagate the state bit that checks loadLibrary was called and completed before members are accessed through the deferred prefix.

TEST=deferred_import_reload_test
Bug: https://github.com/dart-lang/sdk/issues/26878
Bug: https://github.com/flutter/flutter/issues/73602
Change-Id: I48bf3e8331630b732d96393e02b12f86de8cc5b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179620
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-01-20 21:58:04 +00:00
David Morgan 88c1be7e3b Revert "Reland "[VM] Adds Future.then and Future.catchError stack unwinding.""
This reverts commit 9978a246c1.

Reason for revert: VM crashes in google3, b/177506826

Original change's description:
> Reland "[VM] Adds Future.then and Future.catchError stack unwinding."
>
> This reverts commit 978b838461.
>
> Reason for revert: Fix: https://dart-review.googlesource.com/c/sdk/+/179762
>
> TEST=Various 'causal' tests updated below.
>
> Original change's description:
> > Revert "[VM] Adds Future.then and Future.catchError stack unwinding."
> >
> > This reverts commit 8f2c47f24b.
> >
> > Reason for revert: We suspect this is causing VM crashes: http://b/177506826
> >
> > Original change's description:
> > > [VM] Adds Future.then and Future.catchError stack unwinding.
> > >
> > > TEST=Various 'causal' tests updated below.
> > >
> > > Bug: https://github.com/dart-lang/sdk/issues/40815, https://github.com/dart-lang/sdk/issues/37953
> > > Change-Id: I1420d6163ac2e3b22e0971f7b0ad516895dded70
> > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176662
> > > Commit-Queue: Clement Skau <cskau@google.com>
> > > Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> >
> > TBR=vegorov@google.com,cskau@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: https://github.com/dart-lang/sdk/issues/40815
> > Bug: https://github.com/dart-lang/sdk/issues/37953
> > Change-Id: I870f0202f43588f71a5d2b0f82338978b5a5dda9
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178998
> > Reviewed-by: Michal Terepeta <michalt@google.com>
> > Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> > Commit-Queue: Michal Terepeta <michalt@google.com>
>
> TBR=vegorov@google.com,cskau@google.com,michalt@google.com
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: https://github.com/dart-lang/sdk/issues/40815
> Bug: https://github.com/dart-lang/sdk/issues/37953
> Change-Id: I8a1eb6679b01571b850499cac2dadc5bf9ef2dcd
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179763
> Reviewed-by: Clement Skau <cskau@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Commit-Queue: Clement Skau <cskau@google.com>

TBR=vegorov@google.com,cskau@google.com,michalt@google.com

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

Bug: https://github.com/dart-lang/sdk/issues/40815
Bug: https://github.com/dart-lang/sdk/issues/37953
Change-Id: I1274bcb375bf6f9cb0609d372b0b451d51eb99c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180147
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2021-01-20 12:44:55 +00:00
Clement Skau 9978a246c1 Reland "[VM] Adds Future.then and Future.catchError stack unwinding."
This reverts commit 978b838461.

Reason for revert: Fix: https://dart-review.googlesource.com/c/sdk/+/179762

TEST=Various 'causal' tests updated below.

Original change's description:
> Revert "[VM] Adds Future.then and Future.catchError stack unwinding."
>
> This reverts commit 8f2c47f24b.
>
> Reason for revert: We suspect this is causing VM crashes: http://b/177506826
>
> Original change's description:
> > [VM] Adds Future.then and Future.catchError stack unwinding.
> >
> > TEST=Various 'causal' tests updated below.
> >
> > Bug: https://github.com/dart-lang/sdk/issues/40815, https://github.com/dart-lang/sdk/issues/37953
> > Change-Id: I1420d6163ac2e3b22e0971f7b0ad516895dded70
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176662
> > Commit-Queue: Clement Skau <cskau@google.com>
> > Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
>
> TBR=vegorov@google.com,cskau@google.com
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: https://github.com/dart-lang/sdk/issues/40815
> Bug: https://github.com/dart-lang/sdk/issues/37953
> Change-Id: I870f0202f43588f71a5d2b0f82338978b5a5dda9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178998
> Reviewed-by: Michal Terepeta <michalt@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Commit-Queue: Michal Terepeta <michalt@google.com>

TBR=vegorov@google.com,cskau@google.com,michalt@google.com

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

Bug: https://github.com/dart-lang/sdk/issues/40815
Bug: https://github.com/dart-lang/sdk/issues/37953
Change-Id: I8a1eb6679b01571b850499cac2dadc5bf9ef2dcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179763
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-01-18 12:15:49 +00:00
Michal Terepeta 978b838461 Revert "[VM] Adds Future.then and Future.catchError stack unwinding."
This reverts commit 8f2c47f24b.

Reason for revert: We suspect this is causing VM crashes: http://b/177506826

Original change's description:
> [VM] Adds Future.then and Future.catchError stack unwinding.
>
> TEST=Various 'causal' tests updated below.
>
> Bug: https://github.com/dart-lang/sdk/issues/40815, https://github.com/dart-lang/sdk/issues/37953
> Change-Id: I1420d6163ac2e3b22e0971f7b0ad516895dded70
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176662
> Commit-Queue: Clement Skau <cskau@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,cskau@google.com

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

Bug: https://github.com/dart-lang/sdk/issues/40815
Bug: https://github.com/dart-lang/sdk/issues/37953
Change-Id: I870f0202f43588f71a5d2b0f82338978b5a5dda9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178998
Reviewed-by: Michal Terepeta <michalt@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Michal Terepeta <michalt@google.com>
2021-01-14 13:56:53 +00:00
Clement Skau 8f2c47f24b [VM] Adds Future.then and Future.catchError stack unwinding.
TEST=Various 'causal' tests updated below.

Bug: https://github.com/dart-lang/sdk/issues/40815, https://github.com/dart-lang/sdk/issues/37953
Change-Id: I1420d6163ac2e3b22e0971f7b0ad516895dded70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176662
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-13 08:00:14 +00:00
Ben Konyi d9ca0514bc [ Service ] Disconnect existing clients when DDS calls
_yieldControlToDDS

Instead of DDS failing to connect when there are existing clients
connected to the VM service, the VM service will now disconnect these
clients when _yieldControlToDDS is invoked.

If an existing DDS instance is already connected, existing clients will *not*
be disconnected and instead an error will be returned containing the URI of
the existing DDS instance.

TEST= runtime/observatory/tests/service/dds_disconnects_existing_clients_test.dart

Change-Id: I08e126d99f51ff14205f359a60ca802c27fd206d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178725
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2021-01-12 02:05:00 +00:00
Clement Skau 3ee490327e [VM] Adds @pragma('vm:notify-debugger-on-exception')
Note: This is a reland:
- Relocates the tests.
- Adds status file skip for dartkp.

TEST=runtime/observatory{,_2}/tests/service{,_2}/notify_debugger_on_exception_test.dart

Bug: https://github.com/flutter/flutter/issues/17007
Change-Id: I5c79c140c5e7dee9dfeaa6d4bf750cf4d72f6e85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177580
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-01-07 14:33:48 +00:00
Ben Konyi 4245ca05a9 [ Service ] Skip debugger_location_second_test on App-JIT configurations
due to lack of available script sources

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

TEST=Status file update.

Change-Id: Ie7e9370446ba042050dd0b4b28d7acb643f90180
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176820
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-12-22 20:03:11 +00:00
Ben Konyi 795f5ea6b4 [ Service ] Skip get_object_rpc_test on App-JIT configurations due to
lack of script sources

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

TEST=Status file update

Change-Id: Ib56fd0d4d53ef97cc78b600594c9fae9882a1fcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176800
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-12-22 00:59:00 +00:00
Tess Strickland e2df4d30a0 [vm] Remove non-private uses of TokenPosition::value().
Instead, split each old use into the following cases:

* If the TokenPosition value is expected to be a real token position,
  then use TokenPosition::Pos().

* If the TokenPosition is being serialized in some way, then use
  TokenPosition::Serialize() and change the place where the
  TokenPosition is recreated to use TokenPosition::Deserialize().

* If the value of the TokenPosition is being printed for debugging
  purposes, then just use TokenPosition::ToCString() instead.

That is, we try to pin down when token positions are expected to
be real vs. when other types of token positions can be found.

Another source of possible error when using token positions is to
convert between synthetic and real token positions. In the past,
synthetic token positions may have been based off real token positions,
but that is no longer the case. Thus, all methods that allow
that conversion have been removed, and instead there is a new static
method for constructing synthetic tokens from valid nonces.

This CL also makes it so that Pos() and relational operators on token
positions are only defined on real token positions, to avoid any
assumptions about what the value encoded in synthetic positions mean. To
help with cases where non-real token positions may occur, four helper
methods are added:

* TokenPosition::Min(a, b): A static method that returns the smallest
  real token position provided. If neither `a` or `b` are real,
  returns `a`.

* TokenPosition::Max(a, b): A static method that returns the largest
  real token position provided. If neither `a` or `b` are real,
  returns `a`.

* TokenPosition::IsWithin(start, end): Determines whether `this` falls
  between `start` and `end` (inclusive). If `this` is non-real, then it
  must be either `start` or `end` if synthetic, otherwise false.
  Otherwise, we mimic the old style of range checking, which means that
  non-real starts and ends are treated as less than every real token.

* TokenPosition::CompareForSorting(other): Unlike the relational
  operators, provides a comparison between any types of token positions
  for purposes such as sorting.  Currently only used in the profiler.

It also changes TokenPosition::ToCString() to tag synthetic token
positions, so they can be distinguished from real ones at a glance.

TEST=Existing test suite on trybots, especially the observatory tests
which make heavy use of the debugger and the unit tests for the
profiler/source report modules.

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

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try
Change-Id: Ic06aa0bc7a1f0fbac7257ed22ca5e7e0ccd7f3f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174924
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2020-12-16 08:27:32 +00:00