diff options
author | David Brazdil <dbrazdil@google.com> | 2015-03-24 10:51:52 +0000 |
---|---|---|
committer | David Brazdil <dbrazdil@google.com> | 2015-03-26 14:10:03 +0000 |
commit | 8d5b8b295930aaa43255c4f0b74ece3ee8b43a47 (patch) | |
tree | c26fc49bbc74615e7f0b9657aaf3757a8282d7a9 /runtime/base | |
parent | c8924c6ea9e83ba3832dd5551df38ab06f4aaca9 (diff) | |
download | art-8d5b8b295930aaa43255c4f0b74ece3ee8b43a47.tar.gz art-8d5b8b295930aaa43255c4f0b74ece3ee8b43a47.tar.bz2 art-8d5b8b295930aaa43255c4f0b74ece3ee8b43a47.zip |
ART: Force constants into the entry block
Optimizations such as GVN and BCE make the assumption that all
constants are located in the entry block of the CFG, but not all
passes adhere to this rule.
This patch makes constructors of constants private and only accessible
to friend classes - HGraph for int/long constants and SsaBuilder for
float/double - which ensure that they are placed correctly and not
duplicated.
Note that the ArenaAllocatorAdapter was modified to not increment
the ArenaAllocator's internal reference counter in order to allow
for use of ArenaSafeMap inside an arena-allocated objects. Because
their destructor is not called, the counter does not get decremented.
Change-Id: I36a4fa29ae34fb905cdefd482ccbf386cff14166
Diffstat (limited to 'runtime/base')
-rw-r--r-- | runtime/base/arena_containers.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/runtime/base/arena_containers.h b/runtime/base/arena_containers.h index ceff6e85a3..e6fe6c0ad4 100644 --- a/runtime/base/arena_containers.h +++ b/runtime/base/arena_containers.h @@ -85,8 +85,7 @@ class ArenaAllocatorAdapterKindImpl { typedef ArenaAllocatorAdapterKindImpl<kArenaAllocatorCountAllocations> ArenaAllocatorAdapterKind; template <> -class ArenaAllocatorAdapter<void> - : private DebugStackReference, private ArenaAllocatorAdapterKind { +class ArenaAllocatorAdapter<void> : private ArenaAllocatorAdapterKind { public: typedef void value_type; typedef void* pointer; @@ -99,14 +98,12 @@ class ArenaAllocatorAdapter<void> explicit ArenaAllocatorAdapter(ArenaAllocator* arena_allocator, ArenaAllocKind kind = kArenaAllocSTL) - : DebugStackReference(arena_allocator), - ArenaAllocatorAdapterKind(kind), + : ArenaAllocatorAdapterKind(kind), arena_allocator_(arena_allocator) { } template <typename U> ArenaAllocatorAdapter(const ArenaAllocatorAdapter<U>& other) - : DebugStackReference(other), - ArenaAllocatorAdapterKind(other), + : ArenaAllocatorAdapterKind(other), arena_allocator_(other.arena_allocator_) { } ArenaAllocatorAdapter(const ArenaAllocatorAdapter&) = default; @@ -121,7 +118,7 @@ class ArenaAllocatorAdapter<void> }; template <typename T> -class ArenaAllocatorAdapter : private DebugStackReference, private ArenaAllocatorAdapterKind { +class ArenaAllocatorAdapter : private ArenaAllocatorAdapterKind { public: typedef T value_type; typedef T* pointer; @@ -137,14 +134,12 @@ class ArenaAllocatorAdapter : private DebugStackReference, private ArenaAllocato }; explicit ArenaAllocatorAdapter(ArenaAllocator* arena_allocator, ArenaAllocKind kind) - : DebugStackReference(arena_allocator), - ArenaAllocatorAdapterKind(kind), + : ArenaAllocatorAdapterKind(kind), arena_allocator_(arena_allocator) { } template <typename U> ArenaAllocatorAdapter(const ArenaAllocatorAdapter<U>& other) - : DebugStackReference(other), - ArenaAllocatorAdapterKind(other), + : ArenaAllocatorAdapterKind(other), arena_allocator_(other.arena_allocator_) { } ArenaAllocatorAdapter(const ArenaAllocatorAdapter&) = default; |