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

Side by Side Diff: src/x64/stub-cache-x64.cc

Issue 12319144: Avoid TLS accesses in Object::Lookup and Object::GetPrototype. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Simplified Object::GetPrototype a bit Created 7 years, 9 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/stub-cache.cc ('k') | no next file » | 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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after
1820 index_out_of_range_label = &miss; 1820 index_out_of_range_label = &miss;
1821 } 1821 }
1822 GenerateNameCheck(name, &name_miss); 1822 GenerateNameCheck(name, &name_miss);
1823 1823
1824 // Check that the maps starting from the prototype haven't changed. 1824 // Check that the maps starting from the prototype haven't changed.
1825 GenerateDirectLoadGlobalFunctionPrototype(masm(), 1825 GenerateDirectLoadGlobalFunctionPrototype(masm(),
1826 Context::STRING_FUNCTION_INDEX, 1826 Context::STRING_FUNCTION_INDEX,
1827 rax, 1827 rax,
1828 &miss); 1828 &miss);
1829 ASSERT(!object.is_identical_to(holder)); 1829 ASSERT(!object.is_identical_to(holder));
1830 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), 1830 CheckPrototypes(
1831 rax, holder, rbx, rdx, rdi, name, &miss); 1831 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))),
1832 rax, holder, rbx, rdx, rdi, name, &miss);
1832 1833
1833 Register receiver = rbx; 1834 Register receiver = rbx;
1834 Register index = rdi; 1835 Register index = rdi;
1835 Register result = rax; 1836 Register result = rax;
1836 __ movq(receiver, Operand(rsp, (argc + 1) * kPointerSize)); 1837 __ movq(receiver, Operand(rsp, (argc + 1) * kPointerSize));
1837 if (argc > 0) { 1838 if (argc > 0) {
1838 __ movq(index, Operand(rsp, (argc - 0) * kPointerSize)); 1839 __ movq(index, Operand(rsp, (argc - 0) * kPointerSize));
1839 } else { 1840 } else {
1840 __ LoadRoot(index, Heap::kUndefinedValueRootIndex); 1841 __ LoadRoot(index, Heap::kUndefinedValueRootIndex);
1841 } 1842 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1898 index_out_of_range_label = &miss; 1899 index_out_of_range_label = &miss;
1899 } 1900 }
1900 GenerateNameCheck(name, &name_miss); 1901 GenerateNameCheck(name, &name_miss);
1901 1902
1902 // Check that the maps starting from the prototype haven't changed. 1903 // Check that the maps starting from the prototype haven't changed.
1903 GenerateDirectLoadGlobalFunctionPrototype(masm(), 1904 GenerateDirectLoadGlobalFunctionPrototype(masm(),
1904 Context::STRING_FUNCTION_INDEX, 1905 Context::STRING_FUNCTION_INDEX,
1905 rax, 1906 rax,
1906 &miss); 1907 &miss);
1907 ASSERT(!object.is_identical_to(holder)); 1908 ASSERT(!object.is_identical_to(holder));
1908 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), 1909 CheckPrototypes(
1909 rax, holder, rbx, rdx, rdi, name, &miss); 1910 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))),
1911 rax, holder, rbx, rdx, rdi, name, &miss);
1910 1912
1911 Register receiver = rax; 1913 Register receiver = rax;
1912 Register index = rdi; 1914 Register index = rdi;
1913 Register scratch = rdx; 1915 Register scratch = rdx;
1914 Register result = rax; 1916 Register result = rax;
1915 __ movq(receiver, Operand(rsp, (argc + 1) * kPointerSize)); 1917 __ movq(receiver, Operand(rsp, (argc + 1) * kPointerSize));
1916 if (argc > 0) { 1918 if (argc > 0) {
1917 __ movq(index, Operand(rsp, (argc - 0) * kPointerSize)); 1919 __ movq(index, Operand(rsp, (argc - 0) * kPointerSize));
1918 } else { 1920 } else {
1919 __ LoadRoot(index, Heap::kUndefinedValueRootIndex); 1921 __ LoadRoot(index, Heap::kUndefinedValueRootIndex);
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 break; 2240 break;
2239 2241
2240 case STRING_CHECK: 2242 case STRING_CHECK:
2241 // Check that the object is a two-byte string or a symbol. 2243 // Check that the object is a two-byte string or a symbol.
2242 __ CmpObjectType(rdx, FIRST_NONSTRING_TYPE, rax); 2244 __ CmpObjectType(rdx, FIRST_NONSTRING_TYPE, rax);
2243 __ j(above_equal, &miss); 2245 __ j(above_equal, &miss);
2244 // Check that the maps starting from the prototype haven't changed. 2246 // Check that the maps starting from the prototype haven't changed.
2245 GenerateDirectLoadGlobalFunctionPrototype( 2247 GenerateDirectLoadGlobalFunctionPrototype(
2246 masm(), Context::STRING_FUNCTION_INDEX, rax, &miss); 2248 masm(), Context::STRING_FUNCTION_INDEX, rax, &miss);
2247 CheckPrototypes( 2249 CheckPrototypes(
2248 Handle<JSObject>(JSObject::cast(object->GetPrototype())), 2250 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))),
2249 rax, holder, rbx, rdx, rdi, name, &miss); 2251 rax, holder, rbx, rdx, rdi, name, &miss);
2250 break; 2252 break;
2251 2253
2252 case NUMBER_CHECK: { 2254 case NUMBER_CHECK: {
2253 Label fast; 2255 Label fast;
2254 // Check that the object is a smi or a heap number. 2256 // Check that the object is a smi or a heap number.
2255 __ JumpIfSmi(rdx, &fast); 2257 __ JumpIfSmi(rdx, &fast);
2256 __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rax); 2258 __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rax);
2257 __ j(not_equal, &miss); 2259 __ j(not_equal, &miss);
2258 __ bind(&fast); 2260 __ bind(&fast);
2259 // Check that the maps starting from the prototype haven't changed. 2261 // Check that the maps starting from the prototype haven't changed.
2260 GenerateDirectLoadGlobalFunctionPrototype( 2262 GenerateDirectLoadGlobalFunctionPrototype(
2261 masm(), Context::NUMBER_FUNCTION_INDEX, rax, &miss); 2263 masm(), Context::NUMBER_FUNCTION_INDEX, rax, &miss);
2262 CheckPrototypes( 2264 CheckPrototypes(
2263 Handle<JSObject>(JSObject::cast(object->GetPrototype())), 2265 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))),
2264 rax, holder, rbx, rdx, rdi, name, &miss); 2266 rax, holder, rbx, rdx, rdi, name, &miss);
2265 break; 2267 break;
2266 } 2268 }
2267 case BOOLEAN_CHECK: { 2269 case BOOLEAN_CHECK: {
2268 Label fast; 2270 Label fast;
2269 // Check that the object is a boolean. 2271 // Check that the object is a boolean.
2270 __ CompareRoot(rdx, Heap::kTrueValueRootIndex); 2272 __ CompareRoot(rdx, Heap::kTrueValueRootIndex);
2271 __ j(equal, &fast); 2273 __ j(equal, &fast);
2272 __ CompareRoot(rdx, Heap::kFalseValueRootIndex); 2274 __ CompareRoot(rdx, Heap::kFalseValueRootIndex);
2273 __ j(not_equal, &miss); 2275 __ j(not_equal, &miss);
2274 __ bind(&fast); 2276 __ bind(&fast);
2275 // Check that the maps starting from the prototype haven't changed. 2277 // Check that the maps starting from the prototype haven't changed.
2276 GenerateDirectLoadGlobalFunctionPrototype( 2278 GenerateDirectLoadGlobalFunctionPrototype(
2277 masm(), Context::BOOLEAN_FUNCTION_INDEX, rax, &miss); 2279 masm(), Context::BOOLEAN_FUNCTION_INDEX, rax, &miss);
2278 CheckPrototypes( 2280 CheckPrototypes(
2279 Handle<JSObject>(JSObject::cast(object->GetPrototype())), 2281 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))),
2280 rax, holder, rbx, rdx, rdi, name, &miss); 2282 rax, holder, rbx, rdx, rdi, name, &miss);
2281 break; 2283 break;
2282 } 2284 }
2283 } 2285 }
2284 2286
2285 __ jmp(success); 2287 __ jmp(success);
2286 2288
2287 // Handle call cache miss. 2289 // Handle call cache miss.
2288 __ bind(&miss); 2290 __ bind(&miss);
2289 GenerateMissBranch(); 2291 GenerateMissBranch();
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after
3698 __ jmp(ic_slow, RelocInfo::CODE_TARGET); 3700 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
3699 } 3701 }
3700 } 3702 }
3701 3703
3702 3704
3703 #undef __ 3705 #undef __
3704 3706
3705 } } // namespace v8::internal 3707 } } // namespace v8::internal
3706 3708
3707 #endif // V8_TARGET_ARCH_X64 3709 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/stub-cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698