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

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

Issue 10566021: Reapply change to GVN all HFieldGet instructions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/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
diff --git a/lib/compiler/implementation/ssa/nodes.dart b/lib/compiler/implementation/ssa/nodes.dart
index 0d6bb70f794abbcb31a2ea8f7c1da901b83f25c2..d48e813aacf316904219d1146d1efac457e80127 100644
--- a/lib/compiler/implementation/ssa/nodes.dart
+++ b/lib/compiler/implementation/ssa/nodes.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -740,6 +740,9 @@ class HInstruction implements Hashable {
void setAllSideEffects() { flags |= ((1 << FLAG_CHANGES_COUNT) - 1); }
void clearAllSideEffects() { flags &= ~((1 << FLAG_CHANGES_COUNT) - 1); }
+ bool dependsOnSomething() => getFlag(FLAG_DEPENDS_ON_SOMETHING);
+ void setDependsOnSomething() { setFlag(FLAG_DEPENDS_ON_SOMETHING); }
+
bool useGvn() => getFlag(FLAG_USE_GVN);
void setUseGvn() { setFlag(FLAG_USE_GVN); }
// Does this node potentially affect control flow.
@@ -1076,6 +1079,9 @@ class HConditionalBranch extends HControlFlow {
class HControlFlow extends HInstruction {
HControlFlow(inputs) : super(inputs);
abstract toString();
+ void prepareGvn() {
+ // Control flow does not have side-effects.
+ }
bool isControlFlow() => true;
bool isStatement() => true;
}
@@ -1261,12 +1267,8 @@ class HFieldGet extends HFieldAccess {
accept(HVisitor visitor) => visitor.visitFieldGet(this);
void prepareGvn() {
- if (isFinalOrConst) {
- assert(!hasSideEffects());
- setUseGvn();
- } else {
- clearAllSideEffects();
- }
+ setUseGvn();
+ if (!isFinalOrConst) setDependsOnSomething();
}
int typeCode() => 27;
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698