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

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

Issue 2380973002: [stubs] replaced ToString MacroAssembler Stub with CodeStubAssembler builtin (Closed)
Patch Set: completely removed ToStringStub Created 4 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
« no previous file with comments | « no previous file | src/arm64/code-stubs-arm64.cc » ('j') | src/builtins/builtins-conversion.cc » ('J')
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/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 2331 matching lines...) Expand 10 before | Expand all | Expand 10 after
2342 // r3: from index (untagged) 2342 // r3: from index (untagged)
2343 __ SmiTag(r3, r3); 2343 __ SmiTag(r3, r3);
2344 StringCharAtGenerator generator(r0, r3, r2, r0, &runtime, &runtime, &runtime, 2344 StringCharAtGenerator generator(r0, r3, r2, r0, &runtime, &runtime, &runtime,
2345 RECEIVER_IS_STRING); 2345 RECEIVER_IS_STRING);
2346 generator.GenerateFast(masm); 2346 generator.GenerateFast(masm);
2347 __ Drop(3); 2347 __ Drop(3);
2348 __ Ret(); 2348 __ Ret();
2349 generator.SkipSlow(masm, &runtime); 2349 generator.SkipSlow(masm, &runtime);
2350 } 2350 }
2351 2351
2352 void ToStringStub::Generate(MacroAssembler* masm) {
2353 // The ToString stub takes one argument in r0.
2354 Label is_number;
2355 __ JumpIfSmi(r0, &is_number);
2356
2357 __ CompareObjectType(r0, r1, r1, FIRST_NONSTRING_TYPE);
2358 // r0: receiver
2359 // r1: receiver instance type
2360 __ Ret(lo);
2361
2362 Label not_heap_number;
2363 __ cmp(r1, Operand(HEAP_NUMBER_TYPE));
2364 __ b(ne, &not_heap_number);
2365 __ bind(&is_number);
2366 NumberToStringStub stub(isolate());
2367 __ TailCallStub(&stub);
2368 __ bind(&not_heap_number);
2369
2370 Label not_oddball;
2371 __ cmp(r1, Operand(ODDBALL_TYPE));
2372 __ b(ne, &not_oddball);
2373 __ ldr(r0, FieldMemOperand(r0, Oddball::kToStringOffset));
2374 __ Ret();
2375 __ bind(&not_oddball);
2376
2377 __ push(r0); // Push argument.
2378 __ TailCallRuntime(Runtime::kToString);
2379 }
2380
2381 2352
2382 void StringHelper::GenerateFlatOneByteStringEquals( 2353 void StringHelper::GenerateFlatOneByteStringEquals(
2383 MacroAssembler* masm, Register left, Register right, Register scratch1, 2354 MacroAssembler* masm, Register left, Register right, Register scratch1,
2384 Register scratch2, Register scratch3) { 2355 Register scratch2, Register scratch3) {
2385 Register length = scratch1; 2356 Register length = scratch1;
2386 2357
2387 // Compare lengths. 2358 // Compare lengths.
2388 Label strings_not_equal, check_zero_length; 2359 Label strings_not_equal, check_zero_length;
2389 __ ldr(length, FieldMemOperand(left, String::kLengthOffset)); 2360 __ ldr(length, FieldMemOperand(left, String::kLengthOffset));
2390 __ ldr(scratch2, FieldMemOperand(right, String::kLengthOffset)); 2361 __ ldr(scratch2, FieldMemOperand(right, String::kLengthOffset));
(...skipping 2786 matching lines...) Expand 10 before | Expand all | Expand 10 after
5177 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 5148 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
5178 kStackUnwindSpace, NULL, return_value_operand, NULL); 5149 kStackUnwindSpace, NULL, return_value_operand, NULL);
5179 } 5150 }
5180 5151
5181 #undef __ 5152 #undef __
5182 5153
5183 } // namespace internal 5154 } // namespace internal
5184 } // namespace v8 5155 } // namespace v8
5185 5156
5186 #endif // V8_TARGET_ARCH_ARM 5157 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/code-stubs-arm64.cc » ('j') | src/builtins/builtins-conversion.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698