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

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

Issue 1927963002: Support compilation of Hello World (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes Created 4 years, 8 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/compiler/lib/src/deferred_load.dart
diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart
index db578393ae246abbb7b22cbb40dfd0d1994d48ec..b5a2cc5bb84fa7ae5bb7b0031636435df6218a2d 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -8,6 +8,10 @@ import 'common/backend_api.dart' show Backend;
import 'common/tasks.dart' show CompilerTask;
import 'common.dart';
import 'compiler.dart' show Compiler;
+import 'constants/expressions.dart'
+ show
+ ConstantExpression,
+ ConstantExpressionKind;
import 'constants/values.dart'
show
ConstantValue,
@@ -334,15 +338,13 @@ class DeferredLoadTask extends CompilerTask {
TreeElements treeElements = analyzableElement.resolvedAst.elements;
assert(treeElements != null);
- treeElements.forEachConstantNode((Node node, _) {
+ treeElements.forEachConstantNode(
+ (Node node, ConstantExpression expression) {
// Explicitly depend on the backend constants.
- ConstantValue value =
- backend.constants.getConstantValueForNode(node, treeElements);
- if (value != null) {
- // TODO(johnniwinther): Assert that all constants have values when
- // these are directly evaluated.
- constants.add(value);
- }
+ ConstantValue value = backend.constants.getConstantValue(expression);
+ assert(invariant(node, value != null,
+ message: "No constant value for ${expression.toStructuredText()}."));
+ constants.add(value);
});
}
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698