| 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_impact_test; | 5 library dart2js.serialization_impact_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
| 9 import 'package:compiler/src/commandline_options.dart'; | 9 import 'package:compiler/src/commandline_options.dart'; |
| 10 import 'package:compiler/src/common/resolution.dart'; | |
| 11 import 'package:compiler/src/compiler.dart'; | 10 import 'package:compiler/src/compiler.dart'; |
| 12 import 'package:compiler/src/elements/elements.dart'; | |
| 13 import 'package:compiler/src/filenames.dart'; | 11 import 'package:compiler/src/filenames.dart'; |
| 14 import 'package:compiler/src/serialization/equivalence.dart'; | |
| 15 import '../memory_compiler.dart'; | 12 import '../memory_compiler.dart'; |
| 16 import 'helper.dart'; | 13 import 'helper.dart'; |
| 17 import 'test_helper.dart'; | 14 import 'test_helper.dart'; |
| 18 | 15 |
| 19 main(List<String> args) { | 16 main(List<String> args) { |
| 20 Arguments arguments = new Arguments.from(args); | 17 Arguments arguments = new Arguments.from(args); |
| 21 asyncTest(() async { | 18 asyncTest(() async { |
| 22 String serializedData = await serializeDartCore(arguments: arguments); | 19 String serializedData = await serializeDartCore(arguments: arguments); |
| 23 if (arguments.filename != null) { | 20 if (arguments.filename != null) { |
| 24 Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename)); | 21 Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename)); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 41 Compiler compilerNormal = compilerFor( | 38 Compiler compilerNormal = compilerFor( |
| 42 memorySourceFiles: sourceFiles, | 39 memorySourceFiles: sourceFiles, |
| 43 options: [Flags.analyzeAll]); | 40 options: [Flags.analyzeAll]); |
| 44 compilerNormal.resolution.retainCachesForTesting = true; | 41 compilerNormal.resolution.retainCachesForTesting = true; |
| 45 await compilerNormal.run(entryPoint); | 42 await compilerNormal.run(entryPoint); |
| 46 | 43 |
| 47 Compiler compilerDeserialized = compilerFor( | 44 Compiler compilerDeserialized = compilerFor( |
| 48 memorySourceFiles: sourceFiles, | 45 memorySourceFiles: sourceFiles, |
| 49 options: [Flags.analyzeAll]); | 46 options: [Flags.analyzeAll]); |
| 50 compilerDeserialized.resolution.retainCachesForTesting = true; | 47 compilerDeserialized.resolution.retainCachesForTesting = true; |
| 51 deserialize(compilerDeserialized, serializedData); | 48 compilerDeserialized.serialization.deserializeFromText(serializedData); |
| 52 await compilerDeserialized.run(entryPoint); | 49 await compilerDeserialized.run(entryPoint); |
| 53 | 50 |
| 54 checkAllImpacts(compilerNormal, compilerDeserialized, verbose: verbose); | 51 checkAllImpacts(compilerNormal, compilerDeserialized, verbose: verbose); |
| 55 } | 52 } |
| OLD | NEW |