OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 2733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2744 // -- a0 : requested object size (untagged) | 2744 // -- a0 : requested object size (untagged) |
2745 // -- ra : return address | 2745 // -- ra : return address |
2746 // ----------------------------------- | 2746 // ----------------------------------- |
2747 __ SmiTag(a0); | 2747 __ SmiTag(a0); |
2748 __ Move(a1, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); | 2748 __ Move(a1, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); |
2749 __ Push(a0, a1); | 2749 __ Push(a0, a1); |
2750 __ Move(cp, Smi::FromInt(0)); | 2750 __ Move(cp, Smi::FromInt(0)); |
2751 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); | 2751 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); |
2752 } | 2752 } |
2753 | 2753 |
| 2754 // static |
| 2755 void Builtins::Generate_StringToNumber(MacroAssembler* masm) { |
| 2756 // The StringToNumber stub takes on argument in a0. |
| 2757 __ AssertString(a0); |
| 2758 |
| 2759 // Check if string has a cached array index. |
| 2760 Label runtime; |
| 2761 __ lwu(a2, FieldMemOperand(a0, String::kHashFieldOffset)); |
| 2762 __ And(at, a2, Operand(String::kContainsCachedArrayIndexMask)); |
| 2763 __ Branch(&runtime, ne, at, Operand(zero_reg)); |
| 2764 __ IndexFromHash(a2, v0); |
| 2765 __ Ret(); |
| 2766 |
| 2767 __ bind(&runtime); |
| 2768 __ Push(a0); // Push argument. |
| 2769 __ TailCallRuntime(Runtime::kStringToNumber); |
| 2770 } |
| 2771 |
2754 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 2772 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
2755 // State setup as expected by MacroAssembler::InvokePrologue. | 2773 // State setup as expected by MacroAssembler::InvokePrologue. |
2756 // ----------- S t a t e ------------- | 2774 // ----------- S t a t e ------------- |
2757 // -- a0: actual arguments count | 2775 // -- a0: actual arguments count |
2758 // -- a1: function (passed through to callee) | 2776 // -- a1: function (passed through to callee) |
2759 // -- a2: expected arguments count | 2777 // -- a2: expected arguments count |
2760 // -- a3: new target (passed through to callee) | 2778 // -- a3: new target (passed through to callee) |
2761 // ----------------------------------- | 2779 // ----------------------------------- |
2762 | 2780 |
2763 Label invoke, dont_adapt_arguments, stack_overflow; | 2781 Label invoke, dont_adapt_arguments, stack_overflow; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2884 } | 2902 } |
2885 } | 2903 } |
2886 | 2904 |
2887 | 2905 |
2888 #undef __ | 2906 #undef __ |
2889 | 2907 |
2890 } // namespace internal | 2908 } // namespace internal |
2891 } // namespace v8 | 2909 } // namespace v8 |
2892 | 2910 |
2893 #endif // V8_TARGET_ARCH_MIPS64 | 2911 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |