Commit graph

57 commits

Author SHA1 Message Date
Tess Strickland 1bdbafff49 [pkg/vm_snapshot_analysis] Allow old 'patched_class_' field.
While in more recent SDK versions the 'patched_class_' field has
been replaced with 'wrapped_class_', this package can still be
used with the earlier SDK versions if we fall back to checking it.

Issue: https://github.com/flutter/flutter/issues/130009
Change-Id: Ifb1250393b72e58bbdc0764c7e2ce96269e659ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312802
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-07-07 11:36:59 +00:00
Tess Strickland 1133598168 [pkg/vm_snapshot_analysis] Don't assume Code objects have an owner.
For regular stubs, the owner will be null.

Issue: https://github.com/flutter/flutter/issues/130009
Change-Id: I8c85e3130128af79c596f381869d61631221cf9e
Cq-Include-Trybots: luci.dart.try:pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312660
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-07-07 09:52:50 +00:00
Ryan Macnak a4f59b8c20 [gardening] Update PatchClass::patched_class_ to wrapped_class_ in pkg/vm_snapshot_analsysis.
Cf. 99db606bab

Change-Id: I653ab3d8d4bb0ccee0bfeed7e8ab5d2c219b6924
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311928
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-06-29 18:34:37 +00:00
Tess Strickland 766a2be5a4 [pkg/vm_snapshot_analysis] Use program.stubs as owner for TTS stubs.
Also remove the '<anonymous signature>' check, since we stopped
generating function objects for function types before the current
minimum SDK version for the package.

Change-Id: I47c0522ae4ba778221ee98f93fdae8c22a57d688
Bug: https://github.com/flutter/flutter/issues/128402
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-mac-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307860
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-06-08 11:48:58 +00:00
Devon Carew 00972339e6 [pkg/vm_snapshot_analysis] update the readme for tool name changes
Change-Id: I0ea1f228d7d3405b0da24858fd5f03aa7e2c8ce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289442
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-03-20 17:57:51 +00:00
Konstantin Shcheglov 895540889e Update SDK constraints for SDK packages.
https://dart-review.googlesource.com/c/sdk/+/287660 implements it.
I want to fix pre-existing violations before enabling.

Bug: https://github.com/dart-lang/sdk/issues/34978
Change-Id: Ie7731162c643018a2312b265f444bc00534c0a51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287664
Reviewed-by: Leon Senft <leonsenft@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-09 19:52:47 +00:00
Josh Soref 77978889eb Spelling
Closes https://github.com/dart-lang/sdk/pull/51143

GitOrigin-RevId: 9e21c99a222d588e4fc95980725a2f8c9784965c
Change-Id: If0870e8936c7649935dce7e23cd783d62aa5610c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279916
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-30 18:29:59 +00:00
Josh Soref 84e3c8b50f Spelling tests
Closes https://github.com/dart-lang/sdk/pull/50920

GitOrigin-RevId: fa87531bd0f52b69485c9d02ff9e44a4a29c6a91
Change-Id: I0ae8574a5b77087895e004079f221201bb550cf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278535
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-19 16:24:29 +00:00
Alexander Aprelev 4ae1500152 [gardening] Fix instruction_sizes_test on Windows
Bug: https://github.com/dart-lang/sdk/issues/45354
Change-Id: Idbf22076bf01e9dcbe20a6d99993b3283edc067f
TEST=ci
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267244
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-11-03 01:50:48 +00:00
Alexander Aprelev 82dc3cbee9 [gardening] Fix closure naming, instruction_sizes_test
Fixes https://github.com/dart-lang/sdk/issues/48339
TEST=ci

Change-Id: I40b634e78b5b6744fd8c7c8d6d574bec333da82d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266820
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-11-01 14:50:02 +00:00
Jens Johansen b4e2012f5b [CFE] Remove support for .packages file
This CL:
* Removed the redirect from .packages to .dart_tool/package_config.json
  (whenever such a file existed).
* Removes support for the old format entirely.
* Updates all tests etc that were found.

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

TEST=Existing tests updated.

Change-Id: Iccf711c455ac1885189aa773ca74dd8f55012964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248603
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-06-24 08:20:39 +00:00
Devon Carew d798a7be34 [pkg] prep to publish package:vm_snapshot_analysis
Change-Id: I52ea64c667649a631f1232fe3cdf8933aee36e6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246302
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2022-05-31 16:39:14 +00:00
Devon Carew f7c46f145c [pkg] prefer 'any' deps for package dev dependencies
Tested: CI validation
Change-Id: If65cc156130a65ffe00c6f1660ac320e2921afae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246053
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2022-05-27 01:34:59 +00:00
Devon Carew 2a20d4be24 [pkg] ensure each publishable package has a repository pubspec field
Change-Id: I06c0d10c87c3f329098352a7abe9ef9fa0b1532e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241504
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-04-19 22:13:51 +00:00
pq 47ac47fe90 lints 2.0 fixes
In anticipation of lints v 2.0.

(Note the ignores -- I was leery of making API changes but happy to with some guidance.)

See: https://dart-review.googlesource.com/c/sdk/+/237746

Change-Id: I93323e912911bbd62a583b379f0f8140a8ca448d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237764
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-03-17 23:41:27 +00:00
Alexander Thomas 30beab0f43 [infra] Add OWNERS to the Dart SDK
* Add team "groups" in tools/OWNERS_<group name>.
* Add top-level OWNERS as a fallback.
* Add OWNERS for all top-level directories.
* Add OWNERS to all packages.

For additional background information see go/dart-sdk-owners.

TEST=No op until code-owners is enabled.
Bug: b/200915407
Change-Id: I7fe6116cc599c749cd50ca16151d6d6a801d99d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229147
Reviewed-by: Jonas Termansen <sortie@google.com>
2022-02-14 14:06:34 +00:00
Polina bb81a1c1a0 Make dominator nullable.
TEST="tested with the added test 'root-dominator-is-null'"

Bug: https://github.com/flutter/devtools/issues/3025
Change-Id: Ifd6f926e3ecd486d383b03e8b81289310a653bb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230882
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Kenzie (Schmoll) Davisson <kenzieschmoll@google.com>
Commit-Queue: Kenzie (Schmoll) Davisson <kenzieschmoll@google.com>
2022-01-31 21:26:14 +00:00
Michael Thomsen 24c35304c7 Fix windows extension
TEST=Not applicable, fixing existing test

Change-Id: Ie39b7d71fdd1260471f44d98b0f75fe2d5a39153
Bug: https://github.com/dart-lang/sdk/issues/46970
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211060
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-08-24 18:01:23 +00:00
Michael Thomsen 6c5fb84716 Discontinue dart2native (use dart compile)
TEST=Existing tests updated to use dart compile

Change-Id: Ia3478069df2354a3bf057fedae0f1eea9415de95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210241
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-08-23 20:53:09 +00:00
Devon Carew a3256e6b2f [pkg/vm_snapshot_analysis] switch to using package:lints
Change-Id: Ia36b1bf1127e0b78e0294422cff78338ef19ec26
TEST=this CL updates static analysis settings and address associated warnings
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204640
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2021-06-24 17:07:48 +00:00
Tess Strickland 5eb887bfbc [pkg/vm_snapshot_analysis] Fix size check again after 7131d318.
After 7131d318 landed, the instruction size for the modified function
(which removes all but one closure) shrank enough to more than outweigh
the extra nodes that get attributed to it compared to the original.

TEST=pkg/vm_snapshot_analysis/test/instruction_sizes_test

Cq-Include-Trybots: luci.dart.try:pkg-mac-release-try
Change-Id: I05f2dbd6ec2850a66b38c9f70fb67a905208c384
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199660
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-05-13 14:36:11 +00:00
Tess Strickland aa952090fe [pkg/vm_snapshot_analysis] Update expectations in test.
Fixes https://github.com/dart-lang/sdk/issues/45986

TEST=pkg/vm_snapshot_analysis/test/instruction_sizes_test
Cq-Include-Trybots: luci.dart.try:pkg-mac-release-try
Change-Id: I0ab4ffb04349208007f01ff989a26efd297ec64b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199427
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-05-12 14:31:50 +00:00
Vyacheslav Egorov f72a31695c [vm_snapshot_analysis] Bump version number
TBR=alexmarkov@google.com
TEST=ci

Change-Id: Id7a6afc3df6d971372712707896d9976ecb038cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196493
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2021-04-22 20:55:46 +00:00
Vyacheslav Egorov 458be23fa7 [vm_snapshot_analysis] Migrate to null-safety
Fixes https://github.com/dart-lang/sdk/issues/45683

TEST=pkg-*-try bots

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-mac-release-try,pkg-win-release-try
Change-Id: Ie10f313da9778d001f9c4fb618997e3b3c781dd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195263
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-04-15 12:03:47 +00:00
Tess Strickland dc88076767 [vm] Handle WSRs more generally in v8 snapshot profile writing.
Instead of special-casing the current fields that may have
WeakSerializationReferences, handle WSRs appearing as elements
or properties of objects more generally. This removes existing
special casing and avoids the need for it in case of new
future uses of WSRs.

For artificial nodes being added for dropped
WeakSerializationReference targets, add them as kArtificial nodes
(not kSnapshot) that has the original offset (element) or
name (property). The replacement is added as a kSnapshot node
that has a negative offset with the same magnitude as the
artificial node (element) or ":real_<property name>" (property).
This simplifies the work done in pkg/vm_snapshot_analysis to
use the artificial nodes instead of replacement ones for
reassembling hierarchies and the like.

This CL also cleans up the old SerializerWritingObjectScope
class, both moving it to Serializer::WritingObjectScope and
allowing nesting of WritingObjectScopes with the correct
semantics.

Thanks to this, not only can we recur when under a WritingObjectScope
instead of lifting recursion outside of those scopes, but we can
also create artificial nodes for non-empty per-code object pools and
static call target tables instead of attributing their contents
as supposed elements of the Code object being written.

TEST=pkg/vm_snapshot_analysis/test/instruction_sizes_test

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-mac-release-try,pkg-win-release-try
Change-Id: Ib945c5afcd89b1458b8be3559b6eae24048aba2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194243
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-04-14 08:44:58 +00:00
Franklin Yow 03101c0c2b Update LICENSE
Changes to comply to internal review

Closes https://github.com/dart-lang/sdk/pull/45568
https://github.com/dart-lang/sdk/pull/45568

TEST=CL contains no code changes.

No-Try: true
GitOrigin-RevId: 65796784e5fdfddaa021b5c55ad435b1db419700
Change-Id: I085a948f16dc9a0de128ed0bd456ae69adf6c124
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193888
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-04-07 10:28:38 +00:00
Tess Strickland bc924667f4 [vm/compiler] Add artificial nodes for dropped parent functions.
Fixes https://github.com/dart-lang/sdk/issues/45483

TEST=pkg/vm_snapshot_analysis/test/instruction_sizes_test

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-mac-release-try,pkg-win-release-try
Change-Id: I9e347bd38ec339b22d2ecefcce1b276d8ce3e3e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193303
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2021-04-07 04:48:46 +00:00
Tess Strickland e7d3a6027c [vm] Create more Function helper methods for code clarity.
Creates HasParent() as a predicate for Function objects with a non-null
parent function and makes IsLocalFunction() specific to local closures
(i.e. explicit closures with non-null parent functions).

Creates HasSavedArgumentsDescriptor() as a predicate to determine when
saved_args_desc() can be used, to avoid the caller having to do explicit
predicate checks for each dispatcher type that contains one.

Also simplifies Function::PrintName, creates different suffixes for a
SyncGenClosureMaker and its associateed SyncGenClosure, adds suffixes
for skipping more than one generated body when printing the parent name,
and changes ArgumentsDescriptor::PrintTo to match the compact syntax
Function::PrintName used for signifying the arguments descriptor for
certain dispatchers.

TEST=pkg/vm_snapshot_analysis/test/instruction_sizes_test

Cq-Include-Trybots: luci.dart.try:app-kernel-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,pkg-linux-release-try
Change-Id: I0ac1226d1ffe1d81743b5c6788da170d5a4010c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191560
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-03-23 12:21:26 +00:00
jonahwilliams 48e952470a [vm_snapshot_analysis] bump dependency constraints
Flutter cannot update args dependency due to <2.0.0 constraint in package:vm_snapshot_analysis.

TEST=pkg-linux-release-try

Fixes #77856

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try
Change-Id: I93a057d023efe95a13a9a95d85b9405bf9de5ece
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191988
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
2021-03-18 21:18:53 +00:00
Vyacheslav Egorov 6d3f07f252 [vm_snapshot_analysis] Publish a new version
Issue flutter/flutter#76313

TBR=alexmarkov@google.com
TEST=not needed

Change-Id: I2a2fd49dff3dabaade8bbb8adf1f55b95956bc33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186144
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-02-22 09:16:01 +00:00
Vyacheslav Egorov d499f68df5 [vm] Fix vm_snapshot_analysis logic and tests
* When looking for Code node owner simply always check for synthetic
  owner (referenced through ':owner_' property) first. If it is present
  then it means 'owner_' property is invalid anyway. 25fd0200ef changed
  how WSRs are written into snapshot (instead of writing WSRs we are
  simply writing SMI CIDs) which broke previous logic.
* When building ProgramInfoNode for a Class node accommodate for the
  existence of classes which don't have 'library_' property (e.g. base
  objects like void and dynamic). Additionally, adjust how these base
  objects are written into the snapshot profile so that we preserve
  their names.
* Tweak tests diff and diff-collapse tests to pass, they were failing
  because prologue removal compiler change made some of the diffs so
  tiny that they are ignored by threshold filtering.
* Add two more tests: one that verifies that tracings flags don't have
  any impact on the snapshot size and one that checks we correct
  attribute instructions size to the function node from which these
  instructions originated. This last test is added in anticipation of
  Code object removal to make sure that vm_snapshot_analysis continues
  to work correctly.
* Adjust sorting rules for Code cluster to make it more stable between
  slightly different programs to stabilize output of
  --print-instructions-sizes-to (depends on the sorting algorithm used
  in libc, the test was failing on Mac but not on Linux).

These fixes should unblock relanding of b6dc4dad4d

Fixes #44507
Fixes flutter/flutter#76313

TEST=pkg/vm_snapshot_analysis/test/instruction_sizes_test.dart

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: Iee0221dd3a507cb4f36d530404693ebfab3b7bf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185826
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-02-21 15:48:27 +00:00
Lasse R.H. Nielsen 6e29700e16 Update List constructor documentation, deprecate constructor.
Emphasize that the operation is going away,
and mark constructor as deprecated.

TEST= Refactoring+deprecation only, covered by existing tests.

Change-Id: I82aa044cd2cf7bf347b624371399f44bda8f4a07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173261
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-12-07 16:20:28 +00:00
Vyacheslav Egorov 4d182203ca [vm] Include static call references into V8 profile
Code objects might be connected by static calls and these references
were not included into the profile. This lead to some objects being
unreachable from the root.

This CL also adds a test which computes dominators for all nodes
in the snapshot (this in turn verifies that there are no
unreachable nodes).

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try
Change-Id: I2af4107fdb7f875624192e892ce1cec78cbf0dd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161709
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-09-08 12:11:34 +00:00
Vyacheslav Egorov 80504c8ffe [vm_snapshot_analysis] Fix issues with artificial nodes
This CL addresses two problems, which only reveal themselves when
analysing snapshots produced when function dropping is enabled.
When tests for snapshot analysis were written functions were dropped
in PRODUCT build by default - by currently this functionality needs
to be enabled separately or is automatically enabled when DWARF stack
traces are enabled. This CL changes test suite to enable DWARF stack
traces.

* When constructing ProgramInfo from V8 snapshot profile we should
not assume that Function nodes have any fields outside of owner_,
because Function node might be artificial and thus have no real
fields except for owner link.
* When writing V8 snapshot profile we should take care not to call
CreateArtificalNodeIfNeeded inside TraceStartWritingObject scope,
because CreateArtificalNodeIfNeeded might itself call
TraceStartWritingObject and these calls don't nest, the second one
overwrites the first one.

R=sstrickl@google.com

Bug: b/167601345
Change-Id: I40879ee087c38992388776af58b81bbefd147631
Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161703
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-09-03 13:31:14 +00:00
Kenzie Schmoll 42dfb9d304 Add generateCallGraphWithDominators method to generate a CallGraph from a precompiler trace.
Exposing this functionality makes it possible to use this logic in Dart DevTools.

This CL also includes some renames that make the code more readable. When there are both `ProgramInfoNode`s and `CallGraphNode`s in scope, the name "node" is ambiguous.

Bug: https://github.com/dart-lang/sdk/issues/43169
Change-Id: Ic8ef04e10c48db011cd28e1786bee34223766e47
Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160342
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-09-02 16:24:42 +00:00
Vyacheslav Egorov 3471490bb2 [vm_snapshot_analysis] Fix CallGraph.collapse by package
Take into account that not all libraries are grouped into packages
avoid collapsing such libraries into the root node.

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: I73a14a2498c0399073be432d1e22badf99eca3eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161167
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
2020-09-01 21:35:21 +00:00
Devon Carew 3ce72bb994 use dartdev for analysis on the bots; fix two analysis issues
Change-Id: I83beb65396e31b58bb0ffd25984ec322f01e9b99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159641
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-08-21 17:24:10 +00:00
Vyacheslav Egorov 1de92c0db3 [vm_snapshot_analysis] Reduce test sensitivity.
Some compiler changes introduce small fluctuation into the output sizes
which make the test too brittle. Ignore this fluctuation by introducing
sensitivity threshold.

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

R=rmacnak@google.com

Fixed: 43030
Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: I411144db199d36f40b71739965a44802305970b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158386
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-08-13 19:13:04 +00:00
Kenzie Schmoll dabc54edb8 [vm_snapshot_analysis] modify -d flag and add -s flag for summary command
Change-Id: Ibaa017ffc80d674f439af1f2097729df50755fe7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158368
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-08-13 15:32:59 +00:00
Kenzie Schmoll 0a291a5d8f [vm_snapshot_analysis] Bump version to 0.5.4
Change-Id: Iedafbff367544b430329fbfb7f4470b9621cea69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158362
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
2020-08-12 21:46:29 +00:00
Vyacheslav Egorov 1f27788f41 [vm_snapshot_analysis] Avoid name clash
dart:core contains a class Type and it can also contain objects which
are instances of this class. Previously we would try to put size
information for both under dart:core/Type bucket which caused issues.

To prevent the clash we now wrap snapshot node types in '<...>' before using
them as path components, so that the first case would remain dart:core/Type
but size of Type instances would be written into dart:core/<Type> bucket.

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

Fixed: 42969
Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: Ie6c3400e90511507ff37b7ca037bd385dea1b11c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157493
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
2020-08-07 07:06:14 +00:00
Peter Lee 9b185c9dd3 [vm_snapshot_analysis] Add compareProgramInfo helper method
Exposing this helper method will allow comparison between program info without using buildComparisonTreemap


Change-Id: Ib771801530dd34515ccecc4ec01e39cd4546e916
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157080
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
2020-08-06 15:49:49 +00:00
Kenzie Schmoll 99a233505f [vm_snapshot_analysis] Add partsForPath util to split google3 paths
Support splitting paths that look like: `package:foo.bar.baz/src/foobar.dart` as well
as "normal" paths (`package:foo/bar/baz/src/foobar.dart`).

Change-Id: I7816b7d6fd34d786a735bf74e3ea2a2606c27af5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157023
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-08-04 22:30:50 +00:00
Kenzie Schmoll cb10c778a0 [vm_snapshot_analysis] add missing await to fix type error
We were getting the type error "type 'Future<Object>' is not a subtype of type 'Map<String, dynamic>'" because we weren't awaiting this future.

Change-Id: I1247151d5a7bcf688eb90f0188c783cbffc432fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156918
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
2020-08-04 22:27:10 +00:00
Vyacheslav Egorov a99edb8ac5 [vm_snapshot_analysis] Fix treemap construction
Do not include package nodes names into path when building treemap from
ProgramInfo. Library names already contain full package name.

Fixes #42907

Fixed: 42907

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: I91c4fc73edb3b345dfcc485e418d50b2ec5f4fe7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156910
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
2020-08-04 20:39:38 +00:00
Kenzie Schmoll d9860c8b4f [vm_snapshot_analysis] remove unused import
Change-Id: I42f5144e4f657d39a34cf2b1a4906af745372153
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155220
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
2020-07-21 15:44:47 +00:00
Kenzie Schmoll 6607655382 [vm_snapshot_analysis] move command/* lib files out of bin
The files in `command/*` were moved as part of https://dart-review.googlesource.com/c/sdk/+/154360.

This CL responds to Slava's comment "FWIW having this files in bin violates pub layout guidelines and looks pretty different from all other packages we have: bin/ is a folder for scripts. Libraries should live in lib."

I verified in DevTools that with this change, we can still import files from package:vm_snapshot_analysis and run on the web (as long as we do not import files that depend on dart:io - lib/commands/utils.dart)

Change-Id: I8c4f2a55c9cf346260fa5b80116c21993ccfc249
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154481
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
2020-07-15 20:06:47 +00:00
Martin Kustermann 06183779d7 [vm/compiler] Make the compiler use dyn:* selectors when calling getters
We already make the callsites use dyn:* selectors for normal method
calls as well as setters, this is doing the same thing for getters.

Once callsites use dyn:get:* various pieces in runtime need to be
adjusted to accomodate for that (e.g. NSM handling, etc).

A follow-up CL will then start actually generating dyn:* getters in
certain situations.

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

Change-Id: If219603bc0b8eb119edd08b211a8897d21ec0fb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154320
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2020-07-15 12:38:04 +00:00
Kenzie Schmoll 845d0bdc09 [vm_snapshot_analysis] Move utils.dart into bin/commands/
Change-Id: Ib5471b3effb223795f0cdcc6fcf7f2e7d487e1f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154345
Reviewed-by: Jacob Richman <jacobr@google.com>
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
2020-07-15 00:34:03 +00:00
Kenzie Schmoll 4f55ba2639 [vm_snapshot_analysis] rearrange dart:io dep and move commands to bin
Change-Id: Ib22ae8d1ec3c4032c646915bad94361efef48a2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154360
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2020-07-14 23:09:18 +00:00