OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 7 #if V8_TARGET_ARCH_PPC |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/debug.h" | 10 #include "src/debug.h" |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 __ beq(&no_args, cr0); | 781 __ beq(&no_args, cr0); |
782 __ ShiftLeftImm(ip, r3, Operand(kPointerSizeLog2)); | 782 __ ShiftLeftImm(ip, r3, Operand(kPointerSizeLog2)); |
783 __ mtctr(r3); | 783 __ mtctr(r3); |
784 __ bind(&loop); | 784 __ bind(&loop); |
785 __ subi(ip, ip, Operand(kPointerSize)); | 785 __ subi(ip, ip, Operand(kPointerSize)); |
786 __ LoadPX(r0, MemOperand(r5, ip)); | 786 __ LoadPX(r0, MemOperand(r5, ip)); |
787 __ push(r0); | 787 __ push(r0); |
788 __ bdnz(&loop); | 788 __ bdnz(&loop); |
789 __ bind(&no_args); | 789 __ bind(&no_args); |
790 | 790 |
791 __ addi(r3, r3, Operand(1)); | |
792 | |
793 // Handle step in. | 791 // Handle step in. |
794 Label skip_step_in; | 792 Label skip_step_in; |
795 ExternalReference debug_step_in_fp = | 793 ExternalReference debug_step_in_fp = |
796 ExternalReference::debug_step_in_fp_address(masm->isolate()); | 794 ExternalReference::debug_step_in_fp_address(masm->isolate()); |
797 __ mov(r5, Operand(debug_step_in_fp)); | 795 __ mov(r5, Operand(debug_step_in_fp)); |
798 __ LoadP(r5, MemOperand(r5)); | 796 __ LoadP(r5, MemOperand(r5)); |
799 __ and_(r0, r5, r5, SetRC); | 797 __ and_(r0, r5, r5, SetRC); |
800 __ beq(&skip_step_in, cr0); | 798 __ beq(&skip_step_in, cr0); |
801 | 799 |
802 __ Push(r3, r4, r4); | 800 __ Push(r3, r4, r4); |
803 __ CallRuntime(Runtime::kHandleStepInForDerivedConstructors, 1); | 801 __ CallRuntime(Runtime::kHandleStepInForDerivedConstructors, 1); |
804 __ Pop(r3, r4); | 802 __ Pop(r3, r4); |
805 | 803 |
806 __ bind(&skip_step_in); | 804 __ bind(&skip_step_in); |
807 | 805 |
808 // Call the function. | 806 // Call the function. |
809 // r3: number of arguments | 807 // r3: number of arguments |
810 // r4: constructor function | 808 // r4: constructor function |
811 ParameterCount actual(r3); | 809 ParameterCount actual(r3); |
812 __ InvokeFunction(r4, actual, CALL_FUNCTION, NullCallWrapper()); | 810 __ InvokeFunction(r4, actual, CALL_FUNCTION, NullCallWrapper()); |
813 | 811 |
814 // Restore context from the frame. | 812 // Restore context from the frame. |
815 // r3: result | 813 // r3: result |
816 // sp[0]: number of arguments (smi-tagged) | 814 // sp[0]: number of arguments (smi-tagged) |
817 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 815 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
818 __ LoadP(r4, MemOperand(sp, 0)); | 816 // Get arguments count, skipping over new.target. |
| 817 __ LoadP(r4, MemOperand(sp, kPointerSize)); |
819 | 818 |
820 // Leave construct frame. | 819 // Leave construct frame. |
821 } | 820 } |
822 | 821 |
823 __ SmiToPtrArrayOffset(r4, r4); | 822 __ SmiToPtrArrayOffset(r4, r4); |
824 __ add(sp, sp, r4); | 823 __ add(sp, sp, r4); |
825 __ addi(sp, sp, Operand(kPointerSize)); | 824 __ addi(sp, sp, Operand(kPointerSize)); |
826 __ blr(); | 825 __ blr(); |
827 } | 826 } |
828 | 827 |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1880 __ bkpt(0); | 1879 __ bkpt(0); |
1881 } | 1880 } |
1882 } | 1881 } |
1883 | 1882 |
1884 | 1883 |
1885 #undef __ | 1884 #undef __ |
1886 } // namespace internal | 1885 } // namespace internal |
1887 } // namespace v8 | 1886 } // namespace v8 |
1888 | 1887 |
1889 #endif // V8_TARGET_ARCH_PPC | 1888 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |