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

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

Issue 1319973007: [runtime] Add %ToString and %_ToString and remove the TO_STRING builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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/builtins-mips64.cc ('k') | src/mips64/interface-descriptors-mips64.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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 3431 matching lines...) Expand 10 before | Expand all | Expand 10 after
3442 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE)); 3442 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
3443 __ Ret(USE_DELAY_SLOT); 3443 __ Ret(USE_DELAY_SLOT);
3444 __ ld(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); 3444 __ ld(v0, FieldMemOperand(a0, Oddball::kToNumberOffset));
3445 __ bind(&not_oddball); 3445 __ bind(&not_oddball);
3446 3446
3447 __ push(a0); // Push argument. 3447 __ push(a0); // Push argument.
3448 __ TailCallRuntime(Runtime::kToNumber, 1, 1); 3448 __ TailCallRuntime(Runtime::kToNumber, 1, 1);
3449 } 3449 }
3450 3450
3451 3451
3452 void ToStringStub::Generate(MacroAssembler* masm) {
3453 // The ToString stub takes on argument in a0.
3454 Label is_number;
3455 __ JumpIfSmi(a0, &is_number);
3456
3457 Label not_string;
3458 __ GetObjectType(a0, a1, a1);
3459 // a0: receiver
3460 // a1: receiver instance type
3461 __ Branch(&not_string, ge, a1, Operand(FIRST_NONSTRING_TYPE));
3462 __ Ret(USE_DELAY_SLOT);
3463 __ mov(v0, a0);
3464 __ bind(&not_string);
3465
3466 Label not_heap_number;
3467 __ Branch(&not_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE));
3468 __ bind(&is_number);
3469 NumberToStringStub stub(isolate());
3470 __ TailCallStub(&stub);
3471 __ bind(&not_heap_number);
3472
3473 Label not_oddball;
3474 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
3475 __ Ret(USE_DELAY_SLOT);
3476 __ ld(v0, FieldMemOperand(a0, Oddball::kToStringOffset));
3477 __ bind(&not_oddball);
3478
3479 __ push(a0); // Push argument.
3480 __ TailCallRuntime(Runtime::kToString, 1, 1);
3481 }
3482
3483
3452 void StringHelper::GenerateFlatOneByteStringEquals( 3484 void StringHelper::GenerateFlatOneByteStringEquals(
3453 MacroAssembler* masm, Register left, Register right, Register scratch1, 3485 MacroAssembler* masm, Register left, Register right, Register scratch1,
3454 Register scratch2, Register scratch3) { 3486 Register scratch2, Register scratch3) {
3455 Register length = scratch1; 3487 Register length = scratch1;
3456 3488
3457 // Compare lengths. 3489 // Compare lengths.
3458 Label strings_not_equal, check_zero_length; 3490 Label strings_not_equal, check_zero_length;
3459 __ ld(length, FieldMemOperand(left, String::kLengthOffset)); 3491 __ ld(length, FieldMemOperand(left, String::kLengthOffset));
3460 __ ld(scratch2, FieldMemOperand(right, String::kLengthOffset)); 3492 __ ld(scratch2, FieldMemOperand(right, String::kLengthOffset));
3461 __ Branch(&check_zero_length, eq, length, Operand(scratch2)); 3493 __ Branch(&check_zero_length, eq, length, Operand(scratch2));
(...skipping 2198 matching lines...) Expand 10 before | Expand all | Expand 10 after
5660 MemOperand(fp, 6 * kPointerSize), NULL); 5692 MemOperand(fp, 6 * kPointerSize), NULL);
5661 } 5693 }
5662 5694
5663 5695
5664 #undef __ 5696 #undef __
5665 5697
5666 } // namespace internal 5698 } // namespace internal
5667 } // namespace v8 5699 } // namespace v8
5668 5700
5669 #endif // V8_TARGET_ARCH_MIPS64 5701 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/builtins-mips64.cc ('k') | src/mips64/interface-descriptors-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698