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

Unified Diff: pkg/compiler/lib/src/js_backend/codegen/unsugar.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
Index: pkg/compiler/lib/src/js_backend/codegen/unsugar.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart b/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart
index 9913065e6d8e11d21bb2f7dc5674ae18cbe28a30..4fa59bb06b484e9b1e6c7ea038a2a56889baa1df 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart
@@ -31,7 +31,6 @@ class InterceptorEntity extends Entity {
/// special nodes that respect JavaScript behavior.
///
/// Performs the following rewrites:
-/// - Rewrite [IsTrue] in a [Branch] to do boolean conversion.
/// - Add interceptors at call sites that use interceptor calling convention.
/// - Add explicit receiver argument for methods that are called in interceptor
/// calling convention.
@@ -140,10 +139,7 @@ class UnsugarVisitor extends RecursiveVisitor {
new LetCont.many(<Continuation>[returnFalse, originalBody],
new LetPrim(nullPrimitive,
new LetPrim(test,
- new Branch(
- new IsTrue(test),
- returnFalse,
- originalBody))));
+ new Branch.loose(test, returnFalse, originalBody))));
function.body = newBody;
}
@@ -281,41 +277,6 @@ class UnsugarVisitor extends RecursiveVisitor {
node.receiver = new Reference<Primitive>(newReceiver);
}
- processBranch(Branch node) {
- // TODO(karlklose): implement the checked mode part of boolean conversion.
- InteriorNode parent = node.parent;
- IsTrue condition = node.condition;
-
- // Do not rewrite conditions that are foreign code.
- // It is redundant, and causes infinite recursion (if not optimized)
- // in the implementation of identical, which itself contains a condition.
- Primitive value = condition.value.definition;
- if (value is Parameter && value.parent is Continuation) {
- Continuation cont = value.parent;
- if (cont.hasExactlyOneUse && cont.firstRef.parent is ForeignCode) {
- ForeignCode foreign = cont.firstRef.parent;
- if (foreign.type.containsOnlyBool(_glue.classWorld)) {
- return;
- }
- }
- }
-
- Primitive t = trueConstant;
- Primitive i = new ApplyBuiltinOperator(
- BuiltinOperator.Identical,
- <Primitive>[condition.value.definition, t],
- condition.value.definition.sourceInformation);
- LetPrim newNode = new LetPrim(t,
- new LetPrim(i,
- new Branch(new IsTrue(i),
- node.trueContinuation.definition,
- node.falseContinuation.definition)));
- condition.value.unlink();
- node.trueContinuation.unlink();
- node.falseContinuation.unlink();
- parent.body = newNode;
- }
-
processInterceptor(Interceptor node) {
_glue.registerSpecializedGetInterceptor(node.interceptedClasses);
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_propagation.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