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

Side by Side Diff: src/s390/code-stubs-s390.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/ppc/code-stubs-ppc.cc ('k') | src/x64/code-stubs-x64.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_S390 5 #if V8_TARGET_ARCH_S390
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 2448 matching lines...) Expand 10 before | Expand all | Expand 10 after
2459 __ Ret(); 2459 __ Ret();
2460 __ bind(&not_oddball); 2460 __ bind(&not_oddball);
2461 2461
2462 __ push(r2); // Push argument. 2462 __ push(r2); // Push argument.
2463 __ TailCallRuntime(Runtime::kToString); 2463 __ TailCallRuntime(Runtime::kToString);
2464 2464
2465 __ bind(&done); 2465 __ bind(&done);
2466 __ Ret(); 2466 __ Ret();
2467 } 2467 }
2468 2468
2469 void ToNameStub::Generate(MacroAssembler* masm) {
2470 // The ToName stub takes one argument in r2.
2471 Label is_number;
2472 __ JumpIfSmi(r2, &is_number);
2473
2474 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
2475 __ CompareObjectType(r2, r3, r3, LAST_NAME_TYPE);
2476 // r2: receiver
2477 // r3: receiver instance type
2478 __ Ret(le);
2479
2480 Label not_heap_number;
2481 __ CmpP(r3, Operand(HEAP_NUMBER_TYPE));
2482 __ bne(&not_heap_number);
2483 __ bind(&is_number);
2484 NumberToStringStub stub(isolate());
2485 __ TailCallStub(&stub);
2486 __ bind(&not_heap_number);
2487
2488 Label not_oddball;
2489 __ CmpP(r3, Operand(ODDBALL_TYPE));
2490 __ bne(&not_oddball);
2491 __ LoadP(r2, FieldMemOperand(r2, Oddball::kToStringOffset));
2492 __ Ret();
2493 __ bind(&not_oddball);
2494
2495 __ push(r2); // Push argument.
2496 __ TailCallRuntime(Runtime::kToName);
2497 }
2498
2499 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, 2469 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm,
2500 Register left, 2470 Register left,
2501 Register right, 2471 Register right,
2502 Register scratch1, 2472 Register scratch1,
2503 Register scratch2) { 2473 Register scratch2) {
2504 Register length = scratch1; 2474 Register length = scratch1;
2505 2475
2506 // Compare lengths. 2476 // Compare lengths.
2507 Label strings_not_equal, check_zero_length; 2477 Label strings_not_equal, check_zero_length;
2508 __ LoadP(length, FieldMemOperand(left, String::kLengthOffset)); 2478 __ LoadP(length, FieldMemOperand(left, String::kLengthOffset));
(...skipping 2878 matching lines...) Expand 10 before | Expand all | Expand 10 after
5387 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 5357 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
5388 kStackUnwindSpace, NULL, return_value_operand, NULL); 5358 kStackUnwindSpace, NULL, return_value_operand, NULL);
5389 } 5359 }
5390 5360
5391 #undef __ 5361 #undef __
5392 5362
5393 } // namespace internal 5363 } // namespace internal
5394 } // namespace v8 5364 } // namespace v8
5395 5365
5396 #endif // V8_TARGET_ARCH_S390 5366 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « src/ppc/code-stubs-ppc.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698