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_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 1861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1872 __ mov(vector, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1872 __ mov(vector, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1873 __ mov(vector, FieldOperand(vector, JSFunction::kSharedFunctionInfoOffset)); | 1873 __ mov(vector, FieldOperand(vector, JSFunction::kSharedFunctionInfoOffset)); |
1874 __ mov(vector, FieldOperand(vector, | 1874 __ mov(vector, FieldOperand(vector, |
1875 SharedFunctionInfo::kFeedbackVectorOffset)); | 1875 SharedFunctionInfo::kFeedbackVectorOffset)); |
1876 } | 1876 } |
1877 | 1877 |
1878 | 1878 |
1879 void CallIC_ArrayStub::Generate(MacroAssembler* masm) { | 1879 void CallIC_ArrayStub::Generate(MacroAssembler* masm) { |
1880 // edi - function | 1880 // edi - function |
1881 // edx - slot id | 1881 // edx - slot id |
| 1882 // ebx - vector |
1882 Label miss; | 1883 Label miss; |
1883 int argc = arg_count(); | 1884 int argc = arg_count(); |
1884 ParameterCount actual(argc); | 1885 ParameterCount actual(argc); |
1885 | 1886 |
1886 EmitLoadTypeFeedbackVector(masm, ebx); | |
1887 | |
1888 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); | 1887 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); |
1889 __ cmp(edi, ecx); | 1888 __ cmp(edi, ecx); |
1890 __ j(not_equal, &miss); | 1889 __ j(not_equal, &miss); |
1891 | 1890 |
1892 __ mov(eax, arg_count()); | 1891 __ mov(eax, arg_count()); |
1893 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, | 1892 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, |
1894 FixedArray::kHeaderSize)); | 1893 FixedArray::kHeaderSize)); |
1895 | 1894 |
1896 // Verify that ecx contains an AllocationSite | 1895 // Verify that ecx contains an AllocationSite |
1897 Factory* factory = masm->isolate()->factory(); | 1896 Factory* factory = masm->isolate()->factory(); |
(...skipping 15 matching lines...) Expand all Loading... |
1913 CallAsMethod()); | 1912 CallAsMethod()); |
1914 | 1913 |
1915 // Unreachable. | 1914 // Unreachable. |
1916 __ int3(); | 1915 __ int3(); |
1917 } | 1916 } |
1918 | 1917 |
1919 | 1918 |
1920 void CallICStub::Generate(MacroAssembler* masm) { | 1919 void CallICStub::Generate(MacroAssembler* masm) { |
1921 // edi - function | 1920 // edi - function |
1922 // edx - slot id | 1921 // edx - slot id |
| 1922 // ebx - vector |
1923 Isolate* isolate = masm->isolate(); | 1923 Isolate* isolate = masm->isolate(); |
1924 const int with_types_offset = | 1924 const int with_types_offset = |
1925 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); | 1925 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); |
1926 const int generic_offset = | 1926 const int generic_offset = |
1927 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex); | 1927 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex); |
1928 Label extra_checks_or_miss, slow_start; | 1928 Label extra_checks_or_miss, slow_start; |
1929 Label slow, non_function, wrap, cont; | 1929 Label slow, non_function, wrap, cont; |
1930 Label have_js_function; | 1930 Label have_js_function; |
1931 int argc = arg_count(); | 1931 int argc = arg_count(); |
1932 ParameterCount actual(argc); | 1932 ParameterCount actual(argc); |
1933 | 1933 |
1934 EmitLoadTypeFeedbackVector(masm, ebx); | |
1935 | |
1936 // The checks. First, does edi match the recorded monomorphic target? | 1934 // The checks. First, does edi match the recorded monomorphic target? |
1937 __ cmp(edi, FieldOperand(ebx, edx, times_half_pointer_size, | 1935 __ cmp(edi, FieldOperand(ebx, edx, times_half_pointer_size, |
1938 FixedArray::kHeaderSize)); | 1936 FixedArray::kHeaderSize)); |
1939 __ j(not_equal, &extra_checks_or_miss); | 1937 __ j(not_equal, &extra_checks_or_miss); |
1940 | 1938 |
1941 __ bind(&have_js_function); | 1939 __ bind(&have_js_function); |
1942 if (CallAsMethod()) { | 1940 if (CallAsMethod()) { |
1943 EmitContinueIfStrictOrNative(masm, &cont); | 1941 EmitContinueIfStrictOrNative(masm, &cont); |
1944 | 1942 |
1945 // Load the receiver from the stack. | 1943 // Load the receiver from the stack. |
(...skipping 2039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3985 } | 3983 } |
3986 | 3984 |
3987 | 3985 |
3988 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { | 3986 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { |
3989 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); | 3987 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); |
3990 VectorKeyedLoadStub stub(isolate()); | 3988 VectorKeyedLoadStub stub(isolate()); |
3991 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); | 3989 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); |
3992 } | 3990 } |
3993 | 3991 |
3994 | 3992 |
| 3993 void CallICTrampolineStub::Generate(MacroAssembler* masm) { |
| 3994 EmitLoadTypeFeedbackVector(masm, ebx); |
| 3995 CallICStub stub(isolate(), state()); |
| 3996 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); |
| 3997 } |
| 3998 |
| 3999 |
| 4000 void CallIC_ArrayTrampolineStub::Generate(MacroAssembler* masm) { |
| 4001 EmitLoadTypeFeedbackVector(masm, ebx); |
| 4002 CallIC_ArrayStub stub(isolate(), state()); |
| 4003 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); |
| 4004 } |
| 4005 |
| 4006 |
3995 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { | 4007 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { |
3996 if (masm->isolate()->function_entry_hook() != NULL) { | 4008 if (masm->isolate()->function_entry_hook() != NULL) { |
3997 ProfileEntryHookStub stub(masm->isolate()); | 4009 ProfileEntryHookStub stub(masm->isolate()); |
3998 masm->CallStub(&stub); | 4010 masm->CallStub(&stub); |
3999 } | 4011 } |
4000 } | 4012 } |
4001 | 4013 |
4002 | 4014 |
4003 void ProfileEntryHookStub::Generate(MacroAssembler* masm) { | 4015 void ProfileEntryHookStub::Generate(MacroAssembler* masm) { |
4004 // Save volatile registers. | 4016 // Save volatile registers. |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4717 ApiParameterOperand(2), kStackSpace, nullptr, | 4729 ApiParameterOperand(2), kStackSpace, nullptr, |
4718 Operand(ebp, 7 * kPointerSize), NULL); | 4730 Operand(ebp, 7 * kPointerSize), NULL); |
4719 } | 4731 } |
4720 | 4732 |
4721 | 4733 |
4722 #undef __ | 4734 #undef __ |
4723 | 4735 |
4724 } } // namespace v8::internal | 4736 } } // namespace v8::internal |
4725 | 4737 |
4726 #endif // V8_TARGET_ARCH_X87 | 4738 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |