| 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.native_data_test; | 5 library dart2js.serialization.native_data_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/common/names.dart'; | 9 import 'package:compiler/src/common/names.dart'; |
| 10 import 'package:compiler/src/commandline_options.dart'; | 10 import 'package:compiler/src/commandline_options.dart'; |
| 11 import 'package:compiler/src/compiler.dart'; | 11 import 'package:compiler/src/compiler.dart'; |
| 12 import 'package:compiler/src/js_backend/js_backend.dart'; | |
| 13 import 'package:compiler/src/js_backend/native_data.dart'; | 12 import 'package:compiler/src/js_backend/native_data.dart'; |
| 14 import 'package:compiler/src/filenames.dart'; | 13 import 'package:compiler/src/filenames.dart'; |
| 15 import 'package:compiler/src/serialization/equivalence.dart'; | 14 import 'package:compiler/src/serialization/equivalence.dart'; |
| 16 import 'package:compiler/src/world.dart'; | 15 import 'package:compiler/src/world.dart'; |
| 17 import '../equivalence/check_helpers.dart'; | 16 import '../equivalence/check_helpers.dart'; |
| 18 import '../memory_compiler.dart'; | 17 import '../memory_compiler.dart'; |
| 19 import 'helper.dart'; | 18 import 'helper.dart'; |
| 20 | 19 |
| 21 main(List<String> args) { | 20 main(List<String> args) { |
| 22 asyncTest(() async { | 21 asyncTest(() async { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 45 print('------------------------------------------------------------------'); | 44 print('------------------------------------------------------------------'); |
| 46 Compiler compiler2 = compilerFor( | 45 Compiler compiler2 = compilerFor( |
| 47 memorySourceFiles: serializedData.toMemorySourceFiles(), | 46 memorySourceFiles: serializedData.toMemorySourceFiles(), |
| 48 resolutionInputs: serializedData.toUris(), | 47 resolutionInputs: serializedData.toUris(), |
| 49 options: [Flags.analyzeAll]); | 48 options: [Flags.analyzeAll]); |
| 50 await compiler2.run(uri); | 49 await compiler2.run(uri); |
| 51 var elementEnvironment2 = compiler2.frontendStrategy.elementEnvironment; | 50 var elementEnvironment2 = compiler2.frontendStrategy.elementEnvironment; |
| 52 ClosedWorld closedWorld2 = | 51 ClosedWorld closedWorld2 = |
| 53 compiler2.closeResolution(elementEnvironment2.mainFunction).closedWorld; | 52 compiler2.closeResolution(elementEnvironment2.mainFunction).closedWorld; |
| 54 | 53 |
| 55 JavaScriptBackend backend1 = compiler1.backend; | 54 NativeBasicDataImpl nativeBasicData1 = |
| 56 JavaScriptBackend backend2 = compiler2.backend; | 55 compiler1.frontendStrategy.nativeBasicData; |
| 57 NativeBasicDataImpl nativeBasicData1 = backend1.nativeBasicData; | 56 NativeBasicDataImpl nativeBasicData2 = |
| 58 NativeBasicDataImpl nativeBasicData2 = backend2.nativeBasicData; | 57 compiler2.frontendStrategy.nativeBasicData; |
| 59 NativeDataImpl nativeData1 = closedWorld1.nativeData; | 58 NativeDataImpl nativeData1 = closedWorld1.nativeData; |
| 60 NativeDataImpl nativeData2 = closedWorld2.nativeData; | 59 NativeDataImpl nativeData2 = closedWorld2.nativeData; |
| 61 | 60 |
| 62 checkMaps( | 61 checkMaps( |
| 63 nativeData1.jsInteropLibraryNames, | 62 nativeData1.jsInteropLibraryNames, |
| 64 nativeData2.jsInteropLibraryNames, | 63 nativeData2.jsInteropLibraryNames, |
| 65 "NativeData.jsInteropLibraryNames", | 64 "NativeData.jsInteropLibraryNames", |
| 66 areElementsEquivalent, | 65 areElementsEquivalent, |
| 67 equality, | 66 equality, |
| 68 verbose: verbose); | 67 verbose: verbose); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 verbose: verbose); | 103 verbose: verbose); |
| 105 | 104 |
| 106 checkMaps( | 105 checkMaps( |
| 107 nativeData1.nativeFieldStoreBehavior, | 106 nativeData1.nativeFieldStoreBehavior, |
| 108 nativeData2.nativeFieldStoreBehavior, | 107 nativeData2.nativeFieldStoreBehavior, |
| 109 "NativeData.nativeFieldStoreBehavior", | 108 "NativeData.nativeFieldStoreBehavior", |
| 110 areElementsEquivalent, | 109 areElementsEquivalent, |
| 111 testNativeBehavior, | 110 testNativeBehavior, |
| 112 verbose: verbose); | 111 verbose: verbose); |
| 113 } | 112 } |
| OLD | NEW |