| 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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 case IrOpcode::kFloat64ExtractLowWord32: | 754 case IrOpcode::kFloat64ExtractLowWord32: |
| 755 return MarkAsWord32(node), VisitFloat64ExtractLowWord32(node); | 755 return MarkAsWord32(node), VisitFloat64ExtractLowWord32(node); |
| 756 case IrOpcode::kFloat64ExtractHighWord32: | 756 case IrOpcode::kFloat64ExtractHighWord32: |
| 757 return MarkAsWord32(node), VisitFloat64ExtractHighWord32(node); | 757 return MarkAsWord32(node), VisitFloat64ExtractHighWord32(node); |
| 758 case IrOpcode::kFloat64InsertLowWord32: | 758 case IrOpcode::kFloat64InsertLowWord32: |
| 759 return MarkAsFloat64(node), VisitFloat64InsertLowWord32(node); | 759 return MarkAsFloat64(node), VisitFloat64InsertLowWord32(node); |
| 760 case IrOpcode::kFloat64InsertHighWord32: | 760 case IrOpcode::kFloat64InsertHighWord32: |
| 761 return MarkAsFloat64(node), VisitFloat64InsertHighWord32(node); | 761 return MarkAsFloat64(node), VisitFloat64InsertHighWord32(node); |
| 762 case IrOpcode::kLoadStackPointer: | 762 case IrOpcode::kLoadStackPointer: |
| 763 return VisitLoadStackPointer(node); | 763 return VisitLoadStackPointer(node); |
| 764 case IrOpcode::kLoadFramePointer: |
| 765 return VisitLoadFramePointer(node); |
| 764 case IrOpcode::kCheckedLoad: { | 766 case IrOpcode::kCheckedLoad: { |
| 765 MachineType rep = OpParameter<MachineType>(node); | 767 MachineType rep = OpParameter<MachineType>(node); |
| 766 MarkAsRepresentation(rep, node); | 768 MarkAsRepresentation(rep, node); |
| 767 return VisitCheckedLoad(node); | 769 return VisitCheckedLoad(node); |
| 768 } | 770 } |
| 769 case IrOpcode::kCheckedStore: | 771 case IrOpcode::kCheckedStore: |
| 770 return VisitCheckedStore(node); | 772 return VisitCheckedStore(node); |
| 771 default: | 773 default: |
| 772 V8_Fatal(__FILE__, __LINE__, "Unexpected operator #%d:%s @ node #%d", | 774 V8_Fatal(__FILE__, __LINE__, "Unexpected operator #%d:%s @ node #%d", |
| 773 node->opcode(), node->op()->mnemonic(), node->id()); | 775 node->opcode(), node->op()->mnemonic(), node->id()); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 784 g.UseRegister(node->InputAt(0))); | 786 g.UseRegister(node->InputAt(0))); |
| 785 } | 787 } |
| 786 | 788 |
| 787 | 789 |
| 788 void InstructionSelector::VisitLoadStackPointer(Node* node) { | 790 void InstructionSelector::VisitLoadStackPointer(Node* node) { |
| 789 OperandGenerator g(this); | 791 OperandGenerator g(this); |
| 790 Emit(kArchStackPointer, g.DefineAsRegister(node)); | 792 Emit(kArchStackPointer, g.DefineAsRegister(node)); |
| 791 } | 793 } |
| 792 | 794 |
| 793 | 795 |
| 796 void InstructionSelector::VisitLoadFramePointer(Node* node) { |
| 797 OperandGenerator g(this); |
| 798 Emit(kArchFramePointer, g.DefineAsRegister(node)); |
| 799 } |
| 800 |
| 801 |
| 794 void InstructionSelector::EmitTableSwitch(const SwitchInfo& sw, | 802 void InstructionSelector::EmitTableSwitch(const SwitchInfo& sw, |
| 795 InstructionOperand& index_operand) { | 803 InstructionOperand& index_operand) { |
| 796 OperandGenerator g(this); | 804 OperandGenerator g(this); |
| 797 size_t input_count = 2 + sw.value_range; | 805 size_t input_count = 2 + sw.value_range; |
| 798 auto* inputs = zone()->NewArray<InstructionOperand>(input_count); | 806 auto* inputs = zone()->NewArray<InstructionOperand>(input_count); |
| 799 inputs[0] = index_operand; | 807 inputs[0] = index_operand; |
| 800 InstructionOperand default_operand = g.Label(sw.default_branch); | 808 InstructionOperand default_operand = g.Label(sw.default_branch); |
| 801 std::fill(&inputs[1], &inputs[input_count], default_operand); | 809 std::fill(&inputs[1], &inputs[input_count], default_operand); |
| 802 for (size_t index = 0; index < sw.case_count; ++index) { | 810 for (size_t index = 0; index < sw.case_count; ++index) { |
| 803 size_t value = sw.case_values[index] - sw.min_value; | 811 size_t value = sw.case_values[index] - sw.min_value; |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 MachineOperatorBuilder::Flags | 1161 MachineOperatorBuilder::Flags |
| 1154 InstructionSelector::SupportedMachineOperatorFlags() { | 1162 InstructionSelector::SupportedMachineOperatorFlags() { |
| 1155 return MachineOperatorBuilder::Flag::kNoFlags; | 1163 return MachineOperatorBuilder::Flag::kNoFlags; |
| 1156 } | 1164 } |
| 1157 | 1165 |
| 1158 #endif // !V8_TURBOFAN_BACKEND | 1166 #endif // !V8_TURBOFAN_BACKEND |
| 1159 | 1167 |
| 1160 } // namespace compiler | 1168 } // namespace compiler |
| 1161 } // namespace internal | 1169 } // namespace internal |
| 1162 } // namespace v8 | 1170 } // namespace v8 |
| OLD | NEW |