| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/graph-builder.h" | 5 #include "src/compiler/graph-builder.h" |
| 6 | 6 |
| 7 #include "src/bit-vector.h" | 7 #include "src/bit-vector.h" |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/compiler/graph-visualizer.h" | 9 #include "src/compiler/graph-visualizer.h" |
| 10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // Merge OSR values as inputs to the phis of the loop. | 194 // Merge OSR values as inputs to the phis of the loop. |
| 195 Graph* graph = builder_->graph(); | 195 Graph* graph = builder_->graph(); |
| 196 Node* osr_loop_entry = builder_->graph()->NewNode( | 196 Node* osr_loop_entry = builder_->graph()->NewNode( |
| 197 builder_->common()->OsrLoopEntry(), graph->start(), graph->start()); | 197 builder_->common()->OsrLoopEntry(), graph->start(), graph->start()); |
| 198 | 198 |
| 199 builder_->MergeControl(control, osr_loop_entry); | 199 builder_->MergeControl(control, osr_loop_entry); |
| 200 builder_->MergeEffect(effect, osr_loop_entry, control); | 200 builder_->MergeEffect(effect, osr_loop_entry, control); |
| 201 | 201 |
| 202 for (int i = 0; i < size; ++i) { | 202 for (int i = 0; i < size; ++i) { |
| 203 Node* val = values()->at(i); | 203 Node* val = values()->at(i); |
| 204 // TODO(titzer): use IrOpcode::IsConstant() or similar. | 204 if (!IrOpcode::IsConstantOpcode(val->opcode())) { |
| 205 if (val->opcode() == IrOpcode::kNumberConstant || | 205 Node* osr_value = |
| 206 val->opcode() == IrOpcode::kInt32Constant || | 206 graph->NewNode(builder_->common()->OsrValue(i), osr_loop_entry); |
| 207 val->opcode() == IrOpcode::kInt64Constant || | 207 values()->at(i) = builder_->MergeValue(val, osr_value, control); |
| 208 val->opcode() == IrOpcode::kFloat64Constant || | 208 } |
| 209 val->opcode() == IrOpcode::kHeapConstant) | |
| 210 continue; | |
| 211 Node* osr_value = | |
| 212 graph->NewNode(builder_->common()->OsrValue(i), osr_loop_entry); | |
| 213 values()->at(i) = builder_->MergeValue(val, osr_value, control); | |
| 214 } | 209 } |
| 215 } | 210 } |
| 216 } | 211 } |
| 217 | 212 |
| 218 | 213 |
| 219 Node* StructuredGraphBuilder::NewPhi(int count, Node* input, Node* control) { | 214 Node* StructuredGraphBuilder::NewPhi(int count, Node* input, Node* control) { |
| 220 const Operator* phi_op = common()->Phi(kMachAnyTagged, count); | 215 const Operator* phi_op = common()->Phi(kMachAnyTagged, count); |
| 221 Node** buffer = EnsureInputBufferSize(count + 1); | 216 Node** buffer = EnsureInputBufferSize(count + 1); |
| 222 MemsetPointer(buffer, input, count); | 217 MemsetPointer(buffer, input, count); |
| 223 buffer[count] = control; | 218 buffer[count] = control; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 if (!dead_control_.is_set()) { | 291 if (!dead_control_.is_set()) { |
| 297 Node* dead_node = graph()->NewNode(common_->Dead()); | 292 Node* dead_node = graph()->NewNode(common_->Dead()); |
| 298 dead_control_.set(dead_node); | 293 dead_control_.set(dead_node); |
| 299 return dead_node; | 294 return dead_node; |
| 300 } | 295 } |
| 301 return dead_control_.get(); | 296 return dead_control_.get(); |
| 302 } | 297 } |
| 303 } | 298 } |
| 304 } | 299 } |
| 305 } // namespace v8::internal::compiler | 300 } // namespace v8::internal::compiler |
| OLD | NEW |