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 1926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1937 inputs[1] = g.Label(sw.default_branch); | 1937 inputs[1] = g.Label(sw.default_branch); |
1938 for (size_t index = 0; index < sw.case_count; ++index) { | 1938 for (size_t index = 0; index < sw.case_count; ++index) { |
1939 int32_t value = sw.case_values[index]; | 1939 int32_t value = sw.case_values[index]; |
1940 BasicBlock* branch = sw.case_branches[index]; | 1940 BasicBlock* branch = sw.case_branches[index]; |
1941 inputs[index * 2 + 2 + 0] = g.TempImmediate(value); | 1941 inputs[index * 2 + 2 + 0] = g.TempImmediate(value); |
1942 inputs[index * 2 + 2 + 1] = g.Label(branch); | 1942 inputs[index * 2 + 2 + 1] = g.Label(branch); |
1943 } | 1943 } |
1944 Emit(kArchLookupSwitch, 0, nullptr, input_count, inputs, 0, nullptr); | 1944 Emit(kArchLookupSwitch, 0, nullptr, input_count, inputs, 0, nullptr); |
1945 } | 1945 } |
1946 | 1946 |
1947 void InstructionSelector::VisitStackSlot(Node* node) { | |
1948 int size = StackSlotSizeOf(node->op()); | |
1949 int slot = frame_->AllocateSpillSlot(size); | |
1950 OperandGenerator g(this); | |
1951 | |
1952 Emit(kArchStackSlot, g.DefineAsRegister(node), | |
1953 sequence()->AddImmediate(Constant(slot)), 0, nullptr); | |
1954 } | |
1955 | 1947 |
1956 void InstructionSelector::VisitBitcastTaggedToWord(Node* node) { | 1948 void InstructionSelector::VisitBitcastTaggedToWord(Node* node) { |
1957 EmitIdentity(node); | 1949 EmitIdentity(node); |
1958 } | 1950 } |
1959 | 1951 |
1960 void InstructionSelector::VisitBitcastWordToTagged(Node* node) { | 1952 void InstructionSelector::VisitBitcastWordToTagged(Node* node) { |
1961 OperandGenerator g(this); | 1953 OperandGenerator g(this); |
1962 Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(node->InputAt(0))); | 1954 Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(node->InputAt(0))); |
1963 } | 1955 } |
1964 | 1956 |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2939 return new (instruction_zone()) FrameStateDescriptor( | 2931 return new (instruction_zone()) FrameStateDescriptor( |
2940 instruction_zone(), state_info.type(), state_info.bailout_id(), | 2932 instruction_zone(), state_info.type(), state_info.bailout_id(), |
2941 state_info.state_combine(), parameters, locals, stack, | 2933 state_info.state_combine(), parameters, locals, stack, |
2942 state_info.shared_info(), outer_state); | 2934 state_info.shared_info(), outer_state); |
2943 } | 2935 } |
2944 | 2936 |
2945 | 2937 |
2946 } // namespace compiler | 2938 } // namespace compiler |
2947 } // namespace internal | 2939 } // namespace internal |
2948 } // namespace v8 | 2940 } // namespace v8 |
OLD | NEW |