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

Unified Diff: frog/leg/ssa/builder.dart

Issue 9703074: Call the compile-time constant handler inside bodies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 8 years, 9 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 | « frog/leg/compile_time_constants.dart ('k') | tests/co19/co19-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/ssa/builder.dart
diff --git a/frog/leg/ssa/builder.dart b/frog/leg/ssa/builder.dart
index 478124917ba365f509fcb27d4631c4aa2e9e90ce..e3dc5f09adca0c23c118b6a5ea80959012ba80b7 100644
--- a/frog/leg/ssa/builder.dart
+++ b/frog/leg/ssa/builder.dart
@@ -1983,7 +1983,15 @@ class SsaBuilder implements Visitor {
}
}
- visitNewExpression(NewExpression node) => visitSend(node.send);
+ visitNewExpression(NewExpression node) {
+ if (node.isConst()) {
+ ConstantHandler handler = compiler.constantHandler;
+ Constant constant = handler.compileNodeWithDefinitions(node, elements);
+ stack.add(graph.addConstant(constant));
+ } else {
+ visitSend(node.send);
+ }
+ }
visitSendSet(SendSet node) {
Operator op = node.assignmentOperator;
« no previous file with comments | « frog/leg/compile_time_constants.dart ('k') | tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698