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

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

Issue 1622493002: [stubs] Introduce ToNameStub to implement %_ToName. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix BuildNumberToString type in Crankshaft. Created 4 years, 11 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/arm/interface-descriptors-arm.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/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 3101 matching lines...) Expand 10 before | Expand all | Expand 10 after
3112 __ b(ne, &not_oddball); 3112 __ b(ne, &not_oddball);
3113 __ ldr(r0, FieldMemOperand(r0, Oddball::kToStringOffset)); 3113 __ ldr(r0, FieldMemOperand(r0, Oddball::kToStringOffset));
3114 __ Ret(); 3114 __ Ret();
3115 __ bind(&not_oddball); 3115 __ bind(&not_oddball);
3116 3116
3117 __ push(r0); // Push argument. 3117 __ push(r0); // Push argument.
3118 __ TailCallRuntime(Runtime::kToString); 3118 __ TailCallRuntime(Runtime::kToString);
3119 } 3119 }
3120 3120
3121 3121
3122 void ToNameStub::Generate(MacroAssembler* masm) {
3123 // The ToName stub takes one argument in r0.
3124 Label is_number;
3125 __ JumpIfSmi(r0, &is_number);
3126
3127 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
3128 __ CompareObjectType(r0, r1, r1, LAST_NAME_TYPE);
3129 // r0: receiver
3130 // r1: receiver instance type
3131 __ Ret(ls);
3132
3133 Label not_heap_number;
3134 __ cmp(r1, Operand(HEAP_NUMBER_TYPE));
3135 __ b(ne, &not_heap_number);
3136 __ bind(&is_number);
3137 NumberToStringStub stub(isolate());
3138 __ TailCallStub(&stub);
3139 __ bind(&not_heap_number);
3140
3141 Label not_oddball;
3142 __ cmp(r1, Operand(ODDBALL_TYPE));
3143 __ b(ne, &not_oddball);
3144 __ ldr(r0, FieldMemOperand(r0, Oddball::kToStringOffset));
3145 __ Ret();
3146 __ bind(&not_oddball);
3147
3148 __ push(r0); // Push argument.
3149 __ TailCallRuntime(Runtime::kToName);
3150 }
3151
3152
3122 void StringHelper::GenerateFlatOneByteStringEquals( 3153 void StringHelper::GenerateFlatOneByteStringEquals(
3123 MacroAssembler* masm, Register left, Register right, Register scratch1, 3154 MacroAssembler* masm, Register left, Register right, Register scratch1,
3124 Register scratch2, Register scratch3) { 3155 Register scratch2, Register scratch3) {
3125 Register length = scratch1; 3156 Register length = scratch1;
3126 3157
3127 // Compare lengths. 3158 // Compare lengths.
3128 Label strings_not_equal, check_zero_length; 3159 Label strings_not_equal, check_zero_length;
3129 __ ldr(length, FieldMemOperand(left, String::kLengthOffset)); 3160 __ ldr(length, FieldMemOperand(left, String::kLengthOffset));
3130 __ ldr(scratch2, FieldMemOperand(right, String::kLengthOffset)); 3161 __ ldr(scratch2, FieldMemOperand(right, String::kLengthOffset));
3131 __ cmp(length, scratch2); 3162 __ cmp(length, scratch2);
(...skipping 2275 matching lines...) Expand 10 before | Expand all | Expand 10 after
5407 MemOperand(fp, 6 * kPointerSize), NULL); 5438 MemOperand(fp, 6 * kPointerSize), NULL);
5408 } 5439 }
5409 5440
5410 5441
5411 #undef __ 5442 #undef __
5412 5443
5413 } // namespace internal 5444 } // namespace internal
5414 } // namespace v8 5445 } // namespace v8
5415 5446
5416 #endif // V8_TARGET_ARCH_ARM 5447 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/interface-descriptors-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698