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

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: 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
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 {
1760 __ Move(x4, x0); // Store argc for builtin frame construction.
1757 __ Pop(x0); 1761 __ Pop(x0);
1758 __ JumpIfSmi(x0, &receiver_not_date); 1762 __ JumpIfSmi(x0, &receiver_not_date);
1759 __ JumpIfNotObjectType(x0, x1, x2, JS_DATE_TYPE, &receiver_not_date); 1763 __ JumpIfNotObjectType(x0, x2, x3, JS_DATE_TYPE, &receiver_not_date);
1760 } 1764 }
1761 1765
1762 // 2. Load the specified date field, falling back to the runtime as necessary. 1766 // 2. Load the specified date field, falling back to the runtime as necessary.
1763 if (field_index == JSDate::kDateValue) { 1767 if (field_index == JSDate::kDateValue) {
1764 __ Ldr(x0, FieldMemOperand(x0, JSDate::kValueOffset)); 1768 __ Ldr(x0, FieldMemOperand(x0, JSDate::kValueOffset));
1765 } else { 1769 } else {
1766 if (field_index < JSDate::kFirstUncachedField) { 1770 if (field_index < JSDate::kFirstUncachedField) {
1767 Label stamp_mismatch; 1771 Label stamp_mismatch;
1768 __ Mov(x1, ExternalReference::date_cache_stamp(masm->isolate())); 1772 __ Mov(x1, ExternalReference::date_cache_stamp(masm->isolate()));
1769 __ Ldr(x1, MemOperand(x1)); 1773 __ Ldr(x1, MemOperand(x1));
1770 __ Ldr(x2, FieldMemOperand(x0, JSDate::kCacheStampOffset)); 1774 __ Ldr(x2, FieldMemOperand(x0, JSDate::kCacheStampOffset));
1771 __ Cmp(x1, x2); 1775 __ Cmp(x1, x2);
1772 __ B(ne, &stamp_mismatch); 1776 __ B(ne, &stamp_mismatch);
1773 __ Ldr(x0, FieldMemOperand( 1777 __ Ldr(x0, FieldMemOperand(
1774 x0, JSDate::kValueOffset + field_index * kPointerSize)); 1778 x0, JSDate::kValueOffset + field_index * kPointerSize));
1775 __ Ret(); 1779 __ Ret();
1776 __ Bind(&stamp_mismatch); 1780 __ Bind(&stamp_mismatch);
1777 } 1781 }
1778 FrameScope scope(masm, StackFrame::INTERNAL); 1782 FrameScope scope(masm, StackFrame::INTERNAL);
1779 __ Mov(x1, Smi::FromInt(field_index)); 1783 __ Mov(x1, Smi::FromInt(field_index));
1780 __ CallCFunction( 1784 __ CallCFunction(
1781 ExternalReference::get_date_field_function(masm->isolate()), 2); 1785 ExternalReference::get_date_field_function(masm->isolate()), 2);
1782 } 1786 }
1783 __ Ret(); 1787 __ Ret();
1784 1788
1785 // 3. Raise a TypeError if the receiver is not a date. 1789 // 3. Raise a TypeError if the receiver is not a date.
1786 __ Bind(&receiver_not_date); 1790 __ Bind(&receiver_not_date);
1787 __ TailCallRuntime(Runtime::kThrowNotDateError); 1791 {
1792 FrameScope scope(masm, StackFrame::MANUAL);
1793 __ Push(x0, lr, fp);
1794 __ Move(fp, jssp);
1795 __ SmiTag(x4);
1796 __ Push(cp, x1, x4);
1797 __ CallRuntime(Runtime::kThrowNotDateError);
1798 }
1788 } 1799 }
1789 1800
1790 // static 1801 // static
1791 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { 1802 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
1792 // ----------- S t a t e ------------- 1803 // ----------- S t a t e -------------
1793 // -- x0 : argc 1804 // -- x0 : argc
1794 // -- jssp[0] : argArray (if argc == 2) 1805 // -- jssp[0] : argArray (if argc == 2)
1795 // -- jssp[8] : thisArg (if argc >= 1) 1806 // -- jssp[8] : thisArg (if argc >= 1)
1796 // -- jssp[16] : receiver 1807 // -- jssp[16] : receiver
1797 // ----------------------------------- 1808 // -----------------------------------
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after
2994 } 3005 }
2995 } 3006 }
2996 3007
2997 3008
2998 #undef __ 3009 #undef __
2999 3010
3000 } // namespace internal 3011 } // namespace internal
3001 } // namespace v8 3012 } // namespace v8
3002 3013
3003 #endif // V8_TARGET_ARCH_ARM 3014 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698