| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/handler-compiler.h" | 5 #include "src/ic/handler-compiler.h" |
| 6 | 6 |
| 7 #include "src/field-type.h" | 7 #include "src/field-type.h" |
| 8 #include "src/ic/call-optimization.h" | 8 #include "src/ic/call-optimization.h" |
| 9 #include "src/ic/ic-inl.h" | 9 #include "src/ic/ic-inl.h" |
| 10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 } else { | 575 } else { |
| 576 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | 576 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
| 577 ElementsKind elements_kind = receiver_map->elements_kind(); | 577 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 578 | 578 |
| 579 // No need to check for an elements-free prototype chain here, the | 579 // No need to check for an elements-free prototype chain here, the |
| 580 // generated stub code needs to check that dynamically anyway. | 580 // generated stub code needs to check that dynamically anyway. |
| 581 bool convert_hole_to_undefined = | 581 bool convert_hole_to_undefined = |
| 582 (is_js_array && elements_kind == FAST_HOLEY_ELEMENTS && | 582 (is_js_array && elements_kind == FAST_HOLEY_ELEMENTS && |
| 583 *receiver_map == isolate()->get_initial_js_array_map(elements_kind)); | 583 *receiver_map == isolate()->get_initial_js_array_map(elements_kind)); |
| 584 | 584 |
| 585 if (receiver_map->has_indexed_interceptor()) { | 585 if (receiver_map->has_indexed_interceptor() && |
| 586 !receiver_map->GetIndexedInterceptor()->getter()->IsUndefined() && |
| 587 !receiver_map->GetIndexedInterceptor()->non_masking()) { |
| 586 cached_stub = LoadIndexedInterceptorStub(isolate()).GetCode(); | 588 cached_stub = LoadIndexedInterceptorStub(isolate()).GetCode(); |
| 587 } else if (IsSloppyArgumentsElements(elements_kind)) { | 589 } else if (IsSloppyArgumentsElements(elements_kind)) { |
| 588 cached_stub = KeyedLoadSloppyArgumentsStub(isolate()).GetCode(); | 590 cached_stub = KeyedLoadSloppyArgumentsStub(isolate()).GetCode(); |
| 589 } else if (IsFastElementsKind(elements_kind) || | 591 } else if (IsFastElementsKind(elements_kind) || |
| 590 IsFixedTypedArrayElementsKind(elements_kind)) { | 592 IsFixedTypedArrayElementsKind(elements_kind)) { |
| 591 cached_stub = LoadFastElementStub(isolate(), is_js_array, elements_kind, | 593 cached_stub = LoadFastElementStub(isolate(), is_js_array, elements_kind, |
| 592 convert_hole_to_undefined).GetCode(); | 594 convert_hole_to_undefined).GetCode(); |
| 593 } else { | 595 } else { |
| 594 DCHECK(elements_kind == DICTIONARY_ELEMENTS); | 596 DCHECK(elements_kind == DICTIONARY_ELEMENTS); |
| 595 LoadICState state = LoadICState(kNoExtraICState); | 597 LoadICState state = LoadICState(kNoExtraICState); |
| 596 cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode(); | 598 cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode(); |
| 597 } | 599 } |
| 598 } | 600 } |
| 599 | 601 |
| 600 handlers->Add(cached_stub); | 602 handlers->Add(cached_stub); |
| 601 } | 603 } |
| 602 } | 604 } |
| 603 } // namespace internal | 605 } // namespace internal |
| 604 } // namespace v8 | 606 } // namespace v8 |
| OLD | NEW |