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

Side by Side Diff: src/ic.cc

Issue 10515008: Added LoadIC stub for getters. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Incorporated review comments. Created 8 years, 6 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/mips/stub-cache-mips.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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 } else { 981 } else {
982 // There is only one shared stub for loading normalized 982 // There is only one shared stub for loading normalized
983 // properties. It does not traverse the prototype chain, so the 983 // properties. It does not traverse the prototype chain, so the
984 // property must be found in the receiver for the stub to be 984 // property must be found in the receiver for the stub to be
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_object(lookup->GetCallbackObject()); 991 Handle<Object> callback(lookup->GetCallbackObject());
992 if (!callback_object->IsAccessorInfo()) return; 992 if (callback->IsAccessorInfo()) {
993 Handle<AccessorInfo> callback = 993 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(callback);
994 Handle<AccessorInfo>::cast(callback_object); 994 if (v8::ToCData<Address>(info->getter()) == 0) return;
995 if (v8::ToCData<Address>(callback->getter()) == 0) return; 995 if (!info->IsCompatibleReceiver(*receiver)) return;
996 if (!callback->IsCompatibleReceiver(*receiver)) return; 996 code = isolate()->stub_cache()->ComputeLoadCallback(
997 code = isolate()->stub_cache()->ComputeLoadCallback( 997 name, receiver, holder, info);
998 name, receiver, holder, callback); 998 } else if (callback->IsAccessorPair()) {
999 Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter());
1000 if (!getter->IsJSFunction()) return;
1001 if (holder->IsGlobalObject()) return;
1002 if (!receiver->HasFastProperties()) return;
1003 code = isolate()->stub_cache()->ComputeLoadViaGetter(
1004 name, receiver, holder, Handle<JSFunction>::cast(getter));
1005 } else {
1006 ASSERT(callback->IsForeign());
1007 // No IC support for old-style native accessors.
1008 return;
1009 }
999 break; 1010 break;
1000 } 1011 }
1001 case INTERCEPTOR: 1012 case INTERCEPTOR:
1002 ASSERT(HasInterceptorGetter(*holder)); 1013 ASSERT(HasInterceptorGetter(*holder));
1003 code = isolate()->stub_cache()->ComputeLoadInterceptor( 1014 code = isolate()->stub_cache()->ComputeLoadInterceptor(
1004 name, receiver, holder); 1015 name, receiver, holder);
1005 break; 1016 break;
1006 default: 1017 default:
1007 return; 1018 return;
1008 } 1019 }
(...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after
2646 #undef ADDR 2657 #undef ADDR
2647 }; 2658 };
2648 2659
2649 2660
2650 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2661 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2651 return IC_utilities[id]; 2662 return IC_utilities[id];
2652 } 2663 }
2653 2664
2654 2665
2655 } } // namespace v8::internal 2666 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/mips/stub-cache-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698