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

Unified Diff: pkg/compiler/lib/src/js_backend/constant_handler_javascript.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 | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/serialization/task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart
diff --git a/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart b/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart
index 47fb663270d6d070d9e8d04eec3bb545ca23c081..5aefd3955ad11fa61c66b385af034a094e388201 100644
--- a/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart
+++ b/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart
@@ -26,6 +26,11 @@ class JavaScriptConstantTask extends ConstantCompilerTask {
ConstantSystem get constantSystem => dartConstantCompiler.constantSystem;
@override
+ bool hasConstantValue(ConstantExpression expression) {
+ return dartConstantCompiler.hasConstantValue(expression);
+ }
+
+ @override
ConstantValue getConstantValue(ConstantExpression expression) {
return dartConstantCompiler.getConstantValue(expression);
}
@@ -251,7 +256,9 @@ class JavaScriptConstantCompiler extends ConstantCompilerBase
message: "ConstantExpression is null in getConstantValue."));
// TODO(johhniwinther): ensure expressions have been evaluated at this
// point. This can't be enabled today due to dartbug.com/26406.
-
+ if (compiler.serialization.supportsDeserialization) {
+ evaluate(expression);
+ }
ConstantValue value = super.getConstantValue(expression);
if (value == null &&
expression != null &&
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/serialization/task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698