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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
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 3123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3134 __ stop("Unexpected code address"); | 3134 __ stop("Unexpected code address"); |
3135 } | 3135 } |
3136 | 3136 |
3137 | 3137 |
3138 void CallICStub::Generate(MacroAssembler* masm) { | 3138 void CallICStub::Generate(MacroAssembler* masm) { |
3139 // r1 - function | 3139 // r1 - function |
3140 // r3 - slot id (Smi) | 3140 // r3 - slot id (Smi) |
3141 Label extra_checks_or_miss, slow_start; | 3141 Label extra_checks_or_miss, slow_start; |
3142 Label slow, non_function, wrap, cont; | 3142 Label slow, non_function, wrap, cont; |
3143 Label have_js_function; | 3143 Label have_js_function; |
3144 int argc = state_.arg_count(); | 3144 int argc = arg_count(); |
3145 ParameterCount actual(argc); | 3145 ParameterCount actual(argc); |
3146 | 3146 |
3147 EmitLoadTypeFeedbackVector(masm, a2); | 3147 EmitLoadTypeFeedbackVector(masm, a2); |
3148 | 3148 |
3149 // The checks. First, does r1 match the recorded monomorphic target? | 3149 // The checks. First, does r1 match the recorded monomorphic target? |
3150 __ sll(t0, a3, kPointerSizeLog2 - kSmiTagSize); | 3150 __ sll(t0, a3, kPointerSizeLog2 - kSmiTagSize); |
3151 __ Addu(t0, a2, Operand(t0)); | 3151 __ Addu(t0, a2, Operand(t0)); |
3152 __ lw(t0, FieldMemOperand(t0, FixedArray::kHeaderSize)); | 3152 __ lw(t0, FieldMemOperand(t0, FixedArray::kHeaderSize)); |
3153 __ Branch(&extra_checks_or_miss, ne, a1, Operand(t0)); | 3153 __ Branch(&extra_checks_or_miss, ne, a1, Operand(t0)); |
3154 | 3154 |
3155 __ bind(&have_js_function); | 3155 __ bind(&have_js_function); |
3156 if (state_.CallAsMethod()) { | 3156 if (CallAsMethod()) { |
3157 EmitContinueIfStrictOrNative(masm, &cont); | 3157 EmitContinueIfStrictOrNative(masm, &cont); |
3158 // Compute the receiver in sloppy mode. | 3158 // Compute the receiver in sloppy mode. |
3159 __ lw(a3, MemOperand(sp, argc * kPointerSize)); | 3159 __ lw(a3, MemOperand(sp, argc * kPointerSize)); |
3160 | 3160 |
3161 __ JumpIfSmi(a3, &wrap); | 3161 __ JumpIfSmi(a3, &wrap); |
3162 __ GetObjectType(a3, t0, t0); | 3162 __ GetObjectType(a3, t0, t0); |
3163 __ Branch(&wrap, lt, t0, Operand(FIRST_SPEC_OBJECT_TYPE)); | 3163 __ Branch(&wrap, lt, t0, Operand(FIRST_SPEC_OBJECT_TYPE)); |
3164 | 3164 |
3165 __ bind(&cont); | 3165 __ bind(&cont); |
3166 } | 3166 } |
3167 | 3167 |
3168 __ InvokeFunction(a1, actual, JUMP_FUNCTION, NullCallWrapper()); | 3168 __ InvokeFunction(a1, actual, JUMP_FUNCTION, NullCallWrapper()); |
3169 | 3169 |
3170 __ bind(&slow); | 3170 __ bind(&slow); |
3171 EmitSlowCase(masm, argc, &non_function); | 3171 EmitSlowCase(masm, argc, &non_function); |
3172 | 3172 |
3173 if (state_.CallAsMethod()) { | 3173 if (CallAsMethod()) { |
3174 __ bind(&wrap); | 3174 __ bind(&wrap); |
3175 EmitWrapCase(masm, argc, &cont); | 3175 EmitWrapCase(masm, argc, &cont); |
3176 } | 3176 } |
3177 | 3177 |
3178 __ bind(&extra_checks_or_miss); | 3178 __ bind(&extra_checks_or_miss); |
3179 Label miss; | 3179 Label miss; |
3180 | 3180 |
3181 __ LoadRoot(at, Heap::kMegamorphicSymbolRootIndex); | 3181 __ LoadRoot(at, Heap::kMegamorphicSymbolRootIndex); |
3182 __ Branch(&slow_start, eq, t0, Operand(at)); | 3182 __ Branch(&slow_start, eq, t0, Operand(at)); |
3183 __ LoadRoot(at, Heap::kUninitializedSymbolRootIndex); | 3183 __ LoadRoot(at, Heap::kUninitializedSymbolRootIndex); |
(...skipping 24 matching lines...) Expand all Loading... |
3208 | 3208 |
3209 // Goto slow case if we do not have a function. | 3209 // Goto slow case if we do not have a function. |
3210 __ GetObjectType(a1, t0, t0); | 3210 __ GetObjectType(a1, t0, t0); |
3211 __ Branch(&slow, ne, t0, Operand(JS_FUNCTION_TYPE)); | 3211 __ Branch(&slow, ne, t0, Operand(JS_FUNCTION_TYPE)); |
3212 __ Branch(&have_js_function); | 3212 __ Branch(&have_js_function); |
3213 } | 3213 } |
3214 | 3214 |
3215 | 3215 |
3216 void CallICStub::GenerateMiss(MacroAssembler* masm, IC::UtilityId id) { | 3216 void CallICStub::GenerateMiss(MacroAssembler* masm, IC::UtilityId id) { |
3217 // Get the receiver of the function from the stack; 1 ~ return address. | 3217 // Get the receiver of the function from the stack; 1 ~ return address. |
3218 __ lw(t0, MemOperand(sp, (state_.arg_count() + 1) * kPointerSize)); | 3218 __ lw(t0, MemOperand(sp, (arg_count() + 1) * kPointerSize)); |
3219 | 3219 |
3220 { | 3220 { |
3221 FrameScope scope(masm, StackFrame::INTERNAL); | 3221 FrameScope scope(masm, StackFrame::INTERNAL); |
3222 | 3222 |
3223 // Push the receiver and the function and feedback info. | 3223 // Push the receiver and the function and feedback info. |
3224 __ Push(t0, a1, a2, a3); | 3224 __ Push(t0, a1, a2, a3); |
3225 | 3225 |
3226 // Call the entry. | 3226 // Call the entry. |
3227 ExternalReference miss = ExternalReference(IC_Utility(id), | 3227 ExternalReference miss = ExternalReference(IC_Utility(id), |
3228 masm->isolate()); | 3228 masm->isolate()); |
(...skipping 2057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5286 MemOperand(fp, 6 * kPointerSize), | 5286 MemOperand(fp, 6 * kPointerSize), |
5287 NULL); | 5287 NULL); |
5288 } | 5288 } |
5289 | 5289 |
5290 | 5290 |
5291 #undef __ | 5291 #undef __ |
5292 | 5292 |
5293 } } // namespace v8::internal | 5293 } } // namespace v8::internal |
5294 | 5294 |
5295 #endif // V8_TARGET_ARCH_MIPS | 5295 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |