From e764d2e50c544c2cb98ee61a15d613161ac6bd17 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 5 Oct 2017 14:35:55 +0100 Subject: 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 --- compiler/utils/jni_macro_assembler.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'compiler/utils/jni_macro_assembler.cc') 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> template <> MacroAsm32UniquePtr JNIMacroAssembler::Create( - ArenaAllocator* arena, + ArenaAllocator* allocator, InstructionSet instruction_set, const InstructionSetFeatures* instruction_set_features) { #ifndef ART_ENABLE_CODEGEN_mips @@ -58,19 +58,19 @@ MacroAsm32UniquePtr JNIMacroAssembler::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> template <> MacroAsm64UniquePtr JNIMacroAssembler::Create( - ArenaAllocator* arena, + ArenaAllocator* allocator, InstructionSet instruction_set, const InstructionSetFeatures* instruction_set_features) { #ifndef ART_ENABLE_CODEGEN_mips64 @@ -92,22 +92,22 @@ MacroAsm64UniquePtr JNIMacroAssembler::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(); } -- cgit v1.2.3-59-g8ed1b