OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 2828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2839 void CallICStub::Generate(MacroAssembler* masm) { | 2839 void CallICStub::Generate(MacroAssembler* masm) { |
2840 ASM_LOCATION("CallICStub"); | 2840 ASM_LOCATION("CallICStub"); |
2841 | 2841 |
2842 // x1 - function | 2842 // x1 - function |
2843 // x3 - slot id (Smi) | 2843 // x3 - slot id (Smi) |
2844 // x2 - vector | 2844 // x2 - vector |
2845 const int with_types_offset = | 2845 const int with_types_offset = |
2846 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); | 2846 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); |
2847 const int generic_offset = | 2847 const int generic_offset = |
2848 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex); | 2848 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex); |
2849 Label extra_checks_or_miss, call; | 2849 Label extra_checks_or_miss, call, call_function; |
2850 int argc = arg_count(); | 2850 int argc = arg_count(); |
2851 ParameterCount actual(argc); | 2851 ParameterCount actual(argc); |
2852 | 2852 |
2853 Register function = x1; | 2853 Register function = x1; |
2854 Register feedback_vector = x2; | 2854 Register feedback_vector = x2; |
2855 Register index = x3; | 2855 Register index = x3; |
2856 | 2856 |
2857 // The checks. First, does x1 match the recorded monomorphic target? | 2857 // The checks. First, does x1 match the recorded monomorphic target? |
2858 __ Add(x4, feedback_vector, | 2858 __ Add(x4, feedback_vector, |
2859 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 2859 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
(...skipping 23 matching lines...) Expand all Loading... |
2883 | 2883 |
2884 // Increment the call count for monomorphic function calls. | 2884 // Increment the call count for monomorphic function calls. |
2885 __ Add(feedback_vector, feedback_vector, | 2885 __ Add(feedback_vector, feedback_vector, |
2886 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 2886 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
2887 __ Add(feedback_vector, feedback_vector, | 2887 __ Add(feedback_vector, feedback_vector, |
2888 Operand(FixedArray::kHeaderSize + kPointerSize)); | 2888 Operand(FixedArray::kHeaderSize + kPointerSize)); |
2889 __ Ldr(index, FieldMemOperand(feedback_vector, 0)); | 2889 __ Ldr(index, FieldMemOperand(feedback_vector, 0)); |
2890 __ Add(index, index, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 2890 __ Add(index, index, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); |
2891 __ Str(index, FieldMemOperand(feedback_vector, 0)); | 2891 __ Str(index, FieldMemOperand(feedback_vector, 0)); |
2892 | 2892 |
2893 __ bind(&call); | 2893 __ Bind(&call_function); |
2894 __ Mov(x0, argc); | 2894 __ Mov(x0, argc); |
2895 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 2895 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode()), |
| 2896 RelocInfo::CODE_TARGET); |
2896 | 2897 |
2897 __ bind(&extra_checks_or_miss); | 2898 __ bind(&extra_checks_or_miss); |
2898 Label uninitialized, miss, not_allocation_site; | 2899 Label uninitialized, miss, not_allocation_site; |
2899 | 2900 |
2900 __ JumpIfRoot(x4, Heap::kmegamorphic_symbolRootIndex, &call); | 2901 __ JumpIfRoot(x4, Heap::kmegamorphic_symbolRootIndex, &call); |
2901 | 2902 |
2902 __ Ldr(x5, FieldMemOperand(x4, HeapObject::kMapOffset)); | 2903 __ Ldr(x5, FieldMemOperand(x4, HeapObject::kMapOffset)); |
2903 __ JumpIfNotRoot(x5, Heap::kAllocationSiteMapRootIndex, ¬_allocation_site); | 2904 __ JumpIfNotRoot(x5, Heap::kAllocationSiteMapRootIndex, ¬_allocation_site); |
2904 | 2905 |
2905 HandleArrayCase(masm, &miss); | 2906 HandleArrayCase(masm, &miss); |
(...skipping 16 matching lines...) Expand all Loading... |
2922 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 2923 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
2923 __ LoadRoot(x5, Heap::kmegamorphic_symbolRootIndex); | 2924 __ LoadRoot(x5, Heap::kmegamorphic_symbolRootIndex); |
2924 __ Str(x5, FieldMemOperand(x4, FixedArray::kHeaderSize)); | 2925 __ Str(x5, FieldMemOperand(x4, FixedArray::kHeaderSize)); |
2925 // We have to update statistics for runtime profiling. | 2926 // We have to update statistics for runtime profiling. |
2926 __ Ldr(x4, FieldMemOperand(feedback_vector, with_types_offset)); | 2927 __ Ldr(x4, FieldMemOperand(feedback_vector, with_types_offset)); |
2927 __ Subs(x4, x4, Operand(Smi::FromInt(1))); | 2928 __ Subs(x4, x4, Operand(Smi::FromInt(1))); |
2928 __ Str(x4, FieldMemOperand(feedback_vector, with_types_offset)); | 2929 __ Str(x4, FieldMemOperand(feedback_vector, with_types_offset)); |
2929 __ Ldr(x4, FieldMemOperand(feedback_vector, generic_offset)); | 2930 __ Ldr(x4, FieldMemOperand(feedback_vector, generic_offset)); |
2930 __ Adds(x4, x4, Operand(Smi::FromInt(1))); | 2931 __ Adds(x4, x4, Operand(Smi::FromInt(1))); |
2931 __ Str(x4, FieldMemOperand(feedback_vector, generic_offset)); | 2932 __ Str(x4, FieldMemOperand(feedback_vector, generic_offset)); |
2932 __ B(&call); | 2933 |
| 2934 __ Bind(&call); |
| 2935 __ Mov(x0, argc); |
| 2936 __ Jump(masm->isolate()->builtins()->Call(convert_mode()), |
| 2937 RelocInfo::CODE_TARGET); |
2933 | 2938 |
2934 __ bind(&uninitialized); | 2939 __ bind(&uninitialized); |
2935 | 2940 |
2936 // We are going monomorphic, provided we actually have a JSFunction. | 2941 // We are going monomorphic, provided we actually have a JSFunction. |
2937 __ JumpIfSmi(function, &miss); | 2942 __ JumpIfSmi(function, &miss); |
2938 | 2943 |
2939 // Goto miss case if we do not have a function. | 2944 // Goto miss case if we do not have a function. |
2940 __ JumpIfNotObjectType(function, x5, x5, JS_FUNCTION_TYPE, &miss); | 2945 __ JumpIfNotObjectType(function, x5, x5, JS_FUNCTION_TYPE, &miss); |
2941 | 2946 |
2942 // Make sure the function is not the Array() function, which requires special | 2947 // Make sure the function is not the Array() function, which requires special |
(...skipping 26 matching lines...) Expand all Loading... |
2969 // x3 - slot | 2974 // x3 - slot |
2970 // x1 - function | 2975 // x1 - function |
2971 { | 2976 { |
2972 FrameScope scope(masm, StackFrame::INTERNAL); | 2977 FrameScope scope(masm, StackFrame::INTERNAL); |
2973 CreateWeakCellStub create_stub(masm->isolate()); | 2978 CreateWeakCellStub create_stub(masm->isolate()); |
2974 __ Push(function); | 2979 __ Push(function); |
2975 __ CallStub(&create_stub); | 2980 __ CallStub(&create_stub); |
2976 __ Pop(function); | 2981 __ Pop(function); |
2977 } | 2982 } |
2978 | 2983 |
2979 __ B(&call); | 2984 __ B(&call_function); |
2980 | 2985 |
2981 // We are here because tracing is on or we encountered a MISS case we can't | 2986 // We are here because tracing is on or we encountered a MISS case we can't |
2982 // handle here. | 2987 // handle here. |
2983 __ bind(&miss); | 2988 __ bind(&miss); |
2984 GenerateMiss(masm); | 2989 GenerateMiss(masm); |
2985 | 2990 |
2986 __ B(&call); | 2991 __ B(&call); |
2987 } | 2992 } |
2988 | 2993 |
2989 | 2994 |
(...skipping 2825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5815 MemOperand(fp, 6 * kPointerSize), NULL); | 5820 MemOperand(fp, 6 * kPointerSize), NULL); |
5816 } | 5821 } |
5817 | 5822 |
5818 | 5823 |
5819 #undef __ | 5824 #undef __ |
5820 | 5825 |
5821 } // namespace internal | 5826 } // namespace internal |
5822 } // namespace v8 | 5827 } // namespace v8 |
5823 | 5828 |
5824 #endif // V8_TARGET_ARCH_ARM64 | 5829 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |