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_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2042 int argc = state_.arg_count(); | 2042 int argc = state_.arg_count(); |
2043 ParameterCount actual(argc); | 2043 ParameterCount actual(argc); |
2044 | 2044 |
2045 EmitLoadTypeFeedbackVector(masm, ebx); | 2045 EmitLoadTypeFeedbackVector(masm, ebx); |
2046 | 2046 |
2047 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); | 2047 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); |
2048 __ cmp(edi, ecx); | 2048 __ cmp(edi, ecx); |
2049 __ j(not_equal, &miss); | 2049 __ j(not_equal, &miss); |
2050 | 2050 |
2051 __ mov(eax, arg_count()); | 2051 __ mov(eax, arg_count()); |
2052 __ mov(ebx, FieldOperand(ebx, edx, times_half_pointer_size, | 2052 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, |
2053 FixedArray::kHeaderSize)); | 2053 FixedArray::kHeaderSize)); |
| 2054 |
2054 // Verify that ecx contains an AllocationSite | 2055 // Verify that ecx contains an AllocationSite |
2055 __ AssertUndefinedOrAllocationSite(ebx); | 2056 Factory* factory = masm->isolate()->factory(); |
| 2057 __ cmp(FieldOperand(ecx, HeapObject::kMapOffset), |
| 2058 factory->allocation_site_map()); |
| 2059 __ j(not_equal, &miss); |
| 2060 |
| 2061 __ mov(ebx, ecx); |
2056 ArrayConstructorStub stub(masm->isolate(), arg_count()); | 2062 ArrayConstructorStub stub(masm->isolate(), arg_count()); |
2057 __ TailCallStub(&stub); | 2063 __ TailCallStub(&stub); |
2058 | 2064 |
2059 __ bind(&miss); | 2065 __ bind(&miss); |
2060 GenerateMiss(masm, IC::kCallIC_Customization_Miss); | 2066 GenerateMiss(masm, IC::kCallIC_Customization_Miss); |
2061 | 2067 |
2062 // The slow case, we need this no matter what to complete a call after a miss. | 2068 // The slow case, we need this no matter what to complete a call after a miss. |
2063 CallFunctionNoFeedback(masm, | 2069 CallFunctionNoFeedback(masm, |
2064 arg_count(), | 2070 arg_count(), |
2065 true, | 2071 true, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2116 Label miss; | 2122 Label miss; |
2117 | 2123 |
2118 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, | 2124 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, |
2119 FixedArray::kHeaderSize)); | 2125 FixedArray::kHeaderSize)); |
2120 __ cmp(ecx, Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); | 2126 __ cmp(ecx, Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); |
2121 __ j(equal, &slow_start); | 2127 __ j(equal, &slow_start); |
2122 __ cmp(ecx, Immediate(TypeFeedbackInfo::UninitializedSentinel(isolate))); | 2128 __ cmp(ecx, Immediate(TypeFeedbackInfo::UninitializedSentinel(isolate))); |
2123 __ j(equal, &miss); | 2129 __ j(equal, &miss); |
2124 | 2130 |
2125 if (!FLAG_trace_ic) { | 2131 if (!FLAG_trace_ic) { |
2126 // We are going megamorphic, and we don't want to visit the runtime. | 2132 // We are going megamorphic. If the feedback is a JSFunction, it is fine |
| 2133 // to handle it here. More complex cases are dealt with in the runtime. |
| 2134 __ AssertNotSmi(ecx); |
| 2135 __ CmpObjectType(ecx, JS_FUNCTION_TYPE, ecx); |
| 2136 __ j(not_equal, &miss); |
2127 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, | 2137 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, |
2128 FixedArray::kHeaderSize), | 2138 FixedArray::kHeaderSize), |
2129 Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); | 2139 Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); |
2130 __ jmp(&slow_start); | 2140 __ jmp(&slow_start); |
2131 } | 2141 } |
2132 | 2142 |
2133 // We are here because tracing is on or we are going monomorphic. | 2143 // We are here because tracing is on or we are going monomorphic. |
2134 __ bind(&miss); | 2144 __ bind(&miss); |
2135 GenerateMiss(masm, IC::kCallIC_Miss); | 2145 GenerateMiss(masm, IC::kCallIC_Miss); |
2136 | 2146 |
(...skipping 2471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4608 Operand(ebp, 7 * kPointerSize), | 4618 Operand(ebp, 7 * kPointerSize), |
4609 NULL); | 4619 NULL); |
4610 } | 4620 } |
4611 | 4621 |
4612 | 4622 |
4613 #undef __ | 4623 #undef __ |
4614 | 4624 |
4615 } } // namespace v8::internal | 4625 } } // namespace v8::internal |
4616 | 4626 |
4617 #endif // V8_TARGET_ARCH_X87 | 4627 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |