OLD | NEW |
---|---|
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of heap_snapshot; | 5 part of heap_snapshot; |
6 | 6 |
7 class HeapSnapshot implements M.HeapSnapshot { | 7 class HeapSnapshot implements M.HeapSnapshot { |
8 ObjectGraph graph; | 8 ObjectGraph graph; |
9 DateTime timestamp; | 9 DateTime timestamp; |
10 int get objects => graph.vertexCount; | 10 int get objects => graph.vertexCount; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
170 int retainedSize = 0; | 170 int retainedSize = 0; |
171 | 171 |
172 List<MergedEdge> incomingEdges = new List<MergedEdge>(); | 172 List<MergedEdge> incomingEdges = new List<MergedEdge>(); |
173 Map<int, MergedEdge> outgoingEdges = new Map<int, MergedEdge>(); | 173 Map<int, MergedEdge> outgoingEdges = new Map<int, MergedEdge>(); |
174 | 174 |
175 Iterable<HeapSnapshotClassInbound> _inbounds; | 175 Iterable<HeapSnapshotClassInbound> _inbounds; |
176 Iterable<HeapSnapshotClassInbound> get inbounds { | 176 Iterable<HeapSnapshotClassInbound> get inbounds { |
177 if (_inbounds != null) { | 177 if (_inbounds != null) { |
178 return _inbounds; | 178 return _inbounds; |
179 } else { | 179 } else { |
180 return _inbounds = new List.unmodifiable( | 180 // It is important to keep the template. |
181 // https://github.com/dart-lang/sdk/issues/27144 | |
182 return _inbounds = new List<HeapSnapshotClassInbound>.unmodifiable( | |
181 incomingEdges.map((edge) { | 183 incomingEdges.map((edge) { |
182 return new HeapSnapshotClassInbound(this, edge); | 184 return new HeapSnapshotClassInbound(this, edge); |
183 }) | 185 }) |
184 ); | 186 ); |
185 } | 187 } |
186 } | 188 } |
187 | 189 |
188 Iterable<HeapSnapshotClassOutbound> _outbounds; | 190 Iterable<HeapSnapshotClassOutbound> _outbounds; |
189 Iterable<HeapSnapshotClassOutbound> get outbounds { | 191 Iterable<HeapSnapshotClassOutbound> get outbounds { |
190 if (_outbounds != null) { | 192 if (_outbounds != null) { |
191 return _outbounds; | 193 return _outbounds; |
192 } else { | 194 } else { |
193 return _outbounds = new List.unmodifiable( | 195 // It is important to keep the template. |
196 // https://github.com/dart-lang/sdk/issues/27144 | |
197 return _outbounds = new List<HeapSnapshotClassOutbound>.unmodifiable( | |
194 outgoingEdges.values.map((edge) { | 198 outgoingEdges.values.map((edge) { |
195 return new HeapSnapshotClassInbound(this, edge); | 199 return new HeapSnapshotClassInbound(this, edge); |
Cutch
2016/08/24 23:00:46
Should this be HeapSNapshotClassOutbound?
cbernaschina
2016/08/24 23:04:36
see https://codereview.chromium.org/2277073002/
| |
196 }) | 200 }) |
197 ); | 201 ); |
198 } | 202 } |
199 } | 203 } |
200 | 204 |
201 MergedVertex(this.isolate, this.cid); | 205 MergedVertex(this.isolate, this.cid); |
202 } | 206 } |
203 | 207 |
204 class HeapSnapshotClassInbound implements M.HeapSnapshotClassInbound { | 208 class HeapSnapshotClassInbound implements M.HeapSnapshotClassInbound { |
205 final MergedVertex vertex; | 209 final MergedVertex vertex; |
(...skipping 11 matching lines...) Expand all Loading... | |
217 final MergedVertex vertex; | 221 final MergedVertex vertex; |
218 final MergedEdge edge; | 222 final MergedEdge edge; |
219 S.Class get target => edge.sourceVertex != vertex ? edge.sourceVertex.clazz | 223 S.Class get target => edge.sourceVertex != vertex ? edge.sourceVertex.clazz |
220 : edge.targetVertex.clazz; | 224 : edge.targetVertex.clazz; |
221 int get count => edge.count; | 225 int get count => edge.count; |
222 int get shallowSize => edge.shallowSize; | 226 int get shallowSize => edge.shallowSize; |
223 int get retainedSize => edge.retainedSize; | 227 int get retainedSize => edge.retainedSize; |
224 | 228 |
225 HeapSnapshotClassOutbound(this.vertex, this.edge); | 229 HeapSnapshotClassOutbound(this.vertex, this.edge); |
226 } | 230 } |
OLD | NEW |