OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/debug.h" | 10 #include "src/debug.h" |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 // sp[2]: number of arguments (smi-tagged) | 775 // sp[2]: number of arguments (smi-tagged) |
776 Label loop, entry; | 776 Label loop, entry; |
777 __ b(&entry); | 777 __ b(&entry); |
778 __ bind(&loop); | 778 __ bind(&loop); |
779 __ ldr(ip, MemOperand(r2, r4, LSL, kPointerSizeLog2 - 1)); | 779 __ ldr(ip, MemOperand(r2, r4, LSL, kPointerSizeLog2 - 1)); |
780 __ push(ip); | 780 __ push(ip); |
781 __ bind(&entry); | 781 __ bind(&entry); |
782 __ sub(r4, r4, Operand(2), SetCC); | 782 __ sub(r4, r4, Operand(2), SetCC); |
783 __ b(ge, &loop); | 783 __ b(ge, &loop); |
784 | 784 |
785 __ add(r0, r0, Operand(1)); | |
786 | |
787 // Handle step in. | 785 // Handle step in. |
788 Label skip_step_in; | 786 Label skip_step_in; |
789 ExternalReference debug_step_in_fp = | 787 ExternalReference debug_step_in_fp = |
790 ExternalReference::debug_step_in_fp_address(masm->isolate()); | 788 ExternalReference::debug_step_in_fp_address(masm->isolate()); |
791 __ mov(r2, Operand(debug_step_in_fp)); | 789 __ mov(r2, Operand(debug_step_in_fp)); |
792 __ ldr(r2, MemOperand(r2)); | 790 __ ldr(r2, MemOperand(r2)); |
793 __ tst(r2, r2); | 791 __ tst(r2, r2); |
794 __ b(eq, &skip_step_in); | 792 __ b(eq, &skip_step_in); |
795 | 793 |
796 __ Push(r0); | 794 __ Push(r0); |
797 __ Push(r1); | 795 __ Push(r1); |
798 __ Push(r1); | 796 __ Push(r1); |
799 __ CallRuntime(Runtime::kHandleStepInForDerivedConstructors, 1); | 797 __ CallRuntime(Runtime::kHandleStepInForDerivedConstructors, 1); |
800 __ Pop(r1); | 798 __ Pop(r1); |
801 __ Pop(r0); | 799 __ Pop(r0); |
802 | 800 |
803 __ bind(&skip_step_in); | 801 __ bind(&skip_step_in); |
804 | 802 |
805 // Call the function. | 803 // Call the function. |
806 // r0: number of arguments | 804 // r0: number of arguments |
807 // r1: constructor function | 805 // r1: constructor function |
808 ParameterCount actual(r0); | 806 ParameterCount actual(r0); |
809 __ InvokeFunction(r1, actual, CALL_FUNCTION, NullCallWrapper()); | 807 __ InvokeFunction(r1, actual, CALL_FUNCTION, NullCallWrapper()); |
810 | 808 |
811 // Restore context from the frame. | 809 // Restore context from the frame. |
812 // r0: result | 810 // r0: result |
813 // sp[0]: number of arguments (smi-tagged) | 811 // sp[0]: number of arguments (smi-tagged) |
814 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 812 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
815 __ ldr(r1, MemOperand(sp, 0)); | 813 // Get arguments count, skipping over new.target. |
| 814 __ ldr(r1, MemOperand(sp, kPointerSize)); |
816 | 815 |
817 // Leave construct frame. | 816 // Leave construct frame. |
818 } | 817 } |
819 | 818 |
820 __ add(sp, sp, Operand(r1, LSL, kPointerSizeLog2 - 1)); | 819 __ add(sp, sp, Operand(r1, LSL, kPointerSizeLog2 - 1)); |
821 __ add(sp, sp, Operand(kPointerSize)); | 820 __ add(sp, sp, Operand(kPointerSize)); |
822 __ Jump(lr); | 821 __ Jump(lr); |
823 } | 822 } |
824 | 823 |
825 | 824 |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1811 } | 1810 } |
1812 } | 1811 } |
1813 | 1812 |
1814 | 1813 |
1815 #undef __ | 1814 #undef __ |
1816 | 1815 |
1817 } // namespace internal | 1816 } // namespace internal |
1818 } // namespace v8 | 1817 } // namespace v8 |
1819 | 1818 |
1820 #endif // V8_TARGET_ARCH_ARM | 1819 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |