Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: src/ppc/builtins-ppc.cc

Issue 935383002: Contribution of PowerPC port (continuation of 422063005) - PPC dir update 2 - mark2 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ppc/assembler-ppc-inl.h ('k') | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 753
754 { 754 {
755 FrameAndConstantPoolScope scope(masm, StackFrame::CONSTRUCT); 755 FrameAndConstantPoolScope scope(masm, StackFrame::CONSTRUCT);
756 756
757 // Smi-tagged arguments count. 757 // Smi-tagged arguments count.
758 __ mr(r7, r3); 758 __ mr(r7, r3);
759 __ SmiTag(r7, SetRC); 759 __ SmiTag(r7, SetRC);
760 760
761 // receiver is the hole. 761 // receiver is the hole.
762 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); 762 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
763 __ Push(r7, ip); 763
764 // smi arguments count, new.target, receiver
765 __ Push(r7, r6, ip);
764 766
765 // Set up pointer to last argument. 767 // Set up pointer to last argument.
766 __ addi(r5, fp, Operand(StandardFrameConstants::kCallerSPOffset)); 768 __ addi(r5, fp, Operand(StandardFrameConstants::kCallerSPOffset));
767 769
768 // Copy arguments and receiver to the expression stack. 770 // Copy arguments and receiver to the expression stack.
769 // r3: number of arguments 771 // r3: number of arguments
770 // r4: constructor function 772 // r4: constructor function
771 // r5: address of last argument (caller sp) 773 // r5: address of last argument (caller sp)
772 // r7: number of arguments (smi-tagged) 774 // r7: number of arguments (smi-tagged)
773 // cr0: compare against zero of arguments 775 // cr0: compare against zero of arguments
774 // sp[0]: receiver 776 // sp[0]: receiver
775 // sp[1]: number of arguments (smi-tagged) 777 // sp[1]: new.target
778 // sp[2]: number of arguments (smi-tagged)
776 Label loop, no_args; 779 Label loop, no_args;
777 __ beq(&no_args, cr0); 780 __ beq(&no_args, cr0);
778 __ ShiftLeftImm(ip, r3, Operand(kPointerSizeLog2)); 781 __ ShiftLeftImm(ip, r3, Operand(kPointerSizeLog2));
779 __ mtctr(r3); 782 __ mtctr(r3);
780 __ bind(&loop); 783 __ bind(&loop);
781 __ subi(ip, ip, Operand(kPointerSize)); 784 __ subi(ip, ip, Operand(kPointerSize));
782 __ LoadPX(r0, MemOperand(r5, ip)); 785 __ LoadPX(r0, MemOperand(r5, ip));
783 __ push(r0); 786 __ push(r0);
784 __ bdnz(&loop); 787 __ bdnz(&loop);
785 __ bind(&no_args); 788 __ bind(&no_args);
786 789
790 __ addi(r3, r3, Operand(1));
791
792 // Handle step in.
793 Label skip_step_in;
794 ExternalReference debug_step_in_fp =
795 ExternalReference::debug_step_in_fp_address(masm->isolate());
796 __ mov(r5, Operand(debug_step_in_fp));
797 __ LoadP(r5, MemOperand(r5));
798 __ and_(r0, r5, r5, SetRC);
799 __ beq(&skip_step_in, cr0);
800
801 __ Push(r3, r4, r4);
802 __ CallRuntime(Runtime::kHandleStepInForDerivedConstructors, 1);
803 __ Pop(r3, r4);
804
805 __ bind(&skip_step_in);
806
787 // Call the function. 807 // Call the function.
788 // r3: number of arguments 808 // r3: number of arguments
789 // r4: constructor function 809 // r4: constructor function
790 ParameterCount actual(r3); 810 ParameterCount actual(r3);
791 __ InvokeFunction(r4, actual, CALL_FUNCTION, NullCallWrapper()); 811 __ InvokeFunction(r4, actual, CALL_FUNCTION, NullCallWrapper());
792 812
793 // Restore context from the frame. 813 // Restore context from the frame.
794 // r3: result 814 // r3: result
795 // sp[0]: number of arguments (smi-tagged) 815 // sp[0]: number of arguments (smi-tagged)
796 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 816 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
1689 __ bkpt(0); 1709 __ bkpt(0);
1690 } 1710 }
1691 } 1711 }
1692 1712
1693 1713
1694 #undef __ 1714 #undef __
1695 } 1715 }
1696 } // namespace v8::internal 1716 } // namespace v8::internal
1697 1717
1698 #endif // V8_TARGET_ARCH_PPC 1718 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/ppc/assembler-ppc-inl.h ('k') | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698