| 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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 return VisitCall(node); | 900 return VisitCall(node); |
| 901 case IrOpcode::kDeoptimizeIf: | 901 case IrOpcode::kDeoptimizeIf: |
| 902 return VisitDeoptimizeIf(node); | 902 return VisitDeoptimizeIf(node); |
| 903 case IrOpcode::kDeoptimizeUnless: | 903 case IrOpcode::kDeoptimizeUnless: |
| 904 return VisitDeoptimizeUnless(node); | 904 return VisitDeoptimizeUnless(node); |
| 905 case IrOpcode::kFrameState: | 905 case IrOpcode::kFrameState: |
| 906 case IrOpcode::kStateValues: | 906 case IrOpcode::kStateValues: |
| 907 case IrOpcode::kObjectState: | 907 case IrOpcode::kObjectState: |
| 908 return; | 908 return; |
| 909 case IrOpcode::kDebugBreak: | 909 case IrOpcode::kDebugBreak: |
| 910 VisitDebugBreak(); | 910 VisitDebugBreak(node); |
| 911 return; |
| 912 case IrOpcode::kComment: |
| 913 VisitComment(node); |
| 911 return; | 914 return; |
| 912 case IrOpcode::kLoad: { | 915 case IrOpcode::kLoad: { |
| 913 LoadRepresentation type = LoadRepresentationOf(node->op()); | 916 LoadRepresentation type = LoadRepresentationOf(node->op()); |
| 914 MarkAsRepresentation(type.representation(), node); | 917 MarkAsRepresentation(type.representation(), node); |
| 915 return VisitLoad(node); | 918 return VisitLoad(node); |
| 916 } | 919 } |
| 917 case IrOpcode::kStore: | 920 case IrOpcode::kStore: |
| 918 return VisitStore(node); | 921 return VisitStore(node); |
| 919 case IrOpcode::kWord32And: | 922 case IrOpcode::kWord32And: |
| 920 return MarkAsWord32(node), VisitWord32And(node); | 923 return MarkAsWord32(node), VisitWord32And(node); |
| (...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1791 } | 1794 } |
| 1792 EmitDeoptimize(opcode, 0, nullptr, 0, nullptr, value); | 1795 EmitDeoptimize(opcode, 0, nullptr, 0, nullptr, value); |
| 1793 } | 1796 } |
| 1794 | 1797 |
| 1795 | 1798 |
| 1796 void InstructionSelector::VisitThrow(Node* value) { | 1799 void InstructionSelector::VisitThrow(Node* value) { |
| 1797 OperandGenerator g(this); | 1800 OperandGenerator g(this); |
| 1798 Emit(kArchThrowTerminator, g.NoOutput()); | 1801 Emit(kArchThrowTerminator, g.NoOutput()); |
| 1799 } | 1802 } |
| 1800 | 1803 |
| 1801 void InstructionSelector::VisitDebugBreak() { | 1804 void InstructionSelector::VisitDebugBreak(Node* node) { |
| 1802 OperandGenerator g(this); | 1805 OperandGenerator g(this); |
| 1803 Emit(kArchDebugBreak, g.NoOutput()); | 1806 Emit(kArchDebugBreak, g.NoOutput()); |
| 1804 } | 1807 } |
| 1805 | 1808 |
| 1809 void InstructionSelector::VisitComment(Node* node) { |
| 1810 OperandGenerator g(this); |
| 1811 InstructionOperand operand(g.UseImmediate(node)); |
| 1812 Emit(kArchComment, 0, nullptr, 1, &operand); |
| 1813 } |
| 1814 |
| 1806 FrameStateDescriptor* InstructionSelector::GetFrameStateDescriptor( | 1815 FrameStateDescriptor* InstructionSelector::GetFrameStateDescriptor( |
| 1807 Node* state) { | 1816 Node* state) { |
| 1808 DCHECK(state->opcode() == IrOpcode::kFrameState); | 1817 DCHECK(state->opcode() == IrOpcode::kFrameState); |
| 1809 DCHECK_EQ(kFrameStateInputCount, state->InputCount()); | 1818 DCHECK_EQ(kFrameStateInputCount, state->InputCount()); |
| 1810 FrameStateInfo state_info = OpParameter<FrameStateInfo>(state); | 1819 FrameStateInfo state_info = OpParameter<FrameStateInfo>(state); |
| 1811 | 1820 |
| 1812 int parameters = static_cast<int>( | 1821 int parameters = static_cast<int>( |
| 1813 StateValuesAccess(state->InputAt(kFrameStateParametersInput)).size()); | 1822 StateValuesAccess(state->InputAt(kFrameStateParametersInput)).size()); |
| 1814 int locals = static_cast<int>( | 1823 int locals = static_cast<int>( |
| 1815 StateValuesAccess(state->InputAt(kFrameStateLocalsInput)).size()); | 1824 StateValuesAccess(state->InputAt(kFrameStateLocalsInput)).size()); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1828 return new (instruction_zone()) FrameStateDescriptor( | 1837 return new (instruction_zone()) FrameStateDescriptor( |
| 1829 instruction_zone(), state_info.type(), state_info.bailout_id(), | 1838 instruction_zone(), state_info.type(), state_info.bailout_id(), |
| 1830 state_info.state_combine(), parameters, locals, stack, | 1839 state_info.state_combine(), parameters, locals, stack, |
| 1831 state_info.shared_info(), outer_state); | 1840 state_info.shared_info(), outer_state); |
| 1832 } | 1841 } |
| 1833 | 1842 |
| 1834 | 1843 |
| 1835 } // namespace compiler | 1844 } // namespace compiler |
| 1836 } // namespace internal | 1845 } // namespace internal |
| 1837 } // namespace v8 | 1846 } // namespace v8 |
| OLD | NEW |