Clean up arena objects in Mir2Lir.
Change-Id: I93fca37be2ae100ddebf80b6ba7a561b187e8886
diff --git a/compiler/dex/quick/mir_to_lir.h b/compiler/dex/quick/mir_to_lir.h
index f4f4dfc..4623f79 100644
--- a/compiler/dex/quick/mir_to_lir.h
+++ b/compiler/dex/quick/mir_to_lir.h
@@ -319,13 +319,10 @@
* Working plan is, for all targets, to follow mechanism 1 for 64-bit core registers, and
* mechanism 2 for aliased float registers and x86 vector registers.
*/
- class RegisterInfo {
+ class RegisterInfo : public ArenaObject<kArenaAllocRegAlloc> {
public:
RegisterInfo(RegStorage r, const ResourceMask& mask = kEncodeAll);
~RegisterInfo() {}
- static void* operator new(size_t size, ArenaAllocator* arena) {
- return arena->Alloc(size, kArenaAllocRegAlloc);
- }
static const uint32_t k32SoloStorageMask = 0x00000001;
static const uint32_t kLowSingleStorageMask = 0x00000001;
@@ -421,7 +418,7 @@
RegisterInfo* alias_chain_; // Chain of aliased registers.
};
- class RegisterPool {
+ class RegisterPool : public DeletableArenaObject<kArenaAllocRegAlloc> {
public:
RegisterPool(Mir2Lir* m2l, ArenaAllocator* arena,
const ArrayRef<const RegStorage>& core_regs,
@@ -435,10 +432,6 @@
const ArrayRef<const RegStorage>& sp_temps,
const ArrayRef<const RegStorage>& dp_temps);
~RegisterPool() {}
- static void* operator new(size_t size, ArenaAllocator* arena) {
- return arena->Alloc(size, kArenaAllocRegAlloc);
- }
- static void operator delete(void* ptr) { UNUSED(ptr); }
void ResetNextTemp() {
next_core_reg_ = 0;
next_sp_reg_ = 0;
@@ -511,10 +504,6 @@
virtual ~LIRSlowPath() {}
virtual void Compile() = 0;
- static void* operator new(size_t size, ArenaAllocator* arena) {
- return arena->Alloc(size, kArenaAllocData);
- }
-
LIR *GetContinuationLabel() {
return cont_;
}