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/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 2732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2743 __ And(r0, r4, Operand(String::kContainsCachedArrayIndexMask)); | 2743 __ And(r0, r4, Operand(String::kContainsCachedArrayIndexMask)); |
2744 __ bne(&runtime); | 2744 __ bne(&runtime); |
2745 __ IndexFromHash(r4, r2); | 2745 __ IndexFromHash(r4, r2); |
2746 __ Ret(); | 2746 __ Ret(); |
2747 | 2747 |
2748 __ bind(&runtime); | 2748 __ bind(&runtime); |
2749 __ push(r2); // Push argument. | 2749 __ push(r2); // Push argument. |
2750 __ TailCallRuntime(Runtime::kStringToNumber); | 2750 __ TailCallRuntime(Runtime::kStringToNumber); |
2751 } | 2751 } |
2752 | 2752 |
2753 void ToLengthStub::Generate(MacroAssembler* masm) { | |
2754 // The ToLength stub takes one argument in r2. | |
2755 Label not_smi; | |
2756 __ JumpIfNotSmi(r2, ¬_smi); | |
2757 STATIC_ASSERT(kSmiTag == 0); | |
2758 __ CmpP(r2, Operand::Zero()); | |
2759 Label positive; | |
2760 __ bgt(&positive); | |
2761 __ LoadImmP(r2, Operand::Zero()); | |
2762 __ bind(&positive); | |
2763 __ Ret(); | |
2764 __ bind(¬_smi); | |
2765 | |
2766 __ push(r2); // Push argument. | |
2767 __ TailCallRuntime(Runtime::kToLength); | |
2768 } | |
2769 | |
2770 void ToStringStub::Generate(MacroAssembler* masm) { | 2753 void ToStringStub::Generate(MacroAssembler* masm) { |
2771 // The ToString stub takes one argument in r2. | 2754 // The ToString stub takes one argument in r2. |
2772 Label done; | 2755 Label done; |
2773 Label is_number; | 2756 Label is_number; |
2774 __ JumpIfSmi(r2, &is_number); | 2757 __ JumpIfSmi(r2, &is_number); |
2775 | 2758 |
2776 __ CompareObjectType(r2, r3, r3, FIRST_NONSTRING_TYPE); | 2759 __ CompareObjectType(r2, r3, r3, FIRST_NONSTRING_TYPE); |
2777 // r2: receiver | 2760 // r2: receiver |
2778 // r3: receiver instance type | 2761 // r3: receiver instance type |
2779 __ blt(&done); | 2762 __ blt(&done); |
(...skipping 2934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5714 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5697 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5715 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5698 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5716 } | 5699 } |
5717 | 5700 |
5718 #undef __ | 5701 #undef __ |
5719 | 5702 |
5720 } // namespace internal | 5703 } // namespace internal |
5721 } // namespace v8 | 5704 } // namespace v8 |
5722 | 5705 |
5723 #endif // V8_TARGET_ARCH_S390 | 5706 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |