| 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 /// State for a running isolate. | 7 /// State for a running isolate. |
| 8 class Isolate extends ServiceObject { | 8 class Isolate extends ServiceObject { |
| 9 final VM vm; | 9 final VM vm; |
| 10 String get link => _id; | 10 String get link => _id; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 var codeRegions = profile['codes']; | 56 var codeRegions = profile['codes']; |
| 57 for (var codeRegion in codeRegions) { | 57 for (var codeRegion in codeRegions) { |
| 58 Code code = codeRegion['code']; | 58 Code code = codeRegion['code']; |
| 59 assert(code != null); | 59 assert(code != null); |
| 60 codeTable.add(code); | 60 codeTable.add(code); |
| 61 } | 61 } |
| 62 _codes._resetProfileData(); | 62 _codes._resetProfileData(); |
| 63 _codes._updateProfileData(profile, codeTable); | 63 _codes._updateProfileData(profile, codeTable); |
| 64 } | 64 } |
| 65 | 65 |
| 66 Future<ServiceObject> getDirect(String serviceId) { |
| 67 return vm.getAsMap(relativeLink(serviceId)).then((ObservableMap m) { |
| 68 return _upgradeToServiceObject(vm, this, m); |
| 69 }); |
| 70 } |
| 71 |
| 66 /// Requests [serviceId] from [this]. Completes to a [ServiceObject]. | 72 /// Requests [serviceId] from [this]. Completes to a [ServiceObject]. |
| 67 /// Can return pre-existing, cached, [ServiceObject]s. | 73 /// Can return pre-existing, cached, [ServiceObject]s. |
| 68 Future<ServiceObject> get(String serviceId) { | 74 Future<ServiceObject> get(String serviceId) { |
| 69 if (_scripts.cachesId(serviceId)) { | 75 if (_scripts.cachesId(serviceId)) { |
| 70 return _scripts.get(serviceId); | 76 return _scripts.get(serviceId); |
| 71 } | 77 } |
| 72 if (_codes.cachesId(serviceId)) { | 78 if (_codes.cachesId(serviceId)) { |
| 73 return _codes.get(serviceId); | 79 return _codes.get(serviceId); |
| 74 } | 80 } |
| 75 if (_classes.cachesId(serviceId)) { | 81 if (_classes.cachesId(serviceId)) { |
| 76 return _classes.get(serviceId); | 82 return _classes.get(serviceId); |
| 77 } | 83 } |
| 78 if (_functions.cachesId(serviceId)) { | 84 if (_functions.cachesId(serviceId)) { |
| 79 return _functions.get(serviceId); | 85 return _functions.get(serviceId); |
| 80 } | 86 } |
| 81 return vm.getAsMap(relativeLink(serviceId)).then((ObservableMap m) { | 87 return getDirect(serviceId); |
| 82 return _upgradeToServiceObject(vm, this, m); | |
| 83 }); | |
| 84 } | 88 } |
| 85 | 89 |
| 86 @observable ServiceMap rootLib; | 90 @observable ServiceMap rootLib; |
| 87 @observable ObservableMap topFrame; | 91 @observable ObservableMap topFrame; |
| 88 | 92 |
| 89 @observable String name; | 93 @observable String name; |
| 90 @observable String vmName; | 94 @observable String vmName; |
| 91 @observable Map entry; | 95 @observable Map entry; |
| 92 | 96 |
| 93 @observable final Map<String, double> timers = | 97 @observable final Map<String, double> timers = |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 | 629 |
| 626 int _callCount(List<CodeCallCount> calls, Code code) { | 630 int _callCount(List<CodeCallCount> calls, Code code) { |
| 627 for (CodeCallCount caller in calls) { | 631 for (CodeCallCount caller in calls) { |
| 628 if (caller.code == code) { | 632 if (caller.code == code) { |
| 629 return caller.count; | 633 return caller.count; |
| 630 } | 634 } |
| 631 } | 635 } |
| 632 return 0; | 636 return 0; |
| 633 } | 637 } |
| 634 } | 638 } |
| OLD | NEW |