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 4814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4825 | 4825 |
4826 int AccessorInfo::AppendUnique(Handle<Object> descriptors, | 4826 int AccessorInfo::AppendUnique(Handle<Object> descriptors, |
4827 Handle<FixedArray> array, | 4827 Handle<FixedArray> array, |
4828 int valid_descriptors) { | 4828 int valid_descriptors) { |
4829 Handle<TemplateList> callbacks = Handle<TemplateList>::cast(descriptors); | 4829 Handle<TemplateList> callbacks = Handle<TemplateList>::cast(descriptors); |
4830 DCHECK_GE(array->length(), callbacks->length() + valid_descriptors); | 4830 DCHECK_GE(array->length(), callbacks->length() + valid_descriptors); |
4831 return AppendUniqueCallbacks<FixedArrayAppender>(callbacks, array, | 4831 return AppendUniqueCallbacks<FixedArrayAppender>(callbacks, array, |
4832 valid_descriptors); | 4832 valid_descriptors); |
4833 } | 4833 } |
4834 | 4834 |
4835 | 4835 static bool ContainsMap(MapHandles const& maps, Map* map) { |
4836 static bool ContainsMap(MapHandleList* maps, Map* map) { | |
4837 DCHECK_NOT_NULL(map); | 4836 DCHECK_NOT_NULL(map); |
4838 for (int i = 0; i < maps->length(); ++i) { | 4837 for (Handle<Map> current : maps) { |
4839 if (!maps->at(i).is_null() && *maps->at(i) == map) return true; | 4838 if (!current.is_null() && *current == map) return true; |
4840 } | 4839 } |
4841 return false; | 4840 return false; |
4842 } | 4841 } |
4843 | 4842 |
4844 Map* Map::FindElementsKindTransitionedMap(MapHandleList* candidates) { | 4843 Map* Map::FindElementsKindTransitionedMap(MapHandles const& candidates) { |
4845 DisallowHeapAllocation no_allocation; | 4844 DisallowHeapAllocation no_allocation; |
4846 DisallowDeoptimization no_deoptimization(GetIsolate()); | 4845 DisallowDeoptimization no_deoptimization(GetIsolate()); |
4847 | 4846 |
4848 ElementsKind kind = elements_kind(); | 4847 ElementsKind kind = elements_kind(); |
4849 bool packed = IsFastPackedElementsKind(kind); | 4848 bool packed = IsFastPackedElementsKind(kind); |
4850 | 4849 |
4851 Map* transition = nullptr; | 4850 Map* transition = nullptr; |
4852 if (IsTransitionableFastElementsKind(kind)) { | 4851 if (IsTransitionableFastElementsKind(kind)) { |
4853 // Check the state of the root map. | 4852 // Check the state of the root map. |
4854 Map* root_map = FindRootMap(); | 4853 Map* root_map = FindRootMap(); |
(...skipping 15809 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 |