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;
61 SplayTree(AllocationPolicy allocator = AllocationPolicy())
62 : root_(
NULL), allocator_(allocator) { }
65 INLINE(
void*
operator new(
size_t size,
66 AllocationPolicy allocator = AllocationPolicy())) {
67 return allocator.New(static_cast<int>(size));
69 INLINE(
void operator delete(
void* p,
size_t)) {
70 AllocationPolicy::Delete(p);
76 bool Insert(
const Key& key, Locator* locator);
81 bool Find(
const Key& key, Locator* locator);
98 bool Move(
const Key& old_key,
const Key& new_key);
119 INLINE(
void*
operator new(
size_t size, AllocationPolicy allocator)) {
120 return allocator.New(static_cast<int>(size));
122 INLINE(
void operator delete(
void* p,
size_t)) {
123 return AllocationPolicy::Delete(p);
155 template <
class Callback>
156 void ForEach(Callback* callback);
165 bool FindInternal(
const Key& key);
168 void InsertInternal(
int cmp, Node* node);
171 void RemoveRootNode(
const Key& key);
173 template<
class Callback>
177 : callback_(callback) { }
179 callback_->Call(node->
key(), node->
value());
191 void Call(
Node* node) { AllocationPolicy::Delete(node); }
197 template <
class Callback>
198 void ForEachNode(Callback* callback);
201 AllocationPolicy allocator_;
209 #endif // V8_SPLAY_TREE_H_
bool Find(const Key &key, Locator *locator)
bool Insert(const Key &key, Locator *locator)
bool FindGreatest(Locator *locator)
void Splay(const Key &key)
INLINE(void operator delete(void *p, size_t))
void ForEach(Callback *callback)
Node(const Key &key, const Value &value)
INLINE(void *operator new(size_t size, AllocationPolicy allocator))
INLINE(void operator delete(void *p, size_t))
INLINE(void *operator new(size_t size, AllocationPolicy allocator=AllocationPolicy()))
NodeToPairAdaptor(Callback *callback)
bool FindLeast(Locator *locator)
bool Move(const Key &old_key, const Key &new_key)
#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)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination trace on stack replacement optimize closures functions with arguments object optimize functions containing for in loops profiler considers IC stability primitive functions trigger their own optimization re try self optimization if it failed insert an interrupt check at function exit execution budget before interrupt is triggered call count before self optimization self_optimization count_based_interrupts weighted_back_edges trace_opt emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 enable use of ARMv7 instructions if enable use of MIPS FPU instructions if NULL
void set_value(const Value &value)
SplayTree(AllocationPolicy allocator=AllocationPolicy())