| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 6 | 6 |
| 7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
| 10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 DCHECK(argc_is_tagged == kArgcIsUntaggedInt); | 773 DCHECK(argc_is_tagged == kArgcIsUntaggedInt); |
| 774 __ Cmp(x10, Operand(argc, LSL, kPointerSizeLog2)); | 774 __ Cmp(x10, Operand(argc, LSL, kPointerSizeLog2)); |
| 775 } | 775 } |
| 776 __ B(gt, &enough_stack_space); | 776 __ B(gt, &enough_stack_space); |
| 777 // There is not enough stack space, so use a builtin to throw an appropriate | 777 // There is not enough stack space, so use a builtin to throw an appropriate |
| 778 // error. | 778 // error. |
| 779 if (argc_is_tagged == kArgcIsUntaggedInt) { | 779 if (argc_is_tagged == kArgcIsUntaggedInt) { |
| 780 __ SmiTag(argc); | 780 __ SmiTag(argc); |
| 781 } | 781 } |
| 782 __ Push(function, argc); | 782 __ Push(function, argc); |
| 783 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION); | 783 __ CallRuntime(Runtime::kThrowStackOverflow, 0); |
| 784 // We should never return from the APPLY_OVERFLOW builtin. | 784 // We should never return from the APPLY_OVERFLOW builtin. |
| 785 if (__ emit_debug_code()) { | 785 if (__ emit_debug_code()) { |
| 786 __ Unreachable(); | 786 __ Unreachable(); |
| 787 } | 787 } |
| 788 | 788 |
| 789 __ Bind(&enough_stack_space); | 789 __ Bind(&enough_stack_space); |
| 790 } | 790 } |
| 791 | 791 |
| 792 | 792 |
| 793 // Input: | 793 // Input: |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 // Load frame size from the BytecodeArray object. | 938 // Load frame size from the BytecodeArray object. |
| 939 __ Ldr(w11, FieldMemOperand(kInterpreterBytecodeArrayRegister, | 939 __ Ldr(w11, FieldMemOperand(kInterpreterBytecodeArrayRegister, |
| 940 BytecodeArray::kFrameSizeOffset)); | 940 BytecodeArray::kFrameSizeOffset)); |
| 941 | 941 |
| 942 // Do a stack check to ensure we don't go over the limit. | 942 // Do a stack check to ensure we don't go over the limit. |
| 943 Label ok; | 943 Label ok; |
| 944 DCHECK(jssp.Is(__ StackPointer())); | 944 DCHECK(jssp.Is(__ StackPointer())); |
| 945 __ Sub(x10, jssp, Operand(x11)); | 945 __ Sub(x10, jssp, Operand(x11)); |
| 946 __ CompareRoot(x10, Heap::kRealStackLimitRootIndex); | 946 __ CompareRoot(x10, Heap::kRealStackLimitRootIndex); |
| 947 __ B(hs, &ok); | 947 __ B(hs, &ok); |
| 948 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION); | 948 __ CallRuntime(Runtime::kThrowStackOverflow, 0); |
| 949 __ Bind(&ok); | 949 __ Bind(&ok); |
| 950 | 950 |
| 951 // If ok, push undefined as the initial value for all register file entries. | 951 // If ok, push undefined as the initial value for all register file entries. |
| 952 // Note: there should always be at least one stack slot for the return | 952 // Note: there should always be at least one stack slot for the return |
| 953 // register in the register file. | 953 // register in the register file. |
| 954 Label loop_header; | 954 Label loop_header; |
| 955 __ LoadRoot(x10, Heap::kUndefinedValueRootIndex); | 955 __ LoadRoot(x10, Heap::kUndefinedValueRootIndex); |
| 956 // TODO(rmcilroy): Ensure we always have an even number of registers to | 956 // TODO(rmcilroy): Ensure we always have an even number of registers to |
| 957 // allow stack to be 16 bit aligned (and remove need for jssp). | 957 // allow stack to be 16 bit aligned (and remove need for jssp). |
| 958 __ Lsr(x11, x11, kPointerSizeLog2); | 958 __ Lsr(x11, x11, kPointerSizeLog2); |
| (...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 __ Ret(); | 1856 __ Ret(); |
| 1857 | 1857 |
| 1858 // Call the entry point without adapting the arguments. | 1858 // Call the entry point without adapting the arguments. |
| 1859 __ Bind(&dont_adapt_arguments); | 1859 __ Bind(&dont_adapt_arguments); |
| 1860 __ Jump(code_entry); | 1860 __ Jump(code_entry); |
| 1861 | 1861 |
| 1862 __ Bind(&stack_overflow); | 1862 __ Bind(&stack_overflow); |
| 1863 { | 1863 { |
| 1864 FrameScope frame(masm, StackFrame::MANUAL); | 1864 FrameScope frame(masm, StackFrame::MANUAL); |
| 1865 EnterArgumentsAdaptorFrame(masm); | 1865 EnterArgumentsAdaptorFrame(masm); |
| 1866 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION); | 1866 __ CallRuntime(Runtime::kThrowStackOverflow, 0); |
| 1867 __ Unreachable(); | 1867 __ Unreachable(); |
| 1868 } | 1868 } |
| 1869 } | 1869 } |
| 1870 | 1870 |
| 1871 | 1871 |
| 1872 #undef __ | 1872 #undef __ |
| 1873 | 1873 |
| 1874 } // namespace internal | 1874 } // namespace internal |
| 1875 } // namespace v8 | 1875 } // namespace v8 |
| 1876 | 1876 |
| 1877 #endif // V8_TARGET_ARCH_ARM | 1877 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |