| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:io'; | 5 import 'dart:io'; |
| 6 import 'package:async_helper/async_helper.dart'; | 6 import 'package:async_helper/async_helper.dart'; |
| 7 import 'package:compiler/src/commandline_options.dart'; |
| 7 import 'package:compiler/src/common.dart'; | 8 import 'package:compiler/src/common.dart'; |
| 8 import 'package:compiler/src/compiler.dart'; | 9 import 'package:compiler/src/compiler.dart'; |
| 9 import 'package:compiler/src/diagnostics/diagnostic_listener.dart'; | 10 import 'package:compiler/src/diagnostics/diagnostic_listener.dart'; |
| 10 import 'package:compiler/src/elements/elements.dart'; | 11 import 'package:compiler/src/elements/elements.dart'; |
| 11 import 'package:compiler/src/elements/entities.dart'; | 12 import 'package:compiler/src/elements/entities.dart'; |
| 12 import 'package:compiler/src/kernel/element_map.dart'; | 13 import 'package:compiler/src/kernel/element_map.dart'; |
| 13 import 'package:compiler/src/kernel/kernel_backend_strategy.dart'; | 14 import 'package:compiler/src/kernel/kernel_backend_strategy.dart'; |
| 14 import 'package:compiler/src/resolution/access_semantics.dart'; | 15 import 'package:compiler/src/resolution/access_semantics.dart'; |
| 15 import 'package:compiler/src/resolution/send_structure.dart'; | 16 import 'package:compiler/src/resolution/send_structure.dart'; |
| 16 import 'package:compiler/src/tree/nodes.dart' as ast; | 17 import 'package:compiler/src/tree/nodes.dart' as ast; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 27 | 28 |
| 28 main() { | 29 main() { |
| 29 asyncTest(() async { | 30 asyncTest(() async { |
| 30 for (String path in dataDirectories) { | 31 for (String path in dataDirectories) { |
| 31 Directory dataDir = new Directory.fromUri(Platform.script.resolve(path)); | 32 Directory dataDir = new Directory.fromUri(Platform.script.resolve(path)); |
| 32 await for (FileSystemEntity entity in dataDir.list()) { | 33 await for (FileSystemEntity entity in dataDir.list()) { |
| 33 print('Checking ${entity.uri}'); | 34 print('Checking ${entity.uri}'); |
| 34 String annotatedCode = | 35 String annotatedCode = |
| 35 await new File.fromUri(entity.uri).readAsString(); | 36 await new File.fromUri(entity.uri).readAsString(); |
| 36 IdData data1 = await computeData( | 37 IdData data1 = await computeData( |
| 37 annotatedCode, computeAstMemberData, compileFromSource); | 38 annotatedCode, computeAstMemberData, compileFromSource, |
| 39 options: [Flags.disableTypeInference]); |
| 38 IdData data2 = await computeData( | 40 IdData data2 = await computeData( |
| 39 annotatedCode, computeIrMemberData, compileFromDill); | 41 annotatedCode, computeIrMemberData, compileFromDill, |
| 42 options: [Flags.disableTypeInference]); |
| 40 data1.actualMap.forEach((Id id, ActualData actualData1) { | 43 data1.actualMap.forEach((Id id, ActualData actualData1) { |
| 41 String value1 = actualData1.value; | 44 String value1 = actualData1.value; |
| 42 String value2 = data2.actualMap[id]?.value; | 45 String value2 = data2.actualMap[id]?.value; |
| 43 if (value1 != value2) { | 46 if (value1 != value2) { |
| 44 reportHere(data1.compiler.reporter, actualData1.sourceSpan, | 47 reportHere(data1.compiler.reporter, actualData1.sourceSpan, |
| 45 '$id: from source:${value1},from dill:${value2}'); | 48 '$id: from source:${value1},from dill:${value2}'); |
| 46 print('--annotations diff----------------------------------------'); | 49 print('--annotations diff----------------------------------------'); |
| 47 print(data1.computeDiffCodeFor(data2)); | 50 print(data1.computeDiffCodeFor(data2)); |
| 48 print('----------------------------------------------------------'); | 51 print('----------------------------------------------------------'); |
| 49 } | 52 } |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 return gotoName; | 223 return gotoName; |
| 221 } | 224 } |
| 222 return '<unknown:$node (${node.runtimeType})>'; | 225 return '<unknown:$node (${node.runtimeType})>'; |
| 223 } | 226 } |
| 224 | 227 |
| 225 @override | 228 @override |
| 226 String computeMemberValue(ir.Member member) { | 229 String computeMemberValue(ir.Member member) { |
| 227 return computeMemberName(member.enclosingClass?.name, member.name.name); | 230 return computeMemberName(member.enclosingClass?.name, member.name.name); |
| 228 } | 231 } |
| 229 } | 232 } |
| OLD | NEW |