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

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

Issue 1240263002: dart2js cps: Streamline expressions and primitives. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rename Get/SetMutableVariable -> Get/SetMutable 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/cps_ir/type_propagation.dart
diff --git a/pkg/compiler/lib/src/cps_ir/type_propagation.dart b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
index 7f788189c94067f1bc2290eec4351887202fa743..a334abb83ba1b239ee56385f2238275f9c921c68 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -832,12 +832,13 @@ class TransformingVisitor extends RecursiveVisitor {
if (target.isFinal) return false;
assert(cont.parameters.single.hasNoUses);
cont.parameters.clear();
- SetField set = new SetField(getDartReceiver(node),
- target,
- getDartArgument(node, 0));
- set.body = new InvokeContinuation(cont, <Primitive>[]);
- replaceSubtree(node, set);
- visitSetField(set);
+ CpsFragment cps = new CpsFragment(node.sourceInformation);
+ cps.letPrim(new SetField(getDartReceiver(node),
+ target,
+ getDartArgument(node, 0)));
+ cps.invokeContinuation(cont);
+ replaceSubtree(node, cps.result);
+ visit(cps.result);
return true;
}
}
@@ -1052,8 +1053,7 @@ class TransformingVisitor extends RecursiveVisitor {
// that variable name for the mutable variable.
current.hint = result.hint;
}
- LetPrim let =
- makeLetPrimInvoke(new GetMutableVariable(current), useCont);
+ LetPrim let = makeLetPrimInvoke(new GetMutable(current), useCont);
replaceSubtree(use, let);
} else {
assert (use.selector == moveNextSelector);
@@ -2006,9 +2006,8 @@ class TypePropagationVisitor implements Visitor {
}
}
- void visitSetMutableVariable(SetMutableVariable node) {
+ void visitSetMutable(SetMutable node) {
setValue(node.variable.definition, getValue(node.value.definition));
- setReachable(node.body);
}
void visitLiteralList(LiteralList node) {
@@ -2040,7 +2039,7 @@ class TypePropagationVisitor implements Visitor {
setValue(node, constantValue(constant, typeSystem.functionType));
}
- void visitGetMutableVariable(GetMutableVariable node) {
+ void visitGetMutable(GetMutable node) {
setValue(node, getValue(node.variable.definition));
}
@@ -2096,9 +2095,7 @@ class TypePropagationVisitor implements Visitor {
}
}
- void visitSetStatic(SetStatic node) {
- setReachable(node.body);
- }
+ void visitSetStatic(SetStatic node) {}
void visitGetLazyStatic(GetLazyStatic node) {
Continuation cont = node.continuation.definition;
@@ -2126,9 +2123,7 @@ class TypePropagationVisitor implements Visitor {
setValue(node, nonConstant(typeSystem.getFieldType(node.field)));
}
- void visitSetField(SetField node) {
- setReachable(node.body);
- }
+ void visitSetField(SetField node) {}
void visitCreateBox(CreateBox node) {
setValue(node, nonConstant(typeSystem.nonNullType));
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/shrinking_reductions.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