| 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 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 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 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1713 | 1713 |
| 1714 // And "return" to the OSR entry point of the function. | 1714 // And "return" to the OSR entry point of the function. |
| 1715 __ Ret(); | 1715 __ Ret(); |
| 1716 } | 1716 } |
| 1717 | 1717 |
| 1718 | 1718 |
| 1719 // static | 1719 // static |
| 1720 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm, | 1720 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm, |
| 1721 int field_index) { | 1721 int field_index) { |
| 1722 // ----------- S t a t e ------------- | 1722 // ----------- S t a t e ------------- |
| 1723 // -- a0 : number of arguments |
| 1724 // -- a1 : function |
| 1725 // -- cp : context |
| 1723 // -- sp[0] : receiver | 1726 // -- sp[0] : receiver |
| 1724 // ----------------------------------- | 1727 // ----------------------------------- |
| 1725 | 1728 |
| 1726 // 1. Pop receiver into a0 and check that it's actually a JSDate object. | 1729 // 1. Pop receiver into a0 and check that it's actually a JSDate object. |
| 1727 Label receiver_not_date; | 1730 Label receiver_not_date; |
| 1728 { | 1731 { |
| 1732 __ Move(a2, a0); // Store argc for builtin frame construction. |
| 1729 __ Pop(a0); | 1733 __ Pop(a0); |
| 1730 __ JumpIfSmi(a0, &receiver_not_date); | 1734 __ JumpIfSmi(a0, &receiver_not_date); |
| 1731 __ GetObjectType(a0, t0, t0); | 1735 __ GetObjectType(a0, t0, t0); |
| 1732 __ Branch(&receiver_not_date, ne, t0, Operand(JS_DATE_TYPE)); | 1736 __ Branch(&receiver_not_date, ne, t0, Operand(JS_DATE_TYPE)); |
| 1733 } | 1737 } |
| 1734 | 1738 |
| 1735 // 2. Load the specified date field, falling back to the runtime as necessary. | 1739 // 2. Load the specified date field, falling back to the runtime as necessary. |
| 1736 if (field_index == JSDate::kDateValue) { | 1740 if (field_index == JSDate::kDateValue) { |
| 1737 __ Ret(USE_DELAY_SLOT); | 1741 __ Ret(USE_DELAY_SLOT); |
| 1738 __ ld(v0, FieldMemOperand(a0, JSDate::kValueOffset)); // In delay slot. | 1742 __ ld(v0, FieldMemOperand(a0, JSDate::kValueOffset)); // In delay slot. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1752 FrameScope scope(masm, StackFrame::INTERNAL); | 1756 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1753 __ PrepareCallCFunction(2, t0); | 1757 __ PrepareCallCFunction(2, t0); |
| 1754 __ li(a1, Operand(Smi::FromInt(field_index))); | 1758 __ li(a1, Operand(Smi::FromInt(field_index))); |
| 1755 __ CallCFunction( | 1759 __ CallCFunction( |
| 1756 ExternalReference::get_date_field_function(masm->isolate()), 2); | 1760 ExternalReference::get_date_field_function(masm->isolate()), 2); |
| 1757 } | 1761 } |
| 1758 __ Ret(); | 1762 __ Ret(); |
| 1759 | 1763 |
| 1760 // 3. Raise a TypeError if the receiver is not a date. | 1764 // 3. Raise a TypeError if the receiver is not a date. |
| 1761 __ bind(&receiver_not_date); | 1765 __ bind(&receiver_not_date); |
| 1762 __ TailCallRuntime(Runtime::kThrowNotDateError); | 1766 { |
| 1767 FrameScope scope(masm, StackFrame::MANUAL); |
| 1768 __ Push(a0, ra, fp); |
| 1769 __ Move(fp, sp); |
| 1770 __ SmiTag(a2); |
| 1771 __ Push(cp, a1, a2); |
| 1772 __ CallRuntime(Runtime::kThrowNotDateError); |
| 1773 } |
| 1763 } | 1774 } |
| 1764 | 1775 |
| 1765 // static | 1776 // static |
| 1766 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { | 1777 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { |
| 1767 // ----------- S t a t e ------------- | 1778 // ----------- S t a t e ------------- |
| 1768 // -- a0 : argc | 1779 // -- a0 : argc |
| 1769 // -- sp[0] : argArray | 1780 // -- sp[0] : argArray |
| 1770 // -- sp[4] : thisArg | 1781 // -- sp[4] : thisArg |
| 1771 // -- sp[8] : receiver | 1782 // -- sp[8] : receiver |
| 1772 // ----------------------------------- | 1783 // ----------------------------------- |
| (...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2953 } | 2964 } |
| 2954 } | 2965 } |
| 2955 | 2966 |
| 2956 | 2967 |
| 2957 #undef __ | 2968 #undef __ |
| 2958 | 2969 |
| 2959 } // namespace internal | 2970 } // namespace internal |
| 2960 } // namespace v8 | 2971 } // namespace v8 |
| 2961 | 2972 |
| 2962 #endif // V8_TARGET_ARCH_MIPS64 | 2973 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |