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 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1781 case CallDescriptor::kCallAddress: | 1781 case CallDescriptor::kCallAddress: |
1782 opcode = kArchTailCallAddress; | 1782 opcode = kArchTailCallAddress; |
1783 break; | 1783 break; |
1784 default: | 1784 default: |
1785 UNREACHABLE(); | 1785 UNREACHABLE(); |
1786 return; | 1786 return; |
1787 } | 1787 } |
1788 } | 1788 } |
1789 opcode |= MiscField::encode(descriptor->flags()); | 1789 opcode |= MiscField::encode(descriptor->flags()); |
1790 | 1790 |
1791 buffer.instruction_args.push_back(g.TempImmediate(stack_param_delta)); | 1791 Emit(kArchPrepareTailCall, g.NoOutput()); |
1792 | 1792 |
1793 Emit(kArchPrepareTailCall, g.NoOutput(), | 1793 int first_unused_stack_slot = |
1794 g.TempImmediate(stack_param_delta)); | 1794 (V8_TARGET_ARCH_STORES_RETURN_ADDRESS_ON_STACK ? 1 : 0) + |
| 1795 stack_param_delta; |
| 1796 buffer.instruction_args.push_back(g.TempImmediate(first_unused_stack_slot)); |
1795 | 1797 |
1796 // Emit the tailcall instruction. | 1798 // Emit the tailcall instruction. |
1797 Emit(opcode, 0, nullptr, buffer.instruction_args.size(), | 1799 Emit(opcode, 0, nullptr, buffer.instruction_args.size(), |
1798 &buffer.instruction_args.front(), temps.size(), | 1800 &buffer.instruction_args.front(), temps.size(), |
1799 temps.empty() ? nullptr : &temps.front()); | 1801 temps.empty() ? nullptr : &temps.front()); |
1800 } else { | 1802 } else { |
1801 FrameStateDescriptor* frame_state_descriptor = | 1803 FrameStateDescriptor* frame_state_descriptor = |
1802 descriptor->NeedsFrameState() | 1804 descriptor->NeedsFrameState() |
1803 ? GetFrameStateDescriptor( | 1805 ? GetFrameStateDescriptor( |
1804 node->InputAt(static_cast<int>(descriptor->InputCount()))) | 1806 node->InputAt(static_cast<int>(descriptor->InputCount()))) |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1969 return new (instruction_zone()) FrameStateDescriptor( | 1971 return new (instruction_zone()) FrameStateDescriptor( |
1970 instruction_zone(), state_info.type(), state_info.bailout_id(), | 1972 instruction_zone(), state_info.type(), state_info.bailout_id(), |
1971 state_info.state_combine(), parameters, locals, stack, | 1973 state_info.state_combine(), parameters, locals, stack, |
1972 state_info.shared_info(), outer_state); | 1974 state_info.shared_info(), outer_state); |
1973 } | 1975 } |
1974 | 1976 |
1975 | 1977 |
1976 } // namespace compiler | 1978 } // namespace compiler |
1977 } // namespace internal | 1979 } // namespace internal |
1978 } // namespace v8 | 1980 } // namespace v8 |
OLD | NEW |