diff options
author | 2017-10-05 14:35:55 +0100 | |
---|---|---|
committer | 2017-10-09 10:39:22 +0100 | |
commit | e764d2e50c544c2cb98ee61a15d613161ac6bd17 (patch) | |
tree | 112aa7ca459d2edb4f800897060a2407fcc622c7 /compiler/utils/jni_macro_assembler.cc | |
parent | ca6fff898afcb62491458ae8bcd428bfb3043da1 (diff) |
Use ScopedArenaAllocator for register allocation.
Memory needed to compile the two most expensive methods for
aosp_angler-userdebug boot image:
BatteryStats.dumpCheckinLocked() : 25.1MiB -> 21.1MiB
BatteryStats.dumpLocked(): 49.6MiB -> 42.0MiB
This is because all the memory previously used by Scheduler
is reused by the register allocator; the register allocator
has a higher peak usage of the ArenaStack.
And continue the "arena"->"allocator" renaming.
Test: m test-art-host-gtest
Test: testrunner.py --host
Bug: 64312607
Change-Id: Idfd79a9901552b5147ec0bf591cb38120de86b01
Diffstat (limited to 'compiler/utils/jni_macro_assembler.cc')
-rw-r--r-- | compiler/utils/jni_macro_assembler.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/compiler/utils/jni_macro_assembler.cc b/compiler/utils/jni_macro_assembler.cc index 3ac6c3ca7a..0616b35a39 100644 --- a/compiler/utils/jni_macro_assembler.cc +++ b/compiler/utils/jni_macro_assembler.cc @@ -47,7 +47,7 @@ using MacroAsm32UniquePtr = std::unique_ptr<JNIMacroAssembler<PointerSize::k32>> template <> MacroAsm32UniquePtr JNIMacroAssembler<PointerSize::k32>::Create( - ArenaAllocator* arena, + ArenaAllocator* allocator, InstructionSet instruction_set, const InstructionSetFeatures* instruction_set_features) { #ifndef ART_ENABLE_CODEGEN_mips @@ -58,19 +58,19 @@ MacroAsm32UniquePtr JNIMacroAssembler<PointerSize::k32>::Create( #ifdef ART_ENABLE_CODEGEN_arm case kArm: case kThumb2: - return MacroAsm32UniquePtr(new (arena) arm::ArmVIXLJNIMacroAssembler(arena)); + return MacroAsm32UniquePtr(new (allocator) arm::ArmVIXLJNIMacroAssembler(allocator)); #endif #ifdef ART_ENABLE_CODEGEN_mips case kMips: - return MacroAsm32UniquePtr(new (arena) mips::MipsAssembler( - arena, + return MacroAsm32UniquePtr(new (allocator) mips::MipsAssembler( + allocator, instruction_set_features != nullptr ? instruction_set_features->AsMipsInstructionSetFeatures() : nullptr)); #endif #ifdef ART_ENABLE_CODEGEN_x86 case kX86: - return MacroAsm32UniquePtr(new (arena) x86::X86JNIMacroAssembler(arena)); + return MacroAsm32UniquePtr(new (allocator) x86::X86JNIMacroAssembler(allocator)); #endif default: LOG(FATAL) << "Unknown/unsupported 4B InstructionSet: " << instruction_set; @@ -82,7 +82,7 @@ using MacroAsm64UniquePtr = std::unique_ptr<JNIMacroAssembler<PointerSize::k64>> template <> MacroAsm64UniquePtr JNIMacroAssembler<PointerSize::k64>::Create( - ArenaAllocator* arena, + ArenaAllocator* allocator, InstructionSet instruction_set, const InstructionSetFeatures* instruction_set_features) { #ifndef ART_ENABLE_CODEGEN_mips64 @@ -92,22 +92,22 @@ MacroAsm64UniquePtr JNIMacroAssembler<PointerSize::k64>::Create( switch (instruction_set) { #ifdef ART_ENABLE_CODEGEN_arm64 case kArm64: - return MacroAsm64UniquePtr(new (arena) arm64::Arm64JNIMacroAssembler(arena)); + return MacroAsm64UniquePtr(new (allocator) arm64::Arm64JNIMacroAssembler(allocator)); #endif #ifdef ART_ENABLE_CODEGEN_mips64 case kMips64: - return MacroAsm64UniquePtr(new (arena) mips64::Mips64Assembler( - arena, + return MacroAsm64UniquePtr(new (allocator) mips64::Mips64Assembler( + allocator, instruction_set_features != nullptr ? instruction_set_features->AsMips64InstructionSetFeatures() : nullptr)); #endif #ifdef ART_ENABLE_CODEGEN_x86_64 case kX86_64: - return MacroAsm64UniquePtr(new (arena) x86_64::X86_64JNIMacroAssembler(arena)); + return MacroAsm64UniquePtr(new (allocator) x86_64::X86_64JNIMacroAssembler(allocator)); #endif default: - UNUSED(arena); + UNUSED(allocator); LOG(FATAL) << "Unknown/unsupported 8B InstructionSet: " << instruction_set; UNREACHABLE(); } |