| 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/instruction-selector.h" | 5 #include "src/compiler/instruction-selector.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "src/base/adapters.h" | 9 #include "src/base/adapters.h" |
| 10 #include "src/compiler/instruction-selector-impl.h" | 10 #include "src/compiler/instruction-selector-impl.h" |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 int effect_level = 0; | 707 int effect_level = 0; |
| 708 for (Node* const node : *block) { | 708 for (Node* const node : *block) { |
| 709 if (node->opcode() == IrOpcode::kStore || | 709 if (node->opcode() == IrOpcode::kStore || |
| 710 node->opcode() == IrOpcode::kCheckedStore || | 710 node->opcode() == IrOpcode::kCheckedStore || |
| 711 node->opcode() == IrOpcode::kCall) { | 711 node->opcode() == IrOpcode::kCall) { |
| 712 ++effect_level; | 712 ++effect_level; |
| 713 } | 713 } |
| 714 SetEffectLevel(node, effect_level); | 714 SetEffectLevel(node, effect_level); |
| 715 } | 715 } |
| 716 | 716 |
| 717 // We visit the control first, then the nodes in the block, so the block's |
| 718 // control input should be on the same effect level as the last node. |
| 719 if (block->control_input() != nullptr) { |
| 720 SetEffectLevel(block->control_input(), effect_level); |
| 721 } |
| 722 |
| 717 // Generate code for the block control "top down", but schedule the code | 723 // Generate code for the block control "top down", but schedule the code |
| 718 // "bottom up". | 724 // "bottom up". |
| 719 VisitControl(block); | 725 VisitControl(block); |
| 720 std::reverse(instructions_.begin() + current_block_end, instructions_.end()); | 726 std::reverse(instructions_.begin() + current_block_end, instructions_.end()); |
| 721 | 727 |
| 722 // Visit code in reverse control flow order, because architecture-specific | 728 // Visit code in reverse control flow order, because architecture-specific |
| 723 // matching may cover more than one node at a time. | 729 // matching may cover more than one node at a time. |
| 724 for (auto node : base::Reversed(*block)) { | 730 for (auto node : base::Reversed(*block)) { |
| 725 // Skip nodes that are unused or already defined. | 731 // Skip nodes that are unused or already defined. |
| 726 if (!IsUsed(node) || IsDefined(node)) continue; | 732 if (!IsUsed(node) || IsDefined(node)) continue; |
| (...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1797 return new (instruction_zone()) FrameStateDescriptor( | 1803 return new (instruction_zone()) FrameStateDescriptor( |
| 1798 instruction_zone(), state_info.type(), state_info.bailout_id(), | 1804 instruction_zone(), state_info.type(), state_info.bailout_id(), |
| 1799 state_info.state_combine(), parameters, locals, stack, | 1805 state_info.state_combine(), parameters, locals, stack, |
| 1800 state_info.shared_info(), outer_state); | 1806 state_info.shared_info(), outer_state); |
| 1801 } | 1807 } |
| 1802 | 1808 |
| 1803 | 1809 |
| 1804 } // namespace compiler | 1810 } // namespace compiler |
| 1805 } // namespace internal | 1811 } // namespace internal |
| 1806 } // namespace v8 | 1812 } // namespace v8 |
| OLD | NEW |