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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
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 3264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3275 | 3275 |
3276 | 3276 |
3277 void CallICStub::Generate(MacroAssembler* masm) { | 3277 void CallICStub::Generate(MacroAssembler* masm) { |
3278 ASM_LOCATION("CallICStub"); | 3278 ASM_LOCATION("CallICStub"); |
3279 | 3279 |
3280 // x1 - function | 3280 // x1 - function |
3281 // x3 - slot id (Smi) | 3281 // x3 - slot id (Smi) |
3282 Label extra_checks_or_miss, slow_start; | 3282 Label extra_checks_or_miss, slow_start; |
3283 Label slow, non_function, wrap, cont; | 3283 Label slow, non_function, wrap, cont; |
3284 Label have_js_function; | 3284 Label have_js_function; |
3285 int argc = state_.arg_count(); | 3285 int argc = arg_count(); |
3286 ParameterCount actual(argc); | 3286 ParameterCount actual(argc); |
3287 | 3287 |
3288 Register function = x1; | 3288 Register function = x1; |
3289 Register feedback_vector = x2; | 3289 Register feedback_vector = x2; |
3290 Register index = x3; | 3290 Register index = x3; |
3291 Register type = x4; | 3291 Register type = x4; |
3292 | 3292 |
3293 EmitLoadTypeFeedbackVector(masm, feedback_vector); | 3293 EmitLoadTypeFeedbackVector(masm, feedback_vector); |
3294 | 3294 |
3295 // The checks. First, does x1 match the recorded monomorphic target? | 3295 // The checks. First, does x1 match the recorded monomorphic target? |
3296 __ Add(x4, feedback_vector, | 3296 __ Add(x4, feedback_vector, |
3297 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 3297 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
3298 __ Ldr(x4, FieldMemOperand(x4, FixedArray::kHeaderSize)); | 3298 __ Ldr(x4, FieldMemOperand(x4, FixedArray::kHeaderSize)); |
3299 | 3299 |
3300 __ Cmp(x4, function); | 3300 __ Cmp(x4, function); |
3301 __ B(ne, &extra_checks_or_miss); | 3301 __ B(ne, &extra_checks_or_miss); |
3302 | 3302 |
3303 __ bind(&have_js_function); | 3303 __ bind(&have_js_function); |
3304 if (state_.CallAsMethod()) { | 3304 if (CallAsMethod()) { |
3305 EmitContinueIfStrictOrNative(masm, &cont); | 3305 EmitContinueIfStrictOrNative(masm, &cont); |
3306 | 3306 |
3307 // Compute the receiver in sloppy mode. | 3307 // Compute the receiver in sloppy mode. |
3308 __ Peek(x3, argc * kPointerSize); | 3308 __ Peek(x3, argc * kPointerSize); |
3309 | 3309 |
3310 __ JumpIfSmi(x3, &wrap); | 3310 __ JumpIfSmi(x3, &wrap); |
3311 __ JumpIfObjectType(x3, x10, type, FIRST_SPEC_OBJECT_TYPE, &wrap, lt); | 3311 __ JumpIfObjectType(x3, x10, type, FIRST_SPEC_OBJECT_TYPE, &wrap, lt); |
3312 | 3312 |
3313 __ Bind(&cont); | 3313 __ Bind(&cont); |
3314 } | 3314 } |
3315 | 3315 |
3316 __ InvokeFunction(function, | 3316 __ InvokeFunction(function, |
3317 actual, | 3317 actual, |
3318 JUMP_FUNCTION, | 3318 JUMP_FUNCTION, |
3319 NullCallWrapper()); | 3319 NullCallWrapper()); |
3320 | 3320 |
3321 __ bind(&slow); | 3321 __ bind(&slow); |
3322 EmitSlowCase(masm, argc, function, type, &non_function); | 3322 EmitSlowCase(masm, argc, function, type, &non_function); |
3323 | 3323 |
3324 if (state_.CallAsMethod()) { | 3324 if (CallAsMethod()) { |
3325 __ bind(&wrap); | 3325 __ bind(&wrap); |
3326 EmitWrapCase(masm, argc, &cont); | 3326 EmitWrapCase(masm, argc, &cont); |
3327 } | 3327 } |
3328 | 3328 |
3329 __ bind(&extra_checks_or_miss); | 3329 __ bind(&extra_checks_or_miss); |
3330 Label miss; | 3330 Label miss; |
3331 | 3331 |
3332 __ JumpIfRoot(x4, Heap::kMegamorphicSymbolRootIndex, &slow_start); | 3332 __ JumpIfRoot(x4, Heap::kMegamorphicSymbolRootIndex, &slow_start); |
3333 __ JumpIfRoot(x4, Heap::kUninitializedSymbolRootIndex, &miss); | 3333 __ JumpIfRoot(x4, Heap::kUninitializedSymbolRootIndex, &miss); |
3334 | 3334 |
(...skipping 22 matching lines...) Expand all Loading... |
3357 // Goto slow case if we do not have a function. | 3357 // Goto slow case if we do not have a function. |
3358 __ JumpIfNotObjectType(function, x10, type, JS_FUNCTION_TYPE, &slow); | 3358 __ JumpIfNotObjectType(function, x10, type, JS_FUNCTION_TYPE, &slow); |
3359 __ B(&have_js_function); | 3359 __ B(&have_js_function); |
3360 } | 3360 } |
3361 | 3361 |
3362 | 3362 |
3363 void CallICStub::GenerateMiss(MacroAssembler* masm, IC::UtilityId id) { | 3363 void CallICStub::GenerateMiss(MacroAssembler* masm, IC::UtilityId id) { |
3364 ASM_LOCATION("CallICStub[Miss]"); | 3364 ASM_LOCATION("CallICStub[Miss]"); |
3365 | 3365 |
3366 // Get the receiver of the function from the stack; 1 ~ return address. | 3366 // Get the receiver of the function from the stack; 1 ~ return address. |
3367 __ Peek(x4, (state_.arg_count() + 1) * kPointerSize); | 3367 __ Peek(x4, (arg_count() + 1) * kPointerSize); |
3368 | 3368 |
3369 { | 3369 { |
3370 FrameScope scope(masm, StackFrame::INTERNAL); | 3370 FrameScope scope(masm, StackFrame::INTERNAL); |
3371 | 3371 |
3372 // Push the receiver and the function and feedback info. | 3372 // Push the receiver and the function and feedback info. |
3373 __ Push(x4, x1, x2, x3); | 3373 __ Push(x4, x1, x2, x3); |
3374 | 3374 |
3375 // Call the entry. | 3375 // Call the entry. |
3376 ExternalReference miss = ExternalReference(IC_Utility(id), | 3376 ExternalReference miss = ExternalReference(IC_Utility(id), |
3377 masm->isolate()); | 3377 masm->isolate()); |
(...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5423 MemOperand(fp, 6 * kPointerSize), | 5423 MemOperand(fp, 6 * kPointerSize), |
5424 NULL); | 5424 NULL); |
5425 } | 5425 } |
5426 | 5426 |
5427 | 5427 |
5428 #undef __ | 5428 #undef __ |
5429 | 5429 |
5430 } } // namespace v8::internal | 5430 } } // namespace v8::internal |
5431 | 5431 |
5432 #endif // V8_TARGET_ARCH_ARM64 | 5432 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |