| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 | 382 |
| 383 HeapObject._empty(ServiceObjectOwner owner) : super._empty(owner); | 383 HeapObject._empty(ServiceObjectOwner owner) : super._empty(owner); |
| 384 | 384 |
| 385 void _update(ObservableMap map, bool mapIsRef) { | 385 void _update(ObservableMap map, bool mapIsRef) { |
| 386 if (map['class'] != null) { | 386 if (map['class'] != null) { |
| 387 // Sent with refs for some types. Load it if available, but don't clobber | 387 // Sent with refs for some types. Load it if available, but don't clobber |
| 388 // it with null for kinds that only send if for full responses. | 388 // it with null for kinds that only send if for full responses. |
| 389 clazz = map['class']; | 389 clazz = map['class']; |
| 390 } | 390 } |
| 391 | 391 |
| 392 // Load the full class object. | 392 // Load the full class object if the isolate is runnable. |
| 393 clazz?.load(); | 393 if (clazz != null) { |
| 394 if (clazz.owner.runnable) { |
| 395 clazz.load(); |
| 396 } |
| 397 } |
| 394 | 398 |
| 395 if (mapIsRef) { | 399 if (mapIsRef) { |
| 396 return; | 400 return; |
| 397 } | 401 } |
| 398 size = map['size']; | 402 size = map['size']; |
| 399 } | 403 } |
| 400 } | 404 } |
| 401 | 405 |
| 402 abstract class ServiceObjectOwner extends ServiceObject { | 406 abstract class ServiceObjectOwner extends ServiceObject { |
| 403 /// Creates an empty [ServiceObjectOwner]. | 407 /// Creates an empty [ServiceObjectOwner]. |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 notifyPropertyChange(#paused, 0, 1); | 1137 notifyPropertyChange(#paused, 0, 1); |
| 1134 notifyPropertyChange(#running, 0, 1); | 1138 notifyPropertyChange(#running, 0, 1); |
| 1135 notifyPropertyChange(#idle, 0, 1); | 1139 notifyPropertyChange(#idle, 0, 1); |
| 1136 } | 1140 } |
| 1137 | 1141 |
| 1138 @observable ServiceEvent pauseEvent = null; | 1142 @observable ServiceEvent pauseEvent = null; |
| 1139 @observable bool paused = false; | 1143 @observable bool paused = false; |
| 1140 @observable bool running = false; | 1144 @observable bool running = false; |
| 1141 @observable bool idle = false; | 1145 @observable bool idle = false; |
| 1142 @observable bool loading = true; | 1146 @observable bool loading = true; |
| 1143 | 1147 @observable bool runnable = false; |
| 1144 @observable bool ioEnabled = false; | 1148 @observable bool ioEnabled = false; |
| 1145 | 1149 |
| 1146 final List<String> extensionRPCs = new List<String>(); | 1150 final List<String> extensionRPCs = new List<String>(); |
| 1147 | 1151 |
| 1148 Map<String,ServiceObject> _cache = new Map<String,ServiceObject>(); | 1152 Map<String,ServiceObject> _cache = new Map<String,ServiceObject>(); |
| 1149 final TagProfile tagProfile = new TagProfile(20); | 1153 final TagProfile tagProfile = new TagProfile(20); |
| 1150 | 1154 |
| 1151 Isolate._empty(ServiceObjectOwner owner) : super._empty(owner) { | 1155 Isolate._empty(ServiceObjectOwner owner) : super._empty(owner) { |
| 1152 assert(owner is VM); | 1156 assert(owner is VM); |
| 1153 } | 1157 } |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1371 | 1375 |
| 1372 void _update(ObservableMap map, bool mapIsRef) { | 1376 void _update(ObservableMap map, bool mapIsRef) { |
| 1373 name = map['name']; | 1377 name = map['name']; |
| 1374 vmName = map.containsKey('_vmName') ? map['_vmName'] : name; | 1378 vmName = map.containsKey('_vmName') ? map['_vmName'] : name; |
| 1375 number = int.parse(map['number'], onError:(_) => null); | 1379 number = int.parse(map['number'], onError:(_) => null); |
| 1376 if (mapIsRef) { | 1380 if (mapIsRef) { |
| 1377 return; | 1381 return; |
| 1378 } | 1382 } |
| 1379 _loaded = true; | 1383 _loaded = true; |
| 1380 loading = false; | 1384 loading = false; |
| 1381 | 1385 runnable = map['runnable'] == true; |
| 1382 _upgradeCollection(map, isolate); | 1386 _upgradeCollection(map, isolate); |
| 1383 originNumber = int.parse(map['_originNumber'], onError:(_) => null); | 1387 originNumber = int.parse(map['_originNumber'], onError:(_) => null); |
| 1384 rootLibrary = map['rootLib']; | 1388 rootLibrary = map['rootLib']; |
| 1385 if (map['entry'] != null) { | 1389 if (map['entry'] != null) { |
| 1386 entry = map['entry']; | 1390 entry = map['entry']; |
| 1387 } | 1391 } |
| 1388 var savedStartTime = startTime; | 1392 var savedStartTime = startTime; |
| 1389 int startTimeInMillis = map['startTime']; | 1393 int startTimeInMillis = map['startTime']; |
| 1390 startTime = new DateTime.fromMillisecondsSinceEpoch(startTimeInMillis); | 1394 startTime = new DateTime.fromMillisecondsSinceEpoch(startTimeInMillis); |
| 1391 notifyPropertyChange(#upTime, 0, 1); | 1395 notifyPropertyChange(#upTime, 0, 1); |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1854 return (kind == kPauseStart || | 1858 return (kind == kPauseStart || |
| 1855 kind == kPauseExit || | 1859 kind == kPauseExit || |
| 1856 kind == kPauseBreakpoint || | 1860 kind == kPauseBreakpoint || |
| 1857 kind == kPauseInterrupted || | 1861 kind == kPauseInterrupted || |
| 1858 kind == kPauseException); | 1862 kind == kPauseException); |
| 1859 } | 1863 } |
| 1860 | 1864 |
| 1861 void _update(ObservableMap map, bool mapIsRef) { | 1865 void _update(ObservableMap map, bool mapIsRef) { |
| 1862 _loaded = true; | 1866 _loaded = true; |
| 1863 _upgradeCollection(map, owner); | 1867 _upgradeCollection(map, owner); |
| 1868 |
| 1864 assert(map['isolate'] == null || owner == map['isolate']); | 1869 assert(map['isolate'] == null || owner == map['isolate']); |
| 1865 timestamp = | 1870 timestamp = |
| 1866 new DateTime.fromMillisecondsSinceEpoch(map['timestamp']); | 1871 new DateTime.fromMillisecondsSinceEpoch(map['timestamp']); |
| 1867 kind = map['kind']; | 1872 kind = map['kind']; |
| 1868 notifyPropertyChange(#isPauseEvent, 0, 1); | 1873 notifyPropertyChange(#isPauseEvent, 0, 1); |
| 1869 name = 'ServiceEvent $kind'; | 1874 name = 'ServiceEvent $kind'; |
| 1870 vmName = name; | 1875 vmName = name; |
| 1871 if (map['breakpoint'] != null) { | 1876 if (map['breakpoint'] != null) { |
| 1872 breakpoint = map['breakpoint']; | 1877 breakpoint = map['breakpoint']; |
| 1873 } | 1878 } |
| (...skipping 2128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4002 var v = list[i]; | 4007 var v = list[i]; |
| 4003 if ((v is ObservableMap) && _isServiceMap(v)) { | 4008 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 4004 list[i] = owner.getFromMap(v); | 4009 list[i] = owner.getFromMap(v); |
| 4005 } else if (v is ObservableList) { | 4010 } else if (v is ObservableList) { |
| 4006 _upgradeObservableList(v, owner); | 4011 _upgradeObservableList(v, owner); |
| 4007 } else if (v is ObservableMap) { | 4012 } else if (v is ObservableMap) { |
| 4008 _upgradeObservableMap(v, owner); | 4013 _upgradeObservableMap(v, owner); |
| 4009 } | 4014 } |
| 4010 } | 4015 } |
| 4011 } | 4016 } |
| OLD | NEW |