diff options
Diffstat (limited to 'deps/v8/src/zone/zone-list-inl.h')
-rw-r--r-- | deps/v8/src/zone/zone-list-inl.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/deps/v8/src/zone/zone-list-inl.h b/deps/v8/src/zone/zone-list-inl.h index a0e4b1950b..aca54133f9 100644 --- a/deps/v8/src/zone/zone-list-inl.h +++ b/deps/v8/src/zone/zone-list-inl.h @@ -9,7 +9,7 @@ #include "src/base/macros.h" #include "src/base/platform/platform.h" -#include "src/memcopy.h" +#include "src/utils/memcopy.h" namespace v8 { namespace internal { @@ -34,7 +34,7 @@ void ZoneList<T>::AddAll(const Vector<T>& other, Zone* zone) { if (capacity_ < result_length) Resize(result_length, ZoneAllocationPolicy(zone)); if (std::is_fundamental<T>()) { - memcpy(data_ + length_, other.start(), sizeof(*data_) * other.length()); + memcpy(data_ + length_, other.begin(), sizeof(*data_) * other.length()); } else { for (int i = 0; i < other.length(); i++) data_[length_ + i] = other.at(i); } @@ -133,7 +133,8 @@ void ZoneList<T>::Iterate(Visitor* visitor) { template <typename T> template <typename CompareFunction> void ZoneList<T>::Sort(CompareFunction cmp) { - ToVector().Sort(cmp, 0, length_); + std::sort(begin(), end(), + [cmp](const T& a, const T& b) { return cmp(&a, &b) < 0; }); #ifdef DEBUG for (int i = 1; i < length_; i++) { DCHECK_LE(cmp(&data_[i - 1], &data_[i]), 0); @@ -144,7 +145,8 @@ void ZoneList<T>::Sort(CompareFunction cmp) { template <typename T> template <typename CompareFunction> void ZoneList<T>::StableSort(CompareFunction cmp, size_t s, size_t l) { - ToVector().StableSort(cmp, s, l); + std::stable_sort(begin() + s, begin() + s + l, + [cmp](const T& a, const T& b) { return cmp(&a, &b) < 0; }); #ifdef DEBUG for (size_t i = s + 1; i < l; i++) { DCHECK_LE(cmp(&data_[i - 1], &data_[i]), 0); |