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

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

Issue 1203103003: Unify the stack layout for construct frames (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix deopt case and clean up constants Created 5 years, 5 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/mips/frames-mips.h ('k') | src/mips64/frames-mips64.h » ('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 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 5
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #if V8_TARGET_ARCH_MIPS64 9 #if V8_TARGET_ARCH_MIPS64
10 10
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 // a2 is an AllocationSite. We are creating a memento from it, so we 642 // a2 is an AllocationSite. We are creating a memento from it, so we
643 // need to increment the memento create count. 643 // need to increment the memento create count.
644 __ ld(a3, FieldMemOperand(a2, 644 __ ld(a3, FieldMemOperand(a2,
645 AllocationSite::kPretenureCreateCountOffset)); 645 AllocationSite::kPretenureCreateCountOffset));
646 __ Daddu(a3, a3, Operand(Smi::FromInt(1))); 646 __ Daddu(a3, a3, Operand(Smi::FromInt(1)));
647 __ sd(a3, FieldMemOperand(a2, 647 __ sd(a3, FieldMemOperand(a2,
648 AllocationSite::kPretenureCreateCountOffset)); 648 AllocationSite::kPretenureCreateCountOffset));
649 __ bind(&count_incremented); 649 __ bind(&count_incremented);
650 } 650 }
651 651
652 __ Pop(a1);
653
652 __ Push(t0, t0); 654 __ Push(t0, t0);
653 655
654 // Reload the number of arguments from the stack. 656 // Reload the number of arguments from the stack.
655 // sp[0]: receiver 657 // sp[0]: receiver
656 // sp[1]: receiver 658 // sp[1]: receiver
657 // sp[2]: constructor function 659 // sp[2]: number of arguments (smi-tagged)
658 // sp[3]: number of arguments (smi-tagged) 660 __ ld(a3, MemOperand(sp, 2 * kPointerSize));
659 __ ld(a1, MemOperand(sp, 2 * kPointerSize));
660 __ ld(a3, MemOperand(sp, 3 * kPointerSize));
661 661
662 // Set up pointer to last argument. 662 // Set up pointer to last argument.
663 __ Daddu(a2, fp, Operand(StandardFrameConstants::kCallerSPOffset)); 663 __ Daddu(a2, fp, Operand(StandardFrameConstants::kCallerSPOffset));
664 664
665 // Set up number of arguments for function call below. 665 // Set up number of arguments for function call below.
666 __ SmiUntag(a0, a3); 666 __ SmiUntag(a0, a3);
667 667
668 // Copy arguments and receiver to the expression stack. 668 // Copy arguments and receiver to the expression stack.
669 // a0: number of arguments 669 // a0: number of arguments
670 // a1: constructor function 670 // a1: constructor function
671 // a2: address of last argument (caller sp) 671 // a2: address of last argument (caller sp)
672 // a3: number of arguments (smi-tagged) 672 // a3: number of arguments (smi-tagged)
673 // sp[0]: receiver 673 // sp[0]: receiver
674 // sp[1]: receiver 674 // sp[1]: receiver
675 // sp[2]: constructor function 675 // sp[2]: number of arguments (smi-tagged)
676 // sp[3]: number of arguments (smi-tagged)
677 Label loop, entry; 676 Label loop, entry;
678 __ SmiUntag(a3); 677 __ SmiUntag(a3);
679 __ jmp(&entry); 678 __ jmp(&entry);
680 __ bind(&loop); 679 __ bind(&loop);
681 __ dsll(a4, a3, kPointerSizeLog2); 680 __ dsll(a4, a3, kPointerSizeLog2);
682 __ Daddu(a4, a2, Operand(a4)); 681 __ Daddu(a4, a2, Operand(a4));
683 __ ld(a5, MemOperand(a4)); 682 __ ld(a5, MemOperand(a4));
684 __ push(a5); 683 __ push(a5);
685 __ bind(&entry); 684 __ bind(&entry);
686 __ Daddu(a3, a3, Operand(-1)); 685 __ Daddu(a3, a3, Operand(-1));
(...skipping 21 matching lines...) Expand all
708 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 707 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
709 708
710 // If the result is an object (in the ECMA sense), we should get rid 709 // If the result is an object (in the ECMA sense), we should get rid
711 // of the receiver and use the result; see ECMA-262 section 13.2.2-7 710 // of the receiver and use the result; see ECMA-262 section 13.2.2-7
712 // on page 74. 711 // on page 74.
713 Label use_receiver, exit; 712 Label use_receiver, exit;
714 713
715 // If the result is a smi, it is *not* an object in the ECMA sense. 714 // If the result is a smi, it is *not* an object in the ECMA sense.
716 // v0: result 715 // v0: result
717 // sp[0]: receiver (newly allocated object) 716 // sp[0]: receiver (newly allocated object)
718 // sp[1]: constructor function 717 // sp[1]: number of arguments (smi-tagged)
719 // sp[2]: number of arguments (smi-tagged)
720 __ JumpIfSmi(v0, &use_receiver); 718 __ JumpIfSmi(v0, &use_receiver);
721 719
722 // If the type of the result (stored in its map) is less than 720 // If the type of the result (stored in its map) is less than
723 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. 721 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense.
724 __ GetObjectType(v0, a1, a3); 722 __ GetObjectType(v0, a1, a3);
725 __ Branch(&exit, greater_equal, a3, Operand(FIRST_SPEC_OBJECT_TYPE)); 723 __ Branch(&exit, greater_equal, a3, Operand(FIRST_SPEC_OBJECT_TYPE));
726 724
727 // Throw away the result of the constructor invocation and use the 725 // Throw away the result of the constructor invocation and use the
728 // on-stack receiver as the result. 726 // on-stack receiver as the result.
729 __ bind(&use_receiver); 727 __ bind(&use_receiver);
730 __ ld(v0, MemOperand(sp)); 728 __ ld(v0, MemOperand(sp));
731 729
732 // Remove receiver from the stack, remove caller arguments, and 730 // Remove receiver from the stack, remove caller arguments, and
733 // return. 731 // return.
734 __ bind(&exit); 732 __ bind(&exit);
735 // v0: result 733 // v0: result
736 // sp[0]: receiver (newly allocated object) 734 // sp[0]: receiver (newly allocated object)
737 // sp[1]: constructor function 735 // sp[1]: number of arguments (smi-tagged)
738 // sp[2]: number of arguments (smi-tagged) 736 __ ld(a1, MemOperand(sp, kPointerSize));
739 __ ld(a1, MemOperand(sp, 2 * kPointerSize));
740 737
741 // Leave construct frame. 738 // Leave construct frame.
742 } 739 }
743 740
744 __ SmiScale(a4, a1, kPointerSizeLog2); 741 __ SmiScale(a4, a1, kPointerSizeLog2);
745 __ Daddu(sp, sp, a4); 742 __ Daddu(sp, sp, a4);
746 __ Daddu(sp, sp, kPointerSize); 743 __ Daddu(sp, sp, kPointerSize);
747 __ IncrementCounter(isolate->counters()->constructed_objects(), 1, a1, a2); 744 __ IncrementCounter(isolate->counters()->constructed_objects(), 1, a1, a2);
748 __ Ret(); 745 __ Ret();
749 } 746 }
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
1846 } 1843 }
1847 } 1844 }
1848 1845
1849 1846
1850 #undef __ 1847 #undef __
1851 1848
1852 } // namespace internal 1849 } // namespace internal
1853 } // namespace v8 1850 } // namespace v8
1854 1851
1855 #endif // V8_TARGET_ARCH_MIPS64 1852 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/frames-mips.h ('k') | src/mips64/frames-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698