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

Side by Side Diff: src/arm64/builtins-arm64.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 | « src/arm/builtins-arm.cc ('k') | src/ia32/builtins-ia32.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after
1739 1739
1740 // And "return" to the OSR entry point of the function. 1740 // And "return" to the OSR entry point of the function.
1741 __ Ret(); 1741 __ Ret();
1742 } 1742 }
1743 1743
1744 1744
1745 // static 1745 // static
1746 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm, 1746 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm,
1747 int field_index) { 1747 int field_index) {
1748 // ----------- S t a t e ------------- 1748 // ----------- S t a t e -------------
1749 // -- x0 : number of arguments
1750 // -- x1 : function
1751 // -- cp : context
1749 // -- lr : return address 1752 // -- lr : return address
1750 // -- jssp[0] : receiver 1753 // -- jssp[0] : receiver
1751 // ----------------------------------- 1754 // -----------------------------------
1752 ASM_LOCATION("Builtins::Generate_DatePrototype_GetField"); 1755 ASM_LOCATION("Builtins::Generate_DatePrototype_GetField");
1753 1756
1754 // 1. Pop receiver into x0 and check that it's actually a JSDate object. 1757 // 1. Pop receiver into x0 and check that it's actually a JSDate object.
1755 Label receiver_not_date; 1758 Label receiver_not_date;
1756 { 1759 {
1757 __ Pop(x0); 1760 __ Pop(x0);
1758 __ JumpIfSmi(x0, &receiver_not_date); 1761 __ JumpIfSmi(x0, &receiver_not_date);
1759 __ JumpIfNotObjectType(x0, x1, x2, JS_DATE_TYPE, &receiver_not_date); 1762 __ JumpIfNotObjectType(x0, x2, x3, JS_DATE_TYPE, &receiver_not_date);
1760 } 1763 }
1761 1764
1762 // 2. Load the specified date field, falling back to the runtime as necessary. 1765 // 2. Load the specified date field, falling back to the runtime as necessary.
1763 if (field_index == JSDate::kDateValue) { 1766 if (field_index == JSDate::kDateValue) {
1764 __ Ldr(x0, FieldMemOperand(x0, JSDate::kValueOffset)); 1767 __ Ldr(x0, FieldMemOperand(x0, JSDate::kValueOffset));
1765 } else { 1768 } else {
1766 if (field_index < JSDate::kFirstUncachedField) { 1769 if (field_index < JSDate::kFirstUncachedField) {
1767 Label stamp_mismatch; 1770 Label stamp_mismatch;
1768 __ Mov(x1, ExternalReference::date_cache_stamp(masm->isolate())); 1771 __ Mov(x1, ExternalReference::date_cache_stamp(masm->isolate()));
1769 __ Ldr(x1, MemOperand(x1)); 1772 __ Ldr(x1, MemOperand(x1));
1770 __ Ldr(x2, FieldMemOperand(x0, JSDate::kCacheStampOffset)); 1773 __ Ldr(x2, FieldMemOperand(x0, JSDate::kCacheStampOffset));
1771 __ Cmp(x1, x2); 1774 __ Cmp(x1, x2);
1772 __ B(ne, &stamp_mismatch); 1775 __ B(ne, &stamp_mismatch);
1773 __ Ldr(x0, FieldMemOperand( 1776 __ Ldr(x0, FieldMemOperand(
1774 x0, JSDate::kValueOffset + field_index * kPointerSize)); 1777 x0, JSDate::kValueOffset + field_index * kPointerSize));
1775 __ Ret(); 1778 __ Ret();
1776 __ Bind(&stamp_mismatch); 1779 __ Bind(&stamp_mismatch);
1777 } 1780 }
1778 FrameScope scope(masm, StackFrame::INTERNAL); 1781 FrameScope scope(masm, StackFrame::INTERNAL);
1779 __ Mov(x1, Smi::FromInt(field_index)); 1782 __ Mov(x1, Smi::FromInt(field_index));
1780 __ CallCFunction( 1783 __ CallCFunction(
1781 ExternalReference::get_date_field_function(masm->isolate()), 2); 1784 ExternalReference::get_date_field_function(masm->isolate()), 2);
1782 } 1785 }
1783 __ Ret(); 1786 __ Ret();
1784 1787
1785 // 3. Raise a TypeError if the receiver is not a date. 1788 // 3. Raise a TypeError if the receiver is not a date.
1786 __ Bind(&receiver_not_date); 1789 __ Bind(&receiver_not_date);
1787 __ TailCallRuntime(Runtime::kThrowNotDateError); 1790 {
1791 FrameScope scope(masm, StackFrame::MANUAL);
1792 __ Push(x0, lr, fp);
1793 __ Move(fp, jssp);
1794 __ Push(cp, x1);
1795 __ Push(Smi::FromInt(0));
1796 __ CallRuntime(Runtime::kThrowNotDateError);
1797 }
1788 } 1798 }
1789 1799
1790 // static 1800 // static
1791 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { 1801 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
1792 // ----------- S t a t e ------------- 1802 // ----------- S t a t e -------------
1793 // -- x0 : argc 1803 // -- x0 : argc
1794 // -- jssp[0] : argArray (if argc == 2) 1804 // -- jssp[0] : argArray (if argc == 2)
1795 // -- jssp[8] : thisArg (if argc >= 1) 1805 // -- jssp[8] : thisArg (if argc >= 1)
1796 // -- jssp[16] : receiver 1806 // -- jssp[16] : receiver
1797 // ----------------------------------- 1807 // -----------------------------------
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after
2994 } 3004 }
2995 } 3005 }
2996 3006
2997 3007
2998 #undef __ 3008 #undef __
2999 3009
3000 } // namespace internal 3010 } // namespace internal
3001 } // namespace v8 3011 } // namespace v8
3002 3012
3003 #endif // V8_TARGET_ARCH_ARM 3013 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698