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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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 int argc = state_.arg_count(); | 2368 int argc = state_.arg_count(); |
2369 ParameterCount actual(argc); | 2369 ParameterCount actual(argc); |
2370 | 2370 |
2371 EmitLoadTypeFeedbackVector(masm, ebx); | 2371 EmitLoadTypeFeedbackVector(masm, ebx); |
2372 | 2372 |
2373 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); | 2373 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); |
2374 __ cmp(edi, ecx); | 2374 __ cmp(edi, ecx); |
2375 __ j(not_equal, &miss); | 2375 __ j(not_equal, &miss); |
2376 | 2376 |
2377 __ mov(eax, arg_count()); | 2377 __ mov(eax, arg_count()); |
2378 __ mov(ebx, FieldOperand(ebx, edx, times_half_pointer_size, | 2378 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, |
2379 FixedArray::kHeaderSize)); | 2379 FixedArray::kHeaderSize)); |
| 2380 |
2380 // Verify that ecx contains an AllocationSite | 2381 // Verify that ecx contains an AllocationSite |
2381 __ AssertUndefinedOrAllocationSite(ebx); | 2382 Factory* factory = masm->isolate()->factory(); |
| 2383 __ cmp(FieldOperand(ecx, HeapObject::kMapOffset), |
| 2384 factory->allocation_site_map()); |
| 2385 __ j(not_equal, &miss); |
| 2386 |
| 2387 __ mov(ebx, ecx); |
2382 ArrayConstructorStub stub(masm->isolate(), arg_count()); | 2388 ArrayConstructorStub stub(masm->isolate(), arg_count()); |
2383 __ TailCallStub(&stub); | 2389 __ TailCallStub(&stub); |
2384 | 2390 |
2385 __ bind(&miss); | 2391 __ bind(&miss); |
2386 GenerateMiss(masm, IC::kCallIC_Customization_Miss); | 2392 GenerateMiss(masm, IC::kCallIC_Customization_Miss); |
2387 | 2393 |
2388 // The slow case, we need this no matter what to complete a call after a miss. | 2394 // The slow case, we need this no matter what to complete a call after a miss. |
2389 CallFunctionNoFeedback(masm, | 2395 CallFunctionNoFeedback(masm, |
2390 arg_count(), | 2396 arg_count(), |
2391 true, | 2397 true, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2442 Label miss; | 2448 Label miss; |
2443 | 2449 |
2444 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, | 2450 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, |
2445 FixedArray::kHeaderSize)); | 2451 FixedArray::kHeaderSize)); |
2446 __ cmp(ecx, Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); | 2452 __ cmp(ecx, Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); |
2447 __ j(equal, &slow_start); | 2453 __ j(equal, &slow_start); |
2448 __ cmp(ecx, Immediate(TypeFeedbackInfo::UninitializedSentinel(isolate))); | 2454 __ cmp(ecx, Immediate(TypeFeedbackInfo::UninitializedSentinel(isolate))); |
2449 __ j(equal, &miss); | 2455 __ j(equal, &miss); |
2450 | 2456 |
2451 if (!FLAG_trace_ic) { | 2457 if (!FLAG_trace_ic) { |
2452 // We are going megamorphic, and we don't want to visit the runtime. | 2458 // We are going megamorphic. If the feedback is a JSFunction, it is fine |
| 2459 // to handle it here. More complex cases are dealt with in the runtime. |
| 2460 __ AssertNotSmi(ecx); |
| 2461 __ CmpObjectType(ecx, JS_FUNCTION_TYPE, ecx); |
| 2462 __ j(not_equal, &miss); |
2453 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, | 2463 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, |
2454 FixedArray::kHeaderSize), | 2464 FixedArray::kHeaderSize), |
2455 Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); | 2465 Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); |
2456 __ jmp(&slow_start); | 2466 __ jmp(&slow_start); |
2457 } | 2467 } |
2458 | 2468 |
2459 // We are here because tracing is on or we are going monomorphic. | 2469 // We are here because tracing is on or we are going monomorphic. |
2460 __ bind(&miss); | 2470 __ bind(&miss); |
2461 GenerateMiss(masm, IC::kCallIC_Miss); | 2471 GenerateMiss(masm, IC::kCallIC_Miss); |
2462 | 2472 |
(...skipping 2513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4976 Operand(ebp, 7 * kPointerSize), | 4986 Operand(ebp, 7 * kPointerSize), |
4977 NULL); | 4987 NULL); |
4978 } | 4988 } |
4979 | 4989 |
4980 | 4990 |
4981 #undef __ | 4991 #undef __ |
4982 | 4992 |
4983 } } // namespace v8::internal | 4993 } } // namespace v8::internal |
4984 | 4994 |
4985 #endif // V8_TARGET_ARCH_IA32 | 4995 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |