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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | 586 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
587 ElementsKind elements_kind = receiver_map->elements_kind(); | 587 ElementsKind elements_kind = receiver_map->elements_kind(); |
588 | 588 |
589 // No need to check for an elements-free prototype chain here, the | 589 // No need to check for an elements-free prototype chain here, the |
590 // generated stub code needs to check that dynamically anyway. | 590 // generated stub code needs to check that dynamically anyway. |
591 bool convert_hole_to_undefined = | 591 bool convert_hole_to_undefined = |
592 (is_js_array && elements_kind == FAST_HOLEY_ELEMENTS && | 592 (is_js_array && elements_kind == FAST_HOLEY_ELEMENTS && |
593 *receiver_map == isolate()->get_initial_js_array_map(elements_kind)); | 593 *receiver_map == isolate()->get_initial_js_array_map(elements_kind)); |
594 | 594 |
595 if (receiver_map->has_indexed_interceptor() && | 595 if (receiver_map->has_indexed_interceptor() && |
596 !receiver_map->GetIndexedInterceptor()->getter()->IsUndefined() && | 596 !receiver_map->GetIndexedInterceptor()->getter()->IsUndefined( |
| 597 isolate()) && |
597 !receiver_map->GetIndexedInterceptor()->non_masking()) { | 598 !receiver_map->GetIndexedInterceptor()->non_masking()) { |
598 cached_stub = LoadIndexedInterceptorStub(isolate()).GetCode(); | 599 cached_stub = LoadIndexedInterceptorStub(isolate()).GetCode(); |
599 } else if (IsSloppyArgumentsElements(elements_kind)) { | 600 } else if (IsSloppyArgumentsElements(elements_kind)) { |
600 cached_stub = KeyedLoadSloppyArgumentsStub(isolate()).GetCode(); | 601 cached_stub = KeyedLoadSloppyArgumentsStub(isolate()).GetCode(); |
601 } else if (IsFastElementsKind(elements_kind) || | 602 } else if (IsFastElementsKind(elements_kind) || |
602 IsFixedTypedArrayElementsKind(elements_kind)) { | 603 IsFixedTypedArrayElementsKind(elements_kind)) { |
603 cached_stub = LoadFastElementStub(isolate(), is_js_array, elements_kind, | 604 cached_stub = LoadFastElementStub(isolate(), is_js_array, elements_kind, |
604 convert_hole_to_undefined).GetCode(); | 605 convert_hole_to_undefined).GetCode(); |
605 } else { | 606 } else { |
606 DCHECK(elements_kind == DICTIONARY_ELEMENTS); | 607 DCHECK(elements_kind == DICTIONARY_ELEMENTS); |
607 LoadICState state = LoadICState(kNoExtraICState); | 608 LoadICState state = LoadICState(kNoExtraICState); |
608 cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode(); | 609 cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode(); |
609 } | 610 } |
610 } | 611 } |
611 | 612 |
612 handlers->Add(cached_stub); | 613 handlers->Add(cached_stub); |
613 } | 614 } |
614 } | 615 } |
615 } // namespace internal | 616 } // namespace internal |
616 } // namespace v8 | 617 } // namespace v8 |
OLD | NEW |