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

Side by Side Diff: pkg/front_end/lib/src/incremental/kernel_driver.dart

Issue 2982093003: Unifying compiler context (Closed)
Patch Set: Created 3 years, 5 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 file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:front_end/file_system.dart'; 7 import 'package:front_end/file_system.dart';
8 import 'package:front_end/compiler_options.dart';
8 import 'package:front_end/src/base/api_signature.dart'; 9 import 'package:front_end/src/base/api_signature.dart';
10 import 'package:front_end/src/base/processed_options.dart';
9 import 'package:front_end/src/base/performace_logger.dart'; 11 import 'package:front_end/src/base/performace_logger.dart';
10 import 'package:front_end/src/fasta/compiler_command_line.dart';
11 import 'package:front_end/src/fasta/compiler_context.dart'; 12 import 'package:front_end/src/fasta/compiler_context.dart';
12 import 'package:front_end/src/fasta/dill/dill_library_builder.dart'; 13 import 'package:front_end/src/fasta/dill/dill_library_builder.dart';
13 import 'package:front_end/src/fasta/dill/dill_target.dart'; 14 import 'package:front_end/src/fasta/dill/dill_target.dart';
14 import 'package:front_end/src/fasta/kernel/kernel_target.dart'; 15 import 'package:front_end/src/fasta/kernel/kernel_target.dart';
15 import 'package:front_end/src/fasta/kernel/utils.dart'; 16 import 'package:front_end/src/fasta/kernel/utils.dart';
16 import 'package:front_end/src/fasta/ticker.dart'; 17 import 'package:front_end/src/fasta/ticker.dart';
17 import 'package:front_end/src/fasta/uri_translator.dart'; 18 import 'package:front_end/src/fasta/uri_translator.dart';
18 import 'package:front_end/src/incremental/byte_store.dart'; 19 import 'package:front_end/src/incremental/byte_store.dart';
19 import 'package:front_end/src/incremental/file_state.dart'; 20 import 'package:front_end/src/incremental/file_state.dart';
20 import 'package:kernel/binary/ast_from_binary.dart'; 21 import 'package:kernel/binary/ast_from_binary.dart';
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 await _compileCycle(nameRoot, dillTarget, cycle); 143 await _compileCycle(nameRoot, dillTarget, cycle);
143 results.add(result); 144 results.add(result);
144 } 145 }
145 }); 146 });
146 147
147 return new KernelResult(nameRoot, results); 148 return new KernelResult(nameRoot, results);
148 }); 149 });
149 } 150 }
150 151
151 Future<T> runWithFrontEndContext<T>(String msg, Future<T> f()) async { 152 Future<T> runWithFrontEndContext<T>(String msg, Future<T> f()) async {
152 return await CompilerCommandLine.withGlobalOptions("", [""], 153 var options = new CompilerOptions()
153 (CompilerContext context) { 154 ..target = _target
154 context.options.options["--target"] = _target; 155 ..reportMessages = false; // ignore errors.
ahe 2017/07/18 16:54:37 Seems like we need a TODO or an explanation why we
Siggi Cherem (dart-lang) 2017/07/18 22:50:44 Done.
155 context.options.options["report"] = (message, severity) {}; 156 return await CompilerContext.runWithOptions(
156 context.options.options["reportWithoutLocation"] = (message, severity) {}; 157 new ProcessedOptions(options), (_) => _logger.runAsync(msg, f));
157 return _logger.runAsync(msg, f);
158 });
159 } 158 }
160 159
161 /// The file with the given [uri] might have changed - updated, added, or 160 /// The file with the given [uri] might have changed - updated, added, or
162 /// removed. Or not, we don't know. Or it might have, but then changed back. 161 /// removed. Or not, we don't know. Or it might have, but then changed back.
163 /// 162 ///
164 /// The [uri] must be absolute and normalized file URI. 163 /// The [uri] must be absolute and normalized file URI.
165 /// 164 ///
166 /// Schedules the file contents for the [uri] to be read into the current 165 /// Schedules the file contents for the [uri] to be read into the current
167 /// file state prior the next invocation of [getKernel] returns the result. 166 /// file state prior the next invocation of [getKernel] returns the result.
168 /// 167 ///
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 368
370 LibraryCycleResult(this.cycle, this.signature, this.kernelLibraries); 369 LibraryCycleResult(this.cycle, this.signature, this.kernelLibraries);
371 } 370 }
372 371
373 @visibleForTesting 372 @visibleForTesting
374 class _TestView { 373 class _TestView {
375 /// The list of [LibraryCycle]s compiled for the last delta. 374 /// The list of [LibraryCycle]s compiled for the last delta.
376 /// It does not include libraries which were read from the cache. 375 /// It does not include libraries which were read from the cache.
377 final List<LibraryCycle> compiledCycles = []; 376 final List<LibraryCycle> compiledCycles = [];
378 } 377 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698