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

Side by Side Diff: src/ic.cc

Issue 10781011: Fix ICs for slow objects with native accessor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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 | « no previous file | test/cctest/test-api.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 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 // applicable. 982 // applicable.
983 if (!holder.is_identical_to(receiver)) return; 983 if (!holder.is_identical_to(receiver)) return;
984 code = isolate()->stub_cache()->ComputeLoadNormal(); 984 code = isolate()->stub_cache()->ComputeLoadNormal();
985 } 985 }
986 break; 986 break;
987 case CALLBACKS: { 987 case CALLBACKS: {
988 Handle<Object> callback(lookup->GetCallbackObject()); 988 Handle<Object> callback(lookup->GetCallbackObject());
989 if (callback->IsAccessorInfo()) { 989 if (callback->IsAccessorInfo()) {
990 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(callback); 990 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(callback);
991 if (v8::ToCData<Address>(info->getter()) == 0) return; 991 if (v8::ToCData<Address>(info->getter()) == 0) return;
992 if (!receiver->HasFastProperties()) return;
992 if (!info->IsCompatibleReceiver(*receiver)) return; 993 if (!info->IsCompatibleReceiver(*receiver)) return;
993 code = isolate()->stub_cache()->ComputeLoadCallback( 994 code = isolate()->stub_cache()->ComputeLoadCallback(
994 name, receiver, holder, info); 995 name, receiver, holder, info);
995 } else if (callback->IsAccessorPair()) { 996 } else if (callback->IsAccessorPair()) {
996 Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter()); 997 Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter());
997 if (!getter->IsJSFunction()) return; 998 if (!getter->IsJSFunction()) return;
998 if (holder->IsGlobalObject()) return; 999 if (holder->IsGlobalObject()) return;
999 if (!receiver->HasFastProperties()) return; 1000 if (!receiver->HasFastProperties()) return;
1000 code = isolate()->stub_cache()->ComputeLoadViaGetter( 1001 code = isolate()->stub_cache()->ComputeLoadViaGetter(
1001 name, receiver, holder, Handle<JSFunction>::cast(getter)); 1002 name, receiver, holder, Handle<JSFunction>::cast(getter));
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 code = isolate()->stub_cache()->ComputeKeyedLoadConstant( 1259 code = isolate()->stub_cache()->ComputeKeyedLoadConstant(
1259 name, receiver, holder, constant); 1260 name, receiver, holder, constant);
1260 break; 1261 break;
1261 } 1262 }
1262 case CALLBACKS: { 1263 case CALLBACKS: {
1263 Handle<Object> callback_object(lookup->GetCallbackObject()); 1264 Handle<Object> callback_object(lookup->GetCallbackObject());
1264 if (!callback_object->IsAccessorInfo()) return; 1265 if (!callback_object->IsAccessorInfo()) return;
1265 Handle<AccessorInfo> callback = 1266 Handle<AccessorInfo> callback =
1266 Handle<AccessorInfo>::cast(callback_object); 1267 Handle<AccessorInfo>::cast(callback_object);
1267 if (v8::ToCData<Address>(callback->getter()) == 0) return; 1268 if (v8::ToCData<Address>(callback->getter()) == 0) return;
1269 if (!receiver->HasFastProperties()) return;
1268 if (!callback->IsCompatibleReceiver(*receiver)) return; 1270 if (!callback->IsCompatibleReceiver(*receiver)) return;
1269 code = isolate()->stub_cache()->ComputeKeyedLoadCallback( 1271 code = isolate()->stub_cache()->ComputeKeyedLoadCallback(
1270 name, receiver, holder, callback); 1272 name, receiver, holder, callback);
1271 break; 1273 break;
1272 } 1274 }
1273 case INTERCEPTOR: 1275 case INTERCEPTOR:
1274 ASSERT(HasInterceptorGetter(lookup->holder())); 1276 ASSERT(HasInterceptorGetter(lookup->holder()));
1275 code = isolate()->stub_cache()->ComputeKeyedLoadInterceptor( 1277 code = isolate()->stub_cache()->ComputeKeyedLoadInterceptor(
1276 name, receiver, holder); 1278 name, receiver, holder);
1277 break; 1279 break;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 } else { 1479 } else {
1478 if (!holder.is_identical_to(receiver)) return; 1480 if (!holder.is_identical_to(receiver)) return;
1479 code = isolate()->stub_cache()->ComputeStoreNormal(strict_mode); 1481 code = isolate()->stub_cache()->ComputeStoreNormal(strict_mode);
1480 } 1482 }
1481 break; 1483 break;
1482 case CALLBACKS: { 1484 case CALLBACKS: {
1483 Handle<Object> callback(lookup->GetCallbackObject()); 1485 Handle<Object> callback(lookup->GetCallbackObject());
1484 if (callback->IsAccessorInfo()) { 1486 if (callback->IsAccessorInfo()) {
1485 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(callback); 1487 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(callback);
1486 if (v8::ToCData<Address>(info->setter()) == 0) return; 1488 if (v8::ToCData<Address>(info->setter()) == 0) return;
1489 if (!receiver->HasFastProperties()) return;
1487 ASSERT(info->IsCompatibleReceiver(*receiver)); 1490 ASSERT(info->IsCompatibleReceiver(*receiver));
1488 code = isolate()->stub_cache()->ComputeStoreCallback( 1491 code = isolate()->stub_cache()->ComputeStoreCallback(
1489 name, receiver, info, strict_mode); 1492 name, receiver, info, strict_mode);
1490 } else if (callback->IsAccessorPair()) { 1493 } else if (callback->IsAccessorPair()) {
1491 Handle<Object> setter(Handle<AccessorPair>::cast(callback)->setter()); 1494 Handle<Object> setter(Handle<AccessorPair>::cast(callback)->setter());
1492 if (!setter->IsJSFunction()) return; 1495 if (!setter->IsJSFunction()) return;
1493 if (holder->IsGlobalObject()) return; 1496 if (holder->IsGlobalObject()) return;
1494 if (!receiver->HasFastProperties()) return; 1497 if (!receiver->HasFastProperties()) return;
1495 code = isolate()->stub_cache()->ComputeStoreViaSetter( 1498 code = isolate()->stub_cache()->ComputeStoreViaSetter(
1496 name, receiver, holder, Handle<JSFunction>::cast(setter), 1499 name, receiver, holder, Handle<JSFunction>::cast(setter),
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after
2701 #undef ADDR 2704 #undef ADDR
2702 }; 2705 };
2703 2706
2704 2707
2705 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2708 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2706 return IC_utilities[id]; 2709 return IC_utilities[id];
2707 } 2710 }
2708 2711
2709 2712
2710 } } // namespace v8::internal 2713 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698