| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 271 |
| 272 // 2. Load the first argument into x2. | 272 // 2. Load the first argument into x2. |
| 273 { | 273 { |
| 274 Label no_arguments, done; | 274 Label no_arguments, done; |
| 275 __ Move(x6, x0); // Store argc in x6. | 275 __ Move(x6, x0); // Store argc in x6. |
| 276 __ Cbz(x0, &no_arguments); | 276 __ Cbz(x0, &no_arguments); |
| 277 __ Sub(x0, x0, 1); | 277 __ Sub(x0, x0, 1); |
| 278 __ Ldr(x2, MemOperand(jssp, x0, LSL, kPointerSizeLog2)); | 278 __ Ldr(x2, MemOperand(jssp, x0, LSL, kPointerSizeLog2)); |
| 279 __ B(&done); | 279 __ B(&done); |
| 280 __ Bind(&no_arguments); | 280 __ Bind(&no_arguments); |
| 281 __ Mov(x2, Smi::kZero); | 281 __ Mov(x2, Smi::FromInt(0)); |
| 282 __ Bind(&done); | 282 __ Bind(&done); |
| 283 } | 283 } |
| 284 | 284 |
| 285 // 3. Make sure x2 is a number. | 285 // 3. Make sure x2 is a number. |
| 286 { | 286 { |
| 287 Label done_convert; | 287 Label done_convert; |
| 288 __ JumpIfSmi(x2, &done_convert); | 288 __ JumpIfSmi(x2, &done_convert); |
| 289 __ JumpIfObjectType(x2, x4, x4, HEAP_NUMBER_TYPE, &done_convert, eq); | 289 __ JumpIfObjectType(x2, x4, x4, HEAP_NUMBER_TYPE, &done_convert, eq); |
| 290 { | 290 { |
| 291 FrameScope scope(masm, StackFrame::MANUAL); | 291 FrameScope scope(masm, StackFrame::MANUAL); |
| (...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1330 __ TailCallRuntime(Runtime::kThrowStackOverflow); | 1330 __ TailCallRuntime(Runtime::kThrowStackOverflow); |
| 1331 __ Unreachable(); | 1331 __ Unreachable(); |
| 1332 } | 1332 } |
| 1333 } | 1333 } |
| 1334 | 1334 |
| 1335 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { | 1335 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
| 1336 // Set the return address to the correct point in the interpreter entry | 1336 // Set the return address to the correct point in the interpreter entry |
| 1337 // trampoline. | 1337 // trampoline. |
| 1338 Smi* interpreter_entry_return_pc_offset( | 1338 Smi* interpreter_entry_return_pc_offset( |
| 1339 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); | 1339 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); |
| 1340 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::kZero); | 1340 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0)); |
| 1341 __ LoadObject(x1, masm->isolate()->builtins()->InterpreterEntryTrampoline()); | 1341 __ LoadObject(x1, masm->isolate()->builtins()->InterpreterEntryTrampoline()); |
| 1342 __ Add(lr, x1, Operand(interpreter_entry_return_pc_offset->value() + | 1342 __ Add(lr, x1, Operand(interpreter_entry_return_pc_offset->value() + |
| 1343 Code::kHeaderSize - kHeapObjectTag)); | 1343 Code::kHeaderSize - kHeapObjectTag)); |
| 1344 | 1344 |
| 1345 // Initialize the dispatch table register. | 1345 // Initialize the dispatch table register. |
| 1346 __ Mov(kInterpreterDispatchTableRegister, | 1346 __ Mov(kInterpreterDispatchTableRegister, |
| 1347 Operand(ExternalReference::interpreter_dispatch_table_address( | 1347 Operand(ExternalReference::interpreter_dispatch_table_address( |
| 1348 masm->isolate()))); | 1348 masm->isolate()))); |
| 1349 | 1349 |
| 1350 // Get the bytecode array pointer from the frame. | 1350 // Get the bytecode array pointer from the frame. |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1840 | 1840 |
| 1841 { | 1841 { |
| 1842 FrameScope scope(masm, StackFrame::INTERNAL); | 1842 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1843 // Pass function as argument. | 1843 // Pass function as argument. |
| 1844 __ Push(x0); | 1844 __ Push(x0); |
| 1845 __ CallRuntime(Runtime::kCompileForOnStackReplacement); | 1845 __ CallRuntime(Runtime::kCompileForOnStackReplacement); |
| 1846 } | 1846 } |
| 1847 | 1847 |
| 1848 // If the code object is null, just return to the caller. | 1848 // If the code object is null, just return to the caller. |
| 1849 Label skip; | 1849 Label skip; |
| 1850 __ CompareAndBranch(x0, Smi::kZero, ne, &skip); | 1850 __ CompareAndBranch(x0, Smi::FromInt(0), ne, &skip); |
| 1851 __ Ret(); | 1851 __ Ret(); |
| 1852 | 1852 |
| 1853 __ Bind(&skip); | 1853 __ Bind(&skip); |
| 1854 | 1854 |
| 1855 // Drop any potential handler frame that is be sitting on top of the actual | 1855 // Drop any potential handler frame that is be sitting on top of the actual |
| 1856 // JavaScript frame. This is the case then OSR is triggered from bytecode. | 1856 // JavaScript frame. This is the case then OSR is triggered from bytecode. |
| 1857 if (has_handler_frame) { | 1857 if (has_handler_frame) { |
| 1858 __ LeaveFrame(StackFrame::STUB); | 1858 __ LeaveFrame(StackFrame::STUB); |
| 1859 } | 1859 } |
| 1860 | 1860 |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2824 | 2824 |
| 2825 // static | 2825 // static |
| 2826 void Builtins::Generate_AllocateInNewSpace(MacroAssembler* masm) { | 2826 void Builtins::Generate_AllocateInNewSpace(MacroAssembler* masm) { |
| 2827 ASM_LOCATION("Builtins::Generate_AllocateInNewSpace"); | 2827 ASM_LOCATION("Builtins::Generate_AllocateInNewSpace"); |
| 2828 // ----------- S t a t e ------------- | 2828 // ----------- S t a t e ------------- |
| 2829 // -- x1 : requested object size (untagged) | 2829 // -- x1 : requested object size (untagged) |
| 2830 // -- lr : return address | 2830 // -- lr : return address |
| 2831 // ----------------------------------- | 2831 // ----------------------------------- |
| 2832 __ SmiTag(x1); | 2832 __ SmiTag(x1); |
| 2833 __ Push(x1); | 2833 __ Push(x1); |
| 2834 __ Move(cp, Smi::kZero); | 2834 __ Move(cp, Smi::FromInt(0)); |
| 2835 __ TailCallRuntime(Runtime::kAllocateInNewSpace); | 2835 __ TailCallRuntime(Runtime::kAllocateInNewSpace); |
| 2836 } | 2836 } |
| 2837 | 2837 |
| 2838 // static | 2838 // static |
| 2839 void Builtins::Generate_AllocateInOldSpace(MacroAssembler* masm) { | 2839 void Builtins::Generate_AllocateInOldSpace(MacroAssembler* masm) { |
| 2840 ASM_LOCATION("Builtins::Generate_AllocateInOldSpace"); | 2840 ASM_LOCATION("Builtins::Generate_AllocateInOldSpace"); |
| 2841 // ----------- S t a t e ------------- | 2841 // ----------- S t a t e ------------- |
| 2842 // -- x1 : requested object size (untagged) | 2842 // -- x1 : requested object size (untagged) |
| 2843 // -- lr : return address | 2843 // -- lr : return address |
| 2844 // ----------------------------------- | 2844 // ----------------------------------- |
| 2845 __ SmiTag(x1); | 2845 __ SmiTag(x1); |
| 2846 __ Move(x2, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); | 2846 __ Move(x2, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); |
| 2847 __ Push(x1, x2); | 2847 __ Push(x1, x2); |
| 2848 __ Move(cp, Smi::kZero); | 2848 __ Move(cp, Smi::FromInt(0)); |
| 2849 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); | 2849 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); |
| 2850 } | 2850 } |
| 2851 | 2851 |
| 2852 // static | 2852 // static |
| 2853 void Builtins::Generate_Abort(MacroAssembler* masm) { | 2853 void Builtins::Generate_Abort(MacroAssembler* masm) { |
| 2854 ASM_LOCATION("Builtins::Generate_Abort"); | 2854 ASM_LOCATION("Builtins::Generate_Abort"); |
| 2855 // ----------- S t a t e ------------- | 2855 // ----------- S t a t e ------------- |
| 2856 // -- x1 : message_id as Smi | 2856 // -- x1 : message_id as Smi |
| 2857 // -- lr : return address | 2857 // -- lr : return address |
| 2858 // ----------------------------------- | 2858 // ----------------------------------- |
| 2859 MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm); | 2859 MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm); |
| 2860 __ Push(x1); | 2860 __ Push(x1); |
| 2861 __ Move(cp, Smi::kZero); | 2861 __ Move(cp, Smi::FromInt(0)); |
| 2862 __ TailCallRuntime(Runtime::kAbort); | 2862 __ TailCallRuntime(Runtime::kAbort); |
| 2863 } | 2863 } |
| 2864 | 2864 |
| 2865 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 2865 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
| 2866 ASM_LOCATION("Builtins::Generate_ArgumentsAdaptorTrampoline"); | 2866 ASM_LOCATION("Builtins::Generate_ArgumentsAdaptorTrampoline"); |
| 2867 // ----------- S t a t e ------------- | 2867 // ----------- S t a t e ------------- |
| 2868 // -- x0 : actual number of arguments | 2868 // -- x0 : actual number of arguments |
| 2869 // -- x1 : function (passed through to callee) | 2869 // -- x1 : function (passed through to callee) |
| 2870 // -- x2 : expected number of arguments | 2870 // -- x2 : expected number of arguments |
| 2871 // -- x3 : new target (passed through to callee) | 2871 // -- x3 : new target (passed through to callee) |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3006 __ Unreachable(); | 3006 __ Unreachable(); |
| 3007 } | 3007 } |
| 3008 } | 3008 } |
| 3009 | 3009 |
| 3010 #undef __ | 3010 #undef __ |
| 3011 | 3011 |
| 3012 } // namespace internal | 3012 } // namespace internal |
| 3013 } // namespace v8 | 3013 } // namespace v8 |
| 3014 | 3014 |
| 3015 #endif // V8_TARGET_ARCH_ARM | 3015 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |