Chromium Code Reviews| Index: lib/compiler/implementation/ssa/nodes.dart |
| diff --git a/lib/compiler/implementation/ssa/nodes.dart b/lib/compiler/implementation/ssa/nodes.dart |
| index 3c205251de1b983a6d07d4a73b82db366c4d02d6..cc27a5b23f864689f299b619711b09fb4f006c7f 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. |
| @@ -1075,6 +1078,9 @@ class HConditionalBranch extends HControlFlow { |
| class HControlFlow extends HInstruction { |
| HControlFlow(inputs) : super(inputs); |
| abstract toString(); |
| + void prepareGvn() { |
| + clearAllSideEffects(); |
|
ngeoffray
2012/06/15 19:45:33
Do you need to do this? I think by default insturc
Mads Ager (google)
2012/06/18 07:45:23
You are right, we don't need to clear side effects
|
| + } |
| bool isControlFlow() => true; |
| bool isStatement() => true; |
| } |
| @@ -1260,12 +1266,9 @@ class HFieldGet extends HFieldAccess { |
| accept(HVisitor visitor) => visitor.visitFieldGet(this); |
| void prepareGvn() { |
| - if (isFinalOrConst) { |
| - assert(!hasSideEffects()); |
| - setUseGvn(); |
| - } else { |
| - clearAllSideEffects(); |
| - } |
| + clearAllSideEffects(); |
|
ngeoffray
2012/06/15 19:45:33
ditto
Mads Ager (google)
2012/06/18 07:45:23
Done.
|
| + setUseGvn(); |
| + if (!isFinalOrConst) setDependsOnSomething(); |
| } |
| int typeCode() => 27; |