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 2699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2710 // -- r3 : requested object size (untagged) | 2710 // -- r3 : requested object size (untagged) |
2711 // -- lr : return address | 2711 // -- lr : return address |
2712 // ----------------------------------- | 2712 // ----------------------------------- |
2713 __ SmiTag(r3); | 2713 __ SmiTag(r3); |
2714 __ LoadSmiLiteral(r4, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); | 2714 __ LoadSmiLiteral(r4, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); |
2715 __ Push(r3, r4); | 2715 __ Push(r3, r4); |
2716 __ LoadSmiLiteral(cp, Smi::FromInt(0)); | 2716 __ LoadSmiLiteral(cp, Smi::FromInt(0)); |
2717 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); | 2717 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); |
2718 } | 2718 } |
2719 | 2719 |
| 2720 // static |
| 2721 void Builtins::Generate_StringToNumber(MacroAssembler* masm) { |
| 2722 // The StringToNumber stub takes one argument in r2. |
| 2723 __ AssertString(r2); |
| 2724 |
| 2725 // Check if string has a cached array index. |
| 2726 Label runtime; |
| 2727 __ LoadlW(r4, FieldMemOperand(r2, String::kHashFieldOffset)); |
| 2728 __ And(r0, r4, Operand(String::kContainsCachedArrayIndexMask)); |
| 2729 __ bne(&runtime); |
| 2730 __ IndexFromHash(r4, r2); |
| 2731 __ Ret(); |
| 2732 |
| 2733 __ bind(&runtime); |
| 2734 __ push(r2); // Push argument. |
| 2735 __ TailCallRuntime(Runtime::kStringToNumber); |
| 2736 } |
| 2737 |
2720 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 2738 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
2721 // ----------- S t a t e ------------- | 2739 // ----------- S t a t e ------------- |
2722 // -- r2 : actual number of arguments | 2740 // -- r2 : actual number of arguments |
2723 // -- r3 : function (passed through to callee) | 2741 // -- r3 : function (passed through to callee) |
2724 // -- r4 : expected number of arguments | 2742 // -- r4 : expected number of arguments |
2725 // -- r5 : new target (passed through to callee) | 2743 // -- r5 : new target (passed through to callee) |
2726 // ----------------------------------- | 2744 // ----------------------------------- |
2727 | 2745 |
2728 Label invoke, dont_adapt_arguments, stack_overflow; | 2746 Label invoke, dont_adapt_arguments, stack_overflow; |
2729 | 2747 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2847 __ bkpt(0); | 2865 __ bkpt(0); |
2848 } | 2866 } |
2849 } | 2867 } |
2850 | 2868 |
2851 #undef __ | 2869 #undef __ |
2852 | 2870 |
2853 } // namespace internal | 2871 } // namespace internal |
2854 } // namespace v8 | 2872 } // namespace v8 |
2855 | 2873 |
2856 #endif // V8_TARGET_ARCH_S390 | 2874 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |