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

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

Issue 10559081: Reapply: Use GVN for length loads from arrays and strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix type annotation on dataEquals argument 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 1b14d315d39a57808086698d9f343eeb61543cdf..b208b485841b7fd348755bcf21ea367c6540bed4 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,9 @@ class HInvokeInterceptor extends HInvokeStatic {
void prepareGvn() {
if (isLengthGetterOnStringOrArray()) {
+ setUseGvn();
clearAllSideEffects();
+ setDependsOnSomething();
} else {
setAllSideEffects();
}
@@ -2292,9 +2283,14 @@ 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;
+
+ int typeCode() => 28;
+ bool typeEquals(HInstruction other) => other is HTypeConversion;
+ bool dataEquals(HTypeConversion other) {
+ return type == other.type && kind == other.kind;
+ }
}
class HStringConcat extends HInstruction {
« 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