OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 2754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2765 | 2765 |
2766 // Check if string has a cached array index. | 2766 // Check if string has a cached array index. |
2767 Label runtime; | 2767 Label runtime; |
2768 __ lwz(r5, FieldMemOperand(r3, String::kHashFieldOffset)); | 2768 __ lwz(r5, FieldMemOperand(r3, String::kHashFieldOffset)); |
2769 __ And(r0, r5, Operand(String::kContainsCachedArrayIndexMask), SetRC); | 2769 __ And(r0, r5, Operand(String::kContainsCachedArrayIndexMask), SetRC); |
2770 __ bne(&runtime, cr0); | 2770 __ bne(&runtime, cr0); |
2771 __ IndexFromHash(r5, r3); | 2771 __ IndexFromHash(r5, r3); |
2772 __ blr(); | 2772 __ blr(); |
2773 | 2773 |
2774 __ bind(&runtime); | 2774 __ bind(&runtime); |
2775 __ push(r3); // Push argument. | 2775 { |
2776 __ TailCallRuntime(Runtime::kStringToNumber); | 2776 FrameScope frame(masm, StackFrame::INTERNAL); |
| 2777 // Push argument. |
| 2778 __ push(r3); |
| 2779 // We cannot use a tail call here because this builtin can also be called |
| 2780 // from wasm. |
| 2781 __ CallRuntime(Runtime::kStringToNumber); |
| 2782 } |
| 2783 __ Ret(); |
2777 } | 2784 } |
2778 | 2785 |
2779 // static | 2786 // static |
2780 void Builtins::Generate_ToNumber(MacroAssembler* masm) { | 2787 void Builtins::Generate_ToNumber(MacroAssembler* masm) { |
2781 // The ToNumber stub takes one argument in r3. | 2788 // The ToNumber stub takes one argument in r3. |
2782 STATIC_ASSERT(kSmiTag == 0); | 2789 STATIC_ASSERT(kSmiTag == 0); |
2783 __ TestIfSmi(r3, r0); | 2790 __ TestIfSmi(r3, r0); |
2784 __ Ret(eq, cr0); | 2791 __ Ret(eq, cr0); |
2785 | 2792 |
2786 __ CompareObjectType(r3, r4, r4, HEAP_NUMBER_TYPE); | 2793 __ CompareObjectType(r3, r4, r4, HEAP_NUMBER_TYPE); |
(...skipping 16 matching lines...) Expand all Loading... |
2803 __ Jump(masm->isolate()->builtins()->StringToNumber(), RelocInfo::CODE_TARGET, | 2810 __ Jump(masm->isolate()->builtins()->StringToNumber(), RelocInfo::CODE_TARGET, |
2804 lt); | 2811 lt); |
2805 | 2812 |
2806 Label not_oddball; | 2813 Label not_oddball; |
2807 __ cmpi(r4, Operand(ODDBALL_TYPE)); | 2814 __ cmpi(r4, Operand(ODDBALL_TYPE)); |
2808 __ bne(¬_oddball); | 2815 __ bne(¬_oddball); |
2809 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToNumberOffset)); | 2816 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToNumberOffset)); |
2810 __ blr(); | 2817 __ blr(); |
2811 __ bind(¬_oddball); | 2818 __ bind(¬_oddball); |
2812 | 2819 |
2813 __ push(r3); // Push argument. | 2820 { |
2814 __ TailCallRuntime(Runtime::kToNumber); | 2821 FrameScope frame(masm, StackFrame::INTERNAL); |
| 2822 // Push argument. |
| 2823 __ push(r3); |
| 2824 // We cannot use a tail call here because this builtin can also be called |
| 2825 // from wasm. |
| 2826 __ CallRuntime(Runtime::kToNumber); |
| 2827 } |
| 2828 __ Ret(); |
2815 } | 2829 } |
2816 | 2830 |
2817 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 2831 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
2818 // ----------- S t a t e ------------- | 2832 // ----------- S t a t e ------------- |
2819 // -- r3 : actual number of arguments | 2833 // -- r3 : actual number of arguments |
2820 // -- r4 : function (passed through to callee) | 2834 // -- r4 : function (passed through to callee) |
2821 // -- r5 : expected number of arguments | 2835 // -- r5 : expected number of arguments |
2822 // -- r6 : new target (passed through to callee) | 2836 // -- r6 : new target (passed through to callee) |
2823 // ----------------------------------- | 2837 // ----------------------------------- |
2824 | 2838 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2946 __ bkpt(0); | 2960 __ bkpt(0); |
2947 } | 2961 } |
2948 } | 2962 } |
2949 | 2963 |
2950 | 2964 |
2951 #undef __ | 2965 #undef __ |
2952 } // namespace internal | 2966 } // namespace internal |
2953 } // namespace v8 | 2967 } // namespace v8 |
2954 | 2968 |
2955 #endif // V8_TARGET_ARCH_PPC | 2969 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |