| 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] represents a persistent object within the vm. | 7 /// A [ServiceObject] represents a persistent object within the vm. |
| 8 abstract class ServiceObject extends Observable { | 8 abstract class ServiceObject extends Observable { |
| 9 static int LexicalSortName(ServiceObject o1, ServiceObject o2) { | 9 static int LexicalSortName(ServiceObject o1, ServiceObject o2) { |
| 10 return o1.name.compareTo(o2.name); | 10 return o1.name.compareTo(o2.name); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 bool get isBool => type == 'bool'; | 72 bool get isBool => type == 'bool'; |
| 73 bool get isContext => type == 'Context'; | 73 bool get isContext => type == 'Context'; |
| 74 bool get isDouble => type == 'double'; | 74 bool get isDouble => type == 'double'; |
| 75 bool get isError => type == 'Error'; | 75 bool get isError => type == 'Error'; |
| 76 bool get isInstance => _isInstanceType(type); | 76 bool get isInstance => _isInstanceType(type); |
| 77 bool get isInt => type == 'int'; | 77 bool get isInt => type == 'int'; |
| 78 bool get isList => type == 'List'; | 78 bool get isList => type == 'List'; |
| 79 bool get isNull => type == 'null'; | 79 bool get isNull => type == 'null'; |
| 80 bool get isSentinel => type == 'Sentinel'; | 80 bool get isSentinel => type == 'Sentinel'; |
| 81 bool get isString => type == 'String'; | 81 bool get isString => type == 'String'; |
| 82 bool get isMessage => type == 'Message'; |
| 82 | 83 |
| 83 // Kinds of Instance. | 84 // Kinds of Instance. |
| 84 bool get isMirrorReference => vmType == 'MirrorReference'; | 85 bool get isMirrorReference => vmType == 'MirrorReference'; |
| 85 bool get isWeakProperty => vmType == 'WeakProperty'; | 86 bool get isWeakProperty => vmType == 'WeakProperty'; |
| 86 bool get isClosure => false; | 87 bool get isClosure => false; |
| 87 bool get isPlainInstance { | 88 bool get isPlainInstance { |
| 88 return (type == 'Instance' && | 89 return (type == 'Instance' && |
| 89 !isMirrorReference && !isWeakProperty && !isClosure); | 90 !isMirrorReference && !isWeakProperty && !isClosure); |
| 90 } | 91 } |
| 91 | 92 |
| (...skipping 2110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2202 void _update(ObservableMap map, bool mapIsRef) { | 2203 void _update(ObservableMap map, bool mapIsRef) { |
| 2203 _upgradeCollection(map, isolate); | 2204 _upgradeCollection(map, isolate); |
| 2204 kind = map['kind']; | 2205 kind = map['kind']; |
| 2205 _url = map['name']; | 2206 _url = map['name']; |
| 2206 _shortUrl = _url.substring(_url.lastIndexOf('/') + 1); | 2207 _shortUrl = _url.substring(_url.lastIndexOf('/') + 1); |
| 2207 name = _shortUrl; | 2208 name = _shortUrl; |
| 2208 vmName = _url; | 2209 vmName = _url; |
| 2209 if (mapIsRef) { | 2210 if (mapIsRef) { |
| 2210 return; | 2211 return; |
| 2211 } | 2212 } |
| 2213 _loaded = true; |
| 2212 lineOffset = map['lineOffset']; | 2214 lineOffset = map['lineOffset']; |
| 2213 columnOffset = map['columnOffset']; | 2215 columnOffset = map['columnOffset']; |
| 2214 _parseTokenPosTable(map['tokenPosTable']); | 2216 _parseTokenPosTable(map['tokenPosTable']); |
| 2215 _processSource(map['source']); | 2217 _processSource(map['source']); |
| 2216 library = map['library']; | 2218 library = map['library']; |
| 2217 } | 2219 } |
| 2218 | 2220 |
| 2219 void _parseTokenPosTable(List<List<int>> table) { | 2221 void _parseTokenPosTable(List<List<int>> table) { |
| 2220 if (table == null) { | 2222 if (table == null) { |
| 2221 return; | 2223 return; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2275 } | 2277 } |
| 2276 | 2278 |
| 2277 mergedCallSites.addAll(callSites); | 2279 mergedCallSites.addAll(callSites); |
| 2278 callSites = mergedCallSites; | 2280 callSites = mergedCallSites; |
| 2279 _applyHitsToLines(); | 2281 _applyHitsToLines(); |
| 2280 // Notify any Observers that this Script's state has changed. | 2282 // Notify any Observers that this Script's state has changed. |
| 2281 notifyChange(null); | 2283 notifyChange(null); |
| 2282 } | 2284 } |
| 2283 | 2285 |
| 2284 void _processSource(String source) { | 2286 void _processSource(String source) { |
| 2285 // Preemptyively mark that this is not loaded. | |
| 2286 _loaded = false; | |
| 2287 if (source == null) { | 2287 if (source == null) { |
| 2288 return; | 2288 return; |
| 2289 } | 2289 } |
| 2290 var sourceLines = source.split('\n'); | 2290 var sourceLines = source.split('\n'); |
| 2291 if (sourceLines.length == 0) { | 2291 if (sourceLines.length == 0) { |
| 2292 return; | 2292 return; |
| 2293 } | 2293 } |
| 2294 // We have the source to the script. This is now loaded. | |
| 2295 _loaded = true; | |
| 2296 lines.clear(); | 2294 lines.clear(); |
| 2297 Logger.root.info('Adding ${sourceLines.length} source lines for ${_url}'); | 2295 Logger.root.info('Adding ${sourceLines.length} source lines for ${_url}'); |
| 2298 for (var i = 0; i < sourceLines.length; i++) { | 2296 for (var i = 0; i < sourceLines.length; i++) { |
| 2299 lines.add(new ScriptLine(this, i + lineOffset + 1, sourceLines[i])); | 2297 lines.add(new ScriptLine(this, i + lineOffset + 1, sourceLines[i])); |
| 2300 } | 2298 } |
| 2301 for (var bpt in isolate.breakpoints.values) { | 2299 for (var bpt in isolate.breakpoints.values) { |
| 2302 if (bpt.script == this) { | 2300 if (bpt.script == this) { |
| 2303 _addBreakpoint(bpt); | 2301 _addBreakpoint(bpt); |
| 2304 } | 2302 } |
| 2305 } | 2303 } |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2997 var v = list[i]; | 2995 var v = list[i]; |
| 2998 if ((v is ObservableMap) && _isServiceMap(v)) { | 2996 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 2999 list[i] = owner.getFromMap(v); | 2997 list[i] = owner.getFromMap(v); |
| 3000 } else if (v is ObservableList) { | 2998 } else if (v is ObservableList) { |
| 3001 _upgradeObservableList(v, owner); | 2999 _upgradeObservableList(v, owner); |
| 3002 } else if (v is ObservableMap) { | 3000 } else if (v is ObservableMap) { |
| 3003 _upgradeObservableMap(v, owner); | 3001 _upgradeObservableMap(v, owner); |
| 3004 } | 3002 } |
| 3005 } | 3003 } |
| 3006 } | 3004 } |
| OLD | NEW |