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

Unified Diff: pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart

Issue 1238163003: dart2js cps: Share interceptors by default and propagate to use later. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Renamed to let_sinking.dart Created 5 years, 5 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/tree_ir/optimization/statement_rewriter.dart
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
index 6fda009eb9f3c3c88e8f903c043b4fd8a9ef2468..11416657d4591a4e6e181f91b469c6a9f24bd0a8 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
@@ -165,7 +165,7 @@ class StatementRewriter extends Transformer implements Pass {
/// Binding environment for variables that are assigned to effectively
/// constant expressions (see [isEffectivelyConstant]).
- final Map<Variable, Expression> constantEnvironment;
+ Map<Variable, Expression> constantEnvironment;
/// Substitution map for labels. Any break to a label L should be substituted
/// for a break to L' if L maps to L'.
@@ -209,10 +209,13 @@ class StatementRewriter extends Transformer implements Pass {
void inEmptyEnvironment(void action()) {
List oldEnvironment = environment;
+ Map oldConstantEnvironment = constantEnvironment;
environment = <Expression>[];
+ constantEnvironment = <Variable, Expression>{};
action();
assert(environment.isEmpty);
environment = oldEnvironment;
+ constantEnvironment = oldConstantEnvironment;
}
/// Left-hand side of the given assignment, or `null` if not an assignment.
@@ -352,6 +355,7 @@ class StatementRewriter extends Transformer implements Pass {
exp is This ||
exp is CreateInvocationMirror ||
exp is GetStatic && exp.element.isFunction ||
+ exp is GetField && exp.objectIsNotNull && exp.field.isFinal ||
exp is Interceptor ||
exp is ApplyBuiltinOperator ||
exp is VariableUse && constantEnvironment.containsKey(exp.variable);
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/unsugar.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698