| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 return receiver->SetProperty(*name, *value, NONE); | 843 return receiver->SetProperty(*name, *value, NONE); |
| 844 } | 844 } |
| 845 | 845 |
| 846 | 846 |
| 847 void StoreIC::UpdateCaches(LookupResult* lookup, | 847 void StoreIC::UpdateCaches(LookupResult* lookup, |
| 848 State state, | 848 State state, |
| 849 Handle<JSObject> receiver, | 849 Handle<JSObject> receiver, |
| 850 Handle<String> name, | 850 Handle<String> name, |
| 851 Handle<Object> value) { | 851 Handle<Object> value) { |
| 852 ASSERT(lookup->IsLoaded()); | 852 ASSERT(lookup->IsLoaded()); |
| 853 // Skip JSGlobalProxy. |
| 854 if (receiver->IsJSGlobalProxy()) return; |
| 855 |
| 853 // Bail out if we didn't find a result. | 856 // Bail out if we didn't find a result. |
| 854 if (!lookup->IsValid() || !lookup->IsCacheable()) return; | 857 if (!lookup->IsValid() || !lookup->IsCacheable()) return; |
| 855 | 858 |
| 856 // If the property is read-only, we leave the IC in its current | 859 // If the property is read-only, we leave the IC in its current |
| 857 // state. | 860 // state. |
| 858 if (lookup->IsReadOnly()) return; | 861 if (lookup->IsReadOnly()) return; |
| 859 | 862 |
| 860 // If the property has a non-field type allowing map transitions | 863 // If the property has a non-field type allowing map transitions |
| 861 // where there is extra room in the object, we leave the IC in its | 864 // where there is extra room in the object, we leave the IC in its |
| 862 // current state. | 865 // current state. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 UpdateCaches(&lookup, state, receiver, name, value); | 952 UpdateCaches(&lookup, state, receiver, name, value); |
| 950 } | 953 } |
| 951 | 954 |
| 952 // Set the property. | 955 // Set the property. |
| 953 return receiver->SetProperty(*name, *value, NONE); | 956 return receiver->SetProperty(*name, *value, NONE); |
| 954 } | 957 } |
| 955 | 958 |
| 956 // Do not use ICs for objects that require access checks (including | 959 // Do not use ICs for objects that require access checks (including |
| 957 // the global object). | 960 // the global object). |
| 958 bool use_ic = FLAG_use_ic && !object->IsAccessCheckNeeded(); | 961 bool use_ic = FLAG_use_ic && !object->IsAccessCheckNeeded(); |
| 962 ASSERT(!(use_ic && object->IsJSGlobalProxy())); |
| 959 | 963 |
| 960 if (use_ic) set_target(generic_stub()); | 964 if (use_ic) set_target(generic_stub()); |
| 961 | 965 |
| 962 // Set the property. | 966 // Set the property. |
| 963 return Runtime::SetObjectProperty(object, key, value, NONE); | 967 return Runtime::SetObjectProperty(object, key, value, NONE); |
| 964 } | 968 } |
| 965 | 969 |
| 966 | 970 |
| 967 void KeyedStoreIC::UpdateCaches(LookupResult* lookup, | 971 void KeyedStoreIC::UpdateCaches(LookupResult* lookup, |
| 968 State state, | 972 State state, |
| 969 Handle<JSObject> receiver, | 973 Handle<JSObject> receiver, |
| 970 Handle<String> name, | 974 Handle<String> name, |
| 971 Handle<Object> value) { | 975 Handle<Object> value) { |
| 972 ASSERT(lookup->IsLoaded()); | 976 ASSERT(lookup->IsLoaded()); |
| 977 |
| 978 // Skip JSGlobalProxy. |
| 979 if (receiver->IsJSGlobalProxy()) return; |
| 980 |
| 973 // Bail out if we didn't find a result. | 981 // Bail out if we didn't find a result. |
| 974 if (!lookup->IsValid() || !lookup->IsCacheable()) return; | 982 if (!lookup->IsValid() || !lookup->IsCacheable()) return; |
| 975 | 983 |
| 976 // If the property is read-only, we leave the IC in its current | 984 // If the property is read-only, we leave the IC in its current |
| 977 // state. | 985 // state. |
| 978 if (lookup->IsReadOnly()) return; | 986 if (lookup->IsReadOnly()) return; |
| 979 | 987 |
| 980 // If the property has a non-field type allowing map transitions | 988 // If the property has a non-field type allowing map transitions |
| 981 // where there is extra room in the object, we leave the IC in its | 989 // where there is extra room in the object, we leave the IC in its |
| 982 // current state. | 990 // current state. |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 #undef ADDR | 1192 #undef ADDR |
| 1185 }; | 1193 }; |
| 1186 | 1194 |
| 1187 | 1195 |
| 1188 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 1196 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
| 1189 return IC_utilities[id]; | 1197 return IC_utilities[id]; |
| 1190 } | 1198 } |
| 1191 | 1199 |
| 1192 | 1200 |
| 1193 } } // namespace v8::internal | 1201 } } // namespace v8::internal |
| OLD | NEW |