| 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
| 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 2832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2843 // ----------- S t a t e ------------- | 2843 // ----------- S t a t e ------------- |
| 2844 // -- r3 : message_id as Smi | 2844 // -- r3 : message_id as Smi |
| 2845 // -- lr : return address | 2845 // -- lr : return address |
| 2846 // ----------------------------------- | 2846 // ----------------------------------- |
| 2847 __ push(r3); | 2847 __ push(r3); |
| 2848 __ LoadSmiLiteral(cp, Smi::FromInt(0)); | 2848 __ LoadSmiLiteral(cp, Smi::FromInt(0)); |
| 2849 __ TailCallRuntime(Runtime::kAbort); | 2849 __ TailCallRuntime(Runtime::kAbort); |
| 2850 } | 2850 } |
| 2851 | 2851 |
| 2852 // static | 2852 // static |
| 2853 void Builtins::Generate_StringToNumber(MacroAssembler* masm) { | |
| 2854 // The StringToNumber stub takes one argument in r2. | |
| 2855 __ AssertString(r2); | |
| 2856 | |
| 2857 // Check if string has a cached array index. | |
| 2858 Label runtime; | |
| 2859 __ LoadlW(r4, FieldMemOperand(r2, String::kHashFieldOffset)); | |
| 2860 __ And(r0, r4, Operand(String::kContainsCachedArrayIndexMask)); | |
| 2861 __ bne(&runtime); | |
| 2862 __ IndexFromHash(r4, r2); | |
| 2863 __ Ret(); | |
| 2864 | |
| 2865 __ bind(&runtime); | |
| 2866 { | |
| 2867 FrameScope frame(masm, StackFrame::INTERNAL); | |
| 2868 // Push argument. | |
| 2869 __ push(r2); | |
| 2870 // We cannot use a tail call here because this builtin can also be called | |
| 2871 // from wasm. | |
| 2872 __ CallRuntime(Runtime::kStringToNumber); | |
| 2873 } | |
| 2874 __ Ret(); | |
| 2875 } | |
| 2876 | |
| 2877 // static | |
| 2878 void Builtins::Generate_ToNumber(MacroAssembler* masm) { | 2853 void Builtins::Generate_ToNumber(MacroAssembler* masm) { |
| 2879 // The ToNumber stub takes one argument in r2. | 2854 // The ToNumber stub takes one argument in r2. |
| 2880 STATIC_ASSERT(kSmiTag == 0); | 2855 STATIC_ASSERT(kSmiTag == 0); |
| 2881 __ TestIfSmi(r2); | 2856 __ TestIfSmi(r2); |
| 2882 __ Ret(eq); | 2857 __ Ret(eq); |
| 2883 | 2858 |
| 2884 __ CompareObjectType(r2, r3, r3, HEAP_NUMBER_TYPE); | 2859 __ CompareObjectType(r2, r3, r3, HEAP_NUMBER_TYPE); |
| 2885 // r2: receiver | 2860 // r2: receiver |
| 2886 // r3: receiver instance type | 2861 // r3: receiver instance type |
| 2887 __ Ret(eq); | 2862 __ Ret(eq); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3020 __ bkpt(0); | 2995 __ bkpt(0); |
| 3021 } | 2996 } |
| 3022 } | 2997 } |
| 3023 | 2998 |
| 3024 #undef __ | 2999 #undef __ |
| 3025 | 3000 |
| 3026 } // namespace internal | 3001 } // namespace internal |
| 3027 } // namespace v8 | 3002 } // namespace v8 |
| 3028 | 3003 |
| 3029 #endif // V8_TARGET_ARCH_S390 | 3004 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |