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/assembler-inl.h" | 9 #include "src/assembler-inl.h" |
10 #include "src/base/adapters.h" | 10 #include "src/base/adapters.h" |
(...skipping 1882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1893 inputs[1] = g.Label(sw.default_branch); | 1893 inputs[1] = g.Label(sw.default_branch); |
1894 for (size_t index = 0; index < sw.case_count; ++index) { | 1894 for (size_t index = 0; index < sw.case_count; ++index) { |
1895 int32_t value = sw.case_values[index]; | 1895 int32_t value = sw.case_values[index]; |
1896 BasicBlock* branch = sw.case_branches[index]; | 1896 BasicBlock* branch = sw.case_branches[index]; |
1897 inputs[index * 2 + 2 + 0] = g.TempImmediate(value); | 1897 inputs[index * 2 + 2 + 0] = g.TempImmediate(value); |
1898 inputs[index * 2 + 2 + 1] = g.Label(branch); | 1898 inputs[index * 2 + 2 + 1] = g.Label(branch); |
1899 } | 1899 } |
1900 Emit(kArchLookupSwitch, 0, nullptr, input_count, inputs, 0, nullptr); | 1900 Emit(kArchLookupSwitch, 0, nullptr, input_count, inputs, 0, nullptr); |
1901 } | 1901 } |
1902 | 1902 |
| 1903 void InstructionSelector::VisitStackSlot(Node* node) { |
| 1904 int size = StackSlotSizeOf(node->op()); |
| 1905 int slot = frame_->AllocateSpillSlot(size); |
| 1906 OperandGenerator g(this); |
| 1907 |
| 1908 Emit(kArchStackSlot, g.DefineAsRegister(node), |
| 1909 sequence()->AddImmediate(Constant(slot)), 0, nullptr); |
| 1910 } |
1903 | 1911 |
1904 void InstructionSelector::VisitBitcastTaggedToWord(Node* node) { | 1912 void InstructionSelector::VisitBitcastTaggedToWord(Node* node) { |
1905 EmitIdentity(node); | 1913 EmitIdentity(node); |
1906 } | 1914 } |
1907 | 1915 |
1908 void InstructionSelector::VisitBitcastWordToTagged(Node* node) { | 1916 void InstructionSelector::VisitBitcastWordToTagged(Node* node) { |
1909 OperandGenerator g(this); | 1917 OperandGenerator g(this); |
1910 Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(node->InputAt(0))); | 1918 Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(node->InputAt(0))); |
1911 } | 1919 } |
1912 | 1920 |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2841 return new (instruction_zone()) FrameStateDescriptor( | 2849 return new (instruction_zone()) FrameStateDescriptor( |
2842 instruction_zone(), state_info.type(), state_info.bailout_id(), | 2850 instruction_zone(), state_info.type(), state_info.bailout_id(), |
2843 state_info.state_combine(), parameters, locals, stack, | 2851 state_info.state_combine(), parameters, locals, stack, |
2844 state_info.shared_info(), outer_state); | 2852 state_info.shared_info(), outer_state); |
2845 } | 2853 } |
2846 | 2854 |
2847 | 2855 |
2848 } // namespace compiler | 2856 } // namespace compiler |
2849 } // namespace internal | 2857 } // namespace internal |
2850 } // namespace v8 | 2858 } // namespace v8 |
OLD | NEW |