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 1836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1847 // convincing us that we have a monomorphic JSFunction. | 1847 // convincing us that we have a monomorphic JSFunction. |
1848 __ JumpIfSmi(edi, &extra_checks_or_miss); | 1848 __ JumpIfSmi(edi, &extra_checks_or_miss); |
1849 | 1849 |
1850 // Increment the call count for monomorphic function calls. | 1850 // Increment the call count for monomorphic function calls. |
1851 __ add(FieldOperand(ebx, edx, times_half_pointer_size, | 1851 __ add(FieldOperand(ebx, edx, times_half_pointer_size, |
1852 FixedArray::kHeaderSize + kPointerSize), | 1852 FixedArray::kHeaderSize + kPointerSize), |
1853 Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 1853 Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); |
1854 | 1854 |
1855 __ bind(&call_function); | 1855 __ bind(&call_function); |
1856 __ Set(eax, argc); | 1856 __ Set(eax, argc); |
1857 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode()), | 1857 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), |
| 1858 tail_call_mode()), |
1858 RelocInfo::CODE_TARGET); | 1859 RelocInfo::CODE_TARGET); |
1859 | 1860 |
1860 __ bind(&extra_checks_or_miss); | 1861 __ bind(&extra_checks_or_miss); |
1861 Label uninitialized, miss, not_allocation_site; | 1862 Label uninitialized, miss, not_allocation_site; |
1862 | 1863 |
1863 __ cmp(ecx, Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate))); | 1864 __ cmp(ecx, Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate))); |
1864 __ j(equal, &call); | 1865 __ j(equal, &call); |
1865 | 1866 |
1866 // Check if we have an allocation site. | 1867 // Check if we have an allocation site. |
1867 __ CompareRoot(FieldOperand(ecx, HeapObject::kMapOffset), | 1868 __ CompareRoot(FieldOperand(ecx, HeapObject::kMapOffset), |
(...skipping 18 matching lines...) Expand all Loading... |
1886 // to handle it here. More complex cases are dealt with in the runtime. | 1887 // to handle it here. More complex cases are dealt with in the runtime. |
1887 __ AssertNotSmi(ecx); | 1888 __ AssertNotSmi(ecx); |
1888 __ CmpObjectType(ecx, JS_FUNCTION_TYPE, ecx); | 1889 __ CmpObjectType(ecx, JS_FUNCTION_TYPE, ecx); |
1889 __ j(not_equal, &miss); | 1890 __ j(not_equal, &miss); |
1890 __ mov( | 1891 __ mov( |
1891 FieldOperand(ebx, edx, times_half_pointer_size, FixedArray::kHeaderSize), | 1892 FieldOperand(ebx, edx, times_half_pointer_size, FixedArray::kHeaderSize), |
1892 Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate))); | 1893 Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate))); |
1893 | 1894 |
1894 __ bind(&call); | 1895 __ bind(&call); |
1895 __ Set(eax, argc); | 1896 __ Set(eax, argc); |
1896 __ Jump(masm->isolate()->builtins()->Call(convert_mode()), | 1897 __ Jump(masm->isolate()->builtins()->Call(convert_mode(), tail_call_mode()), |
1897 RelocInfo::CODE_TARGET); | 1898 RelocInfo::CODE_TARGET); |
1898 | 1899 |
1899 __ bind(&uninitialized); | 1900 __ bind(&uninitialized); |
1900 | 1901 |
1901 // We are going monomorphic, provided we actually have a JSFunction. | 1902 // We are going monomorphic, provided we actually have a JSFunction. |
1902 __ JumpIfSmi(edi, &miss); | 1903 __ JumpIfSmi(edi, &miss); |
1903 | 1904 |
1904 // Goto miss case if we do not have a function. | 1905 // Goto miss case if we do not have a function. |
1905 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); | 1906 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); |
1906 __ j(not_equal, &miss); | 1907 __ j(not_equal, &miss); |
(...skipping 3519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5426 return_value_operand, NULL); | 5427 return_value_operand, NULL); |
5427 } | 5428 } |
5428 | 5429 |
5429 | 5430 |
5430 #undef __ | 5431 #undef __ |
5431 | 5432 |
5432 } // namespace internal | 5433 } // namespace internal |
5433 } // namespace v8 | 5434 } // namespace v8 |
5434 | 5435 |
5435 #endif // V8_TARGET_ARCH_X87 | 5436 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |