28 #ifndef V8_SPLAY_TREE_H_
29 #define V8_SPLAY_TREE_H_
53 template <
typename Config,
class AllocationPolicy>
56 typedef typename Config::Key
Key;
57 typedef typename Config::Value
Value;
66 AllocationPolicy
allocator = AllocationPolicy())) {
67 return allocator.New(static_cast<int>(size));
69 INLINE(
void operator delete(
void* p)) {
70 AllocationPolicy::Delete(p);
73 INLINE(
void operator delete(
void* p, AllocationPolicy policy)) {
85 bool Insert(
const Key& key, Locator* locator);
90 bool Find(
const Key& key, Locator* locator);
107 bool Move(
const Key& old_key,
const Key& new_key);
132 return allocator.New(static_cast<int>(size));
135 return AllocationPolicy::Delete(p);
172 template <
class Callback>
173 void ForEach(Callback* callback);
182 bool FindInternal(
const Key& key);
185 void InsertInternal(
int cmp, Node* node);
188 void RemoveRootNode(
const Key& key);
190 template<
class Callback>
194 : callback_(callback) { }
196 callback_->Call(node->
key(), node->
value());
208 void Call(
Node* node) { AllocationPolicy::Delete(node); }
214 template <
class Callback>
215 void ForEachNode(Callback* callback);
218 AllocationPolicy allocator_;
226 #endif // V8_SPLAY_TREE_H_
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
bool Find(const Key &key, Locator *locator)
bool Insert(const Key &key, Locator *locator)
INLINE(void operator delete(void *p, AllocationPolicy policy))
bool FindGreatest(Locator *locator)
void Splay(const Key &key)
INLINE(void operator delete(void *p))
bool Contains(const Key &key)
void ForEach(Callback *callback)
Node(const Key &key, const Value &value)
INLINE(void *operator new(size_t size, AllocationPolicy allocator))
INLINE(void *operator new(size_t size, AllocationPolicy allocator=AllocationPolicy()))
NodeToPairAdaptor(Callback *callback)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object size
bool FindLeast(Locator *locator)
bool Move(const Key &old_key, const Key &new_key)
INLINE(void operator delete(void *p))
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
bool FindLeastGreaterThan(const Key &key, Locator *locator)
bool Remove(const Key &key)
bool FindGreatestLessThan(const Key &key, Locator *locator)
INLINE(void operator delete(void *p, AllocationPolicy allocator))
AllocationPolicy allocator()
void set_value(const Value &value)
SplayTree(AllocationPolicy allocator=AllocationPolicy())