Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/mips64/code-stubs-mips64.cc

Issue 503373002: MIPS: Minor-key-ify CallICStub and CallIC_ArrayStub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
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 3184 matching lines...) Expand 10 before | Expand all | Expand 10 after
3195 3195
3196 __ mov(a2, a4); 3196 __ mov(a2, a4);
3197 ArrayConstructorStub stub(masm->isolate(), arg_count()); 3197 ArrayConstructorStub stub(masm->isolate(), arg_count());
3198 __ TailCallStub(&stub); 3198 __ TailCallStub(&stub);
3199 3199
3200 __ bind(&miss); 3200 __ bind(&miss);
3201 GenerateMiss(masm, IC::kCallIC_Customization_Miss); 3201 GenerateMiss(masm, IC::kCallIC_Customization_Miss);
3202 3202
3203 // The slow case, we need this no matter what to complete a call after a miss. 3203 // The slow case, we need this no matter what to complete a call after a miss.
3204 CallFunctionNoFeedback(masm, 3204 CallFunctionNoFeedback(masm,
3205 arg_count(), 3205 arg_count(),
3206 true, 3206 true,
3207 CallAsMethod()); 3207 CallAsMethod());
3208 3208
3209 // Unreachable. 3209 // Unreachable.
3210 __ stop("Unexpected code address"); 3210 __ stop("Unexpected code address");
3211 } 3211 }
3212 3212
3213 3213
3214 void CallICStub::Generate(MacroAssembler* masm) { 3214 void CallICStub::Generate(MacroAssembler* masm) {
3215 // a1 - function 3215 // a1 - function
3216 // a3 - slot id (Smi) 3216 // a3 - slot id (Smi)
3217 Label extra_checks_or_miss, slow_start; 3217 Label extra_checks_or_miss, slow_start;
3218 Label slow, non_function, wrap, cont; 3218 Label slow, non_function, wrap, cont;
3219 Label have_js_function; 3219 Label have_js_function;
3220 int argc = state_.arg_count(); 3220 int argc = arg_count();
3221 ParameterCount actual(argc); 3221 ParameterCount actual(argc);
3222 3222
3223 EmitLoadTypeFeedbackVector(masm, a2); 3223 EmitLoadTypeFeedbackVector(masm, a2);
3224 3224
3225 // The checks. First, does r1 match the recorded monomorphic target? 3225 // The checks. First, does r1 match the recorded monomorphic target?
3226 __ dsrl(a4, a3, 32 - kPointerSizeLog2); 3226 __ dsrl(a4, a3, 32 - kPointerSizeLog2);
3227 __ Daddu(a4, a2, Operand(a4)); 3227 __ Daddu(a4, a2, Operand(a4));
3228 __ ld(a4, FieldMemOperand(a4, FixedArray::kHeaderSize)); 3228 __ ld(a4, FieldMemOperand(a4, FixedArray::kHeaderSize));
3229 __ Branch(&extra_checks_or_miss, ne, a1, Operand(a4)); 3229 __ Branch(&extra_checks_or_miss, ne, a1, Operand(a4));
3230 3230
3231 __ bind(&have_js_function); 3231 __ bind(&have_js_function);
3232 if (state_.CallAsMethod()) { 3232 if (CallAsMethod()) {
3233 EmitContinueIfStrictOrNative(masm, &cont); 3233 EmitContinueIfStrictOrNative(masm, &cont);
3234 // Compute the receiver in sloppy mode. 3234 // Compute the receiver in sloppy mode.
3235 __ ld(a3, MemOperand(sp, argc * kPointerSize)); 3235 __ ld(a3, MemOperand(sp, argc * kPointerSize));
3236 3236
3237 __ JumpIfSmi(a3, &wrap); 3237 __ JumpIfSmi(a3, &wrap);
3238 __ GetObjectType(a3, a4, a4); 3238 __ GetObjectType(a3, a4, a4);
3239 __ Branch(&wrap, lt, a4, Operand(FIRST_SPEC_OBJECT_TYPE)); 3239 __ Branch(&wrap, lt, a4, Operand(FIRST_SPEC_OBJECT_TYPE));
3240 3240
3241 __ bind(&cont); 3241 __ bind(&cont);
3242 } 3242 }
3243 3243
3244 __ InvokeFunction(a1, actual, JUMP_FUNCTION, NullCallWrapper()); 3244 __ InvokeFunction(a1, actual, JUMP_FUNCTION, NullCallWrapper());
3245 3245
3246 __ bind(&slow); 3246 __ bind(&slow);
3247 EmitSlowCase(masm, argc, &non_function); 3247 EmitSlowCase(masm, argc, &non_function);
3248 3248
3249 if (state_.CallAsMethod()) { 3249 if (CallAsMethod()) {
3250 __ bind(&wrap); 3250 __ bind(&wrap);
3251 EmitWrapCase(masm, argc, &cont); 3251 EmitWrapCase(masm, argc, &cont);
3252 } 3252 }
3253 3253
3254 __ bind(&extra_checks_or_miss); 3254 __ bind(&extra_checks_or_miss);
3255 Label miss; 3255 Label miss;
3256 3256
3257 __ LoadRoot(at, Heap::kMegamorphicSymbolRootIndex); 3257 __ LoadRoot(at, Heap::kMegamorphicSymbolRootIndex);
3258 __ Branch(&slow_start, eq, a4, Operand(at)); 3258 __ Branch(&slow_start, eq, a4, Operand(at));
3259 __ LoadRoot(at, Heap::kUninitializedSymbolRootIndex); 3259 __ LoadRoot(at, Heap::kUninitializedSymbolRootIndex);
(...skipping 24 matching lines...) Expand all
3284 3284
3285 // Goto slow case if we do not have a function. 3285 // Goto slow case if we do not have a function.
3286 __ GetObjectType(a1, a4, a4); 3286 __ GetObjectType(a1, a4, a4);
3287 __ Branch(&slow, ne, a4, Operand(JS_FUNCTION_TYPE)); 3287 __ Branch(&slow, ne, a4, Operand(JS_FUNCTION_TYPE));
3288 __ Branch(&have_js_function); 3288 __ Branch(&have_js_function);
3289 } 3289 }
3290 3290
3291 3291
3292 void CallICStub::GenerateMiss(MacroAssembler* masm, IC::UtilityId id) { 3292 void CallICStub::GenerateMiss(MacroAssembler* masm, IC::UtilityId id) {
3293 // Get the receiver of the function from the stack; 1 ~ return address. 3293 // Get the receiver of the function from the stack; 1 ~ return address.
3294 __ ld(a4, MemOperand(sp, (state_.arg_count() + 1) * kPointerSize)); 3294 __ ld(a4, MemOperand(sp, (arg_count() + 1) * kPointerSize));
3295 3295
3296 { 3296 {
3297 FrameScope scope(masm, StackFrame::INTERNAL); 3297 FrameScope scope(masm, StackFrame::INTERNAL);
3298 3298
3299 // Push the receiver and the function and feedback info. 3299 // Push the receiver and the function and feedback info.
3300 __ Push(a4, a1, a2, a3); 3300 __ Push(a4, a1, a2, a3);
3301 3301
3302 // Call the entry. 3302 // Call the entry.
3303 ExternalReference miss = ExternalReference(IC_Utility(id), 3303 ExternalReference miss = ExternalReference(IC_Utility(id),
3304 masm->isolate()); 3304 masm->isolate());
(...skipping 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after
5323 MemOperand(fp, 6 * kPointerSize), 5323 MemOperand(fp, 6 * kPointerSize),
5324 NULL); 5324 NULL);
5325 } 5325 }
5326 5326
5327 5327
5328 #undef __ 5328 #undef __
5329 5329
5330 } } // namespace v8::internal 5330 } } // namespace v8::internal
5331 5331
5332 #endif // V8_TARGET_ARCH_MIPS64 5332 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698