| OLD | NEW |
| 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/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 2511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2522 __ Branch(¬_oddball, ne, a1, Operand(ODDBALL_TYPE)); | 2522 __ Branch(¬_oddball, ne, a1, Operand(ODDBALL_TYPE)); |
| 2523 __ Ret(USE_DELAY_SLOT); | 2523 __ Ret(USE_DELAY_SLOT); |
| 2524 __ lw(v0, FieldMemOperand(a0, Oddball::kToStringOffset)); | 2524 __ lw(v0, FieldMemOperand(a0, Oddball::kToStringOffset)); |
| 2525 __ bind(¬_oddball); | 2525 __ bind(¬_oddball); |
| 2526 | 2526 |
| 2527 __ push(a0); // Push argument. | 2527 __ push(a0); // Push argument. |
| 2528 __ TailCallRuntime(Runtime::kToString); | 2528 __ TailCallRuntime(Runtime::kToString); |
| 2529 } | 2529 } |
| 2530 | 2530 |
| 2531 | 2531 |
| 2532 void ToNameStub::Generate(MacroAssembler* masm) { | |
| 2533 // The ToName stub takes on argument in a0. | |
| 2534 Label is_number; | |
| 2535 __ JumpIfSmi(a0, &is_number); | |
| 2536 | |
| 2537 Label not_name; | |
| 2538 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE); | |
| 2539 __ GetObjectType(a0, a1, a1); | |
| 2540 // a0: receiver | |
| 2541 // a1: receiver instance type | |
| 2542 __ Branch(¬_name, gt, a1, Operand(LAST_NAME_TYPE)); | |
| 2543 __ Ret(USE_DELAY_SLOT); | |
| 2544 __ mov(v0, a0); | |
| 2545 __ bind(¬_name); | |
| 2546 | |
| 2547 Label not_heap_number; | |
| 2548 __ Branch(¬_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE)); | |
| 2549 __ bind(&is_number); | |
| 2550 NumberToStringStub stub(isolate()); | |
| 2551 __ TailCallStub(&stub); | |
| 2552 __ bind(¬_heap_number); | |
| 2553 | |
| 2554 Label not_oddball; | |
| 2555 __ Branch(¬_oddball, ne, a1, Operand(ODDBALL_TYPE)); | |
| 2556 __ Ret(USE_DELAY_SLOT); | |
| 2557 __ lw(v0, FieldMemOperand(a0, Oddball::kToStringOffset)); | |
| 2558 __ bind(¬_oddball); | |
| 2559 | |
| 2560 __ push(a0); // Push argument. | |
| 2561 __ TailCallRuntime(Runtime::kToName); | |
| 2562 } | |
| 2563 | |
| 2564 | |
| 2565 void StringHelper::GenerateFlatOneByteStringEquals( | 2532 void StringHelper::GenerateFlatOneByteStringEquals( |
| 2566 MacroAssembler* masm, Register left, Register right, Register scratch1, | 2533 MacroAssembler* masm, Register left, Register right, Register scratch1, |
| 2567 Register scratch2, Register scratch3) { | 2534 Register scratch2, Register scratch3) { |
| 2568 Register length = scratch1; | 2535 Register length = scratch1; |
| 2569 | 2536 |
| 2570 // Compare lengths. | 2537 // Compare lengths. |
| 2571 Label strings_not_equal, check_zero_length; | 2538 Label strings_not_equal, check_zero_length; |
| 2572 __ lw(length, FieldMemOperand(left, String::kLengthOffset)); | 2539 __ lw(length, FieldMemOperand(left, String::kLengthOffset)); |
| 2573 __ lw(scratch2, FieldMemOperand(right, String::kLengthOffset)); | 2540 __ lw(scratch2, FieldMemOperand(right, String::kLengthOffset)); |
| 2574 __ Branch(&check_zero_length, eq, length, Operand(scratch2)); | 2541 __ Branch(&check_zero_length, eq, length, Operand(scratch2)); |
| (...skipping 2828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5403 kStackUnwindSpace, kInvalidStackOffset, | 5370 kStackUnwindSpace, kInvalidStackOffset, |
| 5404 return_value_operand, NULL); | 5371 return_value_operand, NULL); |
| 5405 } | 5372 } |
| 5406 | 5373 |
| 5407 #undef __ | 5374 #undef __ |
| 5408 | 5375 |
| 5409 } // namespace internal | 5376 } // namespace internal |
| 5410 } // namespace v8 | 5377 } // namespace v8 |
| 5411 | 5378 |
| 5412 #endif // V8_TARGET_ARCH_MIPS | 5379 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |