| 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 /// A [ServiceObject] is an object known to the VM service and is tied | 7 /// A [ServiceObject] is an object known to the VM service and is tied |
| 8 /// to an owning [Isolate]. | 8 /// to an owning [Isolate]. |
| 9 abstract class ServiceObject extends Observable { | 9 abstract class ServiceObject extends Observable { |
| 10 static int LexicalSortName(ServiceObject o1, ServiceObject o2) { | 10 static int LexicalSortName(ServiceObject o1, ServiceObject o2) { |
| (...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1456 @reflectable final subclasses = new ObservableList<Class>(); | 1456 @reflectable final subclasses = new ObservableList<Class>(); |
| 1457 | 1457 |
| 1458 bool get canCache => true; | 1458 bool get canCache => true; |
| 1459 bool get immutable => false; | 1459 bool get immutable => false; |
| 1460 | 1460 |
| 1461 Class._empty(ServiceObjectOwner owner) : super._empty(owner); | 1461 Class._empty(ServiceObjectOwner owner) : super._empty(owner); |
| 1462 | 1462 |
| 1463 void _update(ObservableMap map, bool mapIsRef) { | 1463 void _update(ObservableMap map, bool mapIsRef) { |
| 1464 name = map['name']; | 1464 name = map['name']; |
| 1465 vmName = (map.containsKey('vmName') ? map['vmName'] : name); | 1465 vmName = (map.containsKey('vmName') ? map['vmName'] : name); |
| 1466 var idPrefix = "classes/"; |
| 1467 assert(id.startsWith(idPrefix)); |
| 1468 vmCid = int.parse(id.substring(idPrefix.length)); |
| 1466 | 1469 |
| 1467 if (mapIsRef) { | 1470 if (mapIsRef) { |
| 1468 return; | 1471 return; |
| 1469 } | 1472 } |
| 1470 | 1473 |
| 1471 // We are fully loaded. | 1474 // We are fully loaded. |
| 1472 _loaded = true; | 1475 _loaded = true; |
| 1473 | 1476 |
| 1474 // Extract full properties. | 1477 // Extract full properties. |
| 1475 _upgradeCollection(map, isolate); | 1478 _upgradeCollection(map, isolate); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1503 functions.clear(); | 1506 functions.clear(); |
| 1504 functions.addAll(map['functions']); | 1507 functions.addAll(map['functions']); |
| 1505 functions.sort(ServiceObject.LexicalSortName); | 1508 functions.sort(ServiceObject.LexicalSortName); |
| 1506 | 1509 |
| 1507 superclass = map['super']; | 1510 superclass = map['super']; |
| 1508 // Work-around Object not tracking its subclasses in the VM. | 1511 // Work-around Object not tracking its subclasses in the VM. |
| 1509 if (superclass != null && superclass.name == "Object") { | 1512 if (superclass != null && superclass.name == "Object") { |
| 1510 superclass._addSubclass(this); | 1513 superclass._addSubclass(this); |
| 1511 } | 1514 } |
| 1512 error = map['error']; | 1515 error = map['error']; |
| 1513 var idPrefix = "classes/"; | |
| 1514 assert(id.startsWith(idPrefix)); | |
| 1515 vmCid = int.parse(id.substring(idPrefix.length)); | |
| 1516 | 1516 |
| 1517 var allocationStats = map['allocationStats']; | 1517 var allocationStats = map['allocationStats']; |
| 1518 if (allocationStats != null) { | 1518 if (allocationStats != null) { |
| 1519 newSpace.update(allocationStats['new']); | 1519 newSpace.update(allocationStats['new']); |
| 1520 oldSpace.update(allocationStats['old']); | 1520 oldSpace.update(allocationStats['old']); |
| 1521 promotedByLastNewGC.instances = allocationStats['promotedInstances']; | 1521 promotedByLastNewGC.instances = allocationStats['promotedInstances']; |
| 1522 promotedByLastNewGC.bytes = allocationStats['promotedBytes']; | 1522 promotedByLastNewGC.bytes = allocationStats['promotedBytes']; |
| 1523 } | 1523 } |
| 1524 } | 1524 } |
| 1525 | 1525 |
| (...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2735 var v = list[i]; | 2735 var v = list[i]; |
| 2736 if ((v is ObservableMap) && _isServiceMap(v)) { | 2736 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 2737 list[i] = owner.getFromMap(v); | 2737 list[i] = owner.getFromMap(v); |
| 2738 } else if (v is ObservableList) { | 2738 } else if (v is ObservableList) { |
| 2739 _upgradeObservableList(v, owner); | 2739 _upgradeObservableList(v, owner); |
| 2740 } else if (v is ObservableMap) { | 2740 } else if (v is ObservableMap) { |
| 2741 _upgradeObservableMap(v, owner); | 2741 _upgradeObservableMap(v, owner); |
| 2742 } | 2742 } |
| 2743 } | 2743 } |
| 2744 } | 2744 } |
| OLD | NEW |