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 2234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2245 void update(List stats) { | 2245 void update(List stats) { |
2246 accumulated.instances = stats[ACCUMULATED]; | 2246 accumulated.instances = stats[ACCUMULATED]; |
2247 accumulated.bytes = stats[ACCUMULATED_SIZE]; | 2247 accumulated.bytes = stats[ACCUMULATED_SIZE]; |
2248 current.instances = stats[LIVE_AFTER_GC] + stats[ALLOCATED_SINCE_GC]; | 2248 current.instances = stats[LIVE_AFTER_GC] + stats[ALLOCATED_SINCE_GC]; |
2249 current.bytes = stats[LIVE_AFTER_GC_SIZE] + stats[ALLOCATED_SINCE_GC_SIZE]; | 2249 current.bytes = stats[LIVE_AFTER_GC_SIZE] + stats[ALLOCATED_SINCE_GC_SIZE]; |
2250 } | 2250 } |
2251 | 2251 |
2252 bool get empty => accumulated.empty && current.empty; | 2252 bool get empty => accumulated.empty && current.empty; |
2253 } | 2253 } |
2254 | 2254 |
2255 class Class extends HeapObject implements M.ClassRef { | 2255 class Class extends HeapObject implements M.Class { |
2256 @observable Library library; | 2256 @observable Library library; |
2257 | 2257 |
2258 @observable bool isAbstract; | 2258 @observable bool isAbstract; |
2259 @observable bool isConst; | 2259 @observable bool isConst; |
2260 @observable bool isFinalized; | 2260 @observable bool isFinalized; |
2261 @observable bool isPatch; | 2261 @observable bool isPatch; |
2262 @observable bool isImplemented; | 2262 @observable bool isImplemented; |
2263 | 2263 |
2264 @observable SourceLocation location; | 2264 @observable SourceLocation location; |
2265 | 2265 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2383 | 2383 |
2384 Future<ServiceObject> getAllocationSamples([String tags = 'None']) { | 2384 Future<ServiceObject> getAllocationSamples([String tags = 'None']) { |
2385 var params = { 'tags': tags, | 2385 var params = { 'tags': tags, |
2386 'classId': id }; | 2386 'classId': id }; |
2387 return isolate.invokeRpc('_getAllocationSamples', params); | 2387 return isolate.invokeRpc('_getAllocationSamples', params); |
2388 } | 2388 } |
2389 | 2389 |
2390 String toString() => 'Class($vmName)'; | 2390 String toString() => 'Class($vmName)'; |
2391 } | 2391 } |
2392 | 2392 |
2393 class Instance extends HeapObject implements M.InstanceRef { | 2393 class Instance extends HeapObject implements M.Instance { |
2394 @observable String kind; | 2394 @observable String kind; |
2395 @observable String valueAsString; // If primitive. | 2395 @observable String valueAsString; // If primitive. |
2396 @observable bool valueAsStringIsTruncated; | 2396 @observable bool valueAsStringIsTruncated; |
2397 @observable ServiceFunction function; // If a closure. | 2397 @observable ServiceFunction function; // If a closure. |
2398 @observable Context context; // If a closure. | 2398 @observable Context context; // If a closure. |
2399 @observable int length; // If a List, Map or TypedData. | 2399 @observable int length; // If a List, Map or TypedData. |
2400 @observable Instance pattern; // If a RegExp. | 2400 @observable Instance pattern; // If a RegExp. |
2401 | 2401 |
2402 @observable String name; | 2402 @observable String name; |
2403 @observable Class typeClass; | 2403 @observable Class typeClass; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2482 return (clazz.name == 'OutOfMemoryError') && clazz.library.isDart('core'); | 2482 return (clazz.name == 'OutOfMemoryError') && clazz.library.isDart('core'); |
2483 } | 2483 } |
2484 | 2484 |
2485 // TODO(turnidge): Is this properly backwards compatible when new | 2485 // TODO(turnidge): Is this properly backwards compatible when new |
2486 // instance kinds are added? | 2486 // instance kinds are added? |
2487 bool get isPlainInstance => kind == 'PlainInstance'; | 2487 bool get isPlainInstance => kind == 'PlainInstance'; |
2488 | 2488 |
2489 Instance._empty(ServiceObjectOwner owner) : super._empty(owner); | 2489 Instance._empty(ServiceObjectOwner owner) : super._empty(owner); |
2490 | 2490 |
2491 void _update(ObservableMap map, bool mapIsRef) { | 2491 void _update(ObservableMap map, bool mapIsRef) { |
2492 // Extract full properties. | 2492 // Extract full properties.1 |
2493 _upgradeCollection(map, isolate); | 2493 _upgradeCollection(map, isolate); |
2494 super._update(map, mapIsRef); | 2494 super._update(map, mapIsRef); |
2495 | 2495 |
2496 kind = map['kind']; | 2496 kind = map['kind']; |
2497 valueAsString = map['valueAsString']; | 2497 valueAsString = map['valueAsString']; |
2498 // Coerce absence to false. | 2498 // Coerce absence to false. |
2499 valueAsStringIsTruncated = map['valueAsStringIsTruncated'] == true; | 2499 valueAsStringIsTruncated = map['valueAsStringIsTruncated'] == true; |
2500 function = map['closureFunction']; | 2500 function = map['closureFunction']; |
2501 context = map['closureContext']; | 2501 context = map['closureContext']; |
2502 name = map['name']; | 2502 name = map['name']; |
2503 length = map['length']; | 2503 length = map['length']; |
2504 pattern = map['pattern']; | 2504 pattern = map['pattern']; |
| 2505 typeClass = map['typeClass']; |
2505 | 2506 |
2506 if (mapIsRef) { | 2507 if (mapIsRef) { |
2507 return; | 2508 return; |
2508 } | 2509 } |
2509 | 2510 |
2510 isCaseSensitive = map['isCaseSensitive']; | 2511 isCaseSensitive = map['isCaseSensitive']; |
2511 isMultiLine = map['isMultiLine']; | 2512 isMultiLine = map['isMultiLine']; |
2512 bool isCompiled = map['_oneByteFunction'] is ServiceFunction; | 2513 bool isCompiled = map['_oneByteFunction'] is ServiceFunction; |
2513 oneByteFunction = isCompiled ? map['_oneByteFunction'] : null; | 2514 oneByteFunction = isCompiled ? map['_oneByteFunction'] : null; |
2514 twoByteFunction = isCompiled ? map['_twoByteFunction'] : null; | 2515 twoByteFunction = isCompiled ? map['_twoByteFunction'] : null; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2547 case "Float64List": | 2548 case "Float64List": |
2548 typedElements = bytes.buffer.asFloat64List(); break; | 2549 typedElements = bytes.buffer.asFloat64List(); break; |
2549 case "Int32x4List": | 2550 case "Int32x4List": |
2550 typedElements = bytes.buffer.asInt32x4List(); break; | 2551 typedElements = bytes.buffer.asInt32x4List(); break; |
2551 case "Float32x4List": | 2552 case "Float32x4List": |
2552 typedElements = bytes.buffer.asFloat32x4List(); break; | 2553 typedElements = bytes.buffer.asFloat32x4List(); break; |
2553 case "Float64x2List": | 2554 case "Float64x2List": |
2554 typedElements = bytes.buffer.asFloat64x2List(); break; | 2555 typedElements = bytes.buffer.asFloat64x2List(); break; |
2555 } | 2556 } |
2556 } | 2557 } |
2557 typeClass = map['typeClass']; | |
2558 parameterizedClass = map['parameterizedClass']; | 2558 parameterizedClass = map['parameterizedClass']; |
2559 typeArguments = map['typeArguments']; | 2559 typeArguments = map['typeArguments']; |
2560 parameterIndex = map['parameterIndex']; | 2560 parameterIndex = map['parameterIndex']; |
2561 targetType = map['targetType']; | 2561 targetType = map['targetType']; |
2562 bound = map['bound']; | 2562 bound = map['bound']; |
2563 | 2563 |
2564 referent = map['mirrorReferent']; | 2564 referent = map['mirrorReferent']; |
2565 key = map['propertyKey']; | 2565 key = map['propertyKey']; |
2566 value = map['propertyValue']; | 2566 value = map['propertyValue']; |
2567 activationBreakpoint = map['_activationBreakpoint']; | 2567 activationBreakpoint = map['_activationBreakpoint']; |
(...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4094 var v = list[i]; | 4094 var v = list[i]; |
4095 if ((v is ObservableMap) && _isServiceMap(v)) { | 4095 if ((v is ObservableMap) && _isServiceMap(v)) { |
4096 list[i] = owner.getFromMap(v); | 4096 list[i] = owner.getFromMap(v); |
4097 } else if (v is ObservableList) { | 4097 } else if (v is ObservableList) { |
4098 _upgradeObservableList(v, owner); | 4098 _upgradeObservableList(v, owner); |
4099 } else if (v is ObservableMap) { | 4099 } else if (v is ObservableMap) { |
4100 _upgradeObservableMap(v, owner); | 4100 _upgradeObservableMap(v, owner); |
4101 } | 4101 } |
4102 } | 4102 } |
4103 } | 4103 } |
OLD | NEW |