| 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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   701     __ Pop(x1, x0); |   701     __ Pop(x1, x0); | 
|   702  |   702  | 
|   703     __ bind(&skip_step_in); |   703     __ bind(&skip_step_in); | 
|   704  |   704  | 
|   705     // Call the function. |   705     // Call the function. | 
|   706     // x0: number of arguments |   706     // x0: number of arguments | 
|   707     // x1: constructor function |   707     // x1: constructor function | 
|   708     ParameterCount actual(x0); |   708     ParameterCount actual(x0); | 
|   709     __ InvokeFunction(x1, actual, CALL_FUNCTION, NullCallWrapper()); |   709     __ InvokeFunction(x1, actual, CALL_FUNCTION, NullCallWrapper()); | 
|   710  |   710  | 
|   711  |  | 
|   712     // Restore the context from the frame. |   711     // Restore the context from the frame. | 
|   713     // x0: result |   712     // x0: result | 
|   714     // jssp[0]: number of arguments (smi-tagged) |   713     // jssp[0]: number of arguments (smi-tagged) | 
|   715     __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |   714     __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 
|   716  |   715  | 
|   717     // Load number of arguments (smi), skipping over new.target. |   716     // Load number of arguments (smi), skipping over new.target. | 
|   718     __ Peek(x1, kPointerSize); |   717     __ Peek(x1, kPointerSize); | 
|   719  |   718  | 
|   720     // Leave construct frame |   719     // Leave construct frame | 
|   721   } |   720   } | 
| (...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1762  |  1761  | 
|  1763  |  1762  | 
|  1764 // static |  1763 // static | 
|  1765 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { |  1764 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { | 
|  1766   // ----------- S t a t e ------------- |  1765   // ----------- S t a t e ------------- | 
|  1767   //  -- x0 : the number of arguments (not including the receiver) |  1766   //  -- x0 : the number of arguments (not including the receiver) | 
|  1768   //  -- x2 : the address of the first argument to be pushed. Subsequent |  1767   //  -- x2 : the address of the first argument to be pushed. Subsequent | 
|  1769   //          arguments should be consecutive above this, in the same order as |  1768   //          arguments should be consecutive above this, in the same order as | 
|  1770   //          they are to be pushed onto the stack. |  1769   //          they are to be pushed onto the stack. | 
|  1771   //  -- x1 : the target to call (can be any Object). |  1770   //  -- x1 : the target to call (can be any Object). | 
 |  1771   // ----------------------------------- | 
|  1772  |  1772  | 
|  1773   // Find the address of the last argument. |  1773   // Find the address of the last argument. | 
|  1774   __ add(x3, x0, Operand(1));  // Add one for receiver. |  1774   __ add(x3, x0, Operand(1));  // Add one for receiver. | 
|  1775   __ lsl(x3, x3, kPointerSizeLog2); |  1775   __ lsl(x3, x3, kPointerSizeLog2); | 
|  1776   __ sub(x4, x2, x3); |  1776   __ sub(x4, x2, x3); | 
|  1777  |  1777  | 
|  1778   // Push the arguments. |  1778   // Push the arguments. | 
|  1779   Label loop_header, loop_check; |  1779   Label loop_header, loop_check; | 
|  1780   __ Mov(x5, jssp); |  1780   __ Mov(x5, jssp); | 
|  1781   __ Claim(x3, 1); |  1781   __ Claim(x3, 1); | 
|  1782   __ B(&loop_check); |  1782   __ B(&loop_check); | 
|  1783   __ Bind(&loop_header); |  1783   __ Bind(&loop_header); | 
|  1784   // TODO(rmcilroy): Push two at a time once we ensure we keep stack aligned. |  1784   // TODO(rmcilroy): Push two at a time once we ensure we keep stack aligned. | 
|  1785   __ Ldr(x3, MemOperand(x2, -kPointerSize, PostIndex)); |  1785   __ Ldr(x3, MemOperand(x2, -kPointerSize, PostIndex)); | 
|  1786   __ Str(x3, MemOperand(x5, -kPointerSize, PreIndex)); |  1786   __ Str(x3, MemOperand(x5, -kPointerSize, PreIndex)); | 
|  1787   __ Bind(&loop_check); |  1787   __ Bind(&loop_check); | 
|  1788   __ Cmp(x2, x4); |  1788   __ Cmp(x2, x4); | 
|  1789   __ B(gt, &loop_header); |  1789   __ B(gt, &loop_header); | 
|  1790  |  1790  | 
|  1791   // Call the target. |  1791   // Call the target. | 
|  1792   __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |  1792   __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 
|  1793 } |  1793 } | 
|  1794  |  1794  | 
|  1795  |  1795  | 
 |  1796 // static | 
 |  1797 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { | 
 |  1798   // ----------- S t a t e ------------- | 
 |  1799   // -- x0 : argument count (not including receiver) | 
 |  1800   // -- x3 : original constructor | 
 |  1801   // -- x1 : constructor to call | 
 |  1802   // -- x2 : address of the first argument | 
 |  1803   // ----------------------------------- | 
 |  1804  | 
 |  1805   // Find the address of the last argument. | 
 |  1806   __ add(x5, x0, Operand(1));  // Add one for receiver (to be constructed). | 
 |  1807   __ lsl(x5, x5, kPointerSizeLog2); | 
 |  1808  | 
 |  1809   // Set stack pointer and where to stop. | 
 |  1810   __ Mov(x6, jssp); | 
 |  1811   __ Claim(x5, 1); | 
 |  1812   __ sub(x4, x6, x5); | 
 |  1813  | 
 |  1814   // Push a slot for the receiver. | 
 |  1815   __ Str(xzr, MemOperand(x6, -kPointerSize, PreIndex)); | 
 |  1816  | 
 |  1817   Label loop_header, loop_check; | 
 |  1818   // Push the arguments. | 
 |  1819   __ B(&loop_check); | 
 |  1820   __ Bind(&loop_header); | 
 |  1821   // TODO(rmcilroy): Push two at a time once we ensure we keep stack aligned. | 
 |  1822   __ Ldr(x5, MemOperand(x2, -kPointerSize, PostIndex)); | 
 |  1823   __ Str(x5, MemOperand(x6, -kPointerSize, PreIndex)); | 
 |  1824   __ Bind(&loop_check); | 
 |  1825   __ Cmp(x6, x4); | 
 |  1826   __ B(gt, &loop_header); | 
 |  1827  | 
 |  1828   // Call the constructor with x0, x1, and x3 unmodified. | 
 |  1829   __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL); | 
 |  1830 } | 
 |  1831  | 
 |  1832  | 
|  1796 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |  1833 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 
|  1797   ASM_LOCATION("Builtins::Generate_ArgumentsAdaptorTrampoline"); |  1834   ASM_LOCATION("Builtins::Generate_ArgumentsAdaptorTrampoline"); | 
|  1798   // ----------- S t a t e ------------- |  1835   // ----------- S t a t e ------------- | 
|  1799   //  -- x0 : actual number of arguments |  1836   //  -- x0 : actual number of arguments | 
|  1800   //  -- x1 : function (passed through to callee) |  1837   //  -- x1 : function (passed through to callee) | 
|  1801   //  -- x2 : expected number of arguments |  1838   //  -- x2 : expected number of arguments | 
|  1802   // ----------------------------------- |  1839   // ----------------------------------- | 
|  1803  |  1840  | 
|  1804   Label stack_overflow; |  1841   Label stack_overflow; | 
|  1805   ArgumentAdaptorStackCheck(masm, &stack_overflow); |  1842   ArgumentAdaptorStackCheck(masm, &stack_overflow); | 
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1961   } |  1998   } | 
|  1962 } |  1999 } | 
|  1963  |  2000  | 
|  1964  |  2001  | 
|  1965 #undef __ |  2002 #undef __ | 
|  1966  |  2003  | 
|  1967 }  // namespace internal |  2004 }  // namespace internal | 
|  1968 }  // namespace v8 |  2005 }  // namespace v8 | 
|  1969  |  2006  | 
|  1970 #endif  // V8_TARGET_ARCH_ARM |  2007 #endif  // V8_TARGET_ARCH_ARM | 
| OLD | NEW |