OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <memory> | 9 #include <memory> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 4816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4827 | 4827 |
4828 int AccessorInfo::AppendUnique(Handle<Object> descriptors, | 4828 int AccessorInfo::AppendUnique(Handle<Object> descriptors, |
4829 Handle<FixedArray> array, | 4829 Handle<FixedArray> array, |
4830 int valid_descriptors) { | 4830 int valid_descriptors) { |
4831 Handle<TemplateList> callbacks = Handle<TemplateList>::cast(descriptors); | 4831 Handle<TemplateList> callbacks = Handle<TemplateList>::cast(descriptors); |
4832 DCHECK_GE(array->length(), callbacks->length() + valid_descriptors); | 4832 DCHECK_GE(array->length(), callbacks->length() + valid_descriptors); |
4833 return AppendUniqueCallbacks<FixedArrayAppender>(callbacks, array, | 4833 return AppendUniqueCallbacks<FixedArrayAppender>(callbacks, array, |
4834 valid_descriptors); | 4834 valid_descriptors); |
4835 } | 4835 } |
4836 | 4836 |
4837 | 4837 static bool ContainsMap(MapHandles const& maps, Map* map) { |
4838 static bool ContainsMap(MapHandleList* maps, Map* map) { | |
4839 DCHECK_NOT_NULL(map); | 4838 DCHECK_NOT_NULL(map); |
4840 for (int i = 0; i < maps->length(); ++i) { | 4839 for (Handle<Map> current : maps) { |
4841 if (!maps->at(i).is_null() && *maps->at(i) == map) return true; | 4840 if (!current.is_null() && *current == map) return true; |
4842 } | 4841 } |
4843 return false; | 4842 return false; |
4844 } | 4843 } |
4845 | 4844 |
4846 Map* Map::FindElementsKindTransitionedMap(MapHandleList* candidates) { | 4845 Map* Map::FindElementsKindTransitionedMap(MapHandles const& candidates) { |
4847 DisallowHeapAllocation no_allocation; | 4846 DisallowHeapAllocation no_allocation; |
4848 DisallowDeoptimization no_deoptimization(GetIsolate()); | 4847 DisallowDeoptimization no_deoptimization(GetIsolate()); |
4849 | 4848 |
4850 ElementsKind kind = elements_kind(); | 4849 ElementsKind kind = elements_kind(); |
4851 bool packed = IsFastPackedElementsKind(kind); | 4850 bool packed = IsFastPackedElementsKind(kind); |
4852 | 4851 |
4853 Map* transition = nullptr; | 4852 Map* transition = nullptr; |
4854 if (IsTransitionableFastElementsKind(kind)) { | 4853 if (IsTransitionableFastElementsKind(kind)) { |
4855 // Check the state of the root map. | 4854 // Check the state of the root map. |
4856 Map* root_map = FindRootMap(); | 4855 Map* root_map = FindRootMap(); |
(...skipping 15807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20664 // depend on this. | 20663 // depend on this. |
20665 return DICTIONARY_ELEMENTS; | 20664 return DICTIONARY_ELEMENTS; |
20666 } | 20665 } |
20667 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 20666 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
20668 return kind; | 20667 return kind; |
20669 } | 20668 } |
20670 } | 20669 } |
20671 | 20670 |
20672 } // namespace internal | 20671 } // namespace internal |
20673 } // namespace v8 | 20672 } // namespace v8 |
OLD | NEW |