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

Side by Side Diff: src/arm64/code-stubs-arm64.cc

Issue 1412963002: [runtime] Implement %_ToLength via ToLengthStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 3896 matching lines...) Expand 10 before | Expand all | Expand 10 after
3907 __ B(ne, &not_oddball); 3907 __ B(ne, &not_oddball);
3908 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToNumberOffset)); 3908 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToNumberOffset));
3909 __ Ret(); 3909 __ Ret();
3910 __ Bind(&not_oddball); 3910 __ Bind(&not_oddball);
3911 3911
3912 __ Push(x0); // Push argument. 3912 __ Push(x0); // Push argument.
3913 __ TailCallRuntime(Runtime::kToNumber, 1, 1); 3913 __ TailCallRuntime(Runtime::kToNumber, 1, 1);
3914 } 3914 }
3915 3915
3916 3916
3917 void ToLengthStub::Generate(MacroAssembler* masm) {
3918 // The ToLength stub takes one argument in x0.
3919 Label not_smi;
3920 __ JumpIfNotSmi(x0, &not_smi);
3921 STATIC_ASSERT(kSmiTag == 0);
3922 __ Tst(x0, x0);
3923 __ Csel(x0, x0, Operand(0), ge);
3924 __ Ret();
3925 __ Bind(&not_smi);
3926
3927 __ Push(x0); // Push argument.
3928 __ TailCallRuntime(Runtime::kToLength, 1, 1);
3929 }
3930
3931
3917 void ToStringStub::Generate(MacroAssembler* masm) { 3932 void ToStringStub::Generate(MacroAssembler* masm) {
3918 // The ToString stub takes one argument in x0. 3933 // The ToString stub takes one argument in x0.
3919 Label is_number; 3934 Label is_number;
3920 __ JumpIfSmi(x0, &is_number); 3935 __ JumpIfSmi(x0, &is_number);
3921 3936
3922 Label not_string; 3937 Label not_string;
3923 __ JumpIfObjectType(x0, x1, x1, FIRST_NONSTRING_TYPE, &not_string, hs); 3938 __ JumpIfObjectType(x0, x1, x1, FIRST_NONSTRING_TYPE, &not_string, hs);
3924 // x0: receiver 3939 // x0: receiver
3925 // x1: receiver instance type 3940 // x1: receiver instance type
3926 __ Ret(); 3941 __ Ret();
(...skipping 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after
5989 MemOperand(fp, 6 * kPointerSize), NULL); 6004 MemOperand(fp, 6 * kPointerSize), NULL);
5990 } 6005 }
5991 6006
5992 6007
5993 #undef __ 6008 #undef __
5994 6009
5995 } // namespace internal 6010 } // namespace internal
5996 } // namespace v8 6011 } // namespace v8
5997 6012
5998 #endif // V8_TARGET_ARCH_ARM64 6013 #endif // V8_TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698