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

Unified Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 10872059: Static and top-level methods can be compile time constants. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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: lib/compiler/implementation/ssa/codegen.dart
===================================================================
--- lib/compiler/implementation/ssa/codegen.dart (revision 11378)
+++ lib/compiler/implementation/ssa/codegen.dart (working copy)
@@ -1683,8 +1683,15 @@
CodeBuffer buffer = new CodeBuffer();
handler.writeConstant(buffer, constant);
push(new js.LiteralString(buffer.toString()));
+ } else if (constant.isFunction()) {
+ FunctionConstant function = constant;
+ world.registerStaticUse(function.element);
+ push(new js.VariableUse(
+ compiler.namer.isolateAccess(function.element)));
} else {
- compiler.internalError("Forgot constant $constant");
+ compiler.internalError(
+ "The compiler does not know how generate code for "
+ "constant $constant");
}
} else {
js.VariableUse currentIsolateUse =

Powered by Google App Engine
This is Rietveld 408576698