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

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

Issue 10383062: Avoid inserting new temporaries because of HTypeConversion nodes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 | « lib/compiler/implementation/ssa/codegen_helpers.dart ('k') | lib/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/nodes.dart
===================================================================
--- lib/compiler/implementation/ssa/nodes.dart (revision 7417)
+++ lib/compiler/implementation/ssa/nodes.dart (working copy)
@@ -305,9 +305,9 @@
visitThrow(HThrow node) => visitControlFlow(node);
visitTry(HTry node) => visitControlFlow(node);
visitTruncatingDivide(HTruncatingDivide node) => visitBinaryArithmetic(node);
- visitTypeGuard(HTypeGuard node) => visitInstruction(node);
+ visitTypeGuard(HTypeGuard node) => visitCheck(node);
visitIs(HIs node) => visitInstruction(node);
- visitTypeConversion(HTypeConversion node) => visitInstruction(node);
+ visitTypeConversion(HTypeConversion node) => visitCheck(node);
}
class SubGraph {
@@ -955,10 +955,10 @@
// TODO(floitsch): make class abstract instead of adding an abstract method.
abstract accept(HVisitor visitor);
- bool isControlFlow() => true;
+ HInstruction get checkedInput() => inputs[0];
}
-class HTypeGuard extends HInstruction {
+class HTypeGuard extends HCheck {
final int state;
final HType guardedType;
bool isOn = false;
@@ -970,6 +970,7 @@
}
HInstruction get guarded() => inputs.last();
+ HInstruction get checkedInput() => guarded;
HType computeTypeFromInputTypes() {
return isOn ? guardedType : guarded.propagatedType;
@@ -998,8 +999,9 @@
HBoundsCheck(length, index) : super(<HInstruction>[length, index]);
- HInstruction get length() => inputs[0];
- HInstruction get index() => inputs[1];
+ HInstruction get length() => inputs[1];
+ HInstruction get index() => inputs[0];
+ bool isControlFlow() => true;
void prepareGvn() {
assert(!hasSideEffects());
@@ -1020,6 +1022,7 @@
HIntegerCheck(value) : super(<HInstruction>[value]);
HInstruction get value() => inputs[0];
+ bool isControlFlow() => true;
void prepareGvn() {
assert(!hasSideEffects());
@@ -2148,7 +2151,7 @@
toString() => "$expression is $typeExpression";
}
-class HTypeConversion extends HInstruction {
+class HTypeConversion extends HCheck {
HType type;
final bool checked;
@@ -2162,6 +2165,8 @@
HType get guaranteedType() => type;
accept(HVisitor visitor) => visitor.visitTypeConversion(this);
+
+ bool hasSideEffects() => checked;
}
/** Non-block-based (aka. traditional) loop information. */
« no previous file with comments | « lib/compiler/implementation/ssa/codegen_helpers.dart ('k') | lib/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698