OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/simplified-lowering.h" | 5 #include "src/compiler/simplified-lowering.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 | 105 |
106 // Run lowering and change insertion phase. | 106 // Run lowering and change insertion phase. |
107 TRACE("--{Simplified lowering phase}--\n"); | 107 TRACE("--{Simplified lowering phase}--\n"); |
108 phase_ = LOWER; | 108 phase_ = LOWER; |
109 // Process nodes from the collected {nodes_} vector. | 109 // Process nodes from the collected {nodes_} vector. |
110 for (NodeVector::iterator i = nodes_.begin(); i != nodes_.end(); ++i) { | 110 for (NodeVector::iterator i = nodes_.begin(); i != nodes_.end(); ++i) { |
111 Node* node = *i; | 111 Node* node = *i; |
112 TRACE(" visit #%d: %s\n", node->id(), node->op()->mnemonic()); | 112 TRACE(" visit #%d: %s\n", node->id(), node->op()->mnemonic()); |
113 // Reuse {VisitNode()} so the representation rules are in one place. | 113 // Reuse {VisitNode()} so the representation rules are in one place. |
114 if (FLAG_turbo_source_positions) { | 114 SourcePositionTable::Scope scope( |
115 SourcePositionTable::Scope scope( | 115 source_positions_, source_positions_->GetSourcePosition(node)); |
116 source_positions_, source_positions_->GetSourcePosition(node)); | 116 VisitNode(node, GetUseInfo(node), lowering); |
117 VisitNode(node, GetUseInfo(node), lowering); | |
118 } else { | |
119 VisitNode(node, GetUseInfo(node), lowering); | |
120 } | |
121 } | 117 } |
122 | 118 |
123 // Perform the final replacements. | 119 // Perform the final replacements. |
124 for (NodeVector::iterator i = replacements_.begin(); | 120 for (NodeVector::iterator i = replacements_.begin(); |
125 i != replacements_.end(); ++i) { | 121 i != replacements_.end(); ++i) { |
126 Node* node = *i; | 122 Node* node = *i; |
127 Node* replacement = *(++i); | 123 Node* replacement = *(++i); |
128 node->ReplaceUses(replacement); | 124 node->ReplaceUses(replacement); |
129 // We also need to replace the node in the rest of the vector. | 125 // We also need to replace the node in the rest of the vector. |
130 for (NodeVector::iterator j = i + 1; j != replacements_.end(); ++j) { | 126 for (NodeVector::iterator j = i + 1; j != replacements_.end(); ++j) { |
(...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1590 | 1586 |
1591 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { | 1587 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { |
1592 node->set_op(machine()->IntLessThanOrEqual()); | 1588 node->set_op(machine()->IntLessThanOrEqual()); |
1593 node->ReplaceInput(0, StringComparison(node, true)); | 1589 node->ReplaceInput(0, StringComparison(node, true)); |
1594 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); | 1590 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); |
1595 } | 1591 } |
1596 | 1592 |
1597 } // namespace compiler | 1593 } // namespace compiler |
1598 } // namespace internal | 1594 } // namespace internal |
1599 } // namespace v8 | 1595 } // namespace v8 |
OLD | NEW |