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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/debug.h" | 10 #include "src/debug.h" |
(...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1529 __ Bind(&validate_arguments); | 1529 __ Bind(&validate_arguments); |
1530 __ Ldr(function, MemOperand(fp, kFunctionOffset)); | 1530 __ Ldr(function, MemOperand(fp, kFunctionOffset)); |
1531 __ Ldr(args, MemOperand(fp, kArgumentsOffset)); | 1531 __ Ldr(args, MemOperand(fp, kArgumentsOffset)); |
1532 __ Ldr(newTarget, MemOperand(fp, kNewTargetOffset)); | 1532 __ Ldr(newTarget, MemOperand(fp, kNewTargetOffset)); |
1533 __ Push(function, args, newTarget); | 1533 __ Push(function, args, newTarget); |
1534 __ InvokeBuiltin(Builtins::REFLECT_CONSTRUCT_PREPARE, CALL_FUNCTION); | 1534 __ InvokeBuiltin(Builtins::REFLECT_CONSTRUCT_PREPARE, CALL_FUNCTION); |
1535 Register argc = x0; | 1535 Register argc = x0; |
1536 | 1536 |
1537 Generate_CheckStackOverflow(masm, kFunctionOffset, argc, kArgcIsSmiTagged); | 1537 Generate_CheckStackOverflow(masm, kFunctionOffset, argc, kArgcIsSmiTagged); |
1538 | 1538 |
1539 // Push current limit and index, constructor & newTarget | 1539 // Push current limit and index & constructor function as callee. |
1540 __ Mov(x1, 0); // Initial index. | 1540 __ Mov(x1, 0); // Initial index. |
1541 __ Ldr(newTarget, MemOperand(fp, kNewTargetOffset)); | 1541 __ Push(argc, x1, function); |
1542 __ Push(argc, x1, newTarget, function); | |
1543 | 1542 |
1544 // Copy all arguments from the array to the stack. | 1543 // Copy all arguments from the array to the stack. |
1545 Generate_PushAppliedArguments( | 1544 Generate_PushAppliedArguments( |
1546 masm, kArgumentsOffset, kIndexOffset, kLimitOffset); | 1545 masm, kArgumentsOffset, kIndexOffset, kLimitOffset); |
1547 | 1546 |
1548 __ Ldr(x1, MemOperand(fp, kFunctionOffset)); | |
1549 // Use undefined feedback vector | 1547 // Use undefined feedback vector |
1550 __ LoadRoot(x2, Heap::kUndefinedValueRootIndex); | 1548 __ LoadRoot(x2, Heap::kUndefinedValueRootIndex); |
| 1549 __ Ldr(x1, MemOperand(fp, kFunctionOffset)); |
| 1550 __ Ldr(x4, MemOperand(fp, kNewTargetOffset)); |
1551 | 1551 |
1552 // Call the function. | 1552 // Call the function. |
1553 CallConstructStub stub(masm->isolate(), SUPER_CONSTRUCTOR_CALL); | 1553 CallConstructStub stub(masm->isolate(), SUPER_CONSTRUCTOR_CALL); |
1554 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 1554 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
1555 | 1555 |
1556 __ Drop(1); | 1556 // Leave internal frame. |
1557 } | 1557 } |
1558 __ Drop(kStackSize); | 1558 __ Drop(kStackSize); |
1559 __ Ret(); | 1559 __ Ret(); |
1560 } | 1560 } |
1561 | 1561 |
1562 | 1562 |
1563 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { | 1563 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { |
1564 ASM_LOCATION("Builtins::Generate_FunctionApply"); | 1564 ASM_LOCATION("Builtins::Generate_FunctionApply"); |
1565 Generate_ApplyHelper(masm, false); | 1565 Generate_ApplyHelper(masm, false); |
1566 } | 1566 } |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1789 } | 1789 } |
1790 } | 1790 } |
1791 | 1791 |
1792 | 1792 |
1793 #undef __ | 1793 #undef __ |
1794 | 1794 |
1795 } // namespace internal | 1795 } // namespace internal |
1796 } // namespace v8 | 1796 } // namespace v8 |
1797 | 1797 |
1798 #endif // V8_TARGET_ARCH_ARM | 1798 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |