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

Side by Side Diff: src/arm/stub-cache-arm.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/api.cc ('k') | src/builtins.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 // 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 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after
1938 index_out_of_range_label = &miss; 1938 index_out_of_range_label = &miss;
1939 } 1939 }
1940 GenerateNameCheck(name, &name_miss); 1940 GenerateNameCheck(name, &name_miss);
1941 1941
1942 // Check that the maps starting from the prototype haven't changed. 1942 // Check that the maps starting from the prototype haven't changed.
1943 GenerateDirectLoadGlobalFunctionPrototype(masm(), 1943 GenerateDirectLoadGlobalFunctionPrototype(masm(),
1944 Context::STRING_FUNCTION_INDEX, 1944 Context::STRING_FUNCTION_INDEX,
1945 r0, 1945 r0,
1946 &miss); 1946 &miss);
1947 ASSERT(!object.is_identical_to(holder)); 1947 ASSERT(!object.is_identical_to(holder));
1948 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), 1948 CheckPrototypes(
1949 r0, holder, r1, r3, r4, name, &miss); 1949 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))),
1950 r0, holder, r1, r3, r4, name, &miss);
1950 1951
1951 Register receiver = r1; 1952 Register receiver = r1;
1952 Register index = r4; 1953 Register index = r4;
1953 Register result = r0; 1954 Register result = r0;
1954 __ ldr(receiver, MemOperand(sp, argc * kPointerSize)); 1955 __ ldr(receiver, MemOperand(sp, argc * kPointerSize));
1955 if (argc > 0) { 1956 if (argc > 0) {
1956 __ ldr(index, MemOperand(sp, (argc - 1) * kPointerSize)); 1957 __ ldr(index, MemOperand(sp, (argc - 1) * kPointerSize));
1957 } else { 1958 } else {
1958 __ LoadRoot(index, Heap::kUndefinedValueRootIndex); 1959 __ LoadRoot(index, Heap::kUndefinedValueRootIndex);
1959 } 1960 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
2018 index_out_of_range_label = &miss; 2019 index_out_of_range_label = &miss;
2019 } 2020 }
2020 GenerateNameCheck(name, &name_miss); 2021 GenerateNameCheck(name, &name_miss);
2021 2022
2022 // Check that the maps starting from the prototype haven't changed. 2023 // Check that the maps starting from the prototype haven't changed.
2023 GenerateDirectLoadGlobalFunctionPrototype(masm(), 2024 GenerateDirectLoadGlobalFunctionPrototype(masm(),
2024 Context::STRING_FUNCTION_INDEX, 2025 Context::STRING_FUNCTION_INDEX,
2025 r0, 2026 r0,
2026 &miss); 2027 &miss);
2027 ASSERT(!object.is_identical_to(holder)); 2028 ASSERT(!object.is_identical_to(holder));
2028 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), 2029 CheckPrototypes(
2029 r0, holder, r1, r3, r4, name, &miss); 2030 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))),
2031 r0, holder, r1, r3, r4, name, &miss);
2030 2032
2031 Register receiver = r0; 2033 Register receiver = r0;
2032 Register index = r4; 2034 Register index = r4;
2033 Register scratch = r3; 2035 Register scratch = r3;
2034 Register result = r0; 2036 Register result = r0;
2035 __ ldr(receiver, MemOperand(sp, argc * kPointerSize)); 2037 __ ldr(receiver, MemOperand(sp, argc * kPointerSize));
2036 if (argc > 0) { 2038 if (argc > 0) {
2037 __ ldr(index, MemOperand(sp, (argc - 1) * kPointerSize)); 2039 __ ldr(index, MemOperand(sp, (argc - 1) * kPointerSize));
2038 } else { 2040 } else {
2039 __ LoadRoot(index, Heap::kUndefinedValueRootIndex); 2041 __ LoadRoot(index, Heap::kUndefinedValueRootIndex);
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
2483 break; 2485 break;
2484 2486
2485 case STRING_CHECK: 2487 case STRING_CHECK:
2486 // Check that the object is a two-byte string or a symbol. 2488 // Check that the object is a two-byte string or a symbol.
2487 __ CompareObjectType(r1, r3, r3, FIRST_NONSTRING_TYPE); 2489 __ CompareObjectType(r1, r3, r3, FIRST_NONSTRING_TYPE);
2488 __ b(ge, &miss); 2490 __ b(ge, &miss);
2489 // Check that the maps starting from the prototype haven't changed. 2491 // Check that the maps starting from the prototype haven't changed.
2490 GenerateDirectLoadGlobalFunctionPrototype( 2492 GenerateDirectLoadGlobalFunctionPrototype(
2491 masm(), Context::STRING_FUNCTION_INDEX, r0, &miss); 2493 masm(), Context::STRING_FUNCTION_INDEX, r0, &miss);
2492 CheckPrototypes( 2494 CheckPrototypes(
2493 Handle<JSObject>(JSObject::cast(object->GetPrototype())), 2495 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))),
2494 r0, holder, r3, r1, r4, name, &miss); 2496 r0, holder, r3, r1, r4, name, &miss);
2495 break; 2497 break;
2496 2498
2497 case NUMBER_CHECK: { 2499 case NUMBER_CHECK: {
2498 Label fast; 2500 Label fast;
2499 // Check that the object is a smi or a heap number. 2501 // Check that the object is a smi or a heap number.
2500 __ JumpIfSmi(r1, &fast); 2502 __ JumpIfSmi(r1, &fast);
2501 __ CompareObjectType(r1, r0, r0, HEAP_NUMBER_TYPE); 2503 __ CompareObjectType(r1, r0, r0, HEAP_NUMBER_TYPE);
2502 __ b(ne, &miss); 2504 __ b(ne, &miss);
2503 __ bind(&fast); 2505 __ bind(&fast);
2504 // Check that the maps starting from the prototype haven't changed. 2506 // Check that the maps starting from the prototype haven't changed.
2505 GenerateDirectLoadGlobalFunctionPrototype( 2507 GenerateDirectLoadGlobalFunctionPrototype(
2506 masm(), Context::NUMBER_FUNCTION_INDEX, r0, &miss); 2508 masm(), Context::NUMBER_FUNCTION_INDEX, r0, &miss);
2507 CheckPrototypes( 2509 CheckPrototypes(
2508 Handle<JSObject>(JSObject::cast(object->GetPrototype())), 2510 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))),
2509 r0, holder, r3, r1, r4, name, &miss); 2511 r0, holder, r3, r1, r4, name, &miss);
2510 break; 2512 break;
2511 } 2513 }
2512 case BOOLEAN_CHECK: { 2514 case BOOLEAN_CHECK: {
2513 Label fast; 2515 Label fast;
2514 // Check that the object is a boolean. 2516 // Check that the object is a boolean.
2515 __ LoadRoot(ip, Heap::kTrueValueRootIndex); 2517 __ LoadRoot(ip, Heap::kTrueValueRootIndex);
2516 __ cmp(r1, ip); 2518 __ cmp(r1, ip);
2517 __ b(eq, &fast); 2519 __ b(eq, &fast);
2518 __ LoadRoot(ip, Heap::kFalseValueRootIndex); 2520 __ LoadRoot(ip, Heap::kFalseValueRootIndex);
2519 __ cmp(r1, ip); 2521 __ cmp(r1, ip);
2520 __ b(ne, &miss); 2522 __ b(ne, &miss);
2521 __ bind(&fast); 2523 __ bind(&fast);
2522 // Check that the maps starting from the prototype haven't changed. 2524 // Check that the maps starting from the prototype haven't changed.
2523 GenerateDirectLoadGlobalFunctionPrototype( 2525 GenerateDirectLoadGlobalFunctionPrototype(
2524 masm(), Context::BOOLEAN_FUNCTION_INDEX, r0, &miss); 2526 masm(), Context::BOOLEAN_FUNCTION_INDEX, r0, &miss);
2525 CheckPrototypes( 2527 CheckPrototypes(
2526 Handle<JSObject>(JSObject::cast(object->GetPrototype())), 2528 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))),
2527 r0, holder, r3, r1, r4, name, &miss); 2529 r0, holder, r3, r1, r4, name, &miss);
2528 break; 2530 break;
2529 } 2531 }
2530 } 2532 }
2531 2533
2532 __ b(success); 2534 __ b(success);
2533 2535
2534 // Handle call cache miss. 2536 // Handle call cache miss.
2535 __ bind(&miss); 2537 __ bind(&miss);
2536 GenerateMissBranch(); 2538 GenerateMissBranch();
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after
4175 __ Jump(ic_slow, RelocInfo::CODE_TARGET); 4177 __ Jump(ic_slow, RelocInfo::CODE_TARGET);
4176 } 4178 }
4177 } 4179 }
4178 4180
4179 4181
4180 #undef __ 4182 #undef __
4181 4183
4182 } } // namespace v8::internal 4184 } } // namespace v8::internal
4183 4185
4184 #endif // V8_TARGET_ARCH_ARM 4186 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698