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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/cpu-profiler.h" | 7 #include "src/cpu-profiler.h" |
8 #include "src/ic/call-optimization.h" | 8 #include "src/ic/call-optimization.h" |
9 #include "src/ic/handler-compiler.h" | 9 #include "src/ic/handler-compiler.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 Handle<Map> receiver_map = receiver_maps->at(i); | 529 Handle<Map> receiver_map = receiver_maps->at(i); |
530 Handle<Code> cached_stub; | 530 Handle<Code> cached_stub; |
531 | 531 |
532 if (receiver_map->IsStringMap()) { | 532 if (receiver_map->IsStringMap()) { |
533 cached_stub = LoadIndexedStringStub(isolate()).GetCode(); | 533 cached_stub = LoadIndexedStringStub(isolate()).GetCode(); |
534 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { | 534 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { |
535 cached_stub = isolate()->builtins()->KeyedLoadIC_Slow(); | 535 cached_stub = isolate()->builtins()->KeyedLoadIC_Slow(); |
536 } else { | 536 } else { |
537 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | 537 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
538 ElementsKind elements_kind = receiver_map->elements_kind(); | 538 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 539 bool convert_hole_to_undefined = |
| 540 is_js_array && elements_kind == FAST_HOLEY_ELEMENTS && |
| 541 *receiver_map == isolate()->get_initial_js_array_map(elements_kind); |
539 if (receiver_map->has_indexed_interceptor()) { | 542 if (receiver_map->has_indexed_interceptor()) { |
540 cached_stub = LoadIndexedInterceptorStub(isolate()).GetCode(); | 543 cached_stub = LoadIndexedInterceptorStub(isolate()).GetCode(); |
541 } else if (IsSloppyArgumentsElements(elements_kind)) { | 544 } else if (IsSloppyArgumentsElements(elements_kind)) { |
542 cached_stub = KeyedLoadSloppyArgumentsStub(isolate()).GetCode(); | 545 cached_stub = KeyedLoadSloppyArgumentsStub(isolate()).GetCode(); |
543 } else if (IsFastElementsKind(elements_kind) || | 546 } else if (IsFastElementsKind(elements_kind) || |
544 IsExternalArrayElementsKind(elements_kind) || | 547 IsExternalArrayElementsKind(elements_kind) || |
545 IsFixedTypedArrayElementsKind(elements_kind)) { | 548 IsFixedTypedArrayElementsKind(elements_kind)) { |
546 cached_stub = LoadFastElementStub(isolate(), is_js_array, elements_kind) | 549 cached_stub = LoadFastElementStub(isolate(), is_js_array, elements_kind, |
547 .GetCode(); | 550 convert_hole_to_undefined).GetCode(); |
548 } else { | 551 } else { |
549 DCHECK(elements_kind == DICTIONARY_ELEMENTS); | 552 DCHECK(elements_kind == DICTIONARY_ELEMENTS); |
550 cached_stub = LoadDictionaryElementStub(isolate()).GetCode(); | 553 cached_stub = LoadDictionaryElementStub(isolate()).GetCode(); |
551 } | 554 } |
552 } | 555 } |
553 | 556 |
554 handlers->Add(cached_stub); | 557 handlers->Add(cached_stub); |
555 } | 558 } |
556 } | 559 } |
557 } | 560 } |
558 } // namespace v8::internal | 561 } // namespace v8::internal |
OLD | NEW |