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/elements.h" | 9 #include "src/elements.h" |
10 | 10 |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 // holes across concat operations. | 1077 // holes across concat operations. |
1078 storage = | 1078 storage = |
1079 isolate->factory()->NewFixedArrayWithHoles(estimate_result_length); | 1079 isolate->factory()->NewFixedArrayWithHoles(estimate_result_length); |
1080 } else if (is_array_species) { | 1080 } else if (is_array_species) { |
1081 // TODO(126): move 25% pre-allocation logic into Dictionary::Allocate | 1081 // TODO(126): move 25% pre-allocation logic into Dictionary::Allocate |
1082 uint32_t at_least_space_for = | 1082 uint32_t at_least_space_for = |
1083 estimate_nof_elements + (estimate_nof_elements >> 2); | 1083 estimate_nof_elements + (estimate_nof_elements >> 2); |
1084 storage = SeededNumberDictionary::New(isolate, at_least_space_for); | 1084 storage = SeededNumberDictionary::New(isolate, at_least_space_for); |
1085 } else { | 1085 } else { |
1086 DCHECK(species->IsConstructor()); | 1086 DCHECK(species->IsConstructor()); |
1087 Handle<Object> length(Smi::kZero, isolate); | 1087 Handle<Object> length(Smi::FromInt(0), isolate); |
1088 Handle<Object> storage_object; | 1088 Handle<Object> storage_object; |
1089 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 1089 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
1090 isolate, storage_object, | 1090 isolate, storage_object, |
1091 Execution::New(isolate, species, species, 1, &length)); | 1091 Execution::New(isolate, species, species, 1, &length)); |
1092 storage = storage_object; | 1092 storage = storage_object; |
1093 } | 1093 } |
1094 | 1094 |
1095 ArrayConcatVisitor visitor(isolate, storage, fast_case); | 1095 ArrayConcatVisitor visitor(isolate, storage, fast_case); |
1096 | 1096 |
1097 for (int i = 0; i < argument_count; i++) { | 1097 for (int i = 0; i < argument_count; i++) { |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 assembler->Bind(&return_not_found); | 2058 assembler->Bind(&return_not_found); |
2059 assembler->Return(assembler->NumberConstant(-1)); | 2059 assembler->Return(assembler->NumberConstant(-1)); |
2060 | 2060 |
2061 assembler->Bind(&call_runtime); | 2061 assembler->Bind(&call_runtime); |
2062 assembler->Return(assembler->CallRuntime(Runtime::kArrayIndexOf, context, | 2062 assembler->Return(assembler->CallRuntime(Runtime::kArrayIndexOf, context, |
2063 array, search_element, start_from)); | 2063 array, search_element, start_from)); |
2064 } | 2064 } |
2065 | 2065 |
2066 } // namespace internal | 2066 } // namespace internal |
2067 } // namespace v8 | 2067 } // namespace v8 |
OLD | NEW |