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

Side by Side Diff: src/ic.cc

Issue 10828303: Fix improved LoadICs for dictionaries with callbacks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ported to all architectures and addressed comments. 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 | « src/ia32/stub-cache-ia32.cc ('k') | src/stub-cache.h » ('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 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 (!info->IsCompatibleReceiver(*receiver)) return; 992 if (!info->IsCompatibleReceiver(*receiver)) return;
993 code = isolate()->stub_cache()->ComputeLoadCallback( 993 code = isolate()->stub_cache()->ComputeLoadCallback(
994 name, receiver, holder, info); 994 name, receiver, holder, info);
995 } else if (callback->IsAccessorPair()) { 995 } else if (callback->IsAccessorPair()) {
996 Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter()); 996 Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter());
997 if (!getter->IsJSFunction()) return; 997 if (!getter->IsJSFunction()) return;
998 if (holder->IsGlobalObject()) return; 998 if (holder->IsGlobalObject()) return;
999 if (!holder->HasFastProperties()) return;
999 code = isolate()->stub_cache()->ComputeLoadViaGetter( 1000 code = isolate()->stub_cache()->ComputeLoadViaGetter(
1000 name, receiver, holder, Handle<JSFunction>::cast(getter)); 1001 name, receiver, holder, Handle<JSFunction>::cast(getter));
1001 } else { 1002 } else {
1002 ASSERT(callback->IsForeign()); 1003 ASSERT(callback->IsForeign());
1003 // No IC support for old-style native accessors. 1004 // No IC support for old-style native accessors.
1004 return; 1005 return;
1005 } 1006 }
1006 break; 1007 break;
1007 } 1008 }
1008 case INTERCEPTOR: 1009 case INTERCEPTOR:
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 code = isolate()->stub_cache()->ComputeKeyedLoadConstant( 1258 code = isolate()->stub_cache()->ComputeKeyedLoadConstant(
1258 name, receiver, holder, constant); 1259 name, receiver, holder, constant);
1259 break; 1260 break;
1260 } 1261 }
1261 case CALLBACKS: { 1262 case CALLBACKS: {
1262 Handle<Object> callback_object(lookup->GetCallbackObject()); 1263 Handle<Object> callback_object(lookup->GetCallbackObject());
1263 if (!callback_object->IsAccessorInfo()) return; 1264 if (!callback_object->IsAccessorInfo()) return;
1264 Handle<AccessorInfo> callback = 1265 Handle<AccessorInfo> callback =
1265 Handle<AccessorInfo>::cast(callback_object); 1266 Handle<AccessorInfo>::cast(callback_object);
1266 if (v8::ToCData<Address>(callback->getter()) == 0) return; 1267 if (v8::ToCData<Address>(callback->getter()) == 0) return;
1267 if (!holder->HasFastProperties()) return;
1268 if (!callback->IsCompatibleReceiver(*receiver)) return; 1268 if (!callback->IsCompatibleReceiver(*receiver)) return;
1269 code = isolate()->stub_cache()->ComputeKeyedLoadCallback( 1269 code = isolate()->stub_cache()->ComputeKeyedLoadCallback(
1270 name, receiver, holder, callback); 1270 name, receiver, holder, callback);
1271 break; 1271 break;
1272 } 1272 }
1273 case INTERCEPTOR: 1273 case INTERCEPTOR:
1274 ASSERT(HasInterceptorGetter(lookup->holder())); 1274 ASSERT(HasInterceptorGetter(lookup->holder()));
1275 code = isolate()->stub_cache()->ComputeKeyedLoadInterceptor( 1275 code = isolate()->stub_cache()->ComputeKeyedLoadInterceptor(
1276 name, receiver, holder); 1276 name, receiver, holder);
1277 break; 1277 break;
(...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after
2697 #undef ADDR 2697 #undef ADDR
2698 }; 2698 };
2699 2699
2700 2700
2701 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2701 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2702 return IC_utilities[id]; 2702 return IC_utilities[id];
2703 } 2703 }
2704 2704
2705 2705
2706 } } // namespace v8::internal 2706 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698