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 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2140 // convincing us that we have a monomorphic JSFunction. | 2140 // convincing us that we have a monomorphic JSFunction. |
2141 __ JumpIfSmi(edi, &extra_checks_or_miss); | 2141 __ JumpIfSmi(edi, &extra_checks_or_miss); |
2142 | 2142 |
2143 // Increment the call count for monomorphic function calls. | 2143 // Increment the call count for monomorphic function calls. |
2144 __ add(FieldOperand(ebx, edx, times_half_pointer_size, | 2144 __ add(FieldOperand(ebx, edx, times_half_pointer_size, |
2145 FixedArray::kHeaderSize + kPointerSize), | 2145 FixedArray::kHeaderSize + kPointerSize), |
2146 Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 2146 Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); |
2147 | 2147 |
2148 __ bind(&call_function); | 2148 __ bind(&call_function); |
2149 __ Set(eax, argc); | 2149 __ Set(eax, argc); |
2150 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode()), | 2150 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), |
| 2151 tail_call_mode()), |
2151 RelocInfo::CODE_TARGET); | 2152 RelocInfo::CODE_TARGET); |
2152 | 2153 |
2153 __ bind(&extra_checks_or_miss); | 2154 __ bind(&extra_checks_or_miss); |
2154 Label uninitialized, miss, not_allocation_site; | 2155 Label uninitialized, miss, not_allocation_site; |
2155 | 2156 |
2156 __ cmp(ecx, Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate))); | 2157 __ cmp(ecx, Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate))); |
2157 __ j(equal, &call); | 2158 __ j(equal, &call); |
2158 | 2159 |
2159 // Check if we have an allocation site. | 2160 // Check if we have an allocation site. |
2160 __ CompareRoot(FieldOperand(ecx, HeapObject::kMapOffset), | 2161 __ CompareRoot(FieldOperand(ecx, HeapObject::kMapOffset), |
(...skipping 18 matching lines...) Expand all Loading... |
2179 // to handle it here. More complex cases are dealt with in the runtime. | 2180 // to handle it here. More complex cases are dealt with in the runtime. |
2180 __ AssertNotSmi(ecx); | 2181 __ AssertNotSmi(ecx); |
2181 __ CmpObjectType(ecx, JS_FUNCTION_TYPE, ecx); | 2182 __ CmpObjectType(ecx, JS_FUNCTION_TYPE, ecx); |
2182 __ j(not_equal, &miss); | 2183 __ j(not_equal, &miss); |
2183 __ mov( | 2184 __ mov( |
2184 FieldOperand(ebx, edx, times_half_pointer_size, FixedArray::kHeaderSize), | 2185 FieldOperand(ebx, edx, times_half_pointer_size, FixedArray::kHeaderSize), |
2185 Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate))); | 2186 Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate))); |
2186 | 2187 |
2187 __ bind(&call); | 2188 __ bind(&call); |
2188 __ Set(eax, argc); | 2189 __ Set(eax, argc); |
2189 __ Jump(masm->isolate()->builtins()->Call(convert_mode()), | 2190 __ Jump(masm->isolate()->builtins()->Call(convert_mode(), tail_call_mode()), |
2190 RelocInfo::CODE_TARGET); | 2191 RelocInfo::CODE_TARGET); |
2191 | 2192 |
2192 __ bind(&uninitialized); | 2193 __ bind(&uninitialized); |
2193 | 2194 |
2194 // We are going monomorphic, provided we actually have a JSFunction. | 2195 // We are going monomorphic, provided we actually have a JSFunction. |
2195 __ JumpIfSmi(edi, &miss); | 2196 __ JumpIfSmi(edi, &miss); |
2196 | 2197 |
2197 // Goto miss case if we do not have a function. | 2198 // Goto miss case if we do not have a function. |
2198 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); | 2199 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); |
2199 __ j(not_equal, &miss); | 2200 __ j(not_equal, &miss); |
(...skipping 3546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5746 return_value_operand, NULL); | 5747 return_value_operand, NULL); |
5747 } | 5748 } |
5748 | 5749 |
5749 | 5750 |
5750 #undef __ | 5751 #undef __ |
5751 | 5752 |
5752 } // namespace internal | 5753 } // namespace internal |
5753 } // namespace v8 | 5754 } // namespace v8 |
5754 | 5755 |
5755 #endif // V8_TARGET_ARCH_IA32 | 5756 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |