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

Side by Side Diff: pkg/kernel/test/reify/suite.dart

Issue 2918593003: Pass ClassHierarchy instead of creating it. (Closed)
Patch Set: Created 3 years, 6 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
OLDNEW
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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 library test.kernel.reify.suite; 5 library test.kernel.reify.suite;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import 'dart:io' show Directory, File, Platform; 9 import 'dart:io' show Directory, File, Platform;
10 10
11 import 'package:analyzer/src/generated/sdk.dart' show DartSdk; 11 import 'package:analyzer/src/generated/sdk.dart' show DartSdk;
12 12
13 import 'package:analyzer/src/kernel/loader.dart' 13 import 'package:analyzer/src/kernel/loader.dart'
14 show DartLoader, DartOptions, createDartSdk; 14 show DartLoader, DartOptions, createDartSdk;
15 15
16 import 'package:kernel/class_hierarchy.dart' show ClosedWorldClassHierarchy;
17
16 import 'package:kernel/core_types.dart' show CoreTypes; 18 import 'package:kernel/core_types.dart' show CoreTypes;
17 19
18 import 'package:kernel/target/targets.dart' show Target, TargetFlags, getTarget; 20 import 'package:kernel/target/targets.dart' show Target, TargetFlags, getTarget;
19 21
20 import 'package:kernel/target/vmcc.dart' show VmClosureConvertedTarget; 22 import 'package:kernel/target/vmcc.dart' show VmClosureConvertedTarget;
21 23
22 import 'kernel_chain.dart' 24 import 'kernel_chain.dart'
23 show MatchExpectation, Print, ReadDill, SanityCheck, WriteDill; 25 show MatchExpectation, Print, ReadDill, SanityCheck, WriteDill;
24 26
25 import 'package:testing/testing.dart' 27 import 'package:testing/testing.dart'
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 kernelRuntime: Platform.script.resolve("../../runtime/"))); 189 kernelRuntime: Platform.script.resolve("../../runtime/")));
188 190
189 String path = description.file.path; 191 String path = description.file.path;
190 Uri uri = Uri.base.resolve(path); 192 Uri uri = Uri.base.resolve(path);
191 loader.loadProgram(uri, target: target); 193 loader.loadProgram(uri, target: target);
192 var program = loader.program; 194 var program = loader.program;
193 for (var error in loader.errors) { 195 for (var error in loader.errors) {
194 return fail(program, "$error"); 196 return fail(program, "$error");
195 } 197 }
196 var coreTypes = new CoreTypes(program); 198 var coreTypes = new CoreTypes(program);
199 var hierarchy = new ClosedWorldClassHierarchy(program);
197 target 200 target
198 ..performModularTransformations(coreTypes, program) 201 ..performModularTransformations(coreTypes, hierarchy, program)
199 ..performGlobalTransformations(coreTypes, program); 202 ..performGlobalTransformations(coreTypes, program);
200 return pass(program); 203 return pass(program);
201 } catch (e, s) { 204 } catch (e, s) {
202 return crash(e, s); 205 return crash(e, s);
203 } 206 }
204 } 207 }
205 } 208 }
206 209
207 class GenericTypesReification extends Step<Program, Program, TestContext> { 210 class GenericTypesReification extends Step<Program, Program, TestContext> {
208 const GenericTypesReification(); 211 const GenericTypesReification();
(...skipping 24 matching lines...) Expand all
233 await StdioProcess.run(context.vm.toFilePath(), [generated.path]); 236 await StdioProcess.run(context.vm.toFilePath(), [generated.path]);
234 print(process.output); 237 print(process.output);
235 } finally { 238 } finally {
236 generated.parent.delete(recursive: true); 239 generated.parent.delete(recursive: true);
237 } 240 }
238 return process.toResult(); 241 return process.toResult();
239 } 242 }
240 } 243 }
241 244
242 main(List<String> arguments) => runMe(arguments, createContext, "testing.json"); 245 main(List<String> arguments) => runMe(arguments, createContext, "testing.json");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698