| 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 2640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2651 | 2651 |
| 2652 void NonNumberToNumberStub::Generate(MacroAssembler* masm) { | 2652 void NonNumberToNumberStub::Generate(MacroAssembler* masm) { |
| 2653 // The NonNumberToNumber stub takes on argument in a0. | 2653 // The NonNumberToNumber stub takes on argument in a0. |
| 2654 __ AssertNotNumber(a0); | 2654 __ AssertNotNumber(a0); |
| 2655 | 2655 |
| 2656 Label not_string; | 2656 Label not_string; |
| 2657 __ GetObjectType(a0, a1, a1); | 2657 __ GetObjectType(a0, a1, a1); |
| 2658 // a0: receiver | 2658 // a0: receiver |
| 2659 // a1: receiver instance type | 2659 // a1: receiver instance type |
| 2660 __ Branch(¬_string, hs, a1, Operand(FIRST_NONSTRING_TYPE)); | 2660 __ Branch(¬_string, hs, a1, Operand(FIRST_NONSTRING_TYPE)); |
| 2661 StringToNumberStub stub(masm->isolate()); | 2661 __ Jump(isolate()->builtins()->StringToNumber(), RelocInfo::CODE_TARGET); |
| 2662 __ TailCallStub(&stub); | |
| 2663 __ bind(¬_string); | 2662 __ bind(¬_string); |
| 2664 | 2663 |
| 2665 Label not_oddball; | 2664 Label not_oddball; |
| 2666 __ Branch(¬_oddball, ne, a1, Operand(ODDBALL_TYPE)); | 2665 __ Branch(¬_oddball, ne, a1, Operand(ODDBALL_TYPE)); |
| 2667 __ Ret(USE_DELAY_SLOT); | 2666 __ Ret(USE_DELAY_SLOT); |
| 2668 __ lw(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); // In delay slot. | 2667 __ lw(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); // In delay slot. |
| 2669 __ bind(¬_oddball); | 2668 __ bind(¬_oddball); |
| 2670 | 2669 |
| 2671 __ Push(a0); // Push argument. | 2670 __ Push(a0); // Push argument. |
| 2672 __ TailCallRuntime(Runtime::kToNumber); | 2671 __ TailCallRuntime(Runtime::kToNumber); |
| 2673 } | 2672 } |
| 2674 | 2673 |
| 2675 void StringToNumberStub::Generate(MacroAssembler* masm) { | |
| 2676 // The StringToNumber stub takes on argument in a0. | |
| 2677 __ AssertString(a0); | |
| 2678 | |
| 2679 // Check if string has a cached array index. | |
| 2680 Label runtime; | |
| 2681 __ lw(a2, FieldMemOperand(a0, String::kHashFieldOffset)); | |
| 2682 __ And(at, a2, Operand(String::kContainsCachedArrayIndexMask)); | |
| 2683 __ Branch(&runtime, ne, at, Operand(zero_reg)); | |
| 2684 __ IndexFromHash(a2, v0); | |
| 2685 __ Ret(); | |
| 2686 | |
| 2687 __ bind(&runtime); | |
| 2688 __ Push(a0); // Push argument. | |
| 2689 __ TailCallRuntime(Runtime::kStringToNumber); | |
| 2690 } | |
| 2691 | |
| 2692 void ToStringStub::Generate(MacroAssembler* masm) { | 2674 void ToStringStub::Generate(MacroAssembler* masm) { |
| 2693 // The ToString stub takes on argument in a0. | 2675 // The ToString stub takes on argument in a0. |
| 2694 Label is_number; | 2676 Label is_number; |
| 2695 __ JumpIfSmi(a0, &is_number); | 2677 __ JumpIfSmi(a0, &is_number); |
| 2696 | 2678 |
| 2697 Label not_string; | 2679 Label not_string; |
| 2698 __ GetObjectType(a0, a1, a1); | 2680 __ GetObjectType(a0, a1, a1); |
| 2699 // a0: receiver | 2681 // a0: receiver |
| 2700 // a1: receiver instance type | 2682 // a1: receiver instance type |
| 2701 __ Branch(¬_string, ge, a1, Operand(FIRST_NONSTRING_TYPE)); | 2683 __ Branch(¬_string, ge, a1, Operand(FIRST_NONSTRING_TYPE)); |
| (...skipping 2928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5630 kStackUnwindSpace, kInvalidStackOffset, | 5612 kStackUnwindSpace, kInvalidStackOffset, |
| 5631 return_value_operand, NULL); | 5613 return_value_operand, NULL); |
| 5632 } | 5614 } |
| 5633 | 5615 |
| 5634 #undef __ | 5616 #undef __ |
| 5635 | 5617 |
| 5636 } // namespace internal | 5618 } // namespace internal |
| 5637 } // namespace v8 | 5619 } // namespace v8 |
| 5638 | 5620 |
| 5639 #endif // V8_TARGET_ARCH_MIPS | 5621 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |