Include major memory users known to the VM: isolate heaps, profiling buffers, timeline buffers.
Change-Id: I2580ad74b5d4d07c5c75fde28bb7a5d71fddb09b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127382
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Mechanically, this renames shallowSize to internalSize and redefines shallowSize as internalSize + externalSize.
Change-Id: I734f5714ad6dff341627e3d6e51e3bdcf26c63ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125993
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
When creating a KernelProgramInfo, we create several logical views into the kernel buffer. These are fresh ExternalTypedDatas, rather than proper TypedDataViews, so they do not automically keep the original ExternalTypedData alive. Create an explicit reference to the orginal ExternalTypedData in the KernelProgramInfo. When creating snapshots, this reference is ignored/null'd and the views are turned into copies, effectively dropping the parts of the original buffer that do not have views.
Fixes a leak with reload and a use-after-free with eval.
Bug: https://github.com/dart-lang/sdk/issues/33973
Bug: https://github.com/dart-lang/sdk/issues/39610
Change-Id: I09d3830133314ccbaa0341d904127c2b6925c4ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126825
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
When CPU profiling is disabled, the getCpuSamples RPC would return with
a ServerRpcException stating that the profiler was disabled. This wasn't
being caught when the RPC was invoked, but was being caught in
`ObservatoryApplication` and swallowed. This resulted in the timeline
page being stuck at the timeline loading dialog.
Also includes fixes from "[observatory] Properly wait for Catapult's iframe to load. Give
message while fetching timeline.", commit 3b99524167, which was reverted.
Change-Id: I2fe23d4dba5e20f717e111c519563866bb1a221c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126402
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This reverts commit b3cf5ef327.
Reason for revert: Breaking timeline view for users in Google3
b/141889413
b/145128403
Original change's description:
> [observatory] Properly wait for Catapult's iframe to load. Give message while fetching timeline.
>
> Change-Id: I342c9315fc31021fb1387bc0e409645cd7a99d6a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125468
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I38b92a5a50955983369f4de7afb577d1a959e724
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126360
Reviewed-by: Ben Konyi <bkonyi@google.com>
Setting the `enableTimelineLogging` property of `HttpClient` to true results in
timeline events being created for HTTP connections and HTTP requests.
Timeline events contain general connection information, including:
- Request type
- Status code
- Request / response headers
- Cookies
- Non-sensitive proxy information
- Relevent error messages for failed connections
Change-Id: Ibe16a312ab5398c9ae886ea07bea5ca70b63e440
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123540
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Removes support for accumulators, which now repeat the current live values.
Decreases performance difference between release and product modes.
Fixes inaccuracy when counters are queried before the first full GC.
Golem geomean x64 4.687%
Golem geomean arm64 5.770%
Bug: https://github.com/dart-lang/sdk/issues/37678
Change-Id: I12b26a9834b0f0f911ddcc6e8e5ff4573272607d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116885
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This is practically a copy of the change in
https://dart-review.googlesource.com/c/sdk/+/118040 but applied to the non-nnbd
sdk.
Even though there is no intent to run the non-nnbd sdk with the non-nullable
experiment, we need to add this annotation because of how we
intend to gradually start testing NNBD. The libraries.json under
sdk_nnbd is allowed to point to libraries under the non-nnbd sdk in order to
temporarily build without errors until all patch files are migrated and all CFE
issues are addressed.
Change-Id: I53c1123a8d86c10695832a8a0ad35adb7b4d92fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125181
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Original change is in patchset 1.
The issue was that the expected "_Closure.call" frame is not always present.
Change-Id: I91116861e785a72536dde300f4771de4f6fa9d3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124988
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This fixes `package:stack_trace` in the sync-start case of async/async* calls.
Change-Id: I5c41a35283439f533ab19c9fd1cc542931de4b43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124560
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
We attempted to delete the file with service protocol information
immediately after retrieving the URI. However, the spawned process could
potentially still have that file open which will cause the deletion to
fail on Windows. Fix is to wait until the process closes before deleting
to ensure it's not holding onto the file.
Change-Id: I85f715ad0570d121365373d498e539a667bd9d02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124165
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Disabling the profiler will **not** release the sample buffer on Linux,
MacOS, and other platforms which utilize signals for profiling as
there's no way to ensure all signals have been receieved after the
thread interrupter has been shutdown.
Change-Id: Ifb3230fdb95e9bc9147cbd4b85d1a84e976ce119
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123554
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This is to enable vm clients to ask how much memory is consumed by isolate group.
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: I4f1c499bf02c20b80e9802d8ad60e7ea65cfb375
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119724
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Ignoring exceptions that coming from implicit throw. For example, try finally block will generate an implicit throw inside finally block to rethrow the exception.
Bug: https://github.com/dart-lang/sdk/issues/37645
Change-Id: I5c4f90ec3c9aa92bb670d4bb9a8edb332f7b32fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118911
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
source position of clearAsyncThreadStackTrace should not have a valid source position.
This fixes code coverage regression.
Bug: https://github.com/dart-lang/sdk/issues/38628
Change-Id: I41b1822a07b9d4becdda58bb810f03733289cd2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120002
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Timeline save functionality was broken after a recent redesign of how
CPU samples are pushed over the service protocol. When the save button
on the timeline page was clicked, the "traceObject" variable was
undefined, causing the save to fail.
Fixes https://github.com/flutter/flutter/issues/41746
Change-Id: Icd3e9c841431c790dd7f49107f0c5d39f0088cd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120000
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Specifying a parent will result in an argument being added to 'start'
events for that TimelineTask named 'parentId', which contains the task
ID of the parent. This is to be used by DevTools to show relationships
between asynchronous tasks that are not currently supported in the trace
event format used by Catapult.
Change-Id: Id0a030f018f5a6ac1e3b0ef2e89c1cd732790f02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119520
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This matches behavior of AST-based flow graph builder. Debugger ignores
synthetic (is_generated) try blocks when it figures out if thrown
exception is unhandled, so in order to ignore all try/finally blocks
they should be marked as synthetic.
Fixes https://github.com/dart-lang/sdk/issues/38697
Change-Id: I06840362a255b500e1e9317af90a61bbdea2a310
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119726
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Also fixed issue where --write-service-info could not accept URIs.
Change-Id: I0b136dd83335f0aed260850b2e5a5aed36df4317
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119083
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
There is no clear defination on setLibraryDebuggable in rpc. But obviously breakpoint should be not set and hit if library is not debuggable. Correct this behavior.
Bug: https://github.com/dart-lang/sdk/issues/36914
Change-Id: Ic75f89055eeb69279a504366fe35f3e98b173abf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118340
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Since const evaluation has been done at the front end, skip evaluating all static const field in source report.
Bug: https://github.com/dart-lang/sdk/issues/38284
Change-Id: I876a173b1643d3836277ebcfc1f8546a1f4c71ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117166
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
This reverts commit 09ce6d30e7 as it
breaks Flutter, which currently uses this method.
Change-Id: I2a06d48260970cc086a922f1d1f87d17716e8920
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117006
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Collect yield positions inside StreamFlowGraphBuilder. BuildGraph() when yield_positions() are required. All yield positions will be stored into script as a hashmap. Key of hashmap is the starting token position of function, value is an array containing all yield positions.
Bug: https://github.com/dart-lang/sdk/issues/37635
Change-Id: I6d301d1cb0f74c432f855c9dbc20ac2c13acb07f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116743
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
This function has been unused for a long time.
Also, computing fingerprints for bytecode function causes bytecode to be loaded, which can lead to an old enum class being initialized with enum values for the new enum class, causing a forwarding loop when migrating enum values.
Change-Id: Iad9b2bb11aaf161d66f7752cb99cc4b4fc9fb310
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116442
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This matches the behavior in the Chrome and Fuchsia tracing macros.
Change-Id: I7e5759409af5262e6e2596384c67a2eb70d48cd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114545
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
System.gc() considered harmful.
Change-Id: I227a092e7734176b55c269f4f611ef1d4293da99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116044
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
This improves the time to deserialize a snapshot. It also doubles the memory needed to receive the snapshot buffer, but the memory high water mark is still computing the dominators.
Change-Id: Ib93015cd6cb366dd2ff750da09ddaa3b37159f68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115010
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Dart 2 shipped a year ago, so we're pretty well past a "preview". :)
Change-Id: I6c5d21ae4181e4228cc1fc49b6344cdb8fc43794
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115544
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Generated rethrow statements do not require a 'DebugCheck', but explicit rethrow
statements do, so that user breakpoints can be set on rethrow.
Add a IsDebuggable flag on bytecode closures and set it properly.
Remove unused code in a service test.
Add verbosity to debugger.
Change-Id: Ia436cbe62e38cfaec6f9fdf7f8cc2ee5607228e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115602
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This reverts commit 6f85cb83cf.
Reason for revert: CFE built before this CL breaks with dill built after; it expects dart:profiler to be present in the dill.
Original change's description:
> [SDK] Remove dart:profiler library which has been deprecated since Dart 1.2
> and remove all references to it in tests and the SDK build scripts.
>
> Change-Id: I65a4d71b74c66ca090eba28e922e2f70a7b2989d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114965
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>
TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I5fec5c7aec55377ba5cba0b55a25e67682220276
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115242
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>