diff options
Diffstat (limited to 'deps/v8/src/small-pointer-list.h')
-rw-r--r-- | deps/v8/src/small-pointer-list.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/deps/v8/src/small-pointer-list.h b/deps/v8/src/small-pointer-list.h index 6c5ce890d2..75fea061ad 100644 --- a/deps/v8/src/small-pointer-list.h +++ b/deps/v8/src/small-pointer-list.h @@ -69,6 +69,12 @@ class SmallPointerList { data_ = kEmptyTag; } + void Sort() { + if ((data_ & kTagMask) == kListTag) { + list()->Sort(compare_value); + } + } + bool is_empty() const { return length() == 0; } int length() const { @@ -159,6 +165,10 @@ class SmallPointerList { private: typedef ZoneList<T*> PointerList; + static int compare_value(T* const* a, T* const* b) { + return Compare<T>(**a, **b); + } + static const intptr_t kEmptyTag = 1; static const intptr_t kSingletonTag = 0; static const intptr_t kListTag = 2; |