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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1084413003: Fix an assertion failure in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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
Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
index f1e6fbb44af50141d4be27c6f756f96379c62d51..9ef3ff87d1e0052e498360036106e2f6f4434586 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
@@ -198,6 +198,7 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
*/
ir.RootNode buildExecutable(ExecutableElement element);
+ ClosureClassMap get closureClassMap;
ClosureScope getClosureScopeForNode(ast.Node node);
ClosureEnvironment getClosureEnvironment();
@@ -534,7 +535,8 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
irBuilder.buildTry(
tryStatementInfo: tryStatements[node],
buildTryBlock: subbuild(node.tryBlock),
- catchClauseInfos: catchClauseInfos);
+ catchClauseInfos: catchClauseInfos,
+ closureClassMap: closureClassMap);
}
// ## Expressions ##
@@ -2021,6 +2023,7 @@ class DartIrBuilderVisitor extends IrBuilderVisitor {
irBuilder.declareLocalFunction(element, inner);
}
+ ClosureClassMap get closureClassMap => null;
ClosureScope getClosureScopeForNode(ast.Node node) => null;
ClosureEnvironment getClosureEnvironment() => null;
@@ -2155,7 +2158,7 @@ class JsIrBuilderVisitor extends IrBuilderVisitor {
///
/// Will be initialized upon entering the body of a function.
/// It is computed by the [ClosureTranslator].
- ClosureClassMap closureMap;
+ ClosureClassMap closureClassMap;
/// During construction of a constructor factory, [fieldValues] maps fields
/// to the primitive containing their initial value.
@@ -2209,11 +2212,11 @@ class JsIrBuilderVisitor extends IrBuilderVisitor {
/// captured reference to `this`), returns a [ClosureEnvironment]
/// indicating how to access these.
ClosureEnvironment getClosureEnvironment() {
- if (closureMap.closureElement == null) return null;
+ if (closureClassMap.closureElement == null) return null;
return new ClosureEnvironment(
- closureMap.closureElement,
- closureMap.thisLocal,
- mapValues(closureMap.freeVariableMap, getLocation));
+ closureClassMap.closureElement,
+ closureClassMap.thisLocal,
+ mapValues(closureClassMap.freeVariableMap, getLocation));
}
/// If [node] has declarations for variables that should be boxed,
@@ -2222,7 +2225,7 @@ class JsIrBuilderVisitor extends IrBuilderVisitor {
///
/// Also see [ClosureScope].
ClosureScope getClosureScopeForNode(ast.Node node) {
- closurelib.ClosureScope scope = closureMap.capturingScopes[node];
+ closurelib.ClosureScope scope = closureClassMap.capturingScopes[node];
if (scope == null) return null;
// We translate a ClosureScope from closure.dart into IR builder's variant
// because the IR builder should not depend on the synthetic elements
@@ -2615,10 +2618,11 @@ class JsIrBuilderVisitor extends IrBuilderVisitor {
ir.FunctionDefinition buildConstructorBody(ConstructorBodyElement body) {
ConstructorElement constructor = body.constructor;
ast.FunctionExpression node = constructor.node;
- closureMap = compiler.closureToClassMapper.computeClosureToClassMapping(
- constructor,
- node,
- elements);
+ closureClassMap =
+ compiler.closureToClassMapper.computeClosureToClassMapping(
+ constructor,
+ node,
+ elements);
// We compute variables boxed in mutable variables on entry to each try
// block, not including variables captured by a closure (which are boxed
@@ -2647,10 +2651,11 @@ class JsIrBuilderVisitor extends IrBuilderVisitor {
assert(node != null);
assert(elements[node] != null);
- closureMap = compiler.closureToClassMapper.computeClosureToClassMapping(
- element,
- node,
- elements);
+ closureClassMap =
+ compiler.closureToClassMapper.computeClosureToClassMapping(
+ element,
+ node,
+ elements);
DartCapturedVariables variables = _analyzeCapturedVariables(node);
tryStatements = variables.tryStatements;
IrBuilder builder = getBuilderFor(element);
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart ('k') | pkg/pkg.status » ('j') | pkg/pkg.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698