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

Side by Side Diff: pkg/front_end/lib/src/fasta/dill/dill_target.dart

Issue 2924833002: Pass a Target instance to DillTarget instead of its name (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) 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 fasta.dill_target; 5 library fasta.dill_target;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import 'package:kernel/ast.dart' show Class; 9 import 'package:kernel/ast.dart' show Class;
10 10
11 import 'package:kernel/target/targets.dart' show getTarget, TargetFlags; 11 import 'package:kernel/target/targets.dart' show Target;
12 12
13 import '../errors.dart' show internalError; 13 import '../errors.dart' show internalError;
14 import '../kernel/kernel_builder.dart' show ClassBuilder; 14 import '../kernel/kernel_builder.dart' show ClassBuilder;
15 import '../target_implementation.dart' show TargetImplementation; 15 import '../target_implementation.dart' show TargetImplementation;
16 import '../ticker.dart' show Ticker; 16 import '../ticker.dart' show Ticker;
17 import '../translate_uri.dart' show TranslateUri; 17 import '../translate_uri.dart' show TranslateUri;
18 import 'dill_library_builder.dart' show DillLibraryBuilder; 18 import 'dill_library_builder.dart' show DillLibraryBuilder;
19 import 'dill_loader.dart' show DillLoader; 19 import 'dill_loader.dart' show DillLoader;
20 20
21 class DillTarget extends TargetImplementation { 21 class DillTarget extends TargetImplementation {
22 bool isLoaded = false; 22 bool isLoaded = false;
23 DillLoader loader; 23 DillLoader loader;
24 24
25 DillTarget( 25 DillTarget(Ticker ticker, TranslateUri uriTranslator, Target backendTarget)
26 Ticker ticker, TranslateUri uriTranslator, String backendTargetName, 26 : super(ticker, uriTranslator, backendTarget) {
27 {TargetFlags flags})
28 : super(ticker, uriTranslator,
29 getTarget(backendTargetName, flags ?? new TargetFlags())) {
30 loader = new DillLoader(this); 27 loader = new DillLoader(this);
31 } 28 }
32 29
33 void addSourceInformation( 30 void addSourceInformation(
34 Uri uri, List<int> lineStarts, List<int> sourceCode) { 31 Uri uri, List<int> lineStarts, List<int> sourceCode) {
35 internalError("Unsupported operation."); 32 internalError("Unsupported operation.");
36 } 33 }
37 34
38 void read(Uri uri) { 35 void read(Uri uri) {
39 internalError("Unsupported operation."); 36 internalError("Unsupported operation.");
(...skipping 20 matching lines...) Expand all
60 void addDirectSupertype(ClassBuilder cls, Set<ClassBuilder> set) {} 57 void addDirectSupertype(ClassBuilder cls, Set<ClassBuilder> set) {}
61 58
62 List<ClassBuilder> collectAllClasses() { 59 List<ClassBuilder> collectAllClasses() {
63 return null; 60 return null;
64 } 61 }
65 62
66 void breakCycle(ClassBuilder cls) {} 63 void breakCycle(ClassBuilder cls) {}
67 64
68 Class get objectClass => loader.coreLibrary["Object"].target; 65 Class get objectClass => loader.coreLibrary["Object"].target;
69 } 66 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698