| 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 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 | 1468 |
| 1469 _upgradeCollection(map, isolate); | 1469 _upgradeCollection(map, isolate); |
| 1470 | 1470 |
| 1471 owningClass = map.containsKey('owningClass') ? map['owningClass'] : null; | 1471 owningClass = map.containsKey('owningClass') ? map['owningClass'] : null; |
| 1472 owningLibrary = map.containsKey('owningLibrary') ? map['owningLibrary'] : nu
ll; | 1472 owningLibrary = map.containsKey('owningLibrary') ? map['owningLibrary'] : nu
ll; |
| 1473 kind = FunctionKind.fromJSON(map['kind']); | 1473 kind = FunctionKind.fromJSON(map['kind']); |
| 1474 isDart = !kind.isFake(); | 1474 isDart = !kind.isFake(); |
| 1475 | 1475 |
| 1476 if (mapIsRef) { return; } | 1476 if (mapIsRef) { return; } |
| 1477 | 1477 |
| 1478 isStatic = map['isStatic']; | 1478 isStatic = map['static']; |
| 1479 isConst = map['isConst']; | 1479 isConst = map['const']; |
| 1480 parent = map['parent']; | 1480 parent = map['parent']; |
| 1481 script = map['script']; | 1481 script = map['script']; |
| 1482 tokenPos = map['tokenPos']; | 1482 tokenPos = map['tokenPos']; |
| 1483 endTokenPos = map['endTokenPos']; | 1483 endTokenPos = map['endTokenPos']; |
| 1484 code = _convertNull(map['code']); | 1484 code = _convertNull(map['code']); |
| 1485 unoptimizedCode = _convertNull(map['unoptimized_code']); | 1485 unoptimizedCode = _convertNull(map['unoptimizedCode']); |
| 1486 isOptimizable = map['is_optimizable']; | 1486 isOptimizable = map['optimizable']; |
| 1487 isInlinable = map['is_inlinable']; | 1487 isInlinable = map['inlinable']; |
| 1488 deoptimizations = map['deoptimizations']; | 1488 deoptimizations = map['deoptimizations']; |
| 1489 usageCounter = map['usage_counter']; | 1489 usageCounter = map['usageCounter']; |
| 1490 | 1490 |
| 1491 if (parent == null) { | 1491 if (parent == null) { |
| 1492 qualifiedName = (owningClass != null) ? | 1492 qualifiedName = (owningClass != null) ? |
| 1493 "${owningClass.name}.${name}" : | 1493 "${owningClass.name}.${name}" : |
| 1494 name; | 1494 name; |
| 1495 } else { | 1495 } else { |
| 1496 qualifiedName = "${parent.qualifiedName}.${name}"; | 1496 qualifiedName = "${parent.qualifiedName}.${name}"; |
| 1497 } | 1497 } |
| 1498 | 1498 |
| 1499 } | 1499 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1587 kind = map['kind']; | 1587 kind = map['kind']; |
| 1588 _url = map['name']; | 1588 _url = map['name']; |
| 1589 _shortUrl = _url.substring(_url.lastIndexOf('/') + 1); | 1589 _shortUrl = _url.substring(_url.lastIndexOf('/') + 1); |
| 1590 name = _shortUrl; | 1590 name = _shortUrl; |
| 1591 vmName = _url; | 1591 vmName = _url; |
| 1592 if (mapIsRef) { | 1592 if (mapIsRef) { |
| 1593 return; | 1593 return; |
| 1594 } | 1594 } |
| 1595 _processSource(map['source']); | 1595 _processSource(map['source']); |
| 1596 _parseTokenPosTable(map['tokenPosTable']); | 1596 _parseTokenPosTable(map['tokenPosTable']); |
| 1597 owningLibrary = map['owning_library']; | 1597 owningLibrary = map['owningLibrary']; |
| 1598 } | 1598 } |
| 1599 | 1599 |
| 1600 void _parseTokenPosTable(List<List<int>> table) { | 1600 void _parseTokenPosTable(List<List<int>> table) { |
| 1601 if (table == null) { | 1601 if (table == null) { |
| 1602 return; | 1602 return; |
| 1603 } | 1603 } |
| 1604 _tokenToLine.clear(); | 1604 _tokenToLine.clear(); |
| 1605 _tokenToCol.clear(); | 1605 _tokenToCol.clear(); |
| 1606 firstTokenPos = null; | 1606 firstTokenPos = null; |
| 1607 lastTokenPos = null; | 1607 lastTokenPos = null; |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1995 '${formatPercent(inclusiveTicks, totalSamplesInProfile)} ' | 1995 '${formatPercent(inclusiveTicks, totalSamplesInProfile)} ' |
| 1996 '($inclusiveTicks)'; | 1996 '($inclusiveTicks)'; |
| 1997 formattedExclusiveTicks = | 1997 formattedExclusiveTicks = |
| 1998 '${formatPercent(exclusiveTicks, totalSamplesInProfile)} ' | 1998 '${formatPercent(exclusiveTicks, totalSamplesInProfile)} ' |
| 1999 '($exclusiveTicks)'; | 1999 '($exclusiveTicks)'; |
| 2000 } | 2000 } |
| 2001 | 2001 |
| 2002 void _update(ObservableMap m, bool mapIsRef) { | 2002 void _update(ObservableMap m, bool mapIsRef) { |
| 2003 name = m['name']; | 2003 name = m['name']; |
| 2004 vmName = (m.containsKey('vmName') ? m['vmName'] : name); | 2004 vmName = (m.containsKey('vmName') ? m['vmName'] : name); |
| 2005 isOptimized = m['isOptimized'] != null ? m['isOptimized'] : false; | 2005 isOptimized = m['optimized'] != null ? m['optimized'] : false; |
| 2006 kind = CodeKind.fromString(m['kind']); | 2006 kind = CodeKind.fromString(m['kind']); |
| 2007 startAddress = int.parse(m['start'], radix:16); | 2007 startAddress = int.parse(m['start'], radix:16); |
| 2008 endAddress = int.parse(m['end'], radix:16); | 2008 endAddress = int.parse(m['end'], radix:16); |
| 2009 function = isolate.getFromMap(m['function']); | 2009 function = isolate.getFromMap(m['function']); |
| 2010 objectPool = isolate.getFromMap(m['object_pool']); | 2010 objectPool = isolate.getFromMap(m['objectPool']); |
| 2011 var disassembly = m['disassembly']; | 2011 var disassembly = m['disassembly']; |
| 2012 if (disassembly != null) { | 2012 if (disassembly != null) { |
| 2013 _processDisassembly(disassembly); | 2013 _processDisassembly(disassembly); |
| 2014 } | 2014 } |
| 2015 var descriptors = m['descriptors']; | 2015 var descriptors = m['descriptors']; |
| 2016 if (descriptors != null) { | 2016 if (descriptors != null) { |
| 2017 descriptors = descriptors['members']; | 2017 descriptors = descriptors['members']; |
| 2018 _processDescriptors(descriptors); | 2018 _processDescriptors(descriptors); |
| 2019 } | 2019 } |
| 2020 // We are loaded if we have instructions or are not Dart code. | 2020 // We are loaded if we have instructions or are not Dart code. |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2268 var v = list[i]; | 2268 var v = list[i]; |
| 2269 if ((v is ObservableMap) && _isServiceMap(v)) { | 2269 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 2270 list[i] = owner.getFromMap(v); | 2270 list[i] = owner.getFromMap(v); |
| 2271 } else if (v is ObservableList) { | 2271 } else if (v is ObservableList) { |
| 2272 _upgradeObservableList(v, owner); | 2272 _upgradeObservableList(v, owner); |
| 2273 } else if (v is ObservableMap) { | 2273 } else if (v is ObservableMap) { |
| 2274 _upgradeObservableMap(v, owner); | 2274 _upgradeObservableMap(v, owner); |
| 2275 } | 2275 } |
| 2276 } | 2276 } |
| 2277 } | 2277 } |
| OLD | NEW |