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

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

Issue 2078443002: [builtins] Use BUILTIN frame in DatePrototype_GetField (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@20160616-builtin-frame
Patch Set: Created 4 years, 6 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
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 #if V8_TARGET_ARCH_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 #include "src/codegen.h" 7 #include "src/codegen.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 1726
1727 // And "return" to the OSR entry point of the function. 1727 // And "return" to the OSR entry point of the function.
1728 __ Ret(); 1728 __ Ret();
1729 } 1729 }
1730 1730
1731 1731
1732 // static 1732 // static
1733 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm, 1733 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm,
1734 int field_index) { 1734 int field_index) {
1735 // ----------- S t a t e ------------- 1735 // ----------- S t a t e -------------
1736 // -- a0 : number of arguments
1737 // -- a1 : function
1738 // -- cp : context
1736 // -- sp[0] : receiver 1739 // -- sp[0] : receiver
1737 // ----------------------------------- 1740 // -----------------------------------
1738 1741
1739 // 1. Pop receiver into a0 and check that it's actually a JSDate object. 1742 // 1. Pop receiver into a0 and check that it's actually a JSDate object.
1740 Label receiver_not_date; 1743 Label receiver_not_date;
1741 { 1744 {
1745 __ Move(a2, a0); // Store argc for builtin frame construction.
1742 __ Pop(a0); 1746 __ Pop(a0);
1743 __ JumpIfSmi(a0, &receiver_not_date); 1747 __ JumpIfSmi(a0, &receiver_not_date);
1744 __ GetObjectType(a0, t0, t0); 1748 __ GetObjectType(a0, t0, t0);
1745 __ Branch(&receiver_not_date, ne, t0, Operand(JS_DATE_TYPE)); 1749 __ Branch(&receiver_not_date, ne, t0, Operand(JS_DATE_TYPE));
1746 } 1750 }
1747 1751
1748 // 2. Load the specified date field, falling back to the runtime as necessary. 1752 // 2. Load the specified date field, falling back to the runtime as necessary.
1749 if (field_index == JSDate::kDateValue) { 1753 if (field_index == JSDate::kDateValue) {
1750 __ Ret(USE_DELAY_SLOT); 1754 __ Ret(USE_DELAY_SLOT);
1751 __ lw(v0, FieldMemOperand(a0, JSDate::kValueOffset)); // In delay slot. 1755 __ lw(v0, FieldMemOperand(a0, JSDate::kValueOffset)); // In delay slot.
(...skipping 13 matching lines...) Expand all
1765 FrameScope scope(masm, StackFrame::INTERNAL); 1769 FrameScope scope(masm, StackFrame::INTERNAL);
1766 __ PrepareCallCFunction(2, t0); 1770 __ PrepareCallCFunction(2, t0);
1767 __ li(a1, Operand(Smi::FromInt(field_index))); 1771 __ li(a1, Operand(Smi::FromInt(field_index)));
1768 __ CallCFunction( 1772 __ CallCFunction(
1769 ExternalReference::get_date_field_function(masm->isolate()), 2); 1773 ExternalReference::get_date_field_function(masm->isolate()), 2);
1770 } 1774 }
1771 __ Ret(); 1775 __ Ret();
1772 1776
1773 // 3. Raise a TypeError if the receiver is not a date. 1777 // 3. Raise a TypeError if the receiver is not a date.
1774 __ bind(&receiver_not_date); 1778 __ bind(&receiver_not_date);
1775 __ TailCallRuntime(Runtime::kThrowNotDateError); 1779 {
1780 FrameScope scope(masm, StackFrame::MANUAL);
1781 __ Push(a0, ra, fp);
1782 __ Move(fp, sp);
1783 __ SmiTag(a2);
1784 __ Push(cp, a1, a2);
1785 __ CallRuntime(Runtime::kThrowNotDateError);
1786 }
1776 } 1787 }
1777 1788
1778 // static 1789 // static
1779 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { 1790 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
1780 // ----------- S t a t e ------------- 1791 // ----------- S t a t e -------------
1781 // -- a0 : argc 1792 // -- a0 : argc
1782 // -- sp[0] : argArray 1793 // -- sp[0] : argArray
1783 // -- sp[4] : thisArg 1794 // -- sp[4] : thisArg
1784 // -- sp[8] : receiver 1795 // -- sp[8] : receiver
1785 // ----------------------------------- 1796 // -----------------------------------
(...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after
2965 } 2976 }
2966 } 2977 }
2967 2978
2968 2979
2969 #undef __ 2980 #undef __
2970 2981
2971 } // namespace internal 2982 } // namespace internal
2972 } // namespace v8 2983 } // namespace v8
2973 2984
2974 #endif // V8_TARGET_ARCH_MIPS 2985 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698