| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library dart2js.serialization_system; | 5 library dart2js.serialization_system; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common/resolution.dart'; | 10 import '../common/resolution.dart'; |
| 11 import '../compiler.dart'; | 11 import '../compiler.dart'; |
| 12 import '../elements/resolution_types.dart'; | 12 import '../elements/resolution_types.dart'; |
| 13 import '../elements/elements.dart'; | 13 import '../elements/elements.dart'; |
| 14 import '../scanner/scanner.dart'; | |
| 15 import '../script.dart'; | 14 import '../script.dart'; |
| 16 import '../serialization/impact_serialization.dart'; | 15 import '../serialization/impact_serialization.dart'; |
| 17 import '../tokens/token.dart'; | 16 import 'package:dart_scanner/dart_scanner.dart'; |
| 18 import '../universe/call_structure.dart'; | 17 import '../universe/call_structure.dart'; |
| 19 import '../universe/use.dart'; | 18 import '../universe/use.dart'; |
| 20 import '../universe/world_impact.dart'; | 19 import '../universe/world_impact.dart'; |
| 21 import 'modelz.dart'; | 20 import 'modelz.dart'; |
| 22 import 'resolved_ast_serialization.dart'; | 21 import 'resolved_ast_serialization.dart'; |
| 23 import 'serialization.dart'; | 22 import 'serialization.dart'; |
| 24 import 'task.dart'; | 23 import 'task.dart'; |
| 25 | 24 |
| 26 class ResolutionDeserializerSystem extends DeserializerSystem { | 25 class ResolutionDeserializerSystem extends DeserializerSystem { |
| 27 final Compiler _compiler; | 26 final Compiler _compiler; |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 } | 307 } |
| 309 | 308 |
| 310 Token findToken(Uri uri, int offset) { | 309 Token findToken(Uri uri, int offset) { |
| 311 Token beginToken = beginTokenMap.putIfAbsent(uri, () { | 310 Token beginToken = beginTokenMap.putIfAbsent(uri, () { |
| 312 Script script = scripts[uri]; | 311 Script script = scripts[uri]; |
| 313 if (script == null) { | 312 if (script == null) { |
| 314 parsingContext.reporter.internalError(NO_LOCATION_SPANNABLE, | 313 parsingContext.reporter.internalError(NO_LOCATION_SPANNABLE, |
| 315 'No source file found for $uri in:\n ${scripts.keys.join('\n ')}'); | 314 'No source file found for $uri in:\n ${scripts.keys.join('\n ')}'); |
| 316 } | 315 } |
| 317 if (script.isSynthesized) return null; | 316 if (script.isSynthesized) return null; |
| 318 return new Scanner(script.file).tokenize(); | 317 return parsingContext.scanner.scanFile(script.file); |
| 319 }); | 318 }); |
| 320 if (beginToken == null) return null; | 319 if (beginToken == null) return null; |
| 321 return ResolvedAstDeserializer.findTokenInStream(beginToken, offset); | 320 return ResolvedAstDeserializer.findTokenInStream(beginToken, offset); |
| 322 } | 321 } |
| 323 | 322 |
| 324 @override | 323 @override |
| 325 void onElement(Element element, ObjectDecoder getDecoder(String tag)) { | 324 void onElement(Element element, ObjectDecoder getDecoder(String tag)) { |
| 326 ObjectDecoder decoder = getDecoder(RESOLVED_AST_TAG); | 325 ObjectDecoder decoder = getDecoder(RESOLVED_AST_TAG); |
| 327 if (decoder != null) { | 326 if (decoder != null) { |
| 328 _decoderMap[element] = decoder; | 327 _decoderMap[element] = decoder; |
| 329 } | 328 } |
| 330 } | 329 } |
| 331 } | 330 } |
| OLD | NEW |