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_X64 | 7 #if V8_TARGET_ARCH_X64 |
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 2357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2368 // rdi - function | 2368 // rdi - function |
2369 // rdx - slot id (as integer) | 2369 // rdx - slot id (as integer) |
2370 Label miss; | 2370 Label miss; |
2371 int argc = state_.arg_count(); | 2371 int argc = state_.arg_count(); |
2372 ParameterCount actual(argc); | 2372 ParameterCount actual(argc); |
2373 | 2373 |
2374 EmitLoadTypeFeedbackVector(masm, rbx); | 2374 EmitLoadTypeFeedbackVector(masm, rbx); |
2375 __ SmiToInteger32(rdx, rdx); | 2375 __ SmiToInteger32(rdx, rdx); |
2376 | 2376 |
2377 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, rcx); | 2377 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, rcx); |
2378 __ cmpq(rdi, rcx); | 2378 __ cmpp(rdi, rcx); |
2379 __ j(not_equal, &miss); | 2379 __ j(not_equal, &miss); |
2380 | 2380 |
2381 __ movq(rax, Immediate(arg_count())); | 2381 __ movp(rax, Immediate(arg_count())); |
2382 __ movp(rbx, FieldOperand(rbx, rdx, times_pointer_size, | 2382 __ movp(rbx, FieldOperand(rbx, rdx, times_pointer_size, |
2383 FixedArray::kHeaderSize)); | 2383 FixedArray::kHeaderSize)); |
2384 | 2384 |
2385 // Verify that ecx contains an AllocationSite | 2385 // Verify that ecx contains an AllocationSite |
2386 __ AssertUndefinedOrAllocationSite(rbx); | 2386 __ AssertUndefinedOrAllocationSite(rbx); |
2387 ArrayConstructorStub stub(masm->isolate(), arg_count()); | 2387 ArrayConstructorStub stub(masm->isolate(), arg_count()); |
2388 __ TailCallStub(&stub); | 2388 __ TailCallStub(&stub); |
2389 | 2389 |
2390 __ bind(&miss); | 2390 __ bind(&miss); |
2391 GenerateMiss(masm, IC::kCallIC_Customization_Miss); | 2391 GenerateMiss(masm, IC::kCallIC_Customization_Miss); |
(...skipping 18 matching lines...) Expand all Loading... |
2410 Label slow, non_function, wrap, cont; | 2410 Label slow, non_function, wrap, cont; |
2411 Label have_js_function; | 2411 Label have_js_function; |
2412 int argc = state_.arg_count(); | 2412 int argc = state_.arg_count(); |
2413 StackArgumentsAccessor args(rsp, argc); | 2413 StackArgumentsAccessor args(rsp, argc); |
2414 ParameterCount actual(argc); | 2414 ParameterCount actual(argc); |
2415 | 2415 |
2416 EmitLoadTypeFeedbackVector(masm, rbx); | 2416 EmitLoadTypeFeedbackVector(masm, rbx); |
2417 | 2417 |
2418 // The checks. First, does rdi match the recorded monomorphic target? | 2418 // The checks. First, does rdi match the recorded monomorphic target? |
2419 __ SmiToInteger32(rdx, rdx); | 2419 __ SmiToInteger32(rdx, rdx); |
2420 __ cmpq(rdi, FieldOperand(rbx, rdx, times_pointer_size, | 2420 __ cmpp(rdi, FieldOperand(rbx, rdx, times_pointer_size, |
2421 FixedArray::kHeaderSize)); | 2421 FixedArray::kHeaderSize)); |
2422 __ j(not_equal, &extra_checks_or_miss); | 2422 __ j(not_equal, &extra_checks_or_miss); |
2423 | 2423 |
2424 __ bind(&have_js_function); | 2424 __ bind(&have_js_function); |
2425 if (state_.CallAsMethod()) { | 2425 if (state_.CallAsMethod()) { |
2426 EmitContinueIfStrictOrNative(masm, &cont); | 2426 EmitContinueIfStrictOrNative(masm, &cont); |
2427 | 2427 |
2428 // Load the receiver from the stack. | 2428 // Load the receiver from the stack. |
2429 __ movp(rax, args.GetReceiverOperand()); | 2429 __ movp(rax, args.GetReceiverOperand()); |
2430 | 2430 |
(...skipping 2615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5046 return_value_operand, | 5046 return_value_operand, |
5047 NULL); | 5047 NULL); |
5048 } | 5048 } |
5049 | 5049 |
5050 | 5050 |
5051 #undef __ | 5051 #undef __ |
5052 | 5052 |
5053 } } // namespace v8::internal | 5053 } } // namespace v8::internal |
5054 | 5054 |
5055 #endif // V8_TARGET_ARCH_X64 | 5055 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |