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

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

Issue 2051113002: [stubs] ToNumberStub --> ToNumber builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix full-code on non-x64 platforms 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/arm64/builtins-arm64.cc ('k') | src/builtins.h » ('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/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 3083 matching lines...) Expand 10 before | Expand all | Expand 10 after
3094 __ SmiTag(from); 3094 __ SmiTag(from);
3095 StringCharAtGenerator generator(input_string, from, result_length, x0, 3095 StringCharAtGenerator generator(input_string, from, result_length, x0,
3096 &runtime, &runtime, &runtime, 3096 &runtime, &runtime, &runtime,
3097 RECEIVER_IS_STRING); 3097 RECEIVER_IS_STRING);
3098 generator.GenerateFast(masm); 3098 generator.GenerateFast(masm);
3099 __ Drop(3); 3099 __ Drop(3);
3100 __ Ret(); 3100 __ Ret();
3101 generator.SkipSlow(masm, &runtime); 3101 generator.SkipSlow(masm, &runtime);
3102 } 3102 }
3103 3103
3104
3105 void ToNumberStub::Generate(MacroAssembler* masm) {
3106 // The ToNumber stub takes one argument in x0.
3107 Label not_smi;
3108 __ JumpIfNotSmi(x0, &not_smi);
3109 __ Ret();
3110 __ Bind(&not_smi);
3111
3112 Label not_heap_number;
3113 __ CompareObjectType(x0, x1, x1, HEAP_NUMBER_TYPE);
3114 // x0: receiver
3115 // x1: receiver instance type
3116 __ B(ne, &not_heap_number);
3117 __ Ret();
3118 __ Bind(&not_heap_number);
3119
3120 NonNumberToNumberStub stub(masm->isolate());
3121 __ TailCallStub(&stub);
3122 }
3123
3124 void NonNumberToNumberStub::Generate(MacroAssembler* masm) {
3125 // The NonNumberToNumber stub takes one argument in x0.
3126 __ AssertNotNumber(x0);
3127
3128 Label not_string;
3129 __ CompareObjectType(x0, x1, x1, FIRST_NONSTRING_TYPE);
3130 // x0: receiver
3131 // x1: receiver instance type
3132 __ B(hs, &not_string);
3133 __ Jump(isolate()->builtins()->StringToNumber(), RelocInfo::CODE_TARGET);
3134 __ Bind(&not_string);
3135
3136 Label not_oddball;
3137 __ Cmp(x1, ODDBALL_TYPE);
3138 __ B(ne, &not_oddball);
3139 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToNumberOffset));
3140 __ Ret();
3141 __ Bind(&not_oddball);
3142
3143 __ Push(x0); // Push argument.
3144 __ TailCallRuntime(Runtime::kToNumber);
3145 }
3146
3147 void ToStringStub::Generate(MacroAssembler* masm) { 3104 void ToStringStub::Generate(MacroAssembler* masm) {
3148 // The ToString stub takes one argument in x0. 3105 // The ToString stub takes one argument in x0.
3149 Label is_number; 3106 Label is_number;
3150 __ JumpIfSmi(x0, &is_number); 3107 __ JumpIfSmi(x0, &is_number);
3151 3108
3152 Label not_string; 3109 Label not_string;
3153 __ JumpIfObjectType(x0, x1, x1, FIRST_NONSTRING_TYPE, &not_string, hs); 3110 __ JumpIfObjectType(x0, x1, x1, FIRST_NONSTRING_TYPE, &not_string, hs);
3154 // x0: receiver 3111 // x0: receiver
3155 // x1: receiver instance type 3112 // x1: receiver instance type
3156 __ Ret(); 3113 __ Ret();
(...skipping 2665 matching lines...) Expand 10 before | Expand all | Expand 10 after
5822 kStackUnwindSpace, NULL, spill_offset, 5779 kStackUnwindSpace, NULL, spill_offset,
5823 return_value_operand, NULL); 5780 return_value_operand, NULL);
5824 } 5781 }
5825 5782
5826 #undef __ 5783 #undef __
5827 5784
5828 } // namespace internal 5785 } // namespace internal
5829 } // namespace v8 5786 } // namespace v8
5830 5787
5831 #endif // V8_TARGET_ARCH_ARM64 5788 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698