| 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 2960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2971 JSFunction::kSharedFunctionInfoOffset)); | 2971 JSFunction::kSharedFunctionInfoOffset)); |
| 2972 __ ldr(vector, FieldMemOperand(vector, | 2972 __ ldr(vector, FieldMemOperand(vector, |
| 2973 SharedFunctionInfo::kFeedbackVectorOffset)); | 2973 SharedFunctionInfo::kFeedbackVectorOffset)); |
| 2974 } | 2974 } |
| 2975 | 2975 |
| 2976 | 2976 |
| 2977 void CallIC_ArrayStub::Generate(MacroAssembler* masm) { | 2977 void CallIC_ArrayStub::Generate(MacroAssembler* masm) { |
| 2978 // r1 - function | 2978 // r1 - function |
| 2979 // r3 - slot id | 2979 // r3 - slot id |
| 2980 Label miss; | 2980 Label miss; |
| 2981 int argc = state_.arg_count(); | 2981 int argc = arg_count(); |
| 2982 ParameterCount actual(argc); | 2982 ParameterCount actual(argc); |
| 2983 | 2983 |
| 2984 EmitLoadTypeFeedbackVector(masm, r2); | 2984 EmitLoadTypeFeedbackVector(masm, r2); |
| 2985 | 2985 |
| 2986 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r4); | 2986 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r4); |
| 2987 __ cmp(r1, r4); | 2987 __ cmp(r1, r4); |
| 2988 __ b(ne, &miss); | 2988 __ b(ne, &miss); |
| 2989 | 2989 |
| 2990 __ mov(r0, Operand(arg_count())); | 2990 __ mov(r0, Operand(arg_count())); |
| 2991 __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); | 2991 __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 3013 __ stop("Unexpected code address"); | 3013 __ stop("Unexpected code address"); |
| 3014 } | 3014 } |
| 3015 | 3015 |
| 3016 | 3016 |
| 3017 void CallICStub::Generate(MacroAssembler* masm) { | 3017 void CallICStub::Generate(MacroAssembler* masm) { |
| 3018 // r1 - function | 3018 // r1 - function |
| 3019 // r3 - slot id (Smi) | 3019 // r3 - slot id (Smi) |
| 3020 Label extra_checks_or_miss, slow_start; | 3020 Label extra_checks_or_miss, slow_start; |
| 3021 Label slow, non_function, wrap, cont; | 3021 Label slow, non_function, wrap, cont; |
| 3022 Label have_js_function; | 3022 Label have_js_function; |
| 3023 int argc = state_.arg_count(); | 3023 int argc = arg_count(); |
| 3024 ParameterCount actual(argc); | 3024 ParameterCount actual(argc); |
| 3025 | 3025 |
| 3026 EmitLoadTypeFeedbackVector(masm, r2); | 3026 EmitLoadTypeFeedbackVector(masm, r2); |
| 3027 | 3027 |
| 3028 // The checks. First, does r1 match the recorded monomorphic target? | 3028 // The checks. First, does r1 match the recorded monomorphic target? |
| 3029 __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); | 3029 __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); |
| 3030 __ ldr(r4, FieldMemOperand(r4, FixedArray::kHeaderSize)); | 3030 __ ldr(r4, FieldMemOperand(r4, FixedArray::kHeaderSize)); |
| 3031 __ cmp(r1, r4); | 3031 __ cmp(r1, r4); |
| 3032 __ b(ne, &extra_checks_or_miss); | 3032 __ b(ne, &extra_checks_or_miss); |
| 3033 | 3033 |
| 3034 __ bind(&have_js_function); | 3034 __ bind(&have_js_function); |
| 3035 if (state_.CallAsMethod()) { | 3035 if (CallAsMethod()) { |
| 3036 EmitContinueIfStrictOrNative(masm, &cont); | 3036 EmitContinueIfStrictOrNative(masm, &cont); |
| 3037 // Compute the receiver in sloppy mode. | 3037 // Compute the receiver in sloppy mode. |
| 3038 __ ldr(r3, MemOperand(sp, argc * kPointerSize)); | 3038 __ ldr(r3, MemOperand(sp, argc * kPointerSize)); |
| 3039 | 3039 |
| 3040 __ JumpIfSmi(r3, &wrap); | 3040 __ JumpIfSmi(r3, &wrap); |
| 3041 __ CompareObjectType(r3, r4, r4, FIRST_SPEC_OBJECT_TYPE); | 3041 __ CompareObjectType(r3, r4, r4, FIRST_SPEC_OBJECT_TYPE); |
| 3042 __ b(lt, &wrap); | 3042 __ b(lt, &wrap); |
| 3043 | 3043 |
| 3044 __ bind(&cont); | 3044 __ bind(&cont); |
| 3045 } | 3045 } |
| 3046 | 3046 |
| 3047 __ InvokeFunction(r1, actual, JUMP_FUNCTION, NullCallWrapper()); | 3047 __ InvokeFunction(r1, actual, JUMP_FUNCTION, NullCallWrapper()); |
| 3048 | 3048 |
| 3049 __ bind(&slow); | 3049 __ bind(&slow); |
| 3050 EmitSlowCase(masm, argc, &non_function); | 3050 EmitSlowCase(masm, argc, &non_function); |
| 3051 | 3051 |
| 3052 if (state_.CallAsMethod()) { | 3052 if (CallAsMethod()) { |
| 3053 __ bind(&wrap); | 3053 __ bind(&wrap); |
| 3054 EmitWrapCase(masm, argc, &cont); | 3054 EmitWrapCase(masm, argc, &cont); |
| 3055 } | 3055 } |
| 3056 | 3056 |
| 3057 __ bind(&extra_checks_or_miss); | 3057 __ bind(&extra_checks_or_miss); |
| 3058 Label miss; | 3058 Label miss; |
| 3059 | 3059 |
| 3060 __ CompareRoot(r4, Heap::kMegamorphicSymbolRootIndex); | 3060 __ CompareRoot(r4, Heap::kMegamorphicSymbolRootIndex); |
| 3061 __ b(eq, &slow_start); | 3061 __ b(eq, &slow_start); |
| 3062 __ CompareRoot(r4, Heap::kUninitializedSymbolRootIndex); | 3062 __ CompareRoot(r4, Heap::kUninitializedSymbolRootIndex); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 3086 | 3086 |
| 3087 // Goto slow case if we do not have a function. | 3087 // Goto slow case if we do not have a function. |
| 3088 __ CompareObjectType(r1, r4, r4, JS_FUNCTION_TYPE); | 3088 __ CompareObjectType(r1, r4, r4, JS_FUNCTION_TYPE); |
| 3089 __ b(ne, &slow); | 3089 __ b(ne, &slow); |
| 3090 __ jmp(&have_js_function); | 3090 __ jmp(&have_js_function); |
| 3091 } | 3091 } |
| 3092 | 3092 |
| 3093 | 3093 |
| 3094 void CallICStub::GenerateMiss(MacroAssembler* masm, IC::UtilityId id) { | 3094 void CallICStub::GenerateMiss(MacroAssembler* masm, IC::UtilityId id) { |
| 3095 // Get the receiver of the function from the stack; 1 ~ return address. | 3095 // Get the receiver of the function from the stack; 1 ~ return address. |
| 3096 __ ldr(r4, MemOperand(sp, (state_.arg_count() + 1) * kPointerSize)); | 3096 __ ldr(r4, MemOperand(sp, (arg_count() + 1) * kPointerSize)); |
| 3097 | 3097 |
| 3098 { | 3098 { |
| 3099 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 3099 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
| 3100 | 3100 |
| 3101 // Push the receiver and the function and feedback info. | 3101 // Push the receiver and the function and feedback info. |
| 3102 __ Push(r4, r1, r2, r3); | 3102 __ Push(r4, r1, r2, r3); |
| 3103 | 3103 |
| 3104 // Call the entry. | 3104 // Call the entry. |
| 3105 ExternalReference miss = ExternalReference(IC_Utility(id), | 3105 ExternalReference miss = ExternalReference(IC_Utility(id), |
| 3106 masm->isolate()); | 3106 masm->isolate()); |
| (...skipping 1989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5096 MemOperand(fp, 6 * kPointerSize), | 5096 MemOperand(fp, 6 * kPointerSize), |
| 5097 NULL); | 5097 NULL); |
| 5098 } | 5098 } |
| 5099 | 5099 |
| 5100 | 5100 |
| 5101 #undef __ | 5101 #undef __ |
| 5102 | 5102 |
| 5103 } } // namespace v8::internal | 5103 } } // namespace v8::internal |
| 5104 | 5104 |
| 5105 #endif // V8_TARGET_ARCH_ARM | 5105 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |