[observatory] Don't repeat storage of identity hashes in loaded heap snapshots.

TEST=ci
Change-Id: I4696f0e943f4b0dd5716ece285650aed85056c37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265521
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak 2022-10-26 16:02:50 +00:00 committed by Commit Queue
parent b11dc51c0d
commit 6d5c966e68
2 changed files with 4 additions and 6 deletions

View file

@ -260,12 +260,10 @@ abstract class SnapshotObject {
class _SnapshotObject implements SnapshotObject {
final int _id;
final int identityHashCode;
final _SnapshotGraph _graph;
final String label;
_SnapshotObject._new(this._id, this._graph, this.label)
: identityHashCode = _graph._identityHashes![_id];
_SnapshotObject._new(this._id, this._graph, this.label);
bool operator ==(Object other) {
if (other is _SnapshotObject) {
@ -275,6 +273,7 @@ class _SnapshotObject implements SnapshotObject {
}
int get hashCode => _id ^ _graph.hashCode;
int get identityHashCode => _graph._identityHashes![_id];
int get shallowSize => internalSize + externalSize;
int get internalSize => _graph._internalSizes![_id];

View file

@ -260,12 +260,10 @@ abstract class SnapshotObject {
class _SnapshotObject implements SnapshotObject {
final int _id;
final int identityHashCode;
final _SnapshotGraph _graph;
final String label;
_SnapshotObject._new(this._id, this._graph, this.label)
: identityHashCode = _graph._identityHashes[_id];
_SnapshotObject._new(this._id, this._graph, this.label);
bool operator ==(Object other) {
if (other is _SnapshotObject) {
@ -275,6 +273,7 @@ class _SnapshotObject implements SnapshotObject {
}
int get hashCode => _id ^ _graph.hashCode;
int get identityHashCode => _graph._identityHashes[_id];
int get shallowSize => internalSize + externalSize;
int get internalSize => _graph._internalSizes[_id];