Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Unified Diff: runtime/observatory/lib/object_graph.dart

Issue 2759973004: Fix observatory tests broken by running dartfmt. Temporarily reverted formatting for evaluate_activ… (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/observatory/lib/event.dart ('k') | runtime/observatory/lib/src/app/page.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/object_graph.dart
diff --git a/runtime/observatory/lib/object_graph.dart b/runtime/observatory/lib/object_graph.dart
index 146badcaf156795c762bb4be3c15e20747ae015c..324f14fe59cac75f20572984307663afdfae9e05 100644
--- a/runtime/observatory/lib/object_graph.dart
+++ b/runtime/observatory/lib/object_graph.dart
@@ -314,30 +314,29 @@ class MergedObjectVertex {
var cids = _graph._cids;
var size = 0;
var sibling = _id;
- while (sibling != SENTINEL &&
- cids[sibling] == cids[_id]) {
+ while (sibling != SENTINEL && cids[sibling] == cids[_id]) {
size += _graph._shallowSizes[sibling];
sibling = _graph._mergedDomNext[sibling];
}
return size;
}
+
int get retainedSize {
var cids = _graph._cids;
var size = 0;
var sibling = _id;
- while (sibling != SENTINEL &&
- cids[sibling] == cids[_id]) {
+ while (sibling != SENTINEL && cids[sibling] == cids[_id]) {
size += _graph._retainedSizes[sibling];
sibling = _graph._mergedDomNext[sibling];
}
return size;
}
+
int get instanceCount {
var cids = _graph._cids;
var count = 0;
var sibling = _id;
- while (sibling != SENTINEL &&
- cids[sibling] == cids[_id]) {
+ while (sibling != SENTINEL && cids[sibling] == cids[_id]) {
count++;
sibling = _graph._mergedDomNext[sibling];
}
@@ -354,8 +353,7 @@ class MergedObjectVertex {
// Walk the list of children and look for the representative objects, i.e.
// the first sibling of each cid.
while (child != SENTINEL) {
- if (prev == SENTINEL ||
- cids[prev] != cids[child]) {
+ if (prev == SENTINEL || cids[prev] != cids[child]) {
domChildren.add(new MergedObjectVertex._(child, _graph));
}
prev = child;
@@ -502,9 +500,9 @@ class ObjectGraph {
int _kObjectAlignment;
int _kStackCid;
- int _N; // Objects in the snapshot.
- int _Nconnected; // Objects reachable from root.
- int _E; // References in the snapshot.
+ int _N; // Objects in the snapshot.
+ int _Nconnected; // Objects reachable from root.
+ int _E; // References in the snapshot.
int _size;
// Indexed by node id, with id 0 representing invalid/uninitialized.
@@ -694,8 +692,8 @@ class ObjectGraph {
var startSuccIndex = firstSuccs[i];
var limitSuccIndex = firstSuccs[i + 1];
for (var succIndex = startSuccIndex;
- succIndex < limitSuccIndex;
- succIndex++) {
+ succIndex < limitSuccIndex;
+ succIndex++) {
succs[succIndex] = SENTINEL;
}
}
@@ -942,7 +940,7 @@ class ObjectGraph {
retainedSizes[doms[v]] += retainedSizes[v];
}
- assert(retainedSizes[ROOT] == size); // Root retains everything.
+ assert(retainedSizes[ROOT] == size); // Root retains everything.
_retainedSizes = retainedSizes;
_size = size;
@@ -967,16 +965,16 @@ class ObjectGraph {
// Merge the given lists according to the given key in ascending order.
// Returns the head of the merged list.
- static int _mergeSorted(int head1, int head2,
- Uint32List next, Uint16List key) {
+ static int _mergeSorted(
+ int head1, int head2, Uint32List next, Uint16List key) {
var head = head1;
var beforeInsert = SENTINEL;
var afterInsert = head1;
var startInsert = head2;
while (startInsert != SENTINEL) {
- while ((afterInsert != SENTINEL) &&
- (key[afterInsert] <= key[startInsert])) {
+ while (
+ (afterInsert != SENTINEL) && (key[afterInsert] <= key[startInsert])) {
beforeInsert = afterInsert;
afterInsert = next[beforeInsert];
}
@@ -1019,8 +1017,7 @@ class ObjectGraph {
int head1 = head;
int slow = head;
int fast = head;
- while (next[fast] != SENTINEL &&
- next[next[fast]] != SENTINEL) {
+ while (next[fast] != SENTINEL && next[next[fast]] != SENTINEL) {
slow = next[slow];
fast = next[next[fast]];
}
@@ -1058,8 +1055,7 @@ class ObjectGraph {
int cid = cids[parent1];
int slow = parent1;
int fast = parent1;
- while (next[fast] != end &&
- next[next[fast]] != end) {
+ while (next[fast] != end && next[next[fast]] != end) {
slow = next[slow];
fast = next[next[fast]];
}
@@ -1095,8 +1091,7 @@ class ObjectGraph {
// Find next sibling with a different cid.
var after = child;
- while (after != SENTINEL &&
- cids[after] == cids[child]) {
+ while (after != SENTINEL && cids[after] == cids[child]) {
after = next[after];
}
« no previous file with comments | « runtime/observatory/lib/event.dart ('k') | runtime/observatory/lib/src/app/page.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698