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

Side by Side Diff: src/arm/builtins-arm.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: Do not store argc 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
« no previous file with comments | « no previous file | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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
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 {
1744 __ Pop(r0); 1747 __ Pop(r0);
1745 __ JumpIfSmi(r0, &receiver_not_date); 1748 __ JumpIfSmi(r0, &receiver_not_date);
1746 __ CompareObjectType(r0, r1, r2, JS_DATE_TYPE); 1749 __ CompareObjectType(r0, r2, r3, JS_DATE_TYPE);
1747 __ b(ne, &receiver_not_date); 1750 __ b(ne, &receiver_not_date);
1748 } 1751 }
1749 1752
1750 // 2. Load the specified date field, falling back to the runtime as necessary. 1753 // 2. Load the specified date field, falling back to the runtime as necessary.
1751 if (field_index == JSDate::kDateValue) { 1754 if (field_index == JSDate::kDateValue) {
1752 __ ldr(r0, FieldMemOperand(r0, JSDate::kValueOffset)); 1755 __ ldr(r0, FieldMemOperand(r0, JSDate::kValueOffset));
1753 } else { 1756 } else {
1754 if (field_index < JSDate::kFirstUncachedField) { 1757 if (field_index < JSDate::kFirstUncachedField) {
1755 Label stamp_mismatch; 1758 Label stamp_mismatch;
1756 __ mov(r1, Operand(ExternalReference::date_cache_stamp(masm->isolate()))); 1759 __ mov(r1, Operand(ExternalReference::date_cache_stamp(masm->isolate())));
1757 __ ldr(r1, MemOperand(r1)); 1760 __ ldr(r1, MemOperand(r1));
1758 __ ldr(ip, FieldMemOperand(r0, JSDate::kCacheStampOffset)); 1761 __ ldr(ip, FieldMemOperand(r0, JSDate::kCacheStampOffset));
1759 __ cmp(r1, ip); 1762 __ cmp(r1, ip);
1760 __ b(ne, &stamp_mismatch); 1763 __ b(ne, &stamp_mismatch);
1761 __ ldr(r0, FieldMemOperand( 1764 __ ldr(r0, FieldMemOperand(
1762 r0, JSDate::kValueOffset + field_index * kPointerSize)); 1765 r0, JSDate::kValueOffset + field_index * kPointerSize));
1763 __ Ret(); 1766 __ Ret();
1764 __ bind(&stamp_mismatch); 1767 __ bind(&stamp_mismatch);
1765 } 1768 }
1766 FrameScope scope(masm, StackFrame::INTERNAL); 1769 FrameScope scope(masm, StackFrame::INTERNAL);
1767 __ PrepareCallCFunction(2, r1); 1770 __ PrepareCallCFunction(2, r1);
1768 __ mov(r1, Operand(Smi::FromInt(field_index))); 1771 __ mov(r1, Operand(Smi::FromInt(field_index)));
1769 __ CallCFunction( 1772 __ CallCFunction(
1770 ExternalReference::get_date_field_function(masm->isolate()), 2); 1773 ExternalReference::get_date_field_function(masm->isolate()), 2);
1771 } 1774 }
1772 __ Ret(); 1775 __ Ret();
1773 1776
1774 // 3. Raise a TypeError if the receiver is not a date. 1777 // 3. Raise a TypeError if the receiver is not a date.
1775 __ bind(&receiver_not_date); 1778 __ bind(&receiver_not_date);
1776 __ TailCallRuntime(Runtime::kThrowNotDateError); 1779 {
1780 FrameScope scope(masm, StackFrame::MANUAL);
1781 __ Push(r0, lr, fp);
1782 __ Move(fp, sp);
1783 __ Push(cp, r1);
1784 __ Push(Smi::FromInt(0));
1785 __ CallRuntime(Runtime::kThrowNotDateError);
1786 }
1777 } 1787 }
1778 1788
1779 // static 1789 // static
1780 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { 1790 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
1781 // ----------- S t a t e ------------- 1791 // ----------- S t a t e -------------
1782 // -- r0 : argc 1792 // -- r0 : argc
1783 // -- sp[0] : argArray 1793 // -- sp[0] : argArray
1784 // -- sp[4] : thisArg 1794 // -- sp[4] : thisArg
1785 // -- sp[8] : receiver 1795 // -- sp[8] : receiver
1786 // ----------------------------------- 1796 // -----------------------------------
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
2871 } 2881 }
2872 } 2882 }
2873 2883
2874 2884
2875 #undef __ 2885 #undef __
2876 2886
2877 } // namespace internal 2887 } // namespace internal
2878 } // namespace v8 2888 } // namespace v8
2879 2889
2880 #endif // V8_TARGET_ARCH_ARM 2890 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698