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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_fragment.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 | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_builder.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_fragment.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_fragment.dart b/pkg/compiler/lib/src/cps_ir/cps_fragment.dart
index 9bdb9ea15f882f2e4078ca1b9748d7841c50ec39..a9190ddf77aea155692d8abd5577be719ce2a22e 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_fragment.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_fragment.dart
@@ -33,19 +33,19 @@ import '../elements/elements.dart';
///
/// If `condition` is true then invoke `cont1`, else `cont2`.
///
-/// cps.ifTrue(condition).invokeContinuation(cont1, []);
+/// cps.ifTruthy(condition).invokeContinuation(cont1, []);
/// cps.invokeContinuation(cont2, []);
///
/// If `condition` is true then invoke `cont` with a bound primitive:
///
-/// CpsFragment branch = cps.ifTrue(condition);
+/// CpsFragment branch = cps.ifTruthy(condition);
/// branch.invokeContinuation(cont, [branch.letPrim(arg)]);
///
/// Loop and call a method until it returns false:
///
/// Continuation loop = cps.beginLoop();
/// var result = cps.invokeMethod(receiver, selector, ...);
-/// cps.ifFalse(result).invokeContinuation(exit, []);
+/// cps.ifFalsy(result).invokeContinuation(exit, []);
/// cps.continueLoop(loop);
///
class CpsFragment {
@@ -198,11 +198,11 @@ class CpsFragment {
/// Returns a new fragment for the 'then' branch.
///
/// The 'else' branch becomes the new hole.
- CpsFragment ifTrue(Primitive condition) {
+ CpsFragment ifTruthy(Primitive condition) {
Continuation trueCont = new Continuation(<Parameter>[]);
Continuation falseCont = new Continuation(<Parameter>[]);
put(new LetCont.two(trueCont, falseCont,
- new Branch(new IsTrue(condition), trueCont, falseCont)));
+ new Branch.loose(condition, trueCont, falseCont)));
context = falseCont;
return new CpsFragment(sourceInformation, trueCont);
}
@@ -212,11 +212,11 @@ class CpsFragment {
/// Returns a new fragment for the 'else' branch.
///
/// The 'then' branch becomes the new hole.
- CpsFragment ifFalse(Primitive condition) {
+ CpsFragment ifFalsy(Primitive condition) {
Continuation trueCont = new Continuation(<Parameter>[]);
Continuation falseCont = new Continuation(<Parameter>[]);
put(new LetCont.two(trueCont, falseCont,
- new Branch(new IsTrue(condition), trueCont, falseCont)));
+ new Branch.loose(condition, trueCont, falseCont)));
context = trueCont;
return new CpsFragment(sourceInformation, falseCont);
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698