| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/bytecode-graph-builder.h" | 5 #include "src/compiler/bytecode-graph-builder.h" |
| 6 | 6 |
| 7 #include "src/compiler/linkage.h" | 7 #include "src/compiler/linkage.h" |
| 8 #include "src/compiler/operator-properties.h" | 8 #include "src/compiler/operator-properties.h" |
| 9 #include "src/interpreter/bytecode-array-iterator.h" | 9 #include "src/interpreter/bytecode-array-iterator.h" |
| 10 | 10 |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 return result; | 405 return result; |
| 406 } | 406 } |
| 407 | 407 |
| 408 | 408 |
| 409 Node* BytecodeGraphBuilder::MergeControl(Node* control, Node* other) { | 409 Node* BytecodeGraphBuilder::MergeControl(Node* control, Node* other) { |
| 410 int inputs = control->op()->ControlInputCount() + 1; | 410 int inputs = control->op()->ControlInputCount() + 1; |
| 411 if (control->opcode() == IrOpcode::kLoop) { | 411 if (control->opcode() == IrOpcode::kLoop) { |
| 412 // Control node for loop exists, add input. | 412 // Control node for loop exists, add input. |
| 413 const Operator* op = common()->Loop(inputs); | 413 const Operator* op = common()->Loop(inputs); |
| 414 control->AppendInput(graph_zone(), other); | 414 control->AppendInput(graph_zone(), other); |
| 415 control->set_op(op); | 415 NodeProperties::ChangeOp(control, op); |
| 416 } else if (control->opcode() == IrOpcode::kMerge) { | 416 } else if (control->opcode() == IrOpcode::kMerge) { |
| 417 // Control node for merge exists, add input. | 417 // Control node for merge exists, add input. |
| 418 const Operator* op = common()->Merge(inputs); | 418 const Operator* op = common()->Merge(inputs); |
| 419 control->AppendInput(graph_zone(), other); | 419 control->AppendInput(graph_zone(), other); |
| 420 control->set_op(op); | 420 NodeProperties::ChangeOp(control, op); |
| 421 } else { | 421 } else { |
| 422 // Control node is a singleton, introduce a merge. | 422 // Control node is a singleton, introduce a merge. |
| 423 const Operator* op = common()->Merge(inputs); | 423 const Operator* op = common()->Merge(inputs); |
| 424 Node* merge_inputs[] = {control, other}; | 424 Node* merge_inputs[] = {control, other}; |
| 425 control = graph()->NewNode(op, arraysize(merge_inputs), merge_inputs, true); | 425 control = graph()->NewNode(op, arraysize(merge_inputs), merge_inputs, true); |
| 426 } | 426 } |
| 427 return control; | 427 return control; |
| 428 } | 428 } |
| 429 | 429 |
| 430 | 430 |
| 431 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 431 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
| 432 if (environment()->IsMarkedAsUnreachable()) return; | 432 if (environment()->IsMarkedAsUnreachable()) return; |
| 433 environment()->MarkAsUnreachable(); | 433 environment()->MarkAsUnreachable(); |
| 434 exit_controls_.push_back(exit); | 434 exit_controls_.push_back(exit); |
| 435 } | 435 } |
| 436 | 436 |
| 437 } // namespace compiler | 437 } // namespace compiler |
| 438 } // namespace internal | 438 } // namespace internal |
| 439 } // namespace v8 | 439 } // namespace v8 |
| OLD | NEW |