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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 1901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1912 // Goto miss case if we do not have a function. | 1912 // Goto miss case if we do not have a function. |
1913 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); | 1913 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); |
1914 __ j(not_equal, &miss); | 1914 __ j(not_equal, &miss); |
1915 | 1915 |
1916 // Make sure the function is not the Array() function, which requires special | 1916 // Make sure the function is not the Array() function, which requires special |
1917 // behavior on MISS. | 1917 // behavior on MISS. |
1918 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); | 1918 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); |
1919 __ cmp(edi, ecx); | 1919 __ cmp(edi, ecx); |
1920 __ j(equal, &miss); | 1920 __ j(equal, &miss); |
1921 | 1921 |
| 1922 // Make sure the function belongs to the same native context (which implies |
| 1923 // the same global object). |
| 1924 __ mov(ecx, FieldOperand(edi, JSFunction::kContextOffset)); |
| 1925 __ mov(ecx, ContextOperand(ecx, Context::GLOBAL_OBJECT_INDEX)); |
| 1926 __ cmp(ecx, GlobalObjectOperand()); |
| 1927 __ j(not_equal, &miss); |
| 1928 |
1922 // Update stats. | 1929 // Update stats. |
1923 __ add(FieldOperand(ebx, with_types_offset), Immediate(Smi::FromInt(1))); | 1930 __ add(FieldOperand(ebx, with_types_offset), Immediate(Smi::FromInt(1))); |
1924 | 1931 |
1925 // Initialize the call counter. | 1932 // Initialize the call counter. |
1926 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, | 1933 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, |
1927 FixedArray::kHeaderSize + kPointerSize), | 1934 FixedArray::kHeaderSize + kPointerSize), |
1928 Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 1935 Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); |
1929 | 1936 |
1930 // Store the function. Use a stub since we need a frame for allocation. | 1937 // Store the function. Use a stub since we need a frame for allocation. |
1931 // ebx - vector | 1938 // ebx - vector |
(...skipping 3493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5425 Operand(ebp, 7 * kPointerSize), NULL); | 5432 Operand(ebp, 7 * kPointerSize), NULL); |
5426 } | 5433 } |
5427 | 5434 |
5428 | 5435 |
5429 #undef __ | 5436 #undef __ |
5430 | 5437 |
5431 } // namespace internal | 5438 } // namespace internal |
5432 } // namespace v8 | 5439 } // namespace v8 |
5433 | 5440 |
5434 #endif // V8_TARGET_ARCH_X87 | 5441 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |