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

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

Issue 1311353008: dart2js cps: Use a strictness flag on Branch instead of rewriting. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_fragment.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
index f97d15ef94a70e63df409dcad3dbbe02025a42c9..e4cb699468d56edb87e183a1216110c68298dd16 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
@@ -773,9 +773,9 @@ class IrBuilder {
elseContinuation.body = elseBuilder._root;
add(new ir.LetCont(join.continuation,
new ir.LetCont.two(thenContinuation, elseContinuation,
- new ir.Branch(new ir.IsTrue(condition),
- thenContinuation,
- elseContinuation))));
+ new ir.Branch.strict(condition,
+ thenContinuation,
+ elseContinuation))));
environment = join.environment;
return environment.discard(1);
}
@@ -1117,9 +1117,9 @@ class IrBuilder {
ir.Expression result =
new ir.LetCont.many(arms,
- new ir.Branch(new ir.IsTrue(condition),
- thenContinuation,
- elseContinuation));
+ new ir.Branch.strict(condition,
+ thenContinuation,
+ elseContinuation));
JumpCollector join; // Null if there is no join.
if (thenBuilder.isOpen && elseBuilder.isOpen) {
@@ -1288,9 +1288,9 @@ class IrBuilder {
// be filled by LetCont.plug.
ir.LetCont branch =
new ir.LetCont.two(exitContinuation, bodyContinuation,
- new ir.Branch(new ir.IsTrue(condition),
- bodyContinuation,
- exitContinuation));
+ new ir.Branch.strict(condition,
+ bodyContinuation,
+ exitContinuation));
// If there are breaks in the body, then there must be a join-point
// continuation for the normal exit and the breaks. Otherwise, the
// successor is translated in the hole in the exit continuation.
@@ -1449,9 +1449,9 @@ class IrBuilder {
// be filled by LetCont.plug.
ir.LetCont branch =
new ir.LetCont.two(exitContinuation, bodyContinuation,
- new ir.Branch(new ir.IsTrue(condition),
- bodyContinuation,
- exitContinuation));
+ new ir.Branch.strict(condition,
+ bodyContinuation,
+ exitContinuation));
// If there are breaks in the body, then there must be a join-point
// continuation for the normal exit and the breaks. Otherwise, the
// successor is translated in the hole in the exit continuation.
@@ -1524,9 +1524,9 @@ class IrBuilder {
// be filled by LetCont.plug.
ir.LetCont branch =
new ir.LetCont.two(exitContinuation, bodyContinuation,
- new ir.Branch(new ir.IsTrue(condition),
- bodyContinuation,
- exitContinuation));
+ new ir.Branch.strict(condition,
+ bodyContinuation,
+ exitContinuation));
// If there are breaks in the body, then there must be a join-point
// continuation for the normal exit and the breaks. Otherwise, the
// successor is translated in the hole in the exit continuation.
@@ -1610,9 +1610,9 @@ class IrBuilder {
continueBuilder.add(
new ir.LetCont.two(exitContinuation, repeatContinuation,
- new ir.Branch(new ir.IsTrue(condition),
- repeatContinuation,
- exitContinuation)));
+ new ir.Branch.strict(condition,
+ repeatContinuation,
+ exitContinuation)));
continueCollector.continuation.body = continueBuilder._root;
// Construct the loop continuation (i.e., the body and condition).
@@ -1676,9 +1676,9 @@ class IrBuilder {
// else continuation first.
casesBuilder.add(
new ir.LetCont.two(elseContinuation, thenContinuation,
- new ir.Branch(new ir.IsTrue(condition),
- thenContinuation,
- elseContinuation)));
+ new ir.Branch.strict(condition,
+ thenContinuation,
+ elseContinuation)));
}
if (defaultCase != null) {
@@ -1883,9 +1883,9 @@ class IrBuilder {
clause.type,
isTypeTest: true);
checkBuilder.add(new ir.LetCont.two(thenContinuation, elseContinuation,
- new ir.Branch(new ir.IsTrue(typeMatches),
- thenContinuation,
- elseContinuation)));
+ new ir.Branch.strict(typeMatches,
+ thenContinuation,
+ elseContinuation)));
catchBody = checkBuilder._root;
}
builder.add(catchBody);
@@ -2232,9 +2232,9 @@ class IrBuilder {
add(new ir.LetCont(joinContinuation,
new ir.LetCont.two(thenContinuation, elseContinuation,
- new ir.Branch(new ir.IsTrue(condition),
- thenContinuation,
- elseContinuation))));
+ new ir.Branch.strict(condition,
+ thenContinuation,
+ elseContinuation))));
return resultParameter;
}
@@ -2292,9 +2292,9 @@ class IrBuilder {
// The right subexpression has two continuations.
rightBuilder.add(
new ir.LetCont.two(rightTrueContinuation, rightFalseContinuation,
- new ir.Branch(new ir.IsTrue(rightValue),
- rightTrueContinuation,
- rightFalseContinuation)));
+ new ir.Branch.strict(rightValue,
+ rightTrueContinuation,
+ rightFalseContinuation)));
// Depending on the operator, the left subexpression's continuations are
// either the right subexpression or an invocation of the join-point
// continuation.
@@ -2308,9 +2308,9 @@ class IrBuilder {
add(new ir.LetCont(join.continuation,
new ir.LetCont.two(leftTrueContinuation, leftFalseContinuation,
- new ir.Branch(new ir.IsTrue(leftValue),
- leftTrueContinuation,
- leftFalseContinuation))));
+ new ir.Branch.strict(leftValue,
+ leftTrueContinuation,
+ leftFalseContinuation))));
environment = join.environment;
return environment.discard(1);
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_fragment.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698