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

Side by Side Diff: src/ppc/code-stubs-ppc.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 | « src/mips64/code-stubs-mips64.cc ('k') | src/s390/code-stubs-s390.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 2446 matching lines...) Expand 10 before | Expand all | Expand 10 after
2457 __ bne(&not_oddball); 2457 __ bne(&not_oddball);
2458 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToStringOffset)); 2458 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToStringOffset));
2459 __ Ret(); 2459 __ Ret();
2460 __ bind(&not_oddball); 2460 __ bind(&not_oddball);
2461 2461
2462 __ push(r3); // Push argument. 2462 __ push(r3); // Push argument.
2463 __ TailCallRuntime(Runtime::kToString); 2463 __ TailCallRuntime(Runtime::kToString);
2464 } 2464 }
2465 2465
2466 2466
2467 void ToNameStub::Generate(MacroAssembler* masm) {
2468 // The ToName stub takes one argument in r3.
2469 Label is_number;
2470 __ JumpIfSmi(r3, &is_number);
2471
2472 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
2473 __ CompareObjectType(r3, r4, r4, LAST_NAME_TYPE);
2474 // r3: receiver
2475 // r4: receiver instance type
2476 __ Ret(le);
2477
2478 Label not_heap_number;
2479 __ cmpi(r4, Operand(HEAP_NUMBER_TYPE));
2480 __ bne(&not_heap_number);
2481 __ bind(&is_number);
2482 NumberToStringStub stub(isolate());
2483 __ TailCallStub(&stub);
2484 __ bind(&not_heap_number);
2485
2486 Label not_oddball;
2487 __ cmpi(r4, Operand(ODDBALL_TYPE));
2488 __ bne(&not_oddball);
2489 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToStringOffset));
2490 __ Ret();
2491 __ bind(&not_oddball);
2492
2493 __ push(r3); // Push argument.
2494 __ TailCallRuntime(Runtime::kToName);
2495 }
2496
2497
2498 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, 2467 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm,
2499 Register left, 2468 Register left,
2500 Register right, 2469 Register right,
2501 Register scratch1, 2470 Register scratch1,
2502 Register scratch2) { 2471 Register scratch2) {
2503 Register length = scratch1; 2472 Register length = scratch1;
2504 2473
2505 // Compare lengths. 2474 // Compare lengths.
2506 Label strings_not_equal, check_zero_length; 2475 Label strings_not_equal, check_zero_length;
2507 __ LoadP(length, FieldMemOperand(left, String::kLengthOffset)); 2476 __ LoadP(length, FieldMemOperand(left, String::kLengthOffset));
(...skipping 2964 matching lines...) Expand 10 before | Expand all | Expand 10 after
5472 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); 5441 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize);
5473 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 5442 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
5474 kStackUnwindSpace, NULL, return_value_operand, NULL); 5443 kStackUnwindSpace, NULL, return_value_operand, NULL);
5475 } 5444 }
5476 5445
5477 #undef __ 5446 #undef __
5478 } // namespace internal 5447 } // namespace internal
5479 } // namespace v8 5448 } // namespace v8
5480 5449
5481 #endif // V8_TARGET_ARCH_PPC 5450 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | src/s390/code-stubs-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698