Chromium Code Reviews| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 | 82 |
| 83 // Is this an isolate message? | |
|
turnidge
2015/05/04 17:47:12
Not sure that this comment adds, given that none o
Cutch
2015/05/04 19:56:51
Done.
| |
| 84 bool get isIsolateMessage => type == 'IsolateMessage'; | |
| 85 | |
| 83 // Kinds of Instance. | 86 // Kinds of Instance. |
| 84 bool get isMirrorReference => vmType == 'MirrorReference'; | 87 bool get isMirrorReference => vmType == 'MirrorReference'; |
| 85 bool get isWeakProperty => vmType == 'WeakProperty'; | 88 bool get isWeakProperty => vmType == 'WeakProperty'; |
| 86 bool get isClosure => false; | 89 bool get isClosure => false; |
| 87 bool get isPlainInstance { | 90 bool get isPlainInstance { |
| 88 return (type == 'Instance' && | 91 return (type == 'Instance' && |
| 89 !isMirrorReference && !isWeakProperty && !isClosure); | 92 !isMirrorReference && !isWeakProperty && !isClosure); |
| 90 } | 93 } |
| 91 | 94 |
| 92 /// Has this object been fully loaded? | 95 /// Has this object been fully loaded? |
| (...skipping 2109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2202 void _update(ObservableMap map, bool mapIsRef) { | 2205 void _update(ObservableMap map, bool mapIsRef) { |
| 2203 _upgradeCollection(map, isolate); | 2206 _upgradeCollection(map, isolate); |
| 2204 kind = map['kind']; | 2207 kind = map['kind']; |
| 2205 _url = map['name']; | 2208 _url = map['name']; |
| 2206 _shortUrl = _url.substring(_url.lastIndexOf('/') + 1); | 2209 _shortUrl = _url.substring(_url.lastIndexOf('/') + 1); |
| 2207 name = _shortUrl; | 2210 name = _shortUrl; |
| 2208 vmName = _url; | 2211 vmName = _url; |
| 2209 if (mapIsRef) { | 2212 if (mapIsRef) { |
| 2210 return; | 2213 return; |
| 2211 } | 2214 } |
| 2215 _loaded = true; | |
| 2212 lineOffset = map['lineOffset']; | 2216 lineOffset = map['lineOffset']; |
| 2213 columnOffset = map['columnOffset']; | 2217 columnOffset = map['columnOffset']; |
| 2214 _parseTokenPosTable(map['tokenPosTable']); | 2218 _parseTokenPosTable(map['tokenPosTable']); |
| 2215 _processSource(map['source']); | 2219 _processSource(map['source']); |
| 2216 library = map['library']; | 2220 library = map['library']; |
| 2217 } | 2221 } |
| 2218 | 2222 |
| 2219 void _parseTokenPosTable(List<List<int>> table) { | 2223 void _parseTokenPosTable(List<List<int>> table) { |
| 2220 if (table == null) { | 2224 if (table == null) { |
| 2221 return; | 2225 return; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2275 } | 2279 } |
| 2276 | 2280 |
| 2277 mergedCallSites.addAll(callSites); | 2281 mergedCallSites.addAll(callSites); |
| 2278 callSites = mergedCallSites; | 2282 callSites = mergedCallSites; |
| 2279 _applyHitsToLines(); | 2283 _applyHitsToLines(); |
| 2280 // Notify any Observers that this Script's state has changed. | 2284 // Notify any Observers that this Script's state has changed. |
| 2281 notifyChange(null); | 2285 notifyChange(null); |
| 2282 } | 2286 } |
| 2283 | 2287 |
| 2284 void _processSource(String source) { | 2288 void _processSource(String source) { |
| 2285 // Preemptyively mark that this is not loaded. | |
| 2286 _loaded = false; | |
| 2287 if (source == null) { | 2289 if (source == null) { |
| 2288 return; | 2290 return; |
| 2289 } | 2291 } |
| 2290 var sourceLines = source.split('\n'); | 2292 var sourceLines = source.split('\n'); |
| 2291 if (sourceLines.length == 0) { | 2293 if (sourceLines.length == 0) { |
| 2292 return; | 2294 return; |
| 2293 } | 2295 } |
| 2294 // We have the source to the script. This is now loaded. | |
| 2295 _loaded = true; | |
| 2296 lines.clear(); | 2296 lines.clear(); |
| 2297 Logger.root.info('Adding ${sourceLines.length} source lines for ${_url}'); | 2297 Logger.root.info('Adding ${sourceLines.length} source lines for ${_url}'); |
| 2298 for (var i = 0; i < sourceLines.length; i++) { | 2298 for (var i = 0; i < sourceLines.length; i++) { |
| 2299 lines.add(new ScriptLine(this, i + lineOffset + 1, sourceLines[i])); | 2299 lines.add(new ScriptLine(this, i + lineOffset + 1, sourceLines[i])); |
| 2300 } | 2300 } |
| 2301 for (var bpt in isolate.breakpoints.values) { | 2301 for (var bpt in isolate.breakpoints.values) { |
| 2302 if (bpt.script == this) { | 2302 if (bpt.script == this) { |
| 2303 _addBreakpoint(bpt); | 2303 _addBreakpoint(bpt); |
| 2304 } | 2304 } |
| 2305 } | 2305 } |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2997 var v = list[i]; | 2997 var v = list[i]; |
| 2998 if ((v is ObservableMap) && _isServiceMap(v)) { | 2998 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 2999 list[i] = owner.getFromMap(v); | 2999 list[i] = owner.getFromMap(v); |
| 3000 } else if (v is ObservableList) { | 3000 } else if (v is ObservableList) { |
| 3001 _upgradeObservableList(v, owner); | 3001 _upgradeObservableList(v, owner); |
| 3002 } else if (v is ObservableMap) { | 3002 } else if (v is ObservableMap) { |
| 3003 _upgradeObservableMap(v, owner); | 3003 _upgradeObservableMap(v, owner); |
| 3004 } | 3004 } |
| 3005 } | 3005 } |
| 3006 } | 3006 } |
| OLD | NEW |