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

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

Issue 2302923002: [stubs] Port ToName stub to TurboFan. (Closed)
Patch Set: Addressed nits. Created 4 years, 3 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') | 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/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 2367 matching lines...) Expand 10 before | Expand all | Expand 10 after
2378 __ b(ne, &not_oddball); 2378 __ b(ne, &not_oddball);
2379 __ ldr(r0, FieldMemOperand(r0, Oddball::kToStringOffset)); 2379 __ ldr(r0, FieldMemOperand(r0, Oddball::kToStringOffset));
2380 __ Ret(); 2380 __ Ret();
2381 __ bind(&not_oddball); 2381 __ bind(&not_oddball);
2382 2382
2383 __ push(r0); // Push argument. 2383 __ push(r0); // Push argument.
2384 __ TailCallRuntime(Runtime::kToString); 2384 __ TailCallRuntime(Runtime::kToString);
2385 } 2385 }
2386 2386
2387 2387
2388 void ToNameStub::Generate(MacroAssembler* masm) {
2389 // The ToName stub takes one argument in r0.
2390 Label is_number;
2391 __ JumpIfSmi(r0, &is_number);
2392
2393 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
2394 __ CompareObjectType(r0, r1, r1, LAST_NAME_TYPE);
2395 // r0: receiver
2396 // r1: receiver instance type
2397 __ Ret(ls);
2398
2399 Label not_heap_number;
2400 __ cmp(r1, Operand(HEAP_NUMBER_TYPE));
2401 __ b(ne, &not_heap_number);
2402 __ bind(&is_number);
2403 NumberToStringStub stub(isolate());
2404 __ TailCallStub(&stub);
2405 __ bind(&not_heap_number);
2406
2407 Label not_oddball;
2408 __ cmp(r1, Operand(ODDBALL_TYPE));
2409 __ b(ne, &not_oddball);
2410 __ ldr(r0, FieldMemOperand(r0, Oddball::kToStringOffset));
2411 __ Ret();
2412 __ bind(&not_oddball);
2413
2414 __ push(r0); // Push argument.
2415 __ TailCallRuntime(Runtime::kToName);
2416 }
2417
2418
2419 void StringHelper::GenerateFlatOneByteStringEquals( 2388 void StringHelper::GenerateFlatOneByteStringEquals(
2420 MacroAssembler* masm, Register left, Register right, Register scratch1, 2389 MacroAssembler* masm, Register left, Register right, Register scratch1,
2421 Register scratch2, Register scratch3) { 2390 Register scratch2, Register scratch3) {
2422 Register length = scratch1; 2391 Register length = scratch1;
2423 2392
2424 // Compare lengths. 2393 // Compare lengths.
2425 Label strings_not_equal, check_zero_length; 2394 Label strings_not_equal, check_zero_length;
2426 __ ldr(length, FieldMemOperand(left, String::kLengthOffset)); 2395 __ ldr(length, FieldMemOperand(left, String::kLengthOffset));
2427 __ ldr(scratch2, FieldMemOperand(right, String::kLengthOffset)); 2396 __ ldr(scratch2, FieldMemOperand(right, String::kLengthOffset));
2428 __ cmp(length, scratch2); 2397 __ cmp(length, scratch2);
(...skipping 2785 matching lines...) Expand 10 before | Expand all | Expand 10 after
5214 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 5183 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
5215 kStackUnwindSpace, NULL, return_value_operand, NULL); 5184 kStackUnwindSpace, NULL, return_value_operand, NULL);
5216 } 5185 }
5217 5186
5218 #undef __ 5187 #undef __
5219 5188
5220 } // namespace internal 5189 } // namespace internal
5221 } // namespace v8 5190 } // namespace v8
5222 5191
5223 #endif // V8_TARGET_ARCH_ARM 5192 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698