Commit Graph

1605 Commits

Author SHA1 Message Date
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
Regis Crelier b3bca1821c [VM/runtime] Decouple representation of function signatures from Function objects.
This fixes issue https://github.com/dart-lang/sdk/issues/43088

This CL improves on https://dart-review.googlesource.com/c/sdk/+/166920 by keeping the names of type parameters.

See go/dart-vm-signatures for motivation for this change.

TEST=existing suites

Change-Id: Ia82f1d322f72d07b2fb253cf914f9b868025c71e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176981
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-01-07 23:45:37 +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
Ryan Macnak 4a33f9befd [observatory] Update Catapult to de6e3a9d85af0a8bfdd39245e72dc94fd8b579d9.
TEST=manually interact with timeline page
Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1036492
Change-Id: I955136f4ff9c5a62676912177ffc91fc51a8fd45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177660
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-01-05 23:40:10 +00:00
Ryan Macnak c899945e2f [observatory] Remove dead import of package:usage.
TEST=build
Change-Id: I19d145b90e87e7977c4983d22e4bc4555529b6cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177661
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-01-05 22:19:18 +00:00
Parker Lougheed b3f22d072e [Observatory] Switch to Dart 2.12 and remove redundant experiment
TEST=None
Change-Id: I16bf33a6fc78c7bdcd32b376919b348922777b47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176880
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-12-30 02:26:25 +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
Stephen Adams 7e3b19e111 Observatory: at least 3 digits for a size
Add extra digit after period when there is only one before.
"1.21GB" is more helpful than "1.2GB", where an 8% change is needed to
make a visible difference.

TEST=Manual

Change-Id: Ib3e645245f57459fbdb0dc9cba2194fd8e634865
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176840
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-12-22 04:57:30 +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
Jens Johansen 6c19a8fc81 [VM] Read and report constant constructor coverage from dill (2nd try)
This CL makes use of the now included constant constructor coverage
in the dill file.

It works like this:
* When the CFE evaluates constants, every constant constructor
  invocation evaluated saves the reference to the constructor in the
  `Source` (from the Components uri to source table) for the callers
  Library.
* This data is loaded into the VM in a "raw" format.
* When a request for coverage comes in, the VM - on top of the normal
  coverage processing - goes through all scripts to find constant
  constructor coverage for the requested script and offset. Note that
  all scripts must be checked because library A can have evaluated a
  constructor from library B - so even if only coverage for library B
  was requested, library A has to be checked.
  For all constructors found the start and end position is reported as
  covered. Note that this does not mark any initializes and there are
  (at least currently) no good way of marking which initializes were
  evaluated (because it has to be stable across edits even when the
  `advanced invalidation feature` is enabled).
* Note that the reason for the coverage to work on references - as
  hinted above - is because we want it to be stable across hot reloads
  even if/when advanced invalidation is enabled. This means, that
  library A cannot record "positional coverage" for library B because
  library B might get (for instance) new comments that will make any old
  offsets invalid. By using references we always lookup in the current
  world and use the correct offsets.

https://github.com/dart-lang/sdk/issues/38934

TEST=Existing test suite, new tests for the new coverage added.

Change-Id: I29531247a4b91a99d9a459cfdefbb9798e9c948f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175246
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-12-08 10:47:43 +00:00
Ryan Macnak e3a9d70591 [vm, service] Remove unsafe querying across threads during Isolate::PrintJSON.
Note this would be unsafe even if under a safepoint operation because not all of the queried threads participate in safepoints.

TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/44304
Bug: https://github.com/dart-lang/sdk/issues/44385
Change-Id: I8156e8c6049165e5c53b66c3391f3e8a496ddaaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175000
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-12-08 00:36:38 +00:00
Ben Konyi 865d1550d4 [ Gardening / Service ] Cleanup service_kernel status files
Added comments for service tests that are skipped in AOT due to lack of
a debugger.

TEST=N/A

Change-Id: If1f47f07cd6c10a196a2b228382b8d16cf0e2cdc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174764
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-12-07 19:24:29 +00:00
Jens Johansen 05bac41e39 Revert "[VM] Read and report constant constructor coverage from dill"
This reverts commit 5370c56c80.

Reason for revert: Failures on
dartk-android-product-arm
dartk-android-product-arm
dartkp-linux-release-arm-qemu

like this:

sizeof(ScriptLayout) got 64, Script_InstanceSize expected 56
../../runtime/vm/dart.cc: 160: error: CheckOffsets failed. Try updating offsets by running ./tools/run_offsets_extractor.sh

sizeof(ScriptLayout) got 64, AOT_Script_InstanceSize expected 56
../../runtime/vm/dart.cc: 160: error: CheckOffsets failed. Try updating offsets by running ./tools/run_offsets_extractor.sh


Original change's description:
> [VM] Read and report constant constructor coverage from dill
>
> This CL makes use of the now included constant constructor coverage
> in the dill file.
>
> It works like this:
> * When the CFE evaluates constants, every constant constructor
>   invocation evaluated saves the reference to the constructor in the
>   `Source` (from the Components uri to source table) for the callers
>   Library.
> * This data is loaded into the VM in a "raw" format.
> * When a request for coverage comes in, the VM - on top of the normal
>   coverage processing - goes through all scripts to find constant
>   constructor coverage for the requested script and offset. Note that
>   all scripts must be checked because library A can have evaluated a
>   constructor from library B - so even if only coverage for library B
>   was requested, library A has to be checked.
>   For all constructors found the start and end position is reported as
>   covered. Note that this does not mark any initializes and there are
>   (at least currently) no good way of marking which initializes were
>   evaluated (because it has to be stable across edits even when the
>   `advanced invalidation feature` is enabled).
> * Note that the reason for the coverage to work on references - as
>   hinted above - is because we want it to be stable across hot reloads
>   even if/when advanced invalidation is enabled. This means, that
>   library A cannot record "positional coverage" for library B because
>   library B might get (for instance) new comments that will make any old
>   offsets invalid. By using references we always lookup in the current
>   world and use the correct offsets.
>
> https://github.com/dart-lang/sdk/issues/38934
>
> TEST=Existing test suite, new tests for the new coverage added.
>
> Change-Id: I925963d1a9b9907efe621c72deb7348fa3be5ae8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171949
> Commit-Queue: Jens Johansen <jensj@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,bkonyi@google.com,jensj@google.com

Change-Id: I5187e6749d59ded250ec0933a94db0536485b70a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174470
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-12-01 14:12:16 +00:00
Jens Johansen 5370c56c80 [VM] Read and report constant constructor coverage from dill
This CL makes use of the now included constant constructor coverage
in the dill file.

It works like this:
* When the CFE evaluates constants, every constant constructor
  invocation evaluated saves the reference to the constructor in the
  `Source` (from the Components uri to source table) for the callers
  Library.
* This data is loaded into the VM in a "raw" format.
* When a request for coverage comes in, the VM - on top of the normal
  coverage processing - goes through all scripts to find constant
  constructor coverage for the requested script and offset. Note that
  all scripts must be checked because library A can have evaluated a
  constructor from library B - so even if only coverage for library B
  was requested, library A has to be checked.
  For all constructors found the start and end position is reported as
  covered. Note that this does not mark any initializes and there are
  (at least currently) no good way of marking which initializes were
  evaluated (because it has to be stable across edits even when the
  `advanced invalidation feature` is enabled).
* Note that the reason for the coverage to work on references - as
  hinted above - is because we want it to be stable across hot reloads
  even if/when advanced invalidation is enabled. This means, that
  library A cannot record "positional coverage" for library B because
  library B might get (for instance) new comments that will make any old
  offsets invalid. By using references we always lookup in the current
  world and use the correct offsets.

https://github.com/dart-lang/sdk/issues/38934

TEST=Existing test suite, new tests for the new coverage added.

Change-Id: I925963d1a9b9907efe621c72deb7348fa3be5ae8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171949
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-12-01 12:32:15 +00:00
Clement Skau 2d36c85ff8 [vm] Removes support for --causal-async-stacks
All existing embedders have been opted into --lazy-async-stacks, the
VM also uses it as it's default in all configurations.

After this CL, any user of --causal-async-stacks will get an error
message when trying to use it.
=> In any such case, please simply remove the flag.

TEST=Exhaustive CQ.

Bug: https://github.com/dart-lang/sdk/issues/37668
Change-Id: Ia440afcf2dba464aa8b8cf381b93bbac8eb9f8dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172564
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-12-01 07:27:14 +00:00
Ben Konyi 5ba23bc30e [ VM / Service ] Ensure printRetainingPath handles paths which include
objects stored in Expandos

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

TEST=Updated existing test to include Expando case.

Fixed: 44016
Change-Id: I92edb4347765972ebfd9e1d025529fa96361f6d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173080
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-11-30 18:45:02 +00:00
Devon Carew f53405dae6 remove some uses of dartanalyzer
TEST=this only touches a repo metadata file

Change-Id: If754fae853e8e8f639f034c91e707ecc92e40c2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173641
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-11-24 22:40:09 +00:00
Alexander Markov 4320933925 [vm] Add deopt info for runtime calls in slow path
Fixes https://github.com/dart-lang/sdk/issues/44266

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

Change-Id: I35736ea9aab4e61f14b304dbe7ac93a771145bdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173360
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-11-20 22:40:14 +00:00
Ben Konyi 85fd6415ca [ VM ] Update status file for validate_timer_port_behavior_test
This test makes use of debugger() which is a no-op in AOT.

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

TEST=No new tests, just updated expectations

Fixed: 44166
Change-Id: I3188d0f911f89ab3400505133923dc429da74daa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171761
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-12 19:14:03 +00:00
Clement Skau f00c8ff68f [Gardening] Disables validate_timer_port_behavior_test
TEST=tools/test.py -n dartkp-linux-debug-x64 service_2/validate_timer_port_behavior_test

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Bug: https://github.com/dart-lang/sdk/issues/44166
Change-Id: If92276889954f5feb84175ce1f34c4e2167a922c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171591
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Karl Klose <karlklose@google.com>
2020-11-12 11:09:06 +00:00
Ben Konyi b729693cb9 [ VM ] Allow for Timer to set its ReceivePort as active / inactive to
prevent repeated port allocations

Flutter makes heavy use of short-lived Timers which currently causes
repeated opening/closing of the Timer port. This change allows for
RawReceivePorts to be set active / inactive, allowing for a port to be
kept open but not considered alive.

Flutter benchmark changes:

Before dart-lang/sdk@d5118d5: "notifyListener2_iteration": 545.0
After dart-lang/sdk@d5118d5: "notifyListener2_iteration": 1639.0
With fix: "notifyListener2_iteration": 629.0

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

TEST=Updated port state tests and verified change against Flutter's microbenchmarks

Change-Id: I50ff1a1b0f1f29bcdac958e41c66429e9586fba2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171628
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-11-11 23:42:12 +00:00
Ben Konyi d2775733a6 Reland "[ DDS ] Keep event history for Stdout, Stderr, and Extension streams"
This reverts commit a486752050.

Change-Id: I112a907792b5cbfd4a1ee0eb96898dc931c92f23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170480
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-06 19:02:23 +00:00
Clement Skau 60c5434084 [Test] Clarifies test flags, get_stack_limit_rpc_test.
This test, it turns out, only works for these particular flags.
Any other combination of causal/lazy-async-stacks will make it break.

Change-Id: I03efa5c28f49e6bbdb9da359270a0f7eff072924
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170436
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-11-05 15:01:13 +00:00
Clement Skau 27ca552ddb [SDK] Replaces async's _AsyncAwaitCompleter with _Future.
Run time (less is better) impact:
dart:
- Calls.AwaitAsyncCall  -43.95% ~ -55.50%
- Calls.AwaitAsyncCallClosureTargetPolymorphic  -40.33% ~ -53.58%
- Calls.AwaitAsyncCallInstanceTargetPolymorphic  -42.69% ~ -55.65%
- Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits  -42.05% ~ -56.14%
- Calls.Await...  0% ~ -13%
dart-aot:
- Calls.AwaitAsyncCall  -9.748% ~ -11.13%
- Calls.AwaitAsyncCallClosureTargetPolymorphic  -8.673% ~ -13.19%
- Calls.AwaitAsyncCallInstanceTargetPolymorphic  -9.799% ~ -11.74%
- Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits  -5.412% ~ -13.43%

Code size impact:
- flutter_gallery_app_so_brotli_size  -0.1237% ~ -0.2410%
- flutter_gallery_readonlydata_size  0.1693% ~ 0.2041%
- flutter_gallery_instructions_size  0.1157% ~ 0.1779%
- flutter_gallery_total_size  0.1021% ~ 0.1413%

Bug: https://github.com/dart-lang/sdk/issues/39119
Change-Id: I64d28a8bea078277946d7be43737e265920c8f16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126322
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-11-05 09:51:13 +00:00
Ben Konyi 8988d1c18f [ Service ] Disable get_service_limit_rpc_test on NNBD precompiled bots
Change-Id: I1e9bac8206cc72509ba55ecbe6602694579423c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170403
Reviewed-by: Liam Appelbe <liama@google.com>
2020-11-04 19:48:00 +00:00
Ben Konyi 2865802d93 [ Service ] Disable get_stack_limit_rpc_test on precompiled bots
Change-Id: I658d43ef9ad058766f117bdaa45a58590599e7a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170281
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-11-04 00:29:27 +00:00
Ben Konyi a486752050 Revert "[ DDS ] Keep event history for Stdout, Stderr, and Extension streams"
This reverts commit 892cc93f26.

Reason for revert: Causing assertion failures on pkg-linux-debug

Original change's description:
> [ DDS ] Keep event history for Stdout, Stderr, and Extension streams
>
> Change-Id: I14ce732cd408ece1da2801887cac3b518bc36af6
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169146
> Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,kenzieschmoll@google.com

Change-Id: Idf2a5f07433af0772ef36aaa2ba7b24b1a5e0323
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170300
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-04 00:25:37 +00:00
Ben Konyi 89de1e82d9 [ VM / Service ] Add optional 'limit' parameter to getStack RPC
Allows for clients to request the top N frames of the current stack.

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

Change-Id: Ia8d38e6317373024382a5e857faff73c89a0d2c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169980
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-03 21:39:37 +00:00
Ben Konyi 892cc93f26 [ DDS ] Keep event history for Stdout, Stderr, and Extension streams
Change-Id: I14ce732cd408ece1da2801887cac3b518bc36af6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169146
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-03 19:09:47 +00:00
Ben Konyi d5118d5fc8 Reland "[ Service / dart:isolate ] Added getPorts RPC and 'debugName' optional"
This reverts commit f78c40e32a.

Change-Id: Id838b39afcb371d3b50f0009322ecf0fb2080894
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169461
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-10-29 02:52:03 +00:00
Alexander Markov 7588ed86de Remove bytecode mode from the VM
Change-Id: Ief167b7ffc128105a03cc225ab750234c9a6a7a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169147
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-10-28 17:42:35 +00:00
Tess Strickland f78c40e32a Revert "Reland "[ Service / dart:isolate ] Added getPorts RPC and 'debugName' optional""
This reverts commit a5d4511847.

Reason for revert: Failure in test standalone_2/io/unix_socket_test on reload bots, see https://github.com/dart-lang/sdk/issues/43952.

Original change's description:
> Reland "[ Service / dart:isolate ] Added getPorts RPC and 'debugName' optional"
>
> This reverts commit b71477a2a6.
>
> Change-Id: Iba11c41e43ec8c08b48147bbd07b71a151c3d1e6
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169243
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com

Change-Id: I2ac1f18fef03d29bf74df4f49a91406a26f1ce26
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169323
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2020-10-28 10:51:40 +00:00
Ben Konyi a5d4511847 Reland "[ Service / dart:isolate ] Added getPorts RPC and 'debugName' optional"
This reverts commit b71477a2a6.

Change-Id: Iba11c41e43ec8c08b48147bbd07b71a151c3d1e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169243
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-10-28 00:49:11 +00:00
Ben Konyi b71477a2a6 Revert "[ Service / dart:isolate ] Added getPorts RPC and 'debugName' optional"
This reverts commit 5bf9163e1b.

Reason for revert: Tests failing on bots.

Original change's description:
> [ Service / dart:isolate ] Added getPorts RPC and 'debugName' optional
> parameter for ReceivePort and RawReceivePort
>
> This change collects additional information related to ReceivePort
> allocation locations and an optional debug name that will be displayed
> by tooling. ReceivePort is now a special InstanceKind and a ReceivePort
> @Instance will include the port ID, allocation stack trace, and debug
> name.
>
> Change-Id: I003cfff2b7649218e37d9b653c0e953df5d992e7
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167902
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com

Change-Id: I39c3abb07c8c40c158eb4549749b076399bccce9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169160
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-10-27 03:14:30 +00:00
Ben Konyi 5bf9163e1b [ Service / dart:isolate ] Added getPorts RPC and 'debugName' optional
parameter for ReceivePort and RawReceivePort

This change collects additional information related to ReceivePort
allocation locations and an optional debug name that will be displayed
by tooling. ReceivePort is now a special InstanceKind and a ReceivePort
@Instance will include the port ID, allocation stack trace, and debug
name.

Change-Id: I003cfff2b7649218e37d9b653c0e953df5d992e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167902
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-10-26 23:09:47 +00:00
Ben Konyi 377574a791 [ Service ] Fix various service tests
Partially fixes https://github.com/dart-lang/sdk/issues/43713

Change-Id: I70b550f4b46bb8f0d1ecc1a07a4db4631bc85a9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168984
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-10-24 00:24:23 +00:00
Martin Kustermann c0129418be [gardening] Lower threshold for number of trace events in flaky/time-sensitive test
Issue https://github.com/dart-lang/sdk/issues/43713

Change-Id: I6884d08ff08e0e44efcb14b009d9289dba8909ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168021
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
2020-10-16 16:27:42 +00:00
Ryan Macnak 37ed87b038 [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
Port the service tests and Observatory to Dart 3.

Change-Id: I8a8b20d8f90acd3b5f741c93f10ba99971aa0c52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154825
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-10-14 18:16:27 +00:00
Alexander Markov 4902ec5975 [gardening] Reduce number of samples expected in service/get_cpu_samples_rpc_test
This test has been failing on vm-kernel-precomp-win-release-x64 bot as
it was getting only 3-10 samples, while expecting >10.
The expectation doesn't look reliable as we cannot guarantee that
profiler would collect enough samples.
Changed the expectation to >0 samples, in an attempt to make this test
less flaky.

Issue: https://github.com/dart-lang/sdk/issues/43713
Change-Id: I3a8a3854f3828d39eb409b1b540f29a34fe9e6b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167043
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-12 19:17:02 +00:00
Alexander Markov e9aa232066 Remove remaining tests for bytecode mode
Change-Id: I9690bd8a9bdcf16963424c64c1b80628e50fa28a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166922
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-09 22:30:19 +00:00
Ryan Macnak 8434b038fc Do not run service tests with obfuscation.
Change-Id: I046bd3ab6e3b819fd0087e73983d9fd834d5151b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166123
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-10-05 21:59:52 +00:00
Ben Konyi 45159b12e0 [ VM / Service ] Add isolateFlags property to Isolate JSON response
Flags that can be set in `Dart_IsolateFlags` are now surfaced via the
Isolate JSON object returned from the service protocol. Currently only
returns boolean flags.

Related: https://github.com/dart-lang/sdk/issues/43588
Change-Id: I54a30155778de8612105eb4a5f60f8a222a086b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165403
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-10-01 19:18:30 +00:00
Clement Skau 379e208849 [Test] Fix lazy-async nested stepping consistency, tests.
The debugger async function handling has been moved to allow handling
of stepping_fp_ and async_stepping_fp_.
Previously the presence of an async function would take precedence over
the *stepping_fp while stepping, resulting in nested asyncs to
incorrectly re-trigger the insertion of synthetic breakpoints.

This fix revealed three tests that were still testing for unintentional
inconsistencies between causal and lazy async.
Note that there are still tests that branch on `useCausalAsyncStacks`
though these all test for known differences - namely that lazy async
cannot traverse unawaited future calls.

Cq-Include-Trybots: luci.dart.try:app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-x64-try
Change-Id: I5f74db18086a90828024dbb461759869531d478f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164781
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-09-28 08:18:07 +00:00
Ben Konyi a44409615f [ Service / dart:io ] Rework previously unused dart:io service extensions
This CL is mostly modernizing existing Process and File profiling code
that was never made public. Updated the service extension responses to
be more consistent with the rest of the service protocol.

Related to https://github.com/dart-lang/sdk/issues/41455.

Change-Id: I116b3cd1424980e4ec8133672901990776c1d9c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157160
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-09-18 20:15:56 +00:00
Alexander Aprelev 083ecee7f6 [vm/fieldtable] Fix retaining paths for static fields.
This is a follow-up to https://dart.googlesource.com/sdk/+/e2aadc7a075da3b52957c93dc39d3b7fc86a5d1b which regressed retaining path reporting for static field values.

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

Change-Id: Iee9f289652e41fafd075a9e93b225099aac8e01c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162900
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-09-15 18:32:31 +00:00
Tess Strickland 781094f2ce [vm/bytecode] Add parameter flags to FunctionDeclaration.
We create the parameter names array when loading the
FunctionDeclaration, but the required parameter flags are only set later
when we load the Code declaration. If there's an intermediate use of the
Function object that copies the required parameter flags, like creating
an ImplicitClosureFunction when loading a tearoff stored in the object
pool, there will be no set flags at that point.

Add a copy of the parameter flags to the FunctionDeclaration so the
required flags can be set at the same time as the parameter name and
type to avoid this scenario.

To avoid adding unneeded flags to the kernel bytecode, we only serialize
the parameter flags needed for each declaration, so FunctionDeclaration
and ClosureDeclaration only contain the required flag, and Code contains
all flags _but_ the required flag.

There are no trybots for strong mode + bytecode, but manually checked
by running the following on the main branch (cherry-picking the
test_matrix.json changes) and this branch:

python tools/test.py \
    -n dartkb-mixed-strong-linux-release-x64,dartkb-interpret-strong-linux-release-x64 \
    tests/language/nnbd/required_named_parameters/missing_required_argument_dynamic_test.dart

Cq-Include-Trybots: luci.dart.try:vm-dartkb-linux-release-simarm64-try,vm-dartkb-linux-release-x64-try
Change-Id: Ic75b831d5ceed08154e2c61b8f64461705558653
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162501
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2020-09-14 15:28:20 +00:00
Ben Konyi e3fcee331d [ VM / Service ] Roll back major revision, update to 3.39
The major revision bump is causing Intellij users to be unable to debug
as the Dart and Flutter plugins both bail out if the VM service major
revision is not 3. This change will allow for these plugins to keep
working.

This is technically breaking the semver contract as the following RPCs
and objects have been removed:

- getClientName
- getWebSocketTarget
- setClientName
- requireResumeApproval
- ClientName
- WebSocketTarget

However, these RPCs were never used by first party tooling and it's
highly unlikely that they were used externally, so removing these RPCs
is unlikely to break anyone.

Change-Id: Ie8e2705545682e96c3dab4c0787a1e88cd8a19d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162240
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-09 17:46:09 +00:00
Ben Konyi f0d88cc96d Reland "[ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0"
This reverts commit ed120c3c80.

Change-Id: I445f4bb2dafaad3ce2daa3ae42efe1723f9b1abe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160660
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-03 15:20:14 +00:00