| 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
| 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 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1686 __ LoadRR(r14, r0); | 1686 __ LoadRR(r14, r0); |
| 1687 | 1687 |
| 1688 // And "return" to the OSR entry point of the function. | 1688 // And "return" to the OSR entry point of the function. |
| 1689 __ Ret(); | 1689 __ Ret(); |
| 1690 } | 1690 } |
| 1691 | 1691 |
| 1692 // static | 1692 // static |
| 1693 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm, | 1693 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm, |
| 1694 int field_index) { | 1694 int field_index) { |
| 1695 // ----------- S t a t e ------------- | 1695 // ----------- S t a t e ------------- |
| 1696 // -- r2 : number of arguments |
| 1697 // -- r3 : function |
| 1698 // -- cp : context |
| 1699 |
| 1696 // -- lr : return address | 1700 // -- lr : return address |
| 1697 // -- sp[0] : receiver | 1701 // -- sp[0] : receiver |
| 1698 // ----------------------------------- | 1702 // ----------------------------------- |
| 1699 | 1703 |
| 1700 // 1. Pop receiver into r2 and check that it's actually a JSDate object. | 1704 // 1. Pop receiver into r2 and check that it's actually a JSDate object. |
| 1701 Label receiver_not_date; | 1705 Label receiver_not_date; |
| 1702 { | 1706 { |
| 1703 __ Pop(r2); | 1707 __ Pop(r2); |
| 1704 __ JumpIfSmi(r2, &receiver_not_date); | 1708 __ JumpIfSmi(r2, &receiver_not_date); |
| 1705 __ CompareObjectType(r2, r3, r4, JS_DATE_TYPE); | 1709 __ CompareObjectType(r2, r4, r5, JS_DATE_TYPE); |
| 1706 __ bne(&receiver_not_date); | 1710 __ bne(&receiver_not_date); |
| 1707 } | 1711 } |
| 1708 | 1712 |
| 1709 // 2. Load the specified date field, falling back to the runtime as necessary. | 1713 // 2. Load the specified date field, falling back to the runtime as necessary. |
| 1710 if (field_index == JSDate::kDateValue) { | 1714 if (field_index == JSDate::kDateValue) { |
| 1711 __ LoadP(r2, FieldMemOperand(r2, JSDate::kValueOffset)); | 1715 __ LoadP(r2, FieldMemOperand(r2, JSDate::kValueOffset)); |
| 1712 } else { | 1716 } else { |
| 1713 if (field_index < JSDate::kFirstUncachedField) { | 1717 if (field_index < JSDate::kFirstUncachedField) { |
| 1714 Label stamp_mismatch; | 1718 Label stamp_mismatch; |
| 1715 __ mov(r3, Operand(ExternalReference::date_cache_stamp(masm->isolate()))); | 1719 __ mov(r3, Operand(ExternalReference::date_cache_stamp(masm->isolate()))); |
| 1716 __ LoadP(r3, MemOperand(r3)); | 1720 __ LoadP(r3, MemOperand(r3)); |
| 1717 __ LoadP(ip, FieldMemOperand(r2, JSDate::kCacheStampOffset)); | 1721 __ LoadP(ip, FieldMemOperand(r2, JSDate::kCacheStampOffset)); |
| 1718 __ CmpP(r3, ip); | 1722 __ CmpP(r3, ip); |
| 1719 __ bne(&stamp_mismatch); | 1723 __ bne(&stamp_mismatch); |
| 1720 __ LoadP(r2, FieldMemOperand( | 1724 __ LoadP(r2, FieldMemOperand( |
| 1721 r2, JSDate::kValueOffset + field_index * kPointerSize)); | 1725 r2, JSDate::kValueOffset + field_index * kPointerSize)); |
| 1722 __ Ret(); | 1726 __ Ret(); |
| 1723 __ bind(&stamp_mismatch); | 1727 __ bind(&stamp_mismatch); |
| 1724 } | 1728 } |
| 1725 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 1729 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
| 1726 __ PrepareCallCFunction(2, r3); | 1730 __ PrepareCallCFunction(2, r3); |
| 1727 __ LoadSmiLiteral(r3, Smi::FromInt(field_index)); | 1731 __ LoadSmiLiteral(r3, Smi::FromInt(field_index)); |
| 1728 __ CallCFunction( | 1732 __ CallCFunction( |
| 1729 ExternalReference::get_date_field_function(masm->isolate()), 2); | 1733 ExternalReference::get_date_field_function(masm->isolate()), 2); |
| 1730 } | 1734 } |
| 1731 __ Ret(); | 1735 __ Ret(); |
| 1732 | 1736 |
| 1733 // 3. Raise a TypeError if the receiver is not a date. | 1737 // 3. Raise a TypeError if the receiver is not a date. |
| 1734 __ bind(&receiver_not_date); | 1738 __ bind(&receiver_not_date); |
| 1735 __ TailCallRuntime(Runtime::kThrowNotDateError); | 1739 { |
| 1740 FrameScope scope(masm, StackFrame::MANUAL); |
| 1741 __ push(r2); |
| 1742 __ PushStandardFrame(r3); |
| 1743 __ LoadSmiLiteral(r6, Smi::FromInt(0)); |
| 1744 __ push(r6); |
| 1745 __ CallRuntime(Runtime::kThrowNotDateError); |
| 1746 } |
| 1736 } | 1747 } |
| 1737 | 1748 |
| 1738 // static | 1749 // static |
| 1739 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { | 1750 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { |
| 1740 // ----------- S t a t e ------------- | 1751 // ----------- S t a t e ------------- |
| 1741 // -- r2 : argc | 1752 // -- r2 : argc |
| 1742 // -- sp[0] : argArray | 1753 // -- sp[0] : argArray |
| 1743 // -- sp[4] : thisArg | 1754 // -- sp[4] : thisArg |
| 1744 // -- sp[8] : receiver | 1755 // -- sp[8] : receiver |
| 1745 // ----------------------------------- | 1756 // ----------------------------------- |
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2884 __ bkpt(0); | 2895 __ bkpt(0); |
| 2885 } | 2896 } |
| 2886 } | 2897 } |
| 2887 | 2898 |
| 2888 #undef __ | 2899 #undef __ |
| 2889 | 2900 |
| 2890 } // namespace internal | 2901 } // namespace internal |
| 2891 } // namespace v8 | 2902 } // namespace v8 |
| 2892 | 2903 |
| 2893 #endif // V8_TARGET_ARCH_S390 | 2904 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |