| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 service; | 5 part of service; |
| 6 | 6 |
| 7 // Some value smaller than the object ring, so requesting a large array | 7 // Some value smaller than the object ring, so requesting a large array |
| 8 // doesn't result in an expired ref because the elements lapped it in the | 8 // doesn't result in an expired ref because the elements lapped it in the |
| 9 // object ring. | 9 // object ring. |
| 10 const int kDefaultFieldLimit = 100; | 10 const int kDefaultFieldLimit = 100; |
| (...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1358 | 1358 |
| 1359 latestSnapshot = new HeapSnapshot(this, loadedChunks, event.nodeCount); | 1359 latestSnapshot = new HeapSnapshot(this, loadedChunks, event.nodeCount); |
| 1360 if (_snapshotFetch != null) { | 1360 if (_snapshotFetch != null) { |
| 1361 latestSnapshot.graph.process(_snapshotFetch).then((graph) { | 1361 latestSnapshot.graph.process(_snapshotFetch).then((graph) { |
| 1362 _snapshotFetch.add(latestSnapshot); | 1362 _snapshotFetch.add(latestSnapshot); |
| 1363 _snapshotFetch.close(); | 1363 _snapshotFetch.close(); |
| 1364 }); | 1364 }); |
| 1365 } | 1365 } |
| 1366 } | 1366 } |
| 1367 | 1367 |
| 1368 Stream fetchHeapSnapshot() { | 1368 Stream fetchHeapSnapshot(collectGarbage) { |
| 1369 if (_snapshotFetch == null || _snapshotFetch.isClosed) { | 1369 if (_snapshotFetch == null || _snapshotFetch.isClosed) { |
| 1370 _snapshotFetch = new StreamController(); | 1370 _snapshotFetch = new StreamController(); |
| 1371 // isolate.vm.streamListen('_Graph'); | 1371 // isolate.vm.streamListen('_Graph'); |
| 1372 isolate.invokeRpcNoUpgrade('_requestHeapSnapshot', {}); | 1372 isolate.invokeRpcNoUpgrade('_requestHeapSnapshot', |
| 1373 {'collectGarbage': collectGarbage}); |
| 1373 } | 1374 } |
| 1374 return _snapshotFetch.stream; | 1375 return _snapshotFetch.stream; |
| 1375 } | 1376 } |
| 1376 | 1377 |
| 1377 void updateHeapsFromMap(ObservableMap map) { | 1378 void updateHeapsFromMap(ObservableMap map) { |
| 1378 newSpace.update(map['new']); | 1379 newSpace.update(map['new']); |
| 1379 oldSpace.update(map['old']); | 1380 oldSpace.update(map['old']); |
| 1380 } | 1381 } |
| 1381 | 1382 |
| 1382 void _update(ObservableMap map, bool mapIsRef) { | 1383 void _update(ObservableMap map, bool mapIsRef) { |
| (...skipping 2637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4020 var v = list[i]; | 4021 var v = list[i]; |
| 4021 if ((v is ObservableMap) && _isServiceMap(v)) { | 4022 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 4022 list[i] = owner.getFromMap(v); | 4023 list[i] = owner.getFromMap(v); |
| 4023 } else if (v is ObservableList) { | 4024 } else if (v is ObservableList) { |
| 4024 _upgradeObservableList(v, owner); | 4025 _upgradeObservableList(v, owner); |
| 4025 } else if (v is ObservableMap) { | 4026 } else if (v is ObservableMap) { |
| 4026 _upgradeObservableMap(v, owner); | 4027 _upgradeObservableMap(v, owner); |
| 4027 } | 4028 } |
| 4028 } | 4029 } |
| 4029 } | 4030 } |
| OLD | NEW |