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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2959 ParameterCount actual(argc); | 2959 ParameterCount actual(argc); |
2960 | 2960 |
2961 EmitLoadTypeFeedbackVector(masm, r2); | 2961 EmitLoadTypeFeedbackVector(masm, r2); |
2962 | 2962 |
2963 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r4); | 2963 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r4); |
2964 __ cmp(r1, r4); | 2964 __ cmp(r1, r4); |
2965 __ b(ne, &miss); | 2965 __ b(ne, &miss); |
2966 | 2966 |
2967 __ mov(r0, Operand(arg_count())); | 2967 __ mov(r0, Operand(arg_count())); |
2968 __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); | 2968 __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); |
2969 __ ldr(r2, FieldMemOperand(r4, FixedArray::kHeaderSize)); | 2969 __ ldr(r4, FieldMemOperand(r4, FixedArray::kHeaderSize)); |
2970 // Verify that r2 contains an AllocationSite | 2970 |
2971 __ AssertUndefinedOrAllocationSite(r2, r4); | 2971 // Verify that r4 contains an AllocationSite |
| 2972 __ ldr(r5, FieldMemOperand(r4, HeapObject::kMapOffset)); |
| 2973 __ CompareRoot(r5, Heap::kAllocationSiteMapRootIndex); |
| 2974 __ b(ne, &miss); |
| 2975 |
| 2976 __ mov(r2, r4); |
2972 ArrayConstructorStub stub(masm->isolate(), arg_count()); | 2977 ArrayConstructorStub stub(masm->isolate(), arg_count()); |
2973 __ TailCallStub(&stub); | 2978 __ TailCallStub(&stub); |
2974 | 2979 |
2975 __ bind(&miss); | 2980 __ bind(&miss); |
2976 GenerateMiss(masm, IC::kCallIC_Customization_Miss); | 2981 GenerateMiss(masm, IC::kCallIC_Customization_Miss); |
2977 | 2982 |
2978 // The slow case, we need this no matter what to complete a call after a miss. | 2983 // The slow case, we need this no matter what to complete a call after a miss. |
2979 CallFunctionNoFeedback(masm, | 2984 CallFunctionNoFeedback(masm, |
2980 arg_count(), | 2985 arg_count(), |
2981 true, | 2986 true, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3028 | 3033 |
3029 __ bind(&extra_checks_or_miss); | 3034 __ bind(&extra_checks_or_miss); |
3030 Label miss; | 3035 Label miss; |
3031 | 3036 |
3032 __ CompareRoot(r4, Heap::kMegamorphicSymbolRootIndex); | 3037 __ CompareRoot(r4, Heap::kMegamorphicSymbolRootIndex); |
3033 __ b(eq, &slow_start); | 3038 __ b(eq, &slow_start); |
3034 __ CompareRoot(r4, Heap::kUninitializedSymbolRootIndex); | 3039 __ CompareRoot(r4, Heap::kUninitializedSymbolRootIndex); |
3035 __ b(eq, &miss); | 3040 __ b(eq, &miss); |
3036 | 3041 |
3037 if (!FLAG_trace_ic) { | 3042 if (!FLAG_trace_ic) { |
3038 // We are going megamorphic, and we don't want to visit the runtime. | 3043 // We are going megamorphic. If the feedback is a JSFunction, it is fine |
| 3044 // to handle it here. More complex cases are dealt with in the runtime. |
| 3045 __ AssertNotSmi(r4); |
| 3046 __ CompareObjectType(r4, r5, r5, JS_FUNCTION_TYPE); |
| 3047 __ b(ne, &miss); |
3039 __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); | 3048 __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); |
3040 __ LoadRoot(ip, Heap::kMegamorphicSymbolRootIndex); | 3049 __ LoadRoot(ip, Heap::kMegamorphicSymbolRootIndex); |
3041 __ str(ip, FieldMemOperand(r4, FixedArray::kHeaderSize)); | 3050 __ str(ip, FieldMemOperand(r4, FixedArray::kHeaderSize)); |
3042 __ jmp(&slow_start); | 3051 __ jmp(&slow_start); |
3043 } | 3052 } |
3044 | 3053 |
3045 // We are here because tracing is on or we are going monomorphic. | 3054 // We are here because tracing is on or we are going monomorphic. |
3046 __ bind(&miss); | 3055 __ bind(&miss); |
3047 GenerateMiss(masm, IC::kCallIC_Miss); | 3056 GenerateMiss(masm, IC::kCallIC_Miss); |
3048 | 3057 |
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5064 MemOperand(fp, 6 * kPointerSize), | 5073 MemOperand(fp, 6 * kPointerSize), |
5065 NULL); | 5074 NULL); |
5066 } | 5075 } |
5067 | 5076 |
5068 | 5077 |
5069 #undef __ | 5078 #undef __ |
5070 | 5079 |
5071 } } // namespace v8::internal | 5080 } } // namespace v8::internal |
5072 | 5081 |
5073 #endif // V8_TARGET_ARCH_ARM | 5082 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |