| 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/liveness-analyzer.h" | 5 #include "src/compiler/liveness-analyzer.h" |
| 6 #include "src/compiler/js-graph.h" | 6 #include "src/compiler/js-graph.h" |
| 7 #include "src/compiler/node.h" | 7 #include "src/compiler/node.h" |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/compiler/state-values-utils.h" | 9 #include "src/compiler/state-values-utils.h" |
| 10 | 10 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 frame_state->ReplaceInput(1, new_values); | 135 frame_state->ReplaceInput(1, new_values); |
| 136 break; | 136 break; |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 | 140 |
| 141 | 141 |
| 142 Node* NonLiveFrameStateSlotReplacer::ClearNonLiveStateValues( | 142 Node* NonLiveFrameStateSlotReplacer::ClearNonLiveStateValues( |
| 143 Node* values, BitVector* liveness) { | 143 Node* values, BitVector* liveness) { |
| 144 DCHECK(inputs_buffer_.empty()); | 144 DCHECK(inputs_buffer_.empty()); |
| 145 for (Node* node : StateValuesAccess(values)) { | 145 for (StateValuesAccess::TypedNode node : StateValuesAccess(values)) { |
| 146 // Index of the next variable is its furure index in the inputs buffer, | 146 // Index of the next variable is its furure index in the inputs buffer, |
| 147 // i.e., the buffer's size. | 147 // i.e., the buffer's size. |
| 148 int var = static_cast<int>(inputs_buffer_.size()); | 148 int var = static_cast<int>(inputs_buffer_.size()); |
| 149 bool live = liveness->Contains(var) || permanently_live_.Contains(var); | 149 bool live = liveness->Contains(var) || permanently_live_.Contains(var); |
| 150 inputs_buffer_.push_back(live ? node : replacement_node_); | 150 inputs_buffer_.push_back(live ? node.node : replacement_node_); |
| 151 } | 151 } |
| 152 Node* result = state_values_cache()->GetNodeForValues( | 152 Node* result = state_values_cache()->GetNodeForValues( |
| 153 inputs_buffer_.empty() ? nullptr : &(inputs_buffer_.front()), | 153 inputs_buffer_.empty() ? nullptr : &(inputs_buffer_.front()), |
| 154 inputs_buffer_.size()); | 154 inputs_buffer_.size()); |
| 155 inputs_buffer_.clear(); | 155 inputs_buffer_.clear(); |
| 156 return result; | 156 return result; |
| 157 } | 157 } |
| 158 | 158 |
| 159 | 159 |
| 160 void LivenessAnalyzerBlock::Print(std::ostream& os) { | 160 void LivenessAnalyzerBlock::Print(std::ostream& os) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 191 for (int i = 0; i < live_.length(); i++) { | 191 for (int i = 0; i < live_.length(); i++) { |
| 192 os << (live_.Contains(i) ? "L" : "."); | 192 os << (live_.Contains(i) ? "L" : "."); |
| 193 } | 193 } |
| 194 os << std::endl; | 194 os << std::endl; |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace compiler | 198 } // namespace compiler |
| 199 } // namespace internal | 199 } // namespace internal |
| 200 } // namespace v8 | 200 } // namespace v8 |
| OLD | NEW |