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

Unified Diff: sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart

Issue 183373003: Revert "Fix bad type-inferrence for logical expressions." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 | tests/compiler/dart2js/simple_inferrer_and_or_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart b/sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart
index 743a24fa20bed3cad5c6806497e2bc69ac5bb164..86662f7dcb798a5ba86b62cd839375bd13f04499 100644
--- a/sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart
+++ b/sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart
@@ -835,18 +835,6 @@ abstract class InferrerVisitor
}
}
- /// Stops the accumulation of is-checks.
- ///
- /// Nulls the [isChecks] field.
- ///
- /// Returns the old value of [accumulateIsChecks].
- bool stopAccumulatingIsChecks() {
- bool oldAccumulateIsChecks = accumulateIsChecks;
- accumulateIsChecks = false;
- isChecks = null;
- return oldAccumulateIsChecks;
- }
-
T visitOperatorSend(Send node) {
Operator op = node.selector;
if ("[]" == op.source) {
@@ -854,15 +842,11 @@ abstract class InferrerVisitor
} else if ("&&" == op.source) {
conditionIsSimple = false;
bool oldAccumulateIsChecks = accumulateIsChecks;
- if (!accumulateIsChecks) {
- accumulateIsChecks = true;
- isChecks = <Send>[];
- }
+ accumulateIsChecks = true;
+ if (isChecks == null) isChecks = <Send>[];
visit(node.receiver);
- if (!oldAccumulateIsChecks) {
- accumulateIsChecks = false;
- isChecks = null;
- }
+ accumulateIsChecks = oldAccumulateIsChecks;
+ if (!accumulateIsChecks) isChecks = null;
LocalsHandler<T> saved = locals;
locals = new LocalsHandler<T>.from(locals, node);
updateIsChecks(isChecks, usePositive: true);
@@ -873,18 +857,20 @@ abstract class InferrerVisitor
} else if ("||" == op.source) {
conditionIsSimple = false;
List<Send> tests = <Send>[];
- bool isSimple = handleCondition(node.receiver, tests);
+ handleCondition(node.receiver, tests);
LocalsHandler<T> saved = locals;
locals = new LocalsHandler<T>.from(locals, node);
- if (isSimple) updateIsChecks(tests, usePositive: false);
- bool oldAccumulateIsChecks = stopAccumulatingIsChecks();
+ updateIsChecks(tests, usePositive: false);
+ bool oldAccumulateIsChecks = accumulateIsChecks;
+ accumulateIsChecks = false;
visit(node.arguments.head);
accumulateIsChecks = oldAccumulateIsChecks;
saved.mergeDiamondFlow(locals, null);
locals = saved;
return types.boolType;
} else if ("!" == op.source) {
- bool oldAccumulateIsChecks = stopAccumulatingIsChecks();
+ bool oldAccumulateIsChecks = accumulateIsChecks;
+ accumulateIsChecks = false;
node.visitChildren(this);
accumulateIsChecks = oldAccumulateIsChecks;
return types.boolType;
« no previous file with comments | « no previous file | tests/compiler/dart2js/simple_inferrer_and_or_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698