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

Unified Diff: lib/compiler/implementation/ssa/nodes.dart

Issue 10660026: Don't allow statement-nodes in expression contexts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix test for checked mode. Created 8 years, 6 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: lib/compiler/implementation/ssa/nodes.dart
diff --git a/lib/compiler/implementation/ssa/nodes.dart b/lib/compiler/implementation/ssa/nodes.dart
index f0579a7886efa780218898f6704e9041c30e8a25..cfc8a8a32fedd0bedbec50e30aae75b2aeaa3e3d 100644
--- a/lib/compiler/implementation/ssa/nodes.dart
+++ b/lib/compiler/implementation/ssa/nodes.dart
@@ -992,7 +992,7 @@ class HBoolify extends HInstruction {
abstract class HCheck extends HInstruction {
HCheck(inputs) : super(inputs);
HInstruction get checkedInput() => inputs[0];
- final bool isStatement = true;
+ bool get isStatement() => true;
void prepareGvn() {
assert(!hasSideEffects());
setUseGvn();
@@ -1002,7 +1002,7 @@ abstract class HCheck extends HInstruction {
class HTypeGuard extends HCheck {
final int state;
final HType guardedType;
- bool isOn = false;
+ bool isEnabled = false;
int checkedInputIndex = 0;
HTypeGuard(this.guardedType, this.state, List<HInstruction> env) : super(env);
@@ -1011,13 +1011,15 @@ class HTypeGuard extends HCheck {
HInstruction get checkedInput() => guarded;
HType computeTypeFromInputTypes() {
- return isOn ? guardedType : guarded.propagatedType;
+ return isEnabled ? guardedType : guarded.propagatedType;
}
- HType get guaranteedType() => isOn ? guardedType : HType.UNKNOWN;
+ HType get guaranteedType() => isEnabled ? guardedType : HType.UNKNOWN;
bool isControlFlow() => true;
+ bool get isStatement() => isEnabled;
+
accept(HVisitor visitor) => visitor.visitTypeGuard(this);
int typeCode() => 1;
bool typeEquals(other) => other is HTypeGuard;

Powered by Google App Engine
This is Rietveld 408576698