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/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2235 | 2235 |
2236 if (!FLAG_trace_ic) { | 2236 if (!FLAG_trace_ic) { |
2237 // We are going megamorphic. If the feedback is a JSFunction, it is fine | 2237 // We are going megamorphic. If the feedback is a JSFunction, it is fine |
2238 // to handle it here. More complex cases are dealt with in the runtime. | 2238 // to handle it here. More complex cases are dealt with in the runtime. |
2239 __ AssertNotSmi(ecx); | 2239 __ AssertNotSmi(ecx); |
2240 __ CmpObjectType(ecx, JS_FUNCTION_TYPE, ecx); | 2240 __ CmpObjectType(ecx, JS_FUNCTION_TYPE, ecx); |
2241 __ j(not_equal, &miss); | 2241 __ j(not_equal, &miss); |
2242 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, | 2242 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, |
2243 FixedArray::kHeaderSize), | 2243 FixedArray::kHeaderSize), |
2244 Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate))); | 2244 Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate))); |
| 2245 // We have to update statistics for runtime profiling. |
| 2246 const int with_types_offset = |
| 2247 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); |
| 2248 __ sub(FieldOperand(ebx, with_types_offset), Immediate(Smi::FromInt(1))); |
| 2249 const int generic_offset = |
| 2250 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex); |
| 2251 __ add(FieldOperand(ebx, generic_offset), Immediate(Smi::FromInt(1))); |
2245 __ jmp(&slow_start); | 2252 __ jmp(&slow_start); |
2246 } | 2253 } |
2247 | 2254 |
2248 // We are here because tracing is on or we are going monomorphic. | 2255 // We are here because tracing is on or we are going monomorphic. |
2249 __ bind(&miss); | 2256 __ bind(&miss); |
2250 GenerateMiss(masm); | 2257 GenerateMiss(masm); |
2251 | 2258 |
2252 // the slow case | 2259 // the slow case |
2253 __ bind(&slow_start); | 2260 __ bind(&slow_start); |
2254 | 2261 |
(...skipping 2447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4702 Operand(ebp, 7 * kPointerSize), | 4709 Operand(ebp, 7 * kPointerSize), |
4703 NULL); | 4710 NULL); |
4704 } | 4711 } |
4705 | 4712 |
4706 | 4713 |
4707 #undef __ | 4714 #undef __ |
4708 | 4715 |
4709 } } // namespace v8::internal | 4716 } } // namespace v8::internal |
4710 | 4717 |
4711 #endif // V8_TARGET_ARCH_IA32 | 4718 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |