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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 | 1732 |
1733 // static | 1733 // static |
1734 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm, | 1734 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm, |
1735 int field_index) { | 1735 int field_index) { |
1736 // ----------- S t a t e ------------- | 1736 // ----------- S t a t e ------------- |
1737 // -- r0 : number of arguments | |
1738 // -- r1 : function | |
1739 // -- cp : context | |
1737 // -- lr : return address | 1740 // -- lr : return address |
1738 // -- sp[0] : receiver | 1741 // -- sp[0] : receiver |
1739 // ----------------------------------- | 1742 // ----------------------------------- |
1740 | 1743 |
1741 // 1. Pop receiver into r0 and check that it's actually a JSDate object. | 1744 // 1. Pop receiver into r0 and check that it's actually a JSDate object. |
1742 Label receiver_not_date; | 1745 Label receiver_not_date; |
1743 { | 1746 { |
1747 __ Move(r4, r0); // Store argc for builtin frame construction. | |
Benedikt Meurer
2016/06/16 11:37:05
You don't need to remember r0 here, because it's a
jgruber
2016/06/16 15:59:21
Done.
| |
1744 __ Pop(r0); | 1748 __ Pop(r0); |
1745 __ JumpIfSmi(r0, &receiver_not_date); | 1749 __ JumpIfSmi(r0, &receiver_not_date); |
1746 __ CompareObjectType(r0, r1, r2, JS_DATE_TYPE); | 1750 __ CompareObjectType(r0, r2, r3, JS_DATE_TYPE); |
1747 __ b(ne, &receiver_not_date); | 1751 __ b(ne, &receiver_not_date); |
1748 } | 1752 } |
1749 | 1753 |
1750 // 2. Load the specified date field, falling back to the runtime as necessary. | 1754 // 2. Load the specified date field, falling back to the runtime as necessary. |
1751 if (field_index == JSDate::kDateValue) { | 1755 if (field_index == JSDate::kDateValue) { |
1752 __ ldr(r0, FieldMemOperand(r0, JSDate::kValueOffset)); | 1756 __ ldr(r0, FieldMemOperand(r0, JSDate::kValueOffset)); |
1753 } else { | 1757 } else { |
1754 if (field_index < JSDate::kFirstUncachedField) { | 1758 if (field_index < JSDate::kFirstUncachedField) { |
1755 Label stamp_mismatch; | 1759 Label stamp_mismatch; |
1756 __ mov(r1, Operand(ExternalReference::date_cache_stamp(masm->isolate()))); | 1760 __ mov(r1, Operand(ExternalReference::date_cache_stamp(masm->isolate()))); |
1757 __ ldr(r1, MemOperand(r1)); | 1761 __ ldr(r1, MemOperand(r1)); |
1758 __ ldr(ip, FieldMemOperand(r0, JSDate::kCacheStampOffset)); | 1762 __ ldr(ip, FieldMemOperand(r0, JSDate::kCacheStampOffset)); |
1759 __ cmp(r1, ip); | 1763 __ cmp(r1, ip); |
1760 __ b(ne, &stamp_mismatch); | 1764 __ b(ne, &stamp_mismatch); |
1761 __ ldr(r0, FieldMemOperand( | 1765 __ ldr(r0, FieldMemOperand( |
1762 r0, JSDate::kValueOffset + field_index * kPointerSize)); | 1766 r0, JSDate::kValueOffset + field_index * kPointerSize)); |
1763 __ Ret(); | 1767 __ Ret(); |
1764 __ bind(&stamp_mismatch); | 1768 __ bind(&stamp_mismatch); |
1765 } | 1769 } |
1766 FrameScope scope(masm, StackFrame::INTERNAL); | 1770 FrameScope scope(masm, StackFrame::INTERNAL); |
1767 __ PrepareCallCFunction(2, r1); | 1771 __ PrepareCallCFunction(2, r1); |
1768 __ mov(r1, Operand(Smi::FromInt(field_index))); | 1772 __ mov(r1, Operand(Smi::FromInt(field_index))); |
1769 __ CallCFunction( | 1773 __ CallCFunction( |
1770 ExternalReference::get_date_field_function(masm->isolate()), 2); | 1774 ExternalReference::get_date_field_function(masm->isolate()), 2); |
1771 } | 1775 } |
1772 __ Ret(); | 1776 __ Ret(); |
1773 | 1777 |
1774 // 3. Raise a TypeError if the receiver is not a date. | 1778 // 3. Raise a TypeError if the receiver is not a date. |
1775 __ bind(&receiver_not_date); | 1779 __ bind(&receiver_not_date); |
1776 __ TailCallRuntime(Runtime::kThrowNotDateError); | 1780 { |
1781 FrameScope scope(masm, StackFrame::MANUAL); | |
1782 __ Push(r0, lr, fp); | |
1783 __ Move(fp, sp); | |
1784 __ SmiTag(r4); | |
1785 __ Push(cp, r1, r4); | |
1786 __ CallRuntime(Runtime::kThrowNotDateError); | |
1787 } | |
1777 } | 1788 } |
1778 | 1789 |
1779 // static | 1790 // static |
1780 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { | 1791 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { |
1781 // ----------- S t a t e ------------- | 1792 // ----------- S t a t e ------------- |
1782 // -- r0 : argc | 1793 // -- r0 : argc |
1783 // -- sp[0] : argArray | 1794 // -- sp[0] : argArray |
1784 // -- sp[4] : thisArg | 1795 // -- sp[4] : thisArg |
1785 // -- sp[8] : receiver | 1796 // -- sp[8] : receiver |
1786 // ----------------------------------- | 1797 // ----------------------------------- |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2871 } | 2882 } |
2872 } | 2883 } |
2873 | 2884 |
2874 | 2885 |
2875 #undef __ | 2886 #undef __ |
2876 | 2887 |
2877 } // namespace internal | 2888 } // namespace internal |
2878 } // namespace v8 | 2889 } // namespace v8 |
2879 | 2890 |
2880 #endif // V8_TARGET_ARCH_ARM | 2891 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |