OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 if (state != MONOMORPHIC) return state; | 159 if (state != MONOMORPHIC) return state; |
160 if (receiver->IsUndefined() || receiver->IsNull()) return state; | 160 if (receiver->IsUndefined() || receiver->IsNull()) return state; |
161 | 161 |
162 InlineCacheHolderFlag cache_holder = | 162 InlineCacheHolderFlag cache_holder = |
163 Code::ExtractCacheHolderFromFlags(target->flags()); | 163 Code::ExtractCacheHolderFromFlags(target->flags()); |
164 | 164 |
165 | 165 |
166 if (cache_holder == OWN_MAP && !receiver->IsJSObject()) { | 166 if (cache_holder == OWN_MAP && !receiver->IsJSObject()) { |
167 // The stub was generated for JSObject but called for non-JSObject. | 167 // The stub was generated for JSObject but called for non-JSObject. |
168 // IC::GetCodeCacheMap is not applicable. | 168 // IC::GetCodeCacheHolder is not applicable. |
169 return MONOMORPHIC; | 169 return MONOMORPHIC; |
170 } else if (cache_holder == PROTOTYPE_MAP && | 170 } else if (cache_holder == PROTOTYPE_MAP && |
171 receiver->GetPrototype()->IsNull()) { | 171 receiver->GetPrototype()->IsNull()) { |
172 // IC::GetCodeCacheMap is not applicable. | 172 // IC::GetCodeCacheHolder is not applicable. |
173 return MONOMORPHIC; | 173 return MONOMORPHIC; |
174 } | 174 } |
175 Map* map = IC::GetCodeCacheMap(receiver, cache_holder); | 175 Map* map = IC::GetCodeCacheHolder(receiver, cache_holder)->map(); |
176 | 176 |
177 // Decide whether the inline cache failed because of changes to the | 177 // Decide whether the inline cache failed because of changes to the |
178 // receiver itself or changes to one of its prototypes. | 178 // receiver itself or changes to one of its prototypes. |
179 // | 179 // |
180 // If there are changes to the receiver itself, the map of the | 180 // If there are changes to the receiver itself, the map of the |
181 // receiver will have changed and the current target will not be in | 181 // receiver will have changed and the current target will not be in |
182 // the receiver map's code cache. Therefore, if the current target | 182 // the receiver map's code cache. Therefore, if the current target |
183 // is in the receiver map's code cache, the inline cache failed due | 183 // is in the receiver map's code cache, the inline cache failed due |
184 // to prototype check failure. | 184 // to prototype check failure. |
185 int index = map->IndexInCodeCache(name, target); | 185 int index = map->IndexInCodeCache(name, target); |
(...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1818 #undef ADDR | 1818 #undef ADDR |
1819 }; | 1819 }; |
1820 | 1820 |
1821 | 1821 |
1822 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 1822 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
1823 return IC_utilities[id]; | 1823 return IC_utilities[id]; |
1824 } | 1824 } |
1825 | 1825 |
1826 | 1826 |
1827 } } // namespace v8::internal | 1827 } } // namespace v8::internal |
OLD | NEW |