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 2822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2833 | 2833 |
2834 __ CompareObjectType(r3, r4, r4, HEAP_NUMBER_TYPE); | 2834 __ CompareObjectType(r3, r4, r4, HEAP_NUMBER_TYPE); |
2835 // r3: receiver | 2835 // r3: receiver |
2836 // r4: receiver instance type | 2836 // r4: receiver instance type |
2837 __ Ret(eq); | 2837 __ Ret(eq); |
2838 | 2838 |
2839 __ Jump(masm->isolate()->builtins()->NonNumberToNumber(), | 2839 __ Jump(masm->isolate()->builtins()->NonNumberToNumber(), |
2840 RelocInfo::CODE_TARGET); | 2840 RelocInfo::CODE_TARGET); |
2841 } | 2841 } |
2842 | 2842 |
2843 // static | |
2844 void Builtins::Generate_NonNumberToNumber(MacroAssembler* masm) { | |
2845 // The NonNumberToNumber stub takes one argument in r3. | |
2846 __ AssertNotNumber(r3); | |
2847 | |
2848 __ CompareObjectType(r3, r4, r4, FIRST_NONSTRING_TYPE); | |
2849 // r3: receiver | |
2850 // r4: receiver instance type | |
2851 __ Jump(masm->isolate()->builtins()->StringToNumber(), RelocInfo::CODE_TARGET, | |
2852 lt); | |
2853 | |
2854 Label not_oddball; | |
2855 __ cmpi(r4, Operand(ODDBALL_TYPE)); | |
2856 __ bne(¬_oddball); | |
2857 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToNumberOffset)); | |
2858 __ blr(); | |
2859 __ bind(¬_oddball); | |
2860 | |
2861 { | |
2862 FrameScope frame(masm, StackFrame::INTERNAL); | |
2863 // Push argument. | |
2864 __ push(r3); | |
2865 // We cannot use a tail call here because this builtin can also be called | |
2866 // from wasm. | |
2867 __ CallRuntime(Runtime::kToNumber); | |
2868 } | |
2869 __ Ret(); | |
2870 } | |
2871 | |
2872 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 2843 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
2873 // ----------- S t a t e ------------- | 2844 // ----------- S t a t e ------------- |
2874 // -- r3 : actual number of arguments | 2845 // -- r3 : actual number of arguments |
2875 // -- r4 : function (passed through to callee) | 2846 // -- r4 : function (passed through to callee) |
2876 // -- r5 : expected number of arguments | 2847 // -- r5 : expected number of arguments |
2877 // -- r6 : new target (passed through to callee) | 2848 // -- r6 : new target (passed through to callee) |
2878 // ----------------------------------- | 2849 // ----------------------------------- |
2879 | 2850 |
2880 Label invoke, dont_adapt_arguments, stack_overflow; | 2851 Label invoke, dont_adapt_arguments, stack_overflow; |
2881 | 2852 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2999 __ CallRuntime(Runtime::kThrowStackOverflow); | 2970 __ CallRuntime(Runtime::kThrowStackOverflow); |
3000 __ bkpt(0); | 2971 __ bkpt(0); |
3001 } | 2972 } |
3002 } | 2973 } |
3003 | 2974 |
3004 #undef __ | 2975 #undef __ |
3005 } // namespace internal | 2976 } // namespace internal |
3006 } // namespace v8 | 2977 } // namespace v8 |
3007 | 2978 |
3008 #endif // V8_TARGET_ARCH_PPC | 2979 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |