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. |
| 393 clazz?.load(); |
| 394 |
392 if (mapIsRef) { | 395 if (mapIsRef) { |
393 return; | 396 return; |
394 } | 397 } |
395 size = map['size']; | 398 size = map['size']; |
396 } | 399 } |
397 } | 400 } |
398 | 401 |
399 abstract class ServiceObjectOwner extends ServiceObject { | 402 abstract class ServiceObjectOwner extends ServiceObject { |
400 /// Creates an empty [ServiceObjectOwner]. | 403 /// Creates an empty [ServiceObjectOwner]. |
401 ServiceObjectOwner._empty(ServiceObjectOwner owner) : super._empty(owner); | 404 ServiceObjectOwner._empty(ServiceObjectOwner owner) : super._empty(owner); |
(...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2034 @observable String uri; | 2037 @observable String uri; |
2035 @reflectable final dependencies = new ObservableList<LibraryDependency>(); | 2038 @reflectable final dependencies = new ObservableList<LibraryDependency>(); |
2036 @reflectable final scripts = new ObservableList<Script>(); | 2039 @reflectable final scripts = new ObservableList<Script>(); |
2037 @reflectable final classes = new ObservableList<Class>(); | 2040 @reflectable final classes = new ObservableList<Class>(); |
2038 @reflectable final variables = new ObservableList<Field>(); | 2041 @reflectable final variables = new ObservableList<Field>(); |
2039 @reflectable final functions = new ObservableList<ServiceFunction>(); | 2042 @reflectable final functions = new ObservableList<ServiceFunction>(); |
2040 | 2043 |
2041 bool get canCache => true; | 2044 bool get canCache => true; |
2042 bool get immutable => false; | 2045 bool get immutable => false; |
2043 | 2046 |
| 2047 bool isDart(String libraryName) { |
| 2048 return uri == 'dart:$libraryName'; |
| 2049 } |
| 2050 |
2044 Library._empty(ServiceObjectOwner owner) : super._empty(owner); | 2051 Library._empty(ServiceObjectOwner owner) : super._empty(owner); |
2045 | 2052 |
2046 void _update(ObservableMap map, bool mapIsRef) { | 2053 void _update(ObservableMap map, bool mapIsRef) { |
2047 _upgradeCollection(map, isolate); | 2054 _upgradeCollection(map, isolate); |
2048 super._update(map, mapIsRef); | 2055 super._update(map, mapIsRef); |
2049 | 2056 |
2050 uri = map['uri']; | 2057 uri = map['uri']; |
2051 var shortUri = uri; | 2058 var shortUri = uri; |
2052 if (uri.startsWith('file://') || | 2059 if (uri.startsWith('file://') || |
2053 uri.startsWith('http://')) { | 2060 uri.startsWith('http://')) { |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2318 bool get isSimdValue { | 2325 bool get isSimdValue { |
2319 return kind == 'Float32x4' | 2326 return kind == 'Float32x4' |
2320 || kind == 'Float64x2' | 2327 || kind == 'Float64x2' |
2321 || kind == 'Int32x4'; | 2328 || kind == 'Int32x4'; |
2322 } | 2329 } |
2323 bool get isRegExp => kind == 'RegExp'; | 2330 bool get isRegExp => kind == 'RegExp'; |
2324 bool get isMirrorReference => kind == 'MirrorReference'; | 2331 bool get isMirrorReference => kind == 'MirrorReference'; |
2325 bool get isWeakProperty => kind == 'WeakProperty'; | 2332 bool get isWeakProperty => kind == 'WeakProperty'; |
2326 bool get isClosure => kind == 'Closure'; | 2333 bool get isClosure => kind == 'Closure'; |
2327 bool get isStackTrace => kind == 'StackTrace'; | 2334 bool get isStackTrace => kind == 'StackTrace'; |
| 2335 bool get isStackOverflowError { |
| 2336 if (clazz == null) { |
| 2337 return false; |
| 2338 } |
| 2339 if (clazz.library == null) { |
| 2340 return false; |
| 2341 } |
| 2342 return (clazz.name == 'StackOverflowError') && clazz.library.isDart('core'); |
| 2343 } |
| 2344 |
| 2345 bool get isOutOfMemoryError { |
| 2346 if (clazz == null) { |
| 2347 return false; |
| 2348 } |
| 2349 if (clazz.library == null) { |
| 2350 return false; |
| 2351 } |
| 2352 return (clazz.name == 'OutOfMemoryError') && clazz.library.isDart('core'); |
| 2353 } |
2328 | 2354 |
2329 // TODO(turnidge): Is this properly backwards compatible when new | 2355 // TODO(turnidge): Is this properly backwards compatible when new |
2330 // instance kinds are added? | 2356 // instance kinds are added? |
2331 bool get isPlainInstance => kind == 'PlainInstance'; | 2357 bool get isPlainInstance => kind == 'PlainInstance'; |
2332 | 2358 |
2333 Instance._empty(ServiceObjectOwner owner) : super._empty(owner); | 2359 Instance._empty(ServiceObjectOwner owner) : super._empty(owner); |
2334 | 2360 |
2335 void _update(ObservableMap map, bool mapIsRef) { | 2361 void _update(ObservableMap map, bool mapIsRef) { |
2336 // Extract full properties. | 2362 // Extract full properties. |
2337 _upgradeCollection(map, isolate); | 2363 _upgradeCollection(map, isolate); |
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3976 var v = list[i]; | 4002 var v = list[i]; |
3977 if ((v is ObservableMap) && _isServiceMap(v)) { | 4003 if ((v is ObservableMap) && _isServiceMap(v)) { |
3978 list[i] = owner.getFromMap(v); | 4004 list[i] = owner.getFromMap(v); |
3979 } else if (v is ObservableList) { | 4005 } else if (v is ObservableList) { |
3980 _upgradeObservableList(v, owner); | 4006 _upgradeObservableList(v, owner); |
3981 } else if (v is ObservableMap) { | 4007 } else if (v is ObservableMap) { |
3982 _upgradeObservableMap(v, owner); | 4008 _upgradeObservableMap(v, owner); |
3983 } | 4009 } |
3984 } | 4010 } |
3985 } | 4011 } |
OLD | NEW |