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 2194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2205 // Goto miss case if we do not have a function. | 2205 // Goto miss case if we do not have a function. |
2206 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); | 2206 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); |
2207 __ j(not_equal, &miss); | 2207 __ j(not_equal, &miss); |
2208 | 2208 |
2209 // Make sure the function is not the Array() function, which requires special | 2209 // Make sure the function is not the Array() function, which requires special |
2210 // behavior on MISS. | 2210 // behavior on MISS. |
2211 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); | 2211 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); |
2212 __ cmp(edi, ecx); | 2212 __ cmp(edi, ecx); |
2213 __ j(equal, &miss); | 2213 __ j(equal, &miss); |
2214 | 2214 |
| 2215 // Make sure the function belongs to the same native context (which implies |
| 2216 // the same global object). |
| 2217 __ mov(ecx, FieldOperand(edi, JSFunction::kContextOffset)); |
| 2218 __ mov(ecx, ContextOperand(ecx, Context::GLOBAL_OBJECT_INDEX)); |
| 2219 __ cmp(ecx, GlobalObjectOperand()); |
| 2220 __ j(not_equal, &miss); |
| 2221 |
2215 // Update stats. | 2222 // Update stats. |
2216 __ add(FieldOperand(ebx, with_types_offset), Immediate(Smi::FromInt(1))); | 2223 __ add(FieldOperand(ebx, with_types_offset), Immediate(Smi::FromInt(1))); |
2217 | 2224 |
2218 // Initialize the call counter. | 2225 // Initialize the call counter. |
2219 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, | 2226 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, |
2220 FixedArray::kHeaderSize + kPointerSize), | 2227 FixedArray::kHeaderSize + kPointerSize), |
2221 Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 2228 Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); |
2222 | 2229 |
2223 // Store the function. Use a stub since we need a frame for allocation. | 2230 // Store the function. Use a stub since we need a frame for allocation. |
2224 // ebx - vector | 2231 // ebx - vector |
(...skipping 3520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5745 Operand(ebp, 7 * kPointerSize), NULL); | 5752 Operand(ebp, 7 * kPointerSize), NULL); |
5746 } | 5753 } |
5747 | 5754 |
5748 | 5755 |
5749 #undef __ | 5756 #undef __ |
5750 | 5757 |
5751 } // namespace internal | 5758 } // namespace internal |
5752 } // namespace v8 | 5759 } // namespace v8 |
5753 | 5760 |
5754 #endif // V8_TARGET_ARCH_IA32 | 5761 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |