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 2610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2621 // a3: from index (untagged) | 2621 // a3: from index (untagged) |
2622 __ SmiTag(a3, a3); | 2622 __ SmiTag(a3, a3); |
2623 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, | 2623 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, |
2624 RECEIVER_IS_STRING); | 2624 RECEIVER_IS_STRING); |
2625 generator.GenerateFast(masm); | 2625 generator.GenerateFast(masm); |
2626 __ DropAndRet(3); | 2626 __ DropAndRet(3); |
2627 generator.SkipSlow(masm, &runtime); | 2627 generator.SkipSlow(masm, &runtime); |
2628 } | 2628 } |
2629 | 2629 |
2630 | 2630 |
2631 void ToNumberStub::Generate(MacroAssembler* masm) { | |
2632 // The ToNumber stub takes one argument in a0. | |
2633 Label not_smi; | |
2634 __ JumpIfNotSmi(a0, ¬_smi); | |
2635 __ Ret(USE_DELAY_SLOT); | |
2636 __ mov(v0, a0); | |
2637 __ bind(¬_smi); | |
2638 | |
2639 Label not_heap_number; | |
2640 __ GetObjectType(a0, a1, a1); | |
2641 // a0: receiver | |
2642 // a1: receiver instance type | |
2643 __ Branch(¬_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE)); | |
2644 __ Ret(USE_DELAY_SLOT); | |
2645 __ mov(v0, a0); | |
2646 __ bind(¬_heap_number); | |
2647 | |
2648 NonNumberToNumberStub stub(masm->isolate()); | |
2649 __ TailCallStub(&stub); | |
2650 } | |
2651 | |
2652 void NonNumberToNumberStub::Generate(MacroAssembler* masm) { | |
2653 // The NonNumberToNumber stub takes on argument in a0. | |
2654 __ AssertNotNumber(a0); | |
2655 | |
2656 Label not_string; | |
2657 __ GetObjectType(a0, a1, a1); | |
2658 // a0: receiver | |
2659 // a1: receiver instance type | |
2660 __ Branch(¬_string, hs, a1, Operand(FIRST_NONSTRING_TYPE)); | |
2661 __ Jump(isolate()->builtins()->StringToNumber(), RelocInfo::CODE_TARGET); | |
2662 __ bind(¬_string); | |
2663 | |
2664 Label not_oddball; | |
2665 __ Branch(¬_oddball, ne, a1, Operand(ODDBALL_TYPE)); | |
2666 __ Ret(USE_DELAY_SLOT); | |
2667 __ lw(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); // In delay slot. | |
2668 __ bind(¬_oddball); | |
2669 | |
2670 __ Push(a0); // Push argument. | |
2671 __ TailCallRuntime(Runtime::kToNumber); | |
2672 } | |
2673 | |
2674 void ToStringStub::Generate(MacroAssembler* masm) { | 2631 void ToStringStub::Generate(MacroAssembler* masm) { |
2675 // The ToString stub takes on argument in a0. | 2632 // The ToString stub takes on argument in a0. |
2676 Label is_number; | 2633 Label is_number; |
2677 __ JumpIfSmi(a0, &is_number); | 2634 __ JumpIfSmi(a0, &is_number); |
2678 | 2635 |
2679 Label not_string; | 2636 Label not_string; |
2680 __ GetObjectType(a0, a1, a1); | 2637 __ GetObjectType(a0, a1, a1); |
2681 // a0: receiver | 2638 // a0: receiver |
2682 // a1: receiver instance type | 2639 // a1: receiver instance type |
2683 __ Branch(¬_string, ge, a1, Operand(FIRST_NONSTRING_TYPE)); | 2640 __ Branch(¬_string, ge, a1, Operand(FIRST_NONSTRING_TYPE)); |
(...skipping 2928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5612 kStackUnwindSpace, kInvalidStackOffset, | 5569 kStackUnwindSpace, kInvalidStackOffset, |
5613 return_value_operand, NULL); | 5570 return_value_operand, NULL); |
5614 } | 5571 } |
5615 | 5572 |
5616 #undef __ | 5573 #undef __ |
5617 | 5574 |
5618 } // namespace internal | 5575 } // namespace internal |
5619 } // namespace v8 | 5576 } // namespace v8 |
5620 | 5577 |
5621 #endif // V8_TARGET_ARCH_MIPS | 5578 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |