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 1869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1880 inputs[1] = g.Label(sw.default_branch); | 1880 inputs[1] = g.Label(sw.default_branch); |
1881 for (size_t index = 0; index < sw.case_count; ++index) { | 1881 for (size_t index = 0; index < sw.case_count; ++index) { |
1882 int32_t value = sw.case_values[index]; | 1882 int32_t value = sw.case_values[index]; |
1883 BasicBlock* branch = sw.case_branches[index]; | 1883 BasicBlock* branch = sw.case_branches[index]; |
1884 inputs[index * 2 + 2 + 0] = g.TempImmediate(value); | 1884 inputs[index * 2 + 2 + 0] = g.TempImmediate(value); |
1885 inputs[index * 2 + 2 + 1] = g.Label(branch); | 1885 inputs[index * 2 + 2 + 1] = g.Label(branch); |
1886 } | 1886 } |
1887 Emit(kArchLookupSwitch, 0, nullptr, input_count, inputs, 0, nullptr); | 1887 Emit(kArchLookupSwitch, 0, nullptr, input_count, inputs, 0, nullptr); |
1888 } | 1888 } |
1889 | 1889 |
1890 void InstructionSelector::VisitStackSlot(Node* node) { | 1890 void InstructionSelector::VisitStackSlot(Node* node) { |
ahaas
2017/04/24 11:43:54
Can you move this code to platform-specific code?
ivica.bogosavljevic
2017/04/27 13:56:56
Acknowledged.
| |
1891 int size = StackSlotSizeOf(node->op()); | 1891 StackSlotRepresentation rep = StackSlotRepresentationOf(node->op()); |
1892 int slot = frame_->AllocateSpillSlot(size); | 1892 int alignment = rep.alignment(); |
1893 int slot = frame_->AllocateSpillSlot(rep.size(), alignment); | |
1893 OperandGenerator g(this); | 1894 OperandGenerator g(this); |
1894 | 1895 |
1895 Emit(kArchStackSlot, g.DefineAsRegister(node), | 1896 Emit(kArchStackSlot, g.DefineAsRegister(node), |
1896 sequence()->AddImmediate(Constant(slot)), 0, nullptr); | 1897 sequence()->AddImmediate(Constant(slot)), |
1898 sequence()->AddImmediate(Constant(alignment)), 0, nullptr); | |
1897 } | 1899 } |
1898 | 1900 |
1899 void InstructionSelector::VisitBitcastTaggedToWord(Node* node) { | 1901 void InstructionSelector::VisitBitcastTaggedToWord(Node* node) { |
1900 EmitIdentity(node); | 1902 EmitIdentity(node); |
1901 } | 1903 } |
1902 | 1904 |
1903 void InstructionSelector::VisitBitcastWordToTagged(Node* node) { | 1905 void InstructionSelector::VisitBitcastWordToTagged(Node* node) { |
1904 OperandGenerator g(this); | 1906 OperandGenerator g(this); |
1905 Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(node->InputAt(0))); | 1907 Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(node->InputAt(0))); |
1906 } | 1908 } |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2784 return new (instruction_zone()) FrameStateDescriptor( | 2786 return new (instruction_zone()) FrameStateDescriptor( |
2785 instruction_zone(), state_info.type(), state_info.bailout_id(), | 2787 instruction_zone(), state_info.type(), state_info.bailout_id(), |
2786 state_info.state_combine(), parameters, locals, stack, | 2788 state_info.state_combine(), parameters, locals, stack, |
2787 state_info.shared_info(), outer_state); | 2789 state_info.shared_info(), outer_state); |
2788 } | 2790 } |
2789 | 2791 |
2790 | 2792 |
2791 } // namespace compiler | 2793 } // namespace compiler |
2792 } // namespace internal | 2794 } // namespace internal |
2793 } // namespace v8 | 2795 } // namespace v8 |
OLD | NEW |