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

Unified Diff: pkg/front_end/lib/src/incremental_kernel_generator_impl.dart

Issue 2864243004: Revert "Start using FileState/FileSystemState to provide consistent view." (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
diff --git a/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart b/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
index 780852dfcb62b80e3885e65c1718588d0996fb9e..9739aa4473dbc6bc7c6ddf15c5d5c9ad2075c9ff 100644
--- a/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
+++ b/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
@@ -12,9 +12,7 @@ import 'package:front_end/src/fasta/dill/dill_target.dart';
import 'package:front_end/src/fasta/kernel/kernel_target.dart';
import 'package:front_end/src/fasta/ticker.dart';
import 'package:front_end/src/fasta/translate_uri.dart';
-import 'package:front_end/src/incremental/file_state.dart';
import 'package:kernel/kernel.dart' hide Source;
-import 'package:kernel/target/vm.dart';
dynamic unimplemented() {
// TODO(paulberry): get rid of this.
@@ -36,16 +34,9 @@ class IncrementalKernelGeneratorImpl implements IncrementalKernelGenerator {
/// etc.
final ProcessedOptions _options;
- /// The set of absolute file URIs that were reported through [invalidate]
- /// and not checked for actual changes yet.
- final Set<Uri> _invalidatedFiles = new Set<Uri>();
-
/// The object that knows how to resolve "package:" and "dart:" URIs.
TranslateUri _uriTranslator;
- /// The current file system state.
- FileSystemState _fsState;
-
/// The cached SDK kernel.
DillTarget _sdkDillTarget;
@@ -54,18 +45,13 @@ class IncrementalKernelGeneratorImpl implements IncrementalKernelGenerator {
@override
Future<DeltaProgram> computeDelta(
{Future<Null> watch(Uri uri, bool used)}) async {
- await _initialize();
- await _ensureVmLibrariesLoaded();
- await _refreshInvalidatedFiles();
-
- // Ensure that the graph starting at the entry point is ready.
- await _fsState.getFile(_entryPoint);
+ _uriTranslator ??= await _options.getUriTranslator();
DillTarget sdkTarget = await _getSdkDillTarget();
// TODO(scheglov) Use it to also serve other package kernels.
- KernelTarget kernelTarget = new KernelTarget(_fsState.fileSystemView,
- sdkTarget, _uriTranslator, _options.strongMode, null);
+ KernelTarget kernelTarget = new KernelTarget(_options.fileSystem, sdkTarget,
+ _uriTranslator, _options.strongMode, null);
kernelTarget.read(_entryPoint);
// TODO(scheglov) Replace with a better API.
@@ -80,25 +66,11 @@ class IncrementalKernelGeneratorImpl implements IncrementalKernelGenerator {
}
@override
- void invalidate(Uri uri) {
- _invalidatedFiles.add(uri);
- }
+ void invalidate(String path) => unimplemented();
@override
void invalidateAll() => unimplemented();
- /// Fasta unconditionally loads all VM libraries. In order to be able to
- /// serve them using the file system view, we need to ask [_fsState] for
- /// the corresponding files.
- Future<Null> _ensureVmLibrariesLoaded() async {
- List<String> extraLibraries = new VmTarget(null).extraRequiredLibraries;
- for (String absoluteUriStr in extraLibraries) {
- Uri absoluteUri = Uri.parse(absoluteUriStr);
- Uri fileUri = _uriTranslator.translate(absoluteUri);
- await _fsState.getFile(fileUri);
- }
- }
-
/// Return the [DillTarget] that is used inside of [KernelTarget] to
/// resynthesize SDK libraries.
Future<DillTarget> _getSdkDillTarget() async {
@@ -114,24 +86,6 @@ class IncrementalKernelGeneratorImpl implements IncrementalKernelGenerator {
}
return _sdkDillTarget;
}
-
- /// Ensure that asynchronous data from options is ready.
- ///
- /// Ideally this data should be prepared in the constructor, but constructors
- /// cannot be asynchronous.
- Future<Null> _initialize() async {
- _uriTranslator ??= await _options.getUriTranslator();
- _fsState ??= new FileSystemState(_options.fileSystem, _uriTranslator);
- }
-
- /// Refresh all the invalidated files and update dependencies.
- Future<Null> _refreshInvalidatedFiles() async {
- for (Uri fileUri in _invalidatedFiles) {
- FileState file = await _fsState.getFile(fileUri);
- await file.refresh();
- }
- _invalidatedFiles.clear();
- }
}
///// Clears canonical names of [NamedNode] references.
« no previous file with comments | « pkg/front_end/lib/src/incremental/file_state.dart ('k') | pkg/front_end/test/incremental_kernel_generator_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698