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 2816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2827 // ----------- S t a t e ------------- | 2827 // ----------- S t a t e ------------- |
2828 // -- r4 : message_id as Smi | 2828 // -- r4 : message_id as Smi |
2829 // -- lr : return address | 2829 // -- lr : return address |
2830 // ----------------------------------- | 2830 // ----------------------------------- |
2831 __ push(r4); | 2831 __ push(r4); |
2832 __ LoadSmiLiteral(cp, Smi::FromInt(0)); | 2832 __ LoadSmiLiteral(cp, Smi::FromInt(0)); |
2833 __ TailCallRuntime(Runtime::kAbort); | 2833 __ TailCallRuntime(Runtime::kAbort); |
2834 } | 2834 } |
2835 | 2835 |
2836 // static | 2836 // static |
2837 void Builtins::Generate_StringToNumber(MacroAssembler* masm) { | |
2838 // The StringToNumber stub takes one argument in r3. | |
2839 __ AssertString(r3); | |
2840 | |
2841 // Check if string has a cached array index. | |
2842 Label runtime; | |
2843 __ lwz(r5, FieldMemOperand(r3, String::kHashFieldOffset)); | |
2844 __ And(r0, r5, Operand(String::kContainsCachedArrayIndexMask), SetRC); | |
2845 __ bne(&runtime, cr0); | |
2846 __ IndexFromHash(r5, r3); | |
2847 __ blr(); | |
2848 | |
2849 __ bind(&runtime); | |
2850 { | |
2851 FrameScope frame(masm, StackFrame::INTERNAL); | |
2852 // Push argument. | |
2853 __ push(r3); | |
2854 // We cannot use a tail call here because this builtin can also be called | |
2855 // from wasm. | |
2856 __ CallRuntime(Runtime::kStringToNumber); | |
2857 } | |
2858 __ Ret(); | |
2859 } | |
2860 | |
2861 // static | |
2862 void Builtins::Generate_ToNumber(MacroAssembler* masm) { | 2837 void Builtins::Generate_ToNumber(MacroAssembler* masm) { |
2863 // The ToNumber stub takes one argument in r3. | 2838 // The ToNumber stub takes one argument in r3. |
2864 STATIC_ASSERT(kSmiTag == 0); | 2839 STATIC_ASSERT(kSmiTag == 0); |
2865 __ TestIfSmi(r3, r0); | 2840 __ TestIfSmi(r3, r0); |
2866 __ Ret(eq, cr0); | 2841 __ Ret(eq, cr0); |
2867 | 2842 |
2868 __ CompareObjectType(r3, r4, r4, HEAP_NUMBER_TYPE); | 2843 __ CompareObjectType(r3, r4, r4, HEAP_NUMBER_TYPE); |
2869 // r3: receiver | 2844 // r3: receiver |
2870 // r4: receiver instance type | 2845 // r4: receiver instance type |
2871 __ Ret(eq); | 2846 __ Ret(eq); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3004 __ CallRuntime(Runtime::kThrowStackOverflow); | 2979 __ CallRuntime(Runtime::kThrowStackOverflow); |
3005 __ bkpt(0); | 2980 __ bkpt(0); |
3006 } | 2981 } |
3007 } | 2982 } |
3008 | 2983 |
3009 #undef __ | 2984 #undef __ |
3010 } // namespace internal | 2985 } // namespace internal |
3011 } // namespace v8 | 2986 } // namespace v8 |
3012 | 2987 |
3013 #endif // V8_TARGET_ARCH_PPC | 2988 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |