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

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

Issue 10573027: Use GVN for length loads from arrays and strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. 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
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/variable_allocator.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
diff --git a/lib/compiler/implementation/ssa/nodes.dart b/lib/compiler/implementation/ssa/nodes.dart
index c5525630131108cd5bea3fcf5d88119f22eadc0d..5b2d7a7dd8a5e3d8fa7164f4c65abdcbf8275c48 100644
--- a/lib/compiler/implementation/ssa/nodes.dart
+++ b/lib/compiler/implementation/ssa/nodes.dart
@@ -992,6 +992,10 @@ abstract class HCheck extends HInstruction {
HCheck(inputs) : super(inputs);
HInstruction get checkedInput() => inputs[0];
bool isStatement() => true;
+ void prepareGvn() {
+ assert(!hasSideEffects());
+ setUseGvn();
+ }
}
class HTypeGuard extends HCheck {
@@ -1002,11 +1006,6 @@ class HTypeGuard extends HCheck {
HTypeGuard(this.guardedType, this.state, List<HInstruction> env) : super(env);
- void prepareGvn() {
- assert(!hasSideEffects());
- setUseGvn();
- }
-
HInstruction get guarded() => inputs[checkedInputIndex];
HInstruction get checkedInput() => guarded;
@@ -1043,11 +1042,6 @@ class HBoundsCheck extends HCheck {
HInstruction get index() => inputs[0];
bool isControlFlow() => true;
- void prepareGvn() {
- assert(!hasSideEffects());
- setUseGvn();
- }
-
HType get guaranteedType() => HType.INTEGER;
accept(HVisitor visitor) => visitor.visitBoundsCheck(this);
@@ -1064,11 +1058,6 @@ class HIntegerCheck extends HCheck {
HInstruction get value() => inputs[0];
bool isControlFlow() => true;
- void prepareGvn() {
- assert(!hasSideEffects());
- setUseGvn();
- }
-
HType get guaranteedType() => HType.INTEGER;
accept(HVisitor visitor) => visitor.visitIntegerCheck(this);
@@ -1242,7 +1231,8 @@ class HInvokeInterceptor extends HInvokeStatic {
void prepareGvn() {
if (isLengthGetterOnStringOrArray()) {
- clearAllSideEffects();
+ setUseGvn();
+ setDependsOnSomething();
} else {
setAllSideEffects();
}
@@ -2291,7 +2281,6 @@ class HTypeConversion extends HCheck {
accept(HVisitor visitor) => visitor.visitTypeConversion(this);
- bool hasSideEffects() => kind != NO_CHECK;
bool isStatement() => kind == ARGUMENT_TYPE_CHECK;
bool isControlFlow() => kind == ARGUMENT_TYPE_CHECK;
}
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/variable_allocator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698