Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 579153003: Move state sentinels into TypeFeedbackVector. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ports. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/factory.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after
1823 Label initialize, done, miss, megamorphic, not_array_function; 1823 Label initialize, done, miss, megamorphic, not_array_function;
1824 1824
1825 // Load the cache state into ecx. 1825 // Load the cache state into ecx.
1826 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, 1826 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size,
1827 FixedArray::kHeaderSize)); 1827 FixedArray::kHeaderSize));
1828 1828
1829 // A monomorphic cache hit or an already megamorphic state: invoke the 1829 // A monomorphic cache hit or an already megamorphic state: invoke the
1830 // function without changing the state. 1830 // function without changing the state.
1831 __ cmp(ecx, edi); 1831 __ cmp(ecx, edi);
1832 __ j(equal, &done, Label::kFar); 1832 __ j(equal, &done, Label::kFar);
1833 __ cmp(ecx, Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); 1833 __ cmp(ecx, Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate)));
1834 __ j(equal, &done, Label::kFar); 1834 __ j(equal, &done, Label::kFar);
1835 1835
1836 if (!FLAG_pretenuring_call_new) { 1836 if (!FLAG_pretenuring_call_new) {
1837 // If we came here, we need to see if we are the array function. 1837 // If we came here, we need to see if we are the array function.
1838 // If we didn't have a matching function, and we didn't find the megamorph 1838 // If we didn't have a matching function, and we didn't find the megamorph
1839 // sentinel, then we have in the slot either some other function or an 1839 // sentinel, then we have in the slot either some other function or an
1840 // AllocationSite. Do a map check on the object in ecx. 1840 // AllocationSite. Do a map check on the object in ecx.
1841 Handle<Map> allocation_site_map = isolate->factory()->allocation_site_map(); 1841 Handle<Map> allocation_site_map = isolate->factory()->allocation_site_map();
1842 __ cmp(FieldOperand(ecx, 0), Immediate(allocation_site_map)); 1842 __ cmp(FieldOperand(ecx, 0), Immediate(allocation_site_map));
1843 __ j(not_equal, &miss); 1843 __ j(not_equal, &miss);
1844 1844
1845 // Make sure the function is the Array() function 1845 // Make sure the function is the Array() function
1846 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); 1846 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx);
1847 __ cmp(edi, ecx); 1847 __ cmp(edi, ecx);
1848 __ j(not_equal, &megamorphic); 1848 __ j(not_equal, &megamorphic);
1849 __ jmp(&done, Label::kFar); 1849 __ jmp(&done, Label::kFar);
1850 } 1850 }
1851 1851
1852 __ bind(&miss); 1852 __ bind(&miss);
1853 1853
1854 // A monomorphic miss (i.e, here the cache is not uninitialized) goes 1854 // A monomorphic miss (i.e, here the cache is not uninitialized) goes
1855 // megamorphic. 1855 // megamorphic.
1856 __ cmp(ecx, Immediate(TypeFeedbackInfo::UninitializedSentinel(isolate))); 1856 __ cmp(ecx, Immediate(TypeFeedbackVector::UninitializedSentinel(isolate)));
1857 __ j(equal, &initialize); 1857 __ j(equal, &initialize);
1858 // MegamorphicSentinel is an immortal immovable object (undefined) so no 1858 // MegamorphicSentinel is an immortal immovable object (undefined) so no
1859 // write-barrier is needed. 1859 // write-barrier is needed.
1860 __ bind(&megamorphic); 1860 __ bind(&megamorphic);
1861 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, 1861 __ mov(
1862 FixedArray::kHeaderSize), 1862 FieldOperand(ebx, edx, times_half_pointer_size, FixedArray::kHeaderSize),
1863 Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); 1863 Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate)));
1864 __ jmp(&done, Label::kFar); 1864 __ jmp(&done, Label::kFar);
1865 1865
1866 // An uninitialized cache is patched with the function or sentinel to 1866 // An uninitialized cache is patched with the function or sentinel to
1867 // indicate the ElementsKind if function is the Array constructor. 1867 // indicate the ElementsKind if function is the Array constructor.
1868 __ bind(&initialize); 1868 __ bind(&initialize);
1869 if (!FLAG_pretenuring_call_new) { 1869 if (!FLAG_pretenuring_call_new) {
1870 // Make sure the function is the Array() function 1870 // Make sure the function is the Array() function
1871 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); 1871 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx);
1872 __ cmp(edi, ecx); 1872 __ cmp(edi, ecx);
1873 __ j(not_equal, &not_array_function); 1873 __ j(not_equal, &not_array_function);
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
2189 if (CallAsMethod()) { 2189 if (CallAsMethod()) {
2190 __ bind(&wrap); 2190 __ bind(&wrap);
2191 EmitWrapCase(masm, argc, &cont); 2191 EmitWrapCase(masm, argc, &cont);
2192 } 2192 }
2193 2193
2194 __ bind(&extra_checks_or_miss); 2194 __ bind(&extra_checks_or_miss);
2195 Label miss; 2195 Label miss;
2196 2196
2197 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, 2197 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size,
2198 FixedArray::kHeaderSize)); 2198 FixedArray::kHeaderSize));
2199 __ cmp(ecx, Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); 2199 __ cmp(ecx, Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate)));
2200 __ j(equal, &slow_start); 2200 __ j(equal, &slow_start);
2201 __ cmp(ecx, Immediate(TypeFeedbackInfo::UninitializedSentinel(isolate))); 2201 __ cmp(ecx, Immediate(TypeFeedbackVector::UninitializedSentinel(isolate)));
2202 __ j(equal, &miss); 2202 __ j(equal, &miss);
2203 2203
2204 if (!FLAG_trace_ic) { 2204 if (!FLAG_trace_ic) {
2205 // We are going megamorphic. If the feedback is a JSFunction, it is fine 2205 // We are going megamorphic. If the feedback is a JSFunction, it is fine
2206 // to handle it here. More complex cases are dealt with in the runtime. 2206 // to handle it here. More complex cases are dealt with in the runtime.
2207 __ AssertNotSmi(ecx); 2207 __ AssertNotSmi(ecx);
2208 __ CmpObjectType(ecx, JS_FUNCTION_TYPE, ecx); 2208 __ CmpObjectType(ecx, JS_FUNCTION_TYPE, ecx);
2209 __ j(not_equal, &miss); 2209 __ j(not_equal, &miss);
2210 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, 2210 __ mov(FieldOperand(ebx, edx, times_half_pointer_size,
2211 FixedArray::kHeaderSize), 2211 FixedArray::kHeaderSize),
2212 Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); 2212 Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate)));
2213 __ jmp(&slow_start); 2213 __ jmp(&slow_start);
2214 } 2214 }
2215 2215
2216 // We are here because tracing is on or we are going monomorphic. 2216 // We are here because tracing is on or we are going monomorphic.
2217 __ bind(&miss); 2217 __ bind(&miss);
2218 GenerateMiss(masm); 2218 GenerateMiss(masm);
2219 2219
2220 // the slow case 2220 // the slow case
2221 __ bind(&slow_start); 2221 __ bind(&slow_start);
2222 2222
(...skipping 2446 matching lines...) Expand 10 before | Expand all | Expand 10 after
4669 Operand(ebp, 7 * kPointerSize), 4669 Operand(ebp, 7 * kPointerSize),
4670 NULL); 4670 NULL);
4671 } 4671 }
4672 4672
4673 4673
4674 #undef __ 4674 #undef __
4675 4675
4676 } } // namespace v8::internal 4676 } } // namespace v8::internal
4677 4677
4678 #endif // V8_TARGET_ARCH_IA32 4678 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698