| 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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 code = isolate()->stub_cache()->ComputeLoadCallback( |
| 996 code = isolate()->stub_cache()->ComputeLoadCallback( | 996 name, receiver, holder, info); |
| 997 name, receiver, holder, callback); | 997 } else if (callback->IsAccessorPair()) { |
| 998 Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter()); |
| 999 if (!getter->IsJSFunction()) return; |
| 1000 if (holder->IsGlobalObject()) return; |
| 1001 if (!receiver->HasFastProperties()) return; |
| 1002 code = isolate()->stub_cache()->ComputeLoadViaGetter( |
| 1003 name, receiver, holder, Handle<JSFunction>::cast(getter)); |
| 1004 } else { |
| 1005 ASSERT(callback->IsForeign()); |
| 1006 // No IC support for old-style native accessors. |
| 1007 return; |
| 1008 } |
| 998 break; | 1009 break; |
| 999 } | 1010 } |
| 1000 case INTERCEPTOR: | 1011 case INTERCEPTOR: |
| 1001 ASSERT(HasInterceptorGetter(*holder)); | 1012 ASSERT(HasInterceptorGetter(*holder)); |
| 1002 code = isolate()->stub_cache()->ComputeLoadInterceptor( | 1013 code = isolate()->stub_cache()->ComputeLoadInterceptor( |
| 1003 name, receiver, holder); | 1014 name, receiver, holder); |
| 1004 break; | 1015 break; |
| 1005 default: | 1016 default: |
| 1006 return; | 1017 return; |
| 1007 } | 1018 } |
| (...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2639 #undef ADDR | 2650 #undef ADDR |
| 2640 }; | 2651 }; |
| 2641 | 2652 |
| 2642 | 2653 |
| 2643 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2654 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
| 2644 return IC_utilities[id]; | 2655 return IC_utilities[id]; |
| 2645 } | 2656 } |
| 2646 | 2657 |
| 2647 | 2658 |
| 2648 } } // namespace v8::internal | 2659 } } // namespace v8::internal |
| OLD | NEW |