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

Unified Diff: pkg/front_end/lib/src/incremental/file_state.dart

Issue 2980523003: Use precomputed uriBytes while computing cycle signature. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/front_end/lib/src/incremental_kernel_generator_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/incremental/file_state.dart
diff --git a/pkg/front_end/lib/src/incremental/file_state.dart b/pkg/front_end/lib/src/incremental/file_state.dart
index 27519429b9cdec9baac03341800fad37ca8b796d..aefb905a99092972f89336a938b24d4b98b24409 100644
--- a/pkg/front_end/lib/src/incremental/file_state.dart
+++ b/pkg/front_end/lib/src/incremental/file_state.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import 'dart:async';
+import 'dart:convert';
import 'dart:typed_data';
import 'package:convert/convert.dart';
@@ -33,6 +34,9 @@ class FileState {
/// The absolute URI of the file.
final Uri uri;
+ /// The UTF8 bytes of the [uri].
+ final List<int> uriBytes;
+
/// The resolved URI of the file in the file system.
final Uri fileUri;
@@ -55,7 +59,8 @@ class FileState {
/// and set back to `false` for survived instances.
bool _gcMarked = false;
- FileState._(this._fsState, this.uri, this.fileUri);
+ FileState._(this._fsState, this.uri, this.fileUri)
+ : uriBytes = UTF8.encode(uri.toString());
/// The MD5 signature of the file API as a byte array.
/// It depends on all non-comment tokens outside the block bodies.
@@ -108,7 +113,7 @@ class FileState {
/// directly or indirectly referenced files.
Set<FileState> get transitiveFiles {
if (_transitiveFiles == null) {
- _transitiveFiles = new Set<FileState>();
+ _transitiveFiles = new Set<FileState>.identity();
void appendReferenced(FileState file) {
if (_transitiveFiles.add(file)) {
« no previous file with comments | « no previous file | pkg/front_end/lib/src/incremental_kernel_generator_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698