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

Side by Side Diff: src/ic.cc

Issue 10860062: Back port r12247 to 3.11 (check holder, not receiver for dict mode). (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.11/
Patch Set: Created 8 years, 4 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 | src/version.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 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 // applicable. 985 // applicable.
986 if (!holder.is_identical_to(receiver)) return; 986 if (!holder.is_identical_to(receiver)) return;
987 code = isolate()->stub_cache()->ComputeLoadNormal(); 987 code = isolate()->stub_cache()->ComputeLoadNormal();
988 } 988 }
989 break; 989 break;
990 case CALLBACKS: { 990 case CALLBACKS: {
991 Handle<Object> callback(lookup->GetCallbackObject()); 991 Handle<Object> callback(lookup->GetCallbackObject());
992 if (callback->IsAccessorInfo()) { 992 if (callback->IsAccessorInfo()) {
993 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(callback); 993 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(callback);
994 if (v8::ToCData<Address>(info->getter()) == 0) return; 994 if (v8::ToCData<Address>(info->getter()) == 0) return;
995 if (!receiver->HasFastProperties()) return; 995 if (!holder->HasFastProperties()) return;
996 if (!info->IsCompatibleReceiver(*receiver)) return; 996 if (!info->IsCompatibleReceiver(*receiver)) return;
997 code = isolate()->stub_cache()->ComputeLoadCallback( 997 code = isolate()->stub_cache()->ComputeLoadCallback(
998 name, receiver, holder, info); 998 name, receiver, holder, info);
999 } else if (callback->IsAccessorPair()) { 999 } else if (callback->IsAccessorPair()) {
1000 Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter()); 1000 Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter());
1001 if (!getter->IsJSFunction()) return; 1001 if (!getter->IsJSFunction()) return;
1002 if (holder->IsGlobalObject()) return; 1002 if (holder->IsGlobalObject()) return;
1003 if (!receiver->HasFastProperties()) return; 1003 if (!holder->HasFastProperties()) return;
1004 code = isolate()->stub_cache()->ComputeLoadViaGetter( 1004 code = isolate()->stub_cache()->ComputeLoadViaGetter(
1005 name, receiver, holder, Handle<JSFunction>::cast(getter)); 1005 name, receiver, holder, Handle<JSFunction>::cast(getter));
1006 } else { 1006 } else {
1007 ASSERT(callback->IsForeign()); 1007 ASSERT(callback->IsForeign());
1008 // No IC support for old-style native accessors. 1008 // No IC support for old-style native accessors.
1009 return; 1009 return;
1010 } 1010 }
1011 break; 1011 break;
1012 } 1012 }
1013 case INTERCEPTOR: 1013 case INTERCEPTOR:
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 code = isolate()->stub_cache()->ComputeKeyedLoadConstant( 1262 code = isolate()->stub_cache()->ComputeKeyedLoadConstant(
1263 name, receiver, holder, constant); 1263 name, receiver, holder, constant);
1264 break; 1264 break;
1265 } 1265 }
1266 case CALLBACKS: { 1266 case CALLBACKS: {
1267 Handle<Object> callback_object(lookup->GetCallbackObject()); 1267 Handle<Object> callback_object(lookup->GetCallbackObject());
1268 if (!callback_object->IsAccessorInfo()) return; 1268 if (!callback_object->IsAccessorInfo()) return;
1269 Handle<AccessorInfo> callback = 1269 Handle<AccessorInfo> callback =
1270 Handle<AccessorInfo>::cast(callback_object); 1270 Handle<AccessorInfo>::cast(callback_object);
1271 if (v8::ToCData<Address>(callback->getter()) == 0) return; 1271 if (v8::ToCData<Address>(callback->getter()) == 0) return;
1272 if (!receiver->HasFastProperties()) return; 1272 if (!holder->HasFastProperties()) return;
1273 if (!callback->IsCompatibleReceiver(*receiver)) return; 1273 if (!callback->IsCompatibleReceiver(*receiver)) return;
1274 code = isolate()->stub_cache()->ComputeKeyedLoadCallback( 1274 code = isolate()->stub_cache()->ComputeKeyedLoadCallback(
1275 name, receiver, holder, callback); 1275 name, receiver, holder, callback);
1276 break; 1276 break;
1277 } 1277 }
1278 case INTERCEPTOR: 1278 case INTERCEPTOR:
1279 ASSERT(HasInterceptorGetter(lookup->holder())); 1279 ASSERT(HasInterceptorGetter(lookup->holder()));
1280 code = isolate()->stub_cache()->ComputeKeyedLoadInterceptor( 1280 code = isolate()->stub_cache()->ComputeKeyedLoadInterceptor(
1281 name, receiver, holder); 1281 name, receiver, holder);
1282 break; 1282 break;
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 code = isolate()->stub_cache()->ComputeStoreGlobal( 1480 code = isolate()->stub_cache()->ComputeStoreGlobal(
1481 name, global, cell, strict_mode); 1481 name, global, cell, strict_mode);
1482 } else { 1482 } else {
1483 if (!holder.is_identical_to(receiver)) return; 1483 if (!holder.is_identical_to(receiver)) return;
1484 code = isolate()->stub_cache()->ComputeStoreNormal(strict_mode); 1484 code = isolate()->stub_cache()->ComputeStoreNormal(strict_mode);
1485 } 1485 }
1486 break; 1486 break;
1487 case CALLBACKS: { 1487 case CALLBACKS: {
1488 Handle<Object> callback(lookup->GetCallbackObject()); 1488 Handle<Object> callback(lookup->GetCallbackObject());
1489 if (callback->IsAccessorInfo()) { 1489 if (callback->IsAccessorInfo()) {
1490 ASSERT(*holder == *receiver); // LookupForWrite checks this.
1490 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(callback); 1491 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(callback);
1491 if (v8::ToCData<Address>(info->setter()) == 0) return; 1492 if (v8::ToCData<Address>(info->setter()) == 0) return;
1492 if (!receiver->HasFastProperties()) return; 1493 if (!holder->HasFastProperties()) return;
1493 ASSERT(info->IsCompatibleReceiver(*receiver)); 1494 ASSERT(info->IsCompatibleReceiver(*receiver));
1494 code = isolate()->stub_cache()->ComputeStoreCallback( 1495 code = isolate()->stub_cache()->ComputeStoreCallback(
1495 name, receiver, info, strict_mode); 1496 name, receiver, info, strict_mode);
1496 } else if (callback->IsAccessorPair()) { 1497 } else if (callback->IsAccessorPair()) {
1497 Handle<Object> setter(Handle<AccessorPair>::cast(callback)->setter()); 1498 Handle<Object> setter(Handle<AccessorPair>::cast(callback)->setter());
1498 if (!setter->IsJSFunction()) return; 1499 if (!setter->IsJSFunction()) return;
1499 if (holder->IsGlobalObject()) return; 1500 if (holder->IsGlobalObject()) return;
1500 if (!receiver->HasFastProperties()) return; 1501 if (!holder->HasFastProperties()) return;
1501 code = isolate()->stub_cache()->ComputeStoreViaSetter( 1502 code = isolate()->stub_cache()->ComputeStoreViaSetter(
1502 name, receiver, Handle<JSFunction>::cast(setter), strict_mode); 1503 name, receiver, Handle<JSFunction>::cast(setter), strict_mode);
1503 } else { 1504 } else {
1504 ASSERT(callback->IsForeign()); 1505 ASSERT(callback->IsForeign());
1505 // No IC support for old-style native accessors. 1506 // No IC support for old-style native accessors.
1506 return; 1507 return;
1507 } 1508 }
1508 break; 1509 break;
1509 } 1510 }
1510 case INTERCEPTOR: 1511 case INTERCEPTOR:
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
2675 #undef ADDR 2676 #undef ADDR
2676 }; 2677 };
2677 2678
2678 2679
2679 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2680 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2680 return IC_utilities[id]; 2681 return IC_utilities[id];
2681 } 2682 }
2682 2683
2683 2684
2684 } } // namespace v8::internal 2685 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698