OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/ic/ic.h" | 5 #include "src/ic/ic.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/api-arguments.h" | 9 #include "src/api-arguments.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 if (old_map->is_deprecated()) return true; | 273 if (old_map->is_deprecated()) return true; |
274 return IsMoreGeneralElementsKindTransition(old_map->elements_kind(), | 274 return IsMoreGeneralElementsKindTransition(old_map->elements_kind(), |
275 receiver_map()->elements_kind()); | 275 receiver_map()->elements_kind()); |
276 } | 276 } |
277 | 277 |
278 if (receiver->IsJSGlobalObject()) { | 278 if (receiver->IsJSGlobalObject()) { |
279 Handle<JSGlobalObject> global = Handle<JSGlobalObject>::cast(receiver); | 279 Handle<JSGlobalObject> global = Handle<JSGlobalObject>::cast(receiver); |
280 LookupIterator it(global, name, LookupIterator::OWN_SKIP_INTERCEPTOR); | 280 LookupIterator it(global, name, LookupIterator::OWN_SKIP_INTERCEPTOR); |
281 if (it.state() == LookupIterator::ACCESS_CHECK) return false; | 281 if (it.state() == LookupIterator::ACCESS_CHECK) return false; |
282 if (!it.IsFound()) return false; | 282 if (!it.IsFound()) return false; |
| 283 if (!it.GetHolder<JSReceiver>()->IsJSGlobalObject()) return false; |
283 return it.property_details().cell_type() == PropertyCellType::kConstant; | 284 return it.property_details().cell_type() == PropertyCellType::kConstant; |
284 } | 285 } |
285 | 286 |
286 return true; | 287 return true; |
287 } | 288 } |
288 | 289 |
289 bool IC::RecomputeHandlerForName(Handle<Object> name) { | 290 bool IC::RecomputeHandlerForName(Handle<Object> name) { |
290 if (is_keyed()) { | 291 if (is_keyed()) { |
291 // Determine whether the failure is due to a name failure. | 292 // Determine whether the failure is due to a name failure. |
292 if (!name->IsName()) return false; | 293 if (!name->IsName()) return false; |
(...skipping 2500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2793 KeyedLoadICNexus nexus(vector, vector_slot); | 2794 KeyedLoadICNexus nexus(vector, vector_slot); |
2794 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2795 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2795 ic.UpdateState(receiver, key); | 2796 ic.UpdateState(receiver, key); |
2796 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 2797 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
2797 } | 2798 } |
2798 | 2799 |
2799 return *result; | 2800 return *result; |
2800 } | 2801 } |
2801 } // namespace internal | 2802 } // namespace internal |
2802 } // namespace v8 | 2803 } // namespace v8 |
OLD | NEW |