diff options
Diffstat (limited to 'compiler/dex/dataflow_iterator.h')
-rw-r--r-- | compiler/dex/dataflow_iterator.h | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/compiler/dex/dataflow_iterator.h b/compiler/dex/dataflow_iterator.h index 12f924e321..658a9b1c46 100644 --- a/compiler/dex/dataflow_iterator.h +++ b/compiler/dex/dataflow_iterator.h @@ -138,6 +138,21 @@ namespace art { return ForwardSingleNext(); } + + /** + * @brief Redefine the new operator to use the arena + * @param size actually unused, we use our own class size + * @param arena the arena to perform the actual allocation + * @return the pointer to the newly allocated object + */ + static void* operator new(size_t size, ArenaAllocator* arena) { + return arena->Alloc(sizeof(PreOrderDfsIterator), ArenaAllocator::kAllocGrowableBitMap); + } + + /** + * @brief Redefine delete to not actually delete anything since we are using the arena + */ + static void operator delete(void* p) {} }; /** @@ -169,6 +184,21 @@ namespace art { return ForwardRepeatNext(); } + + /** + * @brief Redefine the new operator to use the arena + * @param size actually unused, we use our own class size + * @param arena the arena to perform the actual allocation + * @return the pointer to the newly allocated object + */ + static void* operator new(size_t size, ArenaAllocator* arena) { + return arena->Alloc(sizeof(RepeatingPreOrderDfsIterator), ArenaAllocator::kAllocGrowableBitMap); + } + + /** + * @brief Redefine delete to not actually delete anything since we are using the arena + */ + static void operator delete(void* p) {} }; /** @@ -200,6 +230,21 @@ namespace art { return ForwardRepeatNext(); } + + /** + * @brief Redefine the new operator to use the arena + * @param size actually unused, we use our own class size + * @param arena the arena to perform the actual allocation + * @return the pointer to the newly allocated object + */ + static void* operator new(size_t size, ArenaAllocator* arena) { + return arena->Alloc(sizeof(RepeatingPostOrderDfsIterator), ArenaAllocator::kAllocGrowableBitMap); + } + + /** + * @brief Redefine delete to not actually delete anything since we are using the arena + */ + static void operator delete(void* p) {} }; /** @@ -230,6 +275,21 @@ namespace art { return ReverseSingleNext(); } + + /** + * @brief Redefine the new operator to use the arena + * @param size actually unused, we use our own class size + * @param arena the arena to perform the actual allocation + * @return the pointer to the newly allocated object + */ + static void* operator new(size_t size, ArenaAllocator* arena) { + return arena->Alloc(sizeof(ReversePostOrderDfsIterator), ArenaAllocator::kAllocGrowableBitMap); + } + + /** + * @brief Redefine delete to not actually delete anything since we are using the arena + */ + static void operator delete(void* p) {} }; /** @@ -261,6 +321,21 @@ namespace art { return ReverseRepeatNext(); } + + /** + * @brief Redefine the new operator to use the arena + * @param size actually unused, we use our own class size + * @param arena the arena to perform the actual allocation + * @return the pointer to the newly allocated object + */ + static void* operator new(size_t size, ArenaAllocator* arena) { + return arena->Alloc(sizeof(RepeatingReversePostOrderDfsIterator), ArenaAllocator::kAllocGrowableBitMap); + } + + /** + * @brief Redefine delete to not actually delete anything since we are using the arena + */ + static void operator delete(void* p) {} }; /** @@ -291,6 +366,21 @@ namespace art { return ForwardSingleNext(); } + + /** + * @brief Redefine the new operator to use the arena + * @param size actually unused, we use our own class size + * @param arena the arena to perform the actual allocation + * @return the pointer to the newly allocated object + */ + static void* operator new(size_t size, ArenaAllocator* arena) { + return arena->Alloc(sizeof(PostOrderDOMIterator), ArenaAllocator::kAllocGrowableBitMap); + } + + /** + * @brief Redefine delete to not actually delete anything since we are using the arena + */ + static void operator delete(void* p) {} }; /** @@ -323,6 +413,21 @@ namespace art { */ virtual BasicBlock* Next(bool had_change = false) ALWAYS_INLINE; + /** + * @brief Redefine the new operator to use the arena + * @param size actually unused, we use our own class size + * @param arena the arena to perform the actual allocation + * @return the pointer to the newly allocated object + */ + static void* operator new(size_t size, ArenaAllocator* arena) { + return arena->Alloc(sizeof(AllNodesIterator), ArenaAllocator::kAllocGrowableBitMap); + } + + /** + * @brief Redefine delete to not actually delete anything since we are using the arena + */ + static void operator delete(void* p) {} + private: GrowableArray<BasicBlock*>::Iterator* all_nodes_iterator_; /**< @brief The list of all the nodes */ }; |