OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/builtins/builtins.h" | 5 #include "src/builtins/builtins.h" |
6 #include "src/builtins/builtins-utils.h" | 6 #include "src/builtins/builtins-utils.h" |
7 | 7 |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/contexts.h" | 9 #include "src/contexts.h" |
10 #include "src/elements.h" | 10 #include "src/elements.h" |
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 if (JSObject::kMaxElementCount - estimate_nof_elements < element_estimate) { | 984 if (JSObject::kMaxElementCount - estimate_nof_elements < element_estimate) { |
985 estimate_nof_elements = JSObject::kMaxElementCount; | 985 estimate_nof_elements = JSObject::kMaxElementCount; |
986 } else { | 986 } else { |
987 estimate_nof_elements += element_estimate; | 987 estimate_nof_elements += element_estimate; |
988 } | 988 } |
989 }); | 989 }); |
990 | 990 |
991 // If estimated number of elements is more than half of length, a | 991 // If estimated number of elements is more than half of length, a |
992 // fixed array (fast case) is more time and space-efficient than a | 992 // fixed array (fast case) is more time and space-efficient than a |
993 // dictionary. | 993 // dictionary. |
994 bool fast_case = | 994 bool fast_case = is_array_species && |
995 is_array_species && (estimate_nof_elements * 2) >= estimate_result_length; | 995 (estimate_nof_elements * 2) >= estimate_result_length && |
| 996 isolate->IsIsConcatSpreadableLookupChainIntact(); |
996 | 997 |
997 if (fast_case && kind == FAST_DOUBLE_ELEMENTS) { | 998 if (fast_case && kind == FAST_DOUBLE_ELEMENTS) { |
998 Handle<FixedArrayBase> storage = | 999 Handle<FixedArrayBase> storage = |
999 isolate->factory()->NewFixedDoubleArray(estimate_result_length); | 1000 isolate->factory()->NewFixedDoubleArray(estimate_result_length); |
1000 int j = 0; | 1001 int j = 0; |
1001 bool failure = false; | 1002 bool failure = false; |
1002 if (estimate_result_length > 0) { | 1003 if (estimate_result_length > 0) { |
1003 Handle<FixedDoubleArray> double_storage = | 1004 Handle<FixedDoubleArray> double_storage = |
1004 Handle<FixedDoubleArray>::cast(storage); | 1005 Handle<FixedDoubleArray>::cast(storage); |
1005 for (int i = 0; i < argument_count; i++) { | 1006 for (int i = 0; i < argument_count; i++) { |
(...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2613 Runtime::kThrowIncompatibleMethodReceiver, context, | 2614 Runtime::kThrowIncompatibleMethodReceiver, context, |
2614 assembler.HeapConstant(assembler.factory()->NewStringFromAsciiChecked( | 2615 assembler.HeapConstant(assembler.factory()->NewStringFromAsciiChecked( |
2615 "Array Iterator.prototype.next", TENURED)), | 2616 "Array Iterator.prototype.next", TENURED)), |
2616 iterator); | 2617 iterator); |
2617 assembler.Return(result); | 2618 assembler.Return(result); |
2618 } | 2619 } |
2619 } | 2620 } |
2620 | 2621 |
2621 } // namespace internal | 2622 } // namespace internal |
2622 } // namespace v8 | 2623 } // namespace v8 |
OLD | NEW |