| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/api.h" | 7 #include "src/api.h" |
| 8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 if (is_holey) elements_kind = GetHoleyElementsKind(elements_kind); | 982 if (is_holey) elements_kind = GetHoleyElementsKind(elements_kind); |
| 983 } | 983 } |
| 984 | 984 |
| 985 // If a double array is concatted into a fast elements array, the fast | 985 // If a double array is concatted into a fast elements array, the fast |
| 986 // elements array needs to be initialized to contain proper holes, since | 986 // elements array needs to be initialized to contain proper holes, since |
| 987 // boxing doubles may cause incremental marking. | 987 // boxing doubles may cause incremental marking. |
| 988 ArrayStorageAllocationMode mode = | 988 ArrayStorageAllocationMode mode = |
| 989 has_double && IsFastObjectElementsKind(elements_kind) | 989 has_double && IsFastObjectElementsKind(elements_kind) |
| 990 ? INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE : DONT_INITIALIZE_ARRAY_ELEMENTS; | 990 ? INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE : DONT_INITIALIZE_ARRAY_ELEMENTS; |
| 991 Handle<JSArray> result_array = isolate->factory()->NewJSArray( | 991 Handle<JSArray> result_array = isolate->factory()->NewJSArray( |
| 992 elements_kind, result_len, result_len, WEAK, mode); | 992 elements_kind, result_len, result_len, Strength::WEAK, mode); |
| 993 if (result_len == 0) return *result_array; | 993 if (result_len == 0) return *result_array; |
| 994 | 994 |
| 995 int j = 0; | 995 int j = 0; |
| 996 Handle<FixedArrayBase> storage(result_array->elements(), isolate); | 996 Handle<FixedArrayBase> storage(result_array->elements(), isolate); |
| 997 ElementsAccessor* accessor = ElementsAccessor::ForKind(elements_kind); | 997 ElementsAccessor* accessor = ElementsAccessor::ForKind(elements_kind); |
| 998 for (int i = 0; i < n_arguments; i++) { | 998 for (int i = 0; i < n_arguments; i++) { |
| 999 // It is crucial to keep |array| in a raw pointer form to avoid performance | 999 // It is crucial to keep |array| in a raw pointer form to avoid performance |
| 1000 // degradation. | 1000 // degradation. |
| 1001 JSArray* array = JSArray::cast(args[i]); | 1001 JSArray* array = JSArray::cast(args[i]); |
| 1002 int len = Smi::cast(array->length())->value(); | 1002 int len = Smi::cast(array->length())->value(); |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1654 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1654 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 1655 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1655 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1656 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1656 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 1657 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1657 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1658 #undef DEFINE_BUILTIN_ACCESSOR_C | 1658 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 1659 #undef DEFINE_BUILTIN_ACCESSOR_A | 1659 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 1660 | 1660 |
| 1661 | 1661 |
| 1662 } // namespace internal | 1662 } // namespace internal |
| 1663 } // namespace v8 | 1663 } // namespace v8 |
| OLD | NEW |