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 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1863 __ Ret(); | 1863 __ Ret(); |
1864 | 1864 |
1865 // 3. Raise a TypeError if the receiver is not a date. | 1865 // 3. Raise a TypeError if the receiver is not a date. |
1866 __ Bind(&receiver_not_date); | 1866 __ Bind(&receiver_not_date); |
1867 { | 1867 { |
1868 FrameScope scope(masm, StackFrame::MANUAL); | 1868 FrameScope scope(masm, StackFrame::MANUAL); |
1869 __ Push(x0); | 1869 __ Push(x0); |
1870 __ Mov(x0, Smi::FromInt(0)); | 1870 __ Mov(x0, Smi::FromInt(0)); |
1871 __ EnterBuiltinFrame(cp, x1, x0); | 1871 __ EnterBuiltinFrame(cp, x1, x0); |
1872 __ CallRuntime(Runtime::kThrowNotDateError); | 1872 __ CallRuntime(Runtime::kThrowNotDateError); |
| 1873 |
| 1874 // It's far from obvious, but this final trailing instruction after the call |
| 1875 // is required for StackFrame::LookupCode to work correctly. To illustrate |
| 1876 // why: if call were the final instruction in the code object, then the pc |
| 1877 // (== return address) would point beyond the code object when the stack is |
| 1878 // traversed. When we then try to look up the code object through |
| 1879 // StackFrame::LookupCode, we actually return the next code object that |
| 1880 // happens to be on the same page in memory. |
| 1881 // TODO(jgruber): A proper fix for this would be nice. |
| 1882 __ nop(); |
1873 } | 1883 } |
1874 } | 1884 } |
1875 | 1885 |
1876 // static | 1886 // static |
1877 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { | 1887 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { |
1878 // ----------- S t a t e ------------- | 1888 // ----------- S t a t e ------------- |
1879 // -- x0 : argc | 1889 // -- x0 : argc |
1880 // -- jssp[0] : argArray (if argc == 2) | 1890 // -- jssp[0] : argArray (if argc == 2) |
1881 // -- jssp[8] : thisArg (if argc >= 1) | 1891 // -- jssp[8] : thisArg (if argc >= 1) |
1882 // -- jssp[16] : receiver | 1892 // -- jssp[16] : receiver |
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3037 __ Unreachable(); | 3047 __ Unreachable(); |
3038 } | 3048 } |
3039 } | 3049 } |
3040 | 3050 |
3041 #undef __ | 3051 #undef __ |
3042 | 3052 |
3043 } // namespace internal | 3053 } // namespace internal |
3044 } // namespace v8 | 3054 } // namespace v8 |
3045 | 3055 |
3046 #endif // V8_TARGET_ARCH_ARM | 3056 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |