diff options
author | 2017-10-12 09:05:08 +0000 | |
---|---|---|
committer | 2017-10-12 09:05:08 +0000 | |
commit | 0284f43d625f0776ee0586a7cc321e11f5405e8c (patch) | |
tree | 983c86ff79f2a5a089bfa44ec27a5f2c5d6206b6 /compiler/utils | |
parent | 128acd4b5b34cdd51328de03df085deaa040b864 (diff) | |
parent | 52d52f5dc3e005829926e68c656fb27e8b008ae9 (diff) |
Merge changes I4bbb21bf,Ie79b46cd,Ia50aafc8
* changes:
Use ScopedArenaAllocator in GVN.
Use ScopedArenaAllocator for Phi elimination pass.
Use ScopedArenaAllocator for building HGraph.
Diffstat (limited to 'compiler/utils')
-rw-r--r-- | compiler/utils/assembler.h | 2 | ||||
-rw-r--r-- | compiler/utils/assembler_test.h | 8 | ||||
-rw-r--r-- | compiler/utils/assembler_thumb_test.cc | 12 | ||||
-rw-r--r-- | compiler/utils/jni_macro_assembler_test.h | 8 | ||||
-rw-r--r-- | compiler/utils/x86/assembler_x86_test.cc | 4 | ||||
-rw-r--r-- | compiler/utils/x86_64/assembler_x86_64_test.cc | 4 |
6 files changed, 18 insertions, 20 deletions
diff --git a/compiler/utils/assembler.h b/compiler/utils/assembler.h index dbd35abfcf..e0cef859e1 100644 --- a/compiler/utils/assembler.h +++ b/compiler/utils/assembler.h @@ -252,7 +252,7 @@ class AssemblerBuffer { // for a single, fast space check per instruction. static const int kMinimumGap = 32; - ArenaAllocator* allocator_; + ArenaAllocator* const allocator_; uint8_t* contents_; uint8_t* cursor_; uint8_t* limit_; diff --git a/compiler/utils/assembler_test.h b/compiler/utils/assembler_test.h index 11a9b91600..ae7636b106 100644 --- a/compiler/utils/assembler_test.h +++ b/compiler/utils/assembler_test.h @@ -719,8 +719,8 @@ class AssemblerTest : public testing::Test { explicit AssemblerTest() {} void SetUp() OVERRIDE { - arena_.reset(new ArenaAllocator(&pool_)); - assembler_.reset(CreateAssembler(arena_.get())); + allocator_.reset(new ArenaAllocator(&pool_)); + assembler_.reset(CreateAssembler(allocator_.get())); test_helper_.reset( new AssemblerTestInfrastructure(GetArchitectureString(), GetAssemblerCmdName(), @@ -737,7 +737,7 @@ class AssemblerTest : public testing::Test { void TearDown() OVERRIDE { test_helper_.reset(); // Clean up the helper. assembler_.reset(); - arena_.reset(); + allocator_.reset(); } // Override this to set up any architecture-specific things, e.g., CPU revision. @@ -1589,7 +1589,7 @@ class AssemblerTest : public testing::Test { static constexpr size_t kWarnManyCombinationsThreshold = 500; ArenaPool pool_; - std::unique_ptr<ArenaAllocator> arena_; + std::unique_ptr<ArenaAllocator> allocator_; std::unique_ptr<Ass> assembler_; std::unique_ptr<AssemblerTestInfrastructure> test_helper_; diff --git a/compiler/utils/assembler_thumb_test.cc b/compiler/utils/assembler_thumb_test.cc index 5622f89529..5307d17bb0 100644 --- a/compiler/utils/assembler_thumb_test.cc +++ b/compiler/utils/assembler_thumb_test.cc @@ -167,10 +167,10 @@ void DumpAndCheck(std::vector<uint8_t>& code, const char* testname, const char* class ArmVIXLAssemblerTest : public ::testing::Test { public: - ArmVIXLAssemblerTest() : pool(), arena(&pool), assembler(&arena) { } + ArmVIXLAssemblerTest() : pool(), allocator(&pool), assembler(&allocator) { } ArenaPool pool; - ArenaAllocator arena; + ArenaAllocator allocator; ArmVIXLJNIMacroAssembler assembler; }; @@ -209,18 +209,16 @@ TEST_F(ArmVIXLAssemblerTest, VixlJniHelpers) { const bool is_critical_native = false; const char* shorty = "IIFII"; - ArenaPool pool; - ArenaAllocator arena(&pool); - std::unique_ptr<JniCallingConvention> jni_conv( - JniCallingConvention::Create(&arena, + JniCallingConvention::Create(&allocator, is_static, is_synchronized, is_critical_native, shorty, kThumb2)); std::unique_ptr<ManagedRuntimeCallingConvention> mr_conv( - ManagedRuntimeCallingConvention::Create(&arena, is_static, is_synchronized, shorty, kThumb2)); + ManagedRuntimeCallingConvention::Create( + &allocator, is_static, is_synchronized, shorty, kThumb2)); const int frame_size(jni_conv->FrameSize()); ArrayRef<const ManagedRegister> callee_save_regs = jni_conv->CalleeSaveRegisters(); diff --git a/compiler/utils/jni_macro_assembler_test.h b/compiler/utils/jni_macro_assembler_test.h index ba95e212bb..34ab4c3e43 100644 --- a/compiler/utils/jni_macro_assembler_test.h +++ b/compiler/utils/jni_macro_assembler_test.h @@ -58,8 +58,8 @@ class JNIMacroAssemblerTest : public testing::Test { explicit JNIMacroAssemblerTest() {} void SetUp() OVERRIDE { - arena_.reset(new ArenaAllocator(&pool_)); - assembler_.reset(CreateAssembler(arena_.get())); + allocator_.reset(new ArenaAllocator(&pool_)); + assembler_.reset(CreateAssembler(allocator_.get())); test_helper_.reset( new AssemblerTestInfrastructure(GetArchitectureString(), GetAssemblerCmdName(), @@ -76,7 +76,7 @@ class JNIMacroAssemblerTest : public testing::Test { void TearDown() OVERRIDE { test_helper_.reset(); // Clean up the helper. assembler_.reset(); - arena_.reset(); + allocator_.reset(); } // Override this to set up any architecture-specific things, e.g., CPU revision. @@ -140,7 +140,7 @@ class JNIMacroAssemblerTest : public testing::Test { } ArenaPool pool_; - std::unique_ptr<ArenaAllocator> arena_; + std::unique_ptr<ArenaAllocator> allocator_; std::unique_ptr<Ass> assembler_; std::unique_ptr<AssemblerTestInfrastructure> test_helper_; diff --git a/compiler/utils/x86/assembler_x86_test.cc b/compiler/utils/x86/assembler_x86_test.cc index cccde37548..e232addd26 100644 --- a/compiler/utils/x86/assembler_x86_test.cc +++ b/compiler/utils/x86/assembler_x86_test.cc @@ -24,8 +24,8 @@ namespace art { TEST(AssemblerX86, CreateBuffer) { ArenaPool pool; - ArenaAllocator arena(&pool); - AssemblerBuffer buffer(&arena); + ArenaAllocator allocator(&pool); + AssemblerBuffer buffer(&allocator); AssemblerBuffer::EnsureCapacity ensured(&buffer); buffer.Emit<uint8_t>(0x42); ASSERT_EQ(static_cast<size_t>(1), buffer.Size()); diff --git a/compiler/utils/x86_64/assembler_x86_64_test.cc b/compiler/utils/x86_64/assembler_x86_64_test.cc index b08ba4a03a..0cb3ffd39f 100644 --- a/compiler/utils/x86_64/assembler_x86_64_test.cc +++ b/compiler/utils/x86_64/assembler_x86_64_test.cc @@ -30,8 +30,8 @@ namespace art { TEST(AssemblerX86_64, CreateBuffer) { ArenaPool pool; - ArenaAllocator arena(&pool); - AssemblerBuffer buffer(&arena); + ArenaAllocator allocator(&pool); + AssemblerBuffer buffer(&allocator); AssemblerBuffer::EnsureCapacity ensured(&buffer); buffer.Emit<uint8_t>(0x42); ASSERT_EQ(static_cast<size_t>(1), buffer.Size()); |