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

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

Issue 10091036: Don't try to box immutable objects. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Created 8 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
« no previous file with comments | « no previous file | samples/tests/samples/samples-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/closure.dart
diff --git a/lib/compiler/implementation/ssa/closure.dart b/lib/compiler/implementation/ssa/closure.dart
index ab2d6a48c541bdbf94572232acce6b9d99a23635..7d90b58eec68b241cc4e0c75f09aa9b7ac7eaccb 100644
--- a/lib/compiler/implementation/ssa/closure.dart
+++ b/lib/compiler/implementation/ssa/closure.dart
@@ -240,6 +240,8 @@ class ClosureTranslator extends AbstractVisitor {
Element box = null;
Map<Element, Element> scopeMapping = new Map<Element, Element>();
for (Element element in scopeVariables) {
+ // No need to box non-assignable elements.
+ if (!element.isAssignable()) continue;
if (capturedVariableMapping.containsKey(element)) {
if (box == null) {
// TODO(floitsch): construct better box names.
@@ -354,9 +356,6 @@ class ClosureTranslator extends AbstractVisitor {
}
scopeVariables = new List<Element>();
- // TODO(floitsch): a named function is visible from inside itself. Add
- // the element to the block.
-
// We have to declare the implicit 'this' parameter.
if (!insideClosure && closureData.thisElement !== null) {
declareLocal(closureData.thisElement);
« no previous file with comments | « no previous file | samples/tests/samples/samples-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698