Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: tests/compiler/dart2js/serialization_helper.dart

Issue 1902363002: Derive source information from ResolvedAst. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/compiler/dart2js/serialization_compilation_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_helper; 5 library dart2js.serialization_helper;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:compiler/src/commandline_options.dart'; 10 import 'package:compiler/src/commandline_options.dart';
11 import 'package:compiler/src/common.dart'; 11 import 'package:compiler/src/common.dart';
12 import 'package:compiler/src/common/backend_api.dart'; 12 import 'package:compiler/src/common/backend_api.dart';
13 import 'package:compiler/src/common/names.dart'; 13 import 'package:compiler/src/common/names.dart';
14 import 'package:compiler/src/common/resolution.dart'; 14 import 'package:compiler/src/common/resolution.dart';
15 import 'package:compiler/src/compiler.dart'; 15 import 'package:compiler/src/compiler.dart';
16 import 'package:compiler/src/elements/elements.dart'; 16 import 'package:compiler/src/elements/elements.dart';
17 import 'package:compiler/src/io/source_file.dart'; 17 import 'package:compiler/src/io/source_file.dart';
18 import 'package:compiler/src/scanner/scanner.dart'; 18 import 'package:compiler/src/scanner/scanner.dart';
19 import 'package:compiler/src/script.dart'; 19 import 'package:compiler/src/script.dart';
20 import 'package:compiler/src/serialization/impact_serialization.dart'; 20 import 'package:compiler/src/serialization/impact_serialization.dart';
21 import 'package:compiler/src/serialization/json_serializer.dart'; 21 import 'package:compiler/src/serialization/json_serializer.dart';
22 import 'package:compiler/src/serialization/modelz.dart';
22 import 'package:compiler/src/serialization/resolved_ast_serialization.dart'; 23 import 'package:compiler/src/serialization/resolved_ast_serialization.dart';
23 import 'package:compiler/src/serialization/serialization.dart'; 24 import 'package:compiler/src/serialization/serialization.dart';
24 import 'package:compiler/src/serialization/task.dart'; 25 import 'package:compiler/src/serialization/task.dart';
25 import 'package:compiler/src/tokens/token.dart'; 26 import 'package:compiler/src/tokens/token.dart';
26 import 'package:compiler/src/universe/call_structure.dart'; 27 import 'package:compiler/src/universe/call_structure.dart';
27 import 'package:compiler/src/universe/world_impact.dart'; 28 import 'package:compiler/src/universe/world_impact.dart';
28 import 'package:compiler/src/universe/use.dart'; 29 import 'package:compiler/src/universe/use.dart';
29 30
30 import 'memory_compiler.dart'; 31 import 'memory_compiler.dart';
31 32
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 190 }
190 191
191 @override 192 @override
192 Future<LibraryElement> readLibrary(Uri resolvedUri) { 193 Future<LibraryElement> readLibrary(Uri resolvedUri) {
193 LibraryElement library = _deserializer.lookupLibrary(resolvedUri); 194 LibraryElement library = _deserializer.lookupLibrary(resolvedUri);
194 if (library != null) { 195 if (library != null) {
195 deserializedLibraries.add(library); 196 deserializedLibraries.add(library);
196 if (_deserializeResolvedAst) { 197 if (_deserializeResolvedAst) {
197 return Future.forEach(library.compilationUnits, 198 return Future.forEach(library.compilationUnits,
198 (CompilationUnitElement compilationUnit) { 199 (CompilationUnitElement compilationUnit) {
199 Script script = compilationUnit.script; 200 ScriptZ script = compilationUnit.script;
200 return _compiler.readScript(script.readableUri) 201 return _compiler.readScript(script.readableUri)
201 .then((Script newScript) { 202 .then((Script newScript) {
203 script.file = newScript.file;
202 _resolvedAstDeserializer.sourceFiles[script.resourceUri] = 204 _resolvedAstDeserializer.sourceFiles[script.resourceUri] =
203 newScript.file; 205 newScript.file;
204 }); 206 });
205 }).then((_) => library); 207 }).then((_) => library);
206 } 208 }
207 } 209 }
208 return new Future<LibraryElement>.value(library); 210 return new Future<LibraryElement>.value(library);
209 } 211 }
210 212
211 @override 213 @override
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 340
339 @override 341 @override
340 void onElement(Element element, ObjectDecoder getDecoder(String tag)) { 342 void onElement(Element element, ObjectDecoder getDecoder(String tag)) {
341 ObjectDecoder decoder = getDecoder(RESOLVED_AST_TAG); 343 ObjectDecoder decoder = getDecoder(RESOLVED_AST_TAG);
342 if (decoder != null) { 344 if (decoder != null) {
343 _decoderMap[element] = decoder; 345 _decoderMap[element] = decoder;
344 } 346 }
345 } 347 }
346 } 348 }
347 349
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/serialization_compilation_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698