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 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1749 case CallDescriptor::kCallAddress: | 1749 case CallDescriptor::kCallAddress: |
1750 opcode = kArchTailCallAddress; | 1750 opcode = kArchTailCallAddress; |
1751 break; | 1751 break; |
1752 default: | 1752 default: |
1753 UNREACHABLE(); | 1753 UNREACHABLE(); |
1754 return; | 1754 return; |
1755 } | 1755 } |
1756 } | 1756 } |
1757 opcode |= MiscField::encode(descriptor->flags()); | 1757 opcode |= MiscField::encode(descriptor->flags()); |
1758 | 1758 |
1759 buffer.instruction_args.push_back(g.TempImmediate(stack_param_delta)); | 1759 Emit(kArchPrepareTailCall, g.NoOutput()); |
1760 | 1760 |
1761 Emit(kArchPrepareTailCall, g.NoOutput(), | 1761 int first_unused_stack_slot = |
1762 g.TempImmediate(stack_param_delta)); | 1762 (V8_TARGET_ARCH_STORES_RETURN_ADDRESS_ON_STACK ? 1 : 0) + |
| 1763 stack_param_delta; |
| 1764 buffer.instruction_args.push_back(g.TempImmediate(first_unused_stack_slot)); |
1763 | 1765 |
1764 // Emit the tailcall instruction. | 1766 // Emit the tailcall instruction. |
1765 Emit(opcode, 0, nullptr, buffer.instruction_args.size(), | 1767 Emit(opcode, 0, nullptr, buffer.instruction_args.size(), |
1766 &buffer.instruction_args.front(), temps.size(), | 1768 &buffer.instruction_args.front(), temps.size(), |
1767 temps.empty() ? nullptr : &temps.front()); | 1769 temps.empty() ? nullptr : &temps.front()); |
1768 } else { | 1770 } else { |
1769 FrameStateDescriptor* frame_state_descriptor = | 1771 FrameStateDescriptor* frame_state_descriptor = |
1770 descriptor->NeedsFrameState() | 1772 descriptor->NeedsFrameState() |
1771 ? GetFrameStateDescriptor( | 1773 ? GetFrameStateDescriptor( |
1772 node->InputAt(static_cast<int>(descriptor->InputCount()))) | 1774 node->InputAt(static_cast<int>(descriptor->InputCount()))) |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1937 return new (instruction_zone()) FrameStateDescriptor( | 1939 return new (instruction_zone()) FrameStateDescriptor( |
1938 instruction_zone(), state_info.type(), state_info.bailout_id(), | 1940 instruction_zone(), state_info.type(), state_info.bailout_id(), |
1939 state_info.state_combine(), parameters, locals, stack, | 1941 state_info.state_combine(), parameters, locals, stack, |
1940 state_info.shared_info(), outer_state); | 1942 state_info.shared_info(), outer_state); |
1941 } | 1943 } |
1942 | 1944 |
1943 | 1945 |
1944 } // namespace compiler | 1946 } // namespace compiler |
1945 } // namespace internal | 1947 } // namespace internal |
1946 } // namespace v8 | 1948 } // namespace v8 |
OLD | NEW |