| 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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1716 __ mtlr(r0); | 1716 __ mtlr(r0); |
| 1717 __ blr(); | 1717 __ blr(); |
| 1718 } | 1718 } |
| 1719 } | 1719 } |
| 1720 | 1720 |
| 1721 | 1721 |
| 1722 // static | 1722 // static |
| 1723 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm, | 1723 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm, |
| 1724 int field_index) { | 1724 int field_index) { |
| 1725 // ----------- S t a t e ------------- | 1725 // ----------- S t a t e ------------- |
| 1726 // -- r3 : number of arguments |
| 1727 // -- r4 : function |
| 1728 // -- cp : context |
| 1726 // -- lr : return address | 1729 // -- lr : return address |
| 1727 // -- sp[0] : receiver | 1730 // -- sp[0] : receiver |
| 1728 // ----------------------------------- | 1731 // ----------------------------------- |
| 1729 | 1732 |
| 1730 // 1. Pop receiver into r3 and check that it's actually a JSDate object. | 1733 // 1. Pop receiver into r3 and check that it's actually a JSDate object. |
| 1731 Label receiver_not_date; | 1734 Label receiver_not_date; |
| 1732 { | 1735 { |
| 1733 __ Pop(r3); | 1736 __ Pop(r3); |
| 1734 __ JumpIfSmi(r3, &receiver_not_date); | 1737 __ JumpIfSmi(r3, &receiver_not_date); |
| 1735 __ CompareObjectType(r3, r4, r5, JS_DATE_TYPE); | 1738 __ CompareObjectType(r3, r5, r6, JS_DATE_TYPE); |
| 1736 __ bne(&receiver_not_date); | 1739 __ bne(&receiver_not_date); |
| 1737 } | 1740 } |
| 1738 | 1741 |
| 1739 // 2. Load the specified date field, falling back to the runtime as necessary. | 1742 // 2. Load the specified date field, falling back to the runtime as necessary. |
| 1740 if (field_index == JSDate::kDateValue) { | 1743 if (field_index == JSDate::kDateValue) { |
| 1741 __ LoadP(r3, FieldMemOperand(r3, JSDate::kValueOffset)); | 1744 __ LoadP(r3, FieldMemOperand(r3, JSDate::kValueOffset)); |
| 1742 } else { | 1745 } else { |
| 1743 if (field_index < JSDate::kFirstUncachedField) { | 1746 if (field_index < JSDate::kFirstUncachedField) { |
| 1744 Label stamp_mismatch; | 1747 Label stamp_mismatch; |
| 1745 __ mov(r4, Operand(ExternalReference::date_cache_stamp(masm->isolate()))); | 1748 __ mov(r4, Operand(ExternalReference::date_cache_stamp(masm->isolate()))); |
| 1746 __ LoadP(r4, MemOperand(r4)); | 1749 __ LoadP(r4, MemOperand(r4)); |
| 1747 __ LoadP(ip, FieldMemOperand(r3, JSDate::kCacheStampOffset)); | 1750 __ LoadP(ip, FieldMemOperand(r3, JSDate::kCacheStampOffset)); |
| 1748 __ cmp(r4, ip); | 1751 __ cmp(r4, ip); |
| 1749 __ bne(&stamp_mismatch); | 1752 __ bne(&stamp_mismatch); |
| 1750 __ LoadP(r3, FieldMemOperand( | 1753 __ LoadP(r3, FieldMemOperand( |
| 1751 r3, JSDate::kValueOffset + field_index * kPointerSize)); | 1754 r3, JSDate::kValueOffset + field_index * kPointerSize)); |
| 1752 __ Ret(); | 1755 __ Ret(); |
| 1753 __ bind(&stamp_mismatch); | 1756 __ bind(&stamp_mismatch); |
| 1754 } | 1757 } |
| 1755 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 1758 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
| 1756 __ PrepareCallCFunction(2, r4); | 1759 __ PrepareCallCFunction(2, r4); |
| 1757 __ LoadSmiLiteral(r4, Smi::FromInt(field_index)); | 1760 __ LoadSmiLiteral(r4, Smi::FromInt(field_index)); |
| 1758 __ CallCFunction( | 1761 __ CallCFunction( |
| 1759 ExternalReference::get_date_field_function(masm->isolate()), 2); | 1762 ExternalReference::get_date_field_function(masm->isolate()), 2); |
| 1760 } | 1763 } |
| 1761 __ Ret(); | 1764 __ Ret(); |
| 1762 | 1765 |
| 1763 // 3. Raise a TypeError if the receiver is not a date. | 1766 // 3. Raise a TypeError if the receiver is not a date. |
| 1764 __ bind(&receiver_not_date); | 1767 __ bind(&receiver_not_date); |
| 1765 __ TailCallRuntime(Runtime::kThrowNotDateError); | 1768 { |
| 1769 FrameScope scope(masm, StackFrame::MANUAL); |
| 1770 __ push(r3); |
| 1771 __ PushStandardFrame(r4); |
| 1772 __ LoadSmiLiteral(r7, Smi::FromInt(0)); |
| 1773 __ push(r7); |
| 1774 __ CallRuntime(Runtime::kThrowNotDateError); |
| 1775 } |
| 1766 } | 1776 } |
| 1767 | 1777 |
| 1768 // static | 1778 // static |
| 1769 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { | 1779 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { |
| 1770 // ----------- S t a t e ------------- | 1780 // ----------- S t a t e ------------- |
| 1771 // -- r3 : argc | 1781 // -- r3 : argc |
| 1772 // -- sp[0] : argArray | 1782 // -- sp[0] : argArray |
| 1773 // -- sp[4] : thisArg | 1783 // -- sp[4] : thisArg |
| 1774 // -- sp[8] : receiver | 1784 // -- sp[8] : receiver |
| 1775 // ----------------------------------- | 1785 // ----------------------------------- |
| (...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2920 __ bkpt(0); | 2930 __ bkpt(0); |
| 2921 } | 2931 } |
| 2922 } | 2932 } |
| 2923 | 2933 |
| 2924 | 2934 |
| 2925 #undef __ | 2935 #undef __ |
| 2926 } // namespace internal | 2936 } // namespace internal |
| 2927 } // namespace v8 | 2937 } // namespace v8 |
| 2928 | 2938 |
| 2929 #endif // V8_TARGET_ARCH_PPC | 2939 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |