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

Unified Diff: pkg/compiler/lib/src/compile_time_constants.dart

Issue 1955403002: Skip spurious constants in deferred computation. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/constants/expressions.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compile_time_constants.dart
diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
index 629d4570d32ab647f50078a36a7ec727c05da9b5..724e6f669eca41b3b3742ed62d178f622b6ba15a 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -29,6 +29,9 @@ abstract class ConstantEnvironment {
/// The [ConstantSystem] used by this environment.
ConstantSystem get constantSystem;
+ /// Returns `true` if a value has been computed for [expression].
+ bool hasConstantValue(ConstantExpression expression);
+
/// Returns the constant value computed for [expression].
// TODO(johnniwinther): Support directly evaluation of [expression].
ConstantValue getConstantValue(ConstantExpression expression);
@@ -287,6 +290,10 @@ abstract class ConstantCompilerBase implements ConstantCompiler {
return null;
}
+ bool hasConstantValue(ConstantExpression expression) {
+ return constantValueMap.containsKey(expression);
+ }
+
ConstantValue getConstantValue(ConstantExpression expression) {
return constantValueMap[expression];
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/constants/expressions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698