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

Side by Side Diff: src/mips/code-stubs-mips.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/mips/builtins-mips.cc ('k') | src/mips/interface-descriptors-mips.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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 3399 matching lines...) Expand 10 before | Expand all | Expand 10 after
3410 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE)); 3410 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
3411 __ Ret(USE_DELAY_SLOT); 3411 __ Ret(USE_DELAY_SLOT);
3412 __ lw(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); 3412 __ lw(v0, FieldMemOperand(a0, Oddball::kToNumberOffset));
3413 __ bind(&not_oddball); 3413 __ bind(&not_oddball);
3414 3414
3415 __ push(a0); // Push argument. 3415 __ push(a0); // Push argument.
3416 __ TailCallRuntime(Runtime::kToNumber, 1, 1); 3416 __ TailCallRuntime(Runtime::kToNumber, 1, 1);
3417 } 3417 }
3418 3418
3419 3419
3420 void ToStringStub::Generate(MacroAssembler* masm) {
3421 // The ToString stub takes on argument in a0.
3422 Label is_number;
3423 __ JumpIfSmi(a0, &is_number);
3424
3425 Label not_string;
3426 __ GetObjectType(a0, a1, a1);
3427 // a0: receiver
3428 // a1: receiver instance type
3429 __ Branch(&not_string, ge, a1, Operand(FIRST_NONSTRING_TYPE));
3430 __ Ret(USE_DELAY_SLOT);
3431 __ mov(v0, a0);
3432 __ bind(&not_string);
3433
3434 Label not_heap_number;
3435 __ Branch(&not_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE));
3436 __ bind(&is_number);
3437 NumberToStringStub stub(isolate());
3438 __ TailCallStub(&stub);
3439 __ bind(&not_heap_number);
3440
3441 Label not_oddball;
3442 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
3443 __ Ret(USE_DELAY_SLOT);
3444 __ lw(v0, FieldMemOperand(a0, Oddball::kToStringOffset));
3445 __ bind(&not_oddball);
3446
3447 __ push(a0); // Push argument.
3448 __ TailCallRuntime(Runtime::kToString, 1, 1);
3449 }
3450
3451
3420 void StringHelper::GenerateFlatOneByteStringEquals( 3452 void StringHelper::GenerateFlatOneByteStringEquals(
3421 MacroAssembler* masm, Register left, Register right, Register scratch1, 3453 MacroAssembler* masm, Register left, Register right, Register scratch1,
3422 Register scratch2, Register scratch3) { 3454 Register scratch2, Register scratch3) {
3423 Register length = scratch1; 3455 Register length = scratch1;
3424 3456
3425 // Compare lengths. 3457 // Compare lengths.
3426 Label strings_not_equal, check_zero_length; 3458 Label strings_not_equal, check_zero_length;
3427 __ lw(length, FieldMemOperand(left, String::kLengthOffset)); 3459 __ lw(length, FieldMemOperand(left, String::kLengthOffset));
3428 __ lw(scratch2, FieldMemOperand(right, String::kLengthOffset)); 3460 __ lw(scratch2, FieldMemOperand(right, String::kLengthOffset));
3429 __ Branch(&check_zero_length, eq, length, Operand(scratch2)); 3461 __ Branch(&check_zero_length, eq, length, Operand(scratch2));
(...skipping 2198 matching lines...) Expand 10 before | Expand all | Expand 10 after
5628 MemOperand(fp, 6 * kPointerSize), NULL); 5660 MemOperand(fp, 6 * kPointerSize), NULL);
5629 } 5661 }
5630 5662
5631 5663
5632 #undef __ 5664 #undef __
5633 5665
5634 } // namespace internal 5666 } // namespace internal
5635 } // namespace v8 5667 } // namespace v8
5636 5668
5637 #endif // V8_TARGET_ARCH_MIPS 5669 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/mips/interface-descriptors-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698