| Index: src/compiler/js-typed-lowering.cc
|
| diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc
|
| index 361cb94f058c3e39ce117c69ba3b44c32a91039c..4c166e0dc53d3b2e6dd2319873de41bd230417cc 100644
|
| --- a/src/compiler/js-typed-lowering.cc
|
| +++ b/src/compiler/js-typed-lowering.cc
|
| @@ -17,39 +17,18 @@ namespace compiler {
|
| // - relax effects from generic but not-side-effecting operations
|
| // - relax effects for ToNumber(mixed)
|
|
|
| -// Replace value uses of {node} with {value} and effect uses of {node} with
|
| -// {effect}. If {effect == NULL}, then use the effect input to {node}.
|
| -// TODO(titzer): move into a GraphEditor?
|
| -static void ReplaceUses(Node* node, Node* value, Node* effect) {
|
| - if (value == effect) {
|
| - // Effect and value updates are the same; no special iteration needed.
|
| - if (value != node) node->ReplaceUses(value);
|
| - return;
|
| - }
|
| -
|
| - if (effect == NULL) effect = NodeProperties::GetEffectInput(node);
|
| -
|
| - // The iteration requires distinguishing between value and effect edges.
|
| - UseIter iter = node->uses().begin();
|
| - while (iter != node->uses().end()) {
|
| - if (NodeProperties::IsEffectEdge(iter.edge())) {
|
| - iter = iter.UpdateToAndIncrement(effect);
|
| - } else {
|
| - iter = iter.UpdateToAndIncrement(value);
|
| - }
|
| - }
|
| -}
|
| -
|
|
|
| // Relax the effects of {node} by immediately replacing effect uses of {node}
|
| // with the effect input to {node}.
|
| // TODO(turbofan): replace the effect input to {node} with {graph->start()}.
|
| // TODO(titzer): move into a GraphEditor?
|
| -static void RelaxEffects(Node* node) { ReplaceUses(node, node, NULL); }
|
| +static void RelaxEffects(Node* node) {
|
| + NodeProperties::ReplaceWithValue(node, node, NULL);
|
| +}
|
|
|
|
|
| Reduction JSTypedLowering::ReplaceEagerly(Node* old, Node* node) {
|
| - ReplaceUses(old, node, node);
|
| + NodeProperties::ReplaceWithValue(old, node, node);
|
| return Reducer::Changed(node);
|
| }
|
|
|
| @@ -522,7 +501,7 @@ Reduction JSTypedLowering::ReduceJSToBooleanInput(Node* input) {
|
|
|
| static Reduction ReplaceWithReduction(Node* node, Reduction reduction) {
|
| if (reduction.Changed()) {
|
| - ReplaceUses(node, reduction.replacement(), NULL);
|
| + NodeProperties::ReplaceWithValue(node, reduction.replacement());
|
| return reduction;
|
| }
|
| return Reducer::NoChange();
|
| @@ -573,13 +552,13 @@ Reduction JSTypedLowering::Reduce(Node* node) {
|
| // !x => BooleanNot(x)
|
| value =
|
| graph()->NewNode(simplified()->BooleanNot(), result.replacement());
|
| - ReplaceUses(node, value, NULL);
|
| + NodeProperties::ReplaceWithValue(node, value);
|
| return Changed(value);
|
| } else {
|
| // !x => BooleanNot(JSToBoolean(x))
|
| value = graph()->NewNode(simplified()->BooleanNot(), node);
|
| node->set_op(javascript()->ToBoolean());
|
| - ReplaceUses(node, value, node);
|
| + NodeProperties::ReplaceWithValue(node, value, node);
|
| // Note: ReplaceUses() smashes all uses, so smash it back here.
|
| value->ReplaceInput(0, node);
|
| return ReplaceWith(value);
|
|
|