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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/builder.dart

Issue 25478009: Handle compile-time constness for conditionals and type literal calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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: sdk/lib/_internal/compiler/implementation/ssa/builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index 37585d821ce07f8d0520502623d728bbfa8b51b8..70713dad882d0a1001d0ca5d9df52d3f68575730 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -3675,7 +3675,13 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
Element element = elements[node];
if (element.isClass() || element.isTypedef()) {
// TODO(karlklose): add type representation
- stack.add(addConstant(node));
+ if (node.isCall) {
+ // The node itself is not a constant but we register the selector (the
+ // identifier that refers to the class/typedef) as a constant.
+ stack.add(addConstant(node.selector));
+ } else {
+ stack.add(addConstant(node));
+ }
} else if (element.isTypeVariable()) {
HInstruction value =
addTypeVariableReference(element.computeType(compiler));

Powered by Google App Engine
This is Rietveld 408576698