OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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_model_test; | 5 library dart2js.serialization_model_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
11 import 'package:compiler/src/closure.dart'; | 11 import 'package:compiler/src/closure.dart'; |
12 import 'package:compiler/src/commandline_options.dart'; | 12 import 'package:compiler/src/commandline_options.dart'; |
13 import 'package:compiler/src/common/backend_api.dart'; | 13 import 'package:compiler/src/common/backend_api.dart'; |
14 import 'package:compiler/src/common/names.dart'; | 14 import 'package:compiler/src/common/names.dart'; |
15 import 'package:compiler/src/common/resolution.dart'; | 15 import 'package:compiler/src/common/resolution.dart'; |
16 import 'package:compiler/src/compiler.dart'; | 16 import 'package:compiler/src/compiler.dart'; |
17 import 'package:compiler/src/dart_types.dart'; | 17 import 'package:compiler/src/dart_types.dart'; |
18 import 'package:compiler/src/elements/elements.dart'; | 18 import 'package:compiler/src/elements/elements.dart'; |
19 import 'package:compiler/src/filenames.dart'; | 19 import 'package:compiler/src/filenames.dart'; |
20 import 'package:compiler/src/serialization/element_serialization.dart'; | 20 import 'package:compiler/src/serialization/element_serialization.dart'; |
21 import 'package:compiler/src/serialization/impact_serialization.dart'; | 21 import 'package:compiler/src/serialization/impact_serialization.dart'; |
22 import 'package:compiler/src/serialization/json_serializer.dart'; | 22 import 'package:compiler/src/serialization/json_serializer.dart'; |
23 import 'package:compiler/src/serialization/serialization.dart'; | 23 import 'package:compiler/src/serialization/serialization.dart'; |
24 import 'package:compiler/src/serialization/equivalence.dart'; | 24 import 'package:compiler/src/serialization/equivalence.dart'; |
| 25 import 'package:compiler/src/serialization/system.dart'; |
25 import 'package:compiler/src/serialization/task.dart'; | 26 import 'package:compiler/src/serialization/task.dart'; |
26 import 'package:compiler/src/tree/nodes.dart'; | 27 import 'package:compiler/src/tree/nodes.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/class_set.dart'; | 29 import 'package:compiler/src/universe/class_set.dart'; |
29 import 'package:compiler/src/universe/use.dart'; | 30 import 'package:compiler/src/universe/use.dart'; |
30 import '../memory_compiler.dart'; | 31 import '../memory_compiler.dart'; |
31 import 'helper.dart'; | 32 import 'helper.dart'; |
32 import 'test_data.dart'; | 33 import 'test_data.dart'; |
33 import 'test_helper.dart'; | 34 import 'test_helper.dart'; |
34 | 35 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 compilerNormal.world.populate(); | 73 compilerNormal.world.populate(); |
73 compilerNormal.backend.onResolutionComplete(); | 74 compilerNormal.backend.onResolutionComplete(); |
74 | 75 |
75 print('------------------------------------------------------------------'); | 76 print('------------------------------------------------------------------'); |
76 print('compile deserialized'); | 77 print('compile deserialized'); |
77 print('------------------------------------------------------------------'); | 78 print('------------------------------------------------------------------'); |
78 Compiler compilerDeserialized = compilerFor( | 79 Compiler compilerDeserialized = compilerFor( |
79 memorySourceFiles: sourceFiles, | 80 memorySourceFiles: sourceFiles, |
80 options: [Flags.analyzeOnly]); | 81 options: [Flags.analyzeOnly]); |
81 compilerDeserialized.resolution.retainCachesForTesting = true; | 82 compilerDeserialized.resolution.retainCachesForTesting = true; |
82 deserialize(compilerDeserialized, serializedData); | 83 compilerDeserialized.serialization.deserializeFromText(serializedData); |
83 await compilerDeserialized.run(entryPoint); | 84 await compilerDeserialized.run(entryPoint); |
84 compilerDeserialized.phase = Compiler.PHASE_DONE_RESOLVING; | 85 compilerDeserialized.phase = Compiler.PHASE_DONE_RESOLVING; |
85 compilerDeserialized.world.populate(); | 86 compilerDeserialized.world.populate(); |
86 compilerDeserialized.backend.onResolutionComplete(); | 87 compilerDeserialized.backend.onResolutionComplete(); |
87 | 88 |
88 checkAllImpacts( | 89 checkAllImpacts( |
89 compilerNormal, compilerDeserialized, | 90 compilerNormal, compilerDeserialized, |
90 verbose: verbose); | 91 verbose: verbose); |
91 | 92 |
92 checkSets( | 93 checkSets( |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 return true; | 401 return true; |
401 } | 402 } |
402 | 403 |
403 String nodeToString(Node node) { | 404 String nodeToString(Node node) { |
404 String text = '$node'; | 405 String text = '$node'; |
405 if (text.length > 40) { | 406 if (text.length > 40) { |
406 return '(${node.runtimeType}) ${text.substring(0, 37)}...'; | 407 return '(${node.runtimeType}) ${text.substring(0, 37)}...'; |
407 } | 408 } |
408 return '(${node.runtimeType}) $text'; | 409 return '(${node.runtimeType}) $text'; |
409 } | 410 } |
OLD | NEW |