Optimizing: Tag arena allocations in code generators.
And completely remove the deprecated GrowableArray.
Replace GrowableArray with ArenaVector in code generators
and related classes and tag arena allocations.
Label arrays use direct allocations from ArenaAllocator
because Label is non-copyable and non-movable and as such
cannot be really held in a container. The GrowableArray
never actually constructed them, instead relying on the
zero-initialized storage from the arena allocator to be
correct. We now actually construct the labels.
Also avoid StackMapStream::ComputeDexRegisterMapSize() being
passed null references, even though unused.
Change-Id: I26a46fdd406b23a3969300a67739d55528df8bf4
diff --git a/runtime/base/arena_allocator.cc b/runtime/base/arena_allocator.cc
index c1a1088..691b57f 100644
--- a/runtime/base/arena_allocator.cc
+++ b/runtime/base/arena_allocator.cc
@@ -89,6 +89,9 @@
"PrimTypeProp ",
"SideEffects ",
"RegAllocator ",
+ "StackMapStm ",
+ "CodeGen ",
+ "ParallelMove ",
};
template <bool kCount>
diff --git a/runtime/base/arena_allocator.h b/runtime/base/arena_allocator.h
index be96862..17045c6 100644
--- a/runtime/base/arena_allocator.h
+++ b/runtime/base/arena_allocator.h
@@ -99,6 +99,9 @@
kArenaAllocPrimitiveTypePropagation,
kArenaAllocSideEffectsAnalysis,
kArenaAllocRegisterAllocator,
+ kArenaAllocStackMapStream,
+ kArenaAllocCodeGenerator,
+ kArenaAllocParallelMoveResolver,
kNumArenaAllocKinds
};
diff --git a/runtime/base/arena_object.h b/runtime/base/arena_object.h
index ab97d0c..56e35d8 100644
--- a/runtime/base/arena_object.h
+++ b/runtime/base/arena_object.h
@@ -40,6 +40,10 @@
LOG(FATAL) << "UNREACHABLE";
UNREACHABLE();
}
+
+ // NOTE: Providing placement new (and matching delete) for constructing container elements.
+ ALWAYS_INLINE void* operator new(size_t, void* ptr) noexcept { return ptr; }
+ ALWAYS_INLINE void operator delete(void*, void*) noexcept { }
};