| 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] is an object known to the VM service and is tied | 7 /// A [ServiceObject] is an object known to the VM service and is tied |
| 8 /// to an owning [Isolate]. | 8 /// to an owning [Isolate]. |
| 9 abstract class ServiceObject extends Observable { | 9 abstract class ServiceObject extends Observable { |
| 10 static int LexicalSortName(ServiceObject o1, ServiceObject o2) { | 10 static int LexicalSortName(ServiceObject o1, ServiceObject o2) { |
| (...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 | 1238 |
| 1239 Script._empty(ServiceObjectOwner owner) : super._empty(owner); | 1239 Script._empty(ServiceObjectOwner owner) : super._empty(owner); |
| 1240 | 1240 |
| 1241 ScriptLine getLine(int line) { | 1241 ScriptLine getLine(int line) { |
| 1242 assert(line >= 1); | 1242 assert(line >= 1); |
| 1243 return lines[line - 1]; | 1243 return lines[line - 1]; |
| 1244 } | 1244 } |
| 1245 | 1245 |
| 1246 /// This function maps a token position to a line number. | 1246 /// This function maps a token position to a line number. |
| 1247 int tokenToLine(int token) => _tokenToLine[token]; | 1247 int tokenToLine(int token) => _tokenToLine[token]; |
| 1248 Map _tokenToLine; | 1248 Map _tokenToLine = {}; |
| 1249 | 1249 |
| 1250 /// This function maps a token position to a column number. | 1250 /// This function maps a token position to a column number. |
| 1251 int tokenToCol(int token) => _tokenToCol[token]; | 1251 int tokenToCol(int token) => _tokenToCol[token]; |
| 1252 Map _tokenToCol; | 1252 Map _tokenToCol = {}; |
| 1253 | 1253 |
| 1254 void _update(ObservableMap map, bool mapIsRef) { | 1254 void _update(ObservableMap map, bool mapIsRef) { |
| 1255 kind = map['kind']; | 1255 kind = map['kind']; |
| 1256 _url = map['name']; | 1256 _url = map['name']; |
| 1257 _shortUrl = _url.substring(_url.lastIndexOf('/') + 1); | 1257 _shortUrl = _url.substring(_url.lastIndexOf('/') + 1); |
| 1258 name = _shortUrl; | 1258 name = _shortUrl; |
| 1259 vmName = _url; | 1259 vmName = _url; |
| 1260 _processSource(map['source']); | 1260 _processSource(map['source']); |
| 1261 _parseTokenPosTable(map['tokenPosTable']); | 1261 _parseTokenPosTable(map['tokenPosTable']); |
| 1262 } | 1262 } |
| 1263 | 1263 |
| 1264 void _parseTokenPosTable(List<List<int>> table) { | 1264 void _parseTokenPosTable(List<List<int>> table) { |
| 1265 if (table == null) { | 1265 if (table == null) { |
| 1266 return; | 1266 return; |
| 1267 } | 1267 } |
| 1268 _tokenToLine = {}; | 1268 _tokenToLine.clear(); |
| 1269 _tokenToCol = {}; | 1269 _tokenToCol.clear(); |
| 1270 firstTokenPos = null; | 1270 firstTokenPos = null; |
| 1271 lastTokenPos = null; | 1271 lastTokenPos = null; |
| 1272 for (var line in table) { | 1272 for (var line in table) { |
| 1273 // Each entry begins with a line number... | 1273 // Each entry begins with a line number... |
| 1274 var lineNumber = line[0]; | 1274 var lineNumber = line[0]; |
| 1275 for (var pos = 1; pos < line.length; pos += 2) { | 1275 for (var pos = 1; pos < line.length; pos += 2) { |
| 1276 // ...and is followed by (token offset, col number) pairs. | 1276 // ...and is followed by (token offset, col number) pairs. |
| 1277 var tokenOffset = line[pos]; | 1277 var tokenOffset = line[pos]; |
| 1278 var colNumber = line[pos+1]; | 1278 var colNumber = line[pos+1]; |
| 1279 if (firstTokenPos == null) { | 1279 if (firstTokenPos == null) { |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1916 var v = list[i]; | 1916 var v = list[i]; |
| 1917 if ((v is ObservableMap) && _isServiceMap(v)) { | 1917 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 1918 list[i] = owner.getFromMap(v); | 1918 list[i] = owner.getFromMap(v); |
| 1919 } else if (v is ObservableList) { | 1919 } else if (v is ObservableList) { |
| 1920 _upgradeObservableList(v, owner); | 1920 _upgradeObservableList(v, owner); |
| 1921 } else if (v is ObservableMap) { | 1921 } else if (v is ObservableMap) { |
| 1922 _upgradeObservableMap(v, owner); | 1922 _upgradeObservableMap(v, owner); |
| 1923 } | 1923 } |
| 1924 } | 1924 } |
| 1925 } | 1925 } |
| OLD | NEW |