| 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;
|
|
|