OLD | NEW |
---|---|
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 Loading... | |
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 (!holder->HasFastProperties()) return; | |
Michael Starzinger
2012/08/13 17:47:16
What about the KeyedLoadIC?
| |
993 if (!info->IsCompatibleReceiver(*receiver)) return; | 992 if (!info->IsCompatibleReceiver(*receiver)) return; |
994 code = isolate()->stub_cache()->ComputeLoadCallback( | 993 code = isolate()->stub_cache()->ComputeLoadCallback( |
995 name, receiver, holder, info); | 994 name, receiver, holder, info); |
996 } else if (callback->IsAccessorPair()) { | 995 } else if (callback->IsAccessorPair()) { |
997 Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter()); | 996 Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter()); |
998 if (!getter->IsJSFunction()) return; | 997 if (!getter->IsJSFunction()) return; |
999 if (holder->IsGlobalObject()) return; | 998 if (holder->IsGlobalObject()) return; |
1000 if (!holder->HasFastProperties()) return; | |
Michael Starzinger
2012/08/13 17:47:16
Why can we generate a JavaScript getter call for a
| |
1001 code = isolate()->stub_cache()->ComputeLoadViaGetter( | 999 code = isolate()->stub_cache()->ComputeLoadViaGetter( |
1002 name, receiver, holder, Handle<JSFunction>::cast(getter)); | 1000 name, receiver, holder, Handle<JSFunction>::cast(getter)); |
1003 } else { | 1001 } else { |
1004 ASSERT(callback->IsForeign()); | 1002 ASSERT(callback->IsForeign()); |
1005 // No IC support for old-style native accessors. | 1003 // No IC support for old-style native accessors. |
1006 return; | 1004 return; |
1007 } | 1005 } |
1008 break; | 1006 break; |
1009 } | 1007 } |
1010 case INTERCEPTOR: | 1008 case INTERCEPTOR: |
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2699 #undef ADDR | 2697 #undef ADDR |
2700 }; | 2698 }; |
2701 | 2699 |
2702 | 2700 |
2703 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2701 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2704 return IC_utilities[id]; | 2702 return IC_utilities[id]; |
2705 } | 2703 } |
2706 | 2704 |
2707 | 2705 |
2708 } } // namespace v8::internal | 2706 } } // namespace v8::internal |
OLD | NEW |