diff options
Diffstat (limited to 'compiler/utils')
21 files changed, 69 insertions, 64 deletions
diff --git a/compiler/utils/arm/assembler_arm_vixl.h b/compiler/utils/arm/assembler_arm_vixl.h index 9c11fd3222..0e73e6bf9e 100644 --- a/compiler/utils/arm/assembler_arm_vixl.h +++ b/compiler/utils/arm/assembler_arm_vixl.h @@ -151,8 +151,8 @@ class ArmVIXLAssembler FINAL : public Assembler { private: class ArmException; public: - explicit ArmVIXLAssembler(ArenaAllocator* arena) - : Assembler(arena) { + explicit ArmVIXLAssembler(ArenaAllocator* allocator) + : Assembler(allocator) { // Use Thumb2 instruction set. vixl_masm_.UseT32(); } diff --git a/compiler/utils/arm/jni_macro_assembler_arm_vixl.h b/compiler/utils/arm/jni_macro_assembler_arm_vixl.h index 13b52e5dc5..e239004506 100644 --- a/compiler/utils/arm/jni_macro_assembler_arm_vixl.h +++ b/compiler/utils/arm/jni_macro_assembler_arm_vixl.h @@ -35,9 +35,9 @@ class ArmVIXLJNIMacroAssembler FINAL private: class ArmException; public: - explicit ArmVIXLJNIMacroAssembler(ArenaAllocator* arena) - : JNIMacroAssemblerFwd(arena), - exception_blocks_(arena->Adapter(kArenaAllocAssembler)) {} + explicit ArmVIXLJNIMacroAssembler(ArenaAllocator* allocator) + : JNIMacroAssemblerFwd(allocator), + exception_blocks_(allocator->Adapter(kArenaAllocAssembler)) {} virtual ~ArmVIXLJNIMacroAssembler() {} void FinalizeCode() OVERRIDE; diff --git a/compiler/utils/arm64/assembler_arm64.h b/compiler/utils/arm64/assembler_arm64.h index 6b28363a8f..e5ec24add0 100644 --- a/compiler/utils/arm64/assembler_arm64.h +++ b/compiler/utils/arm64/assembler_arm64.h @@ -61,7 +61,7 @@ enum StoreOperandType { class Arm64Assembler FINAL : public Assembler { public: - explicit Arm64Assembler(ArenaAllocator* arena) : Assembler(arena) {} + explicit Arm64Assembler(ArenaAllocator* allocator) : Assembler(allocator) {} virtual ~Arm64Assembler() {} diff --git a/compiler/utils/arm64/jni_macro_assembler_arm64.h b/compiler/utils/arm64/jni_macro_assembler_arm64.h index c993bbf957..fda87aa573 100644 --- a/compiler/utils/arm64/jni_macro_assembler_arm64.h +++ b/compiler/utils/arm64/jni_macro_assembler_arm64.h @@ -40,9 +40,9 @@ namespace arm64 { class Arm64JNIMacroAssembler FINAL : public JNIMacroAssemblerFwd<Arm64Assembler, PointerSize::k64> { public: - explicit Arm64JNIMacroAssembler(ArenaAllocator* arena) - : JNIMacroAssemblerFwd(arena), - exception_blocks_(arena->Adapter(kArenaAllocAssembler)) {} + explicit Arm64JNIMacroAssembler(ArenaAllocator* allocator) + : JNIMacroAssemblerFwd(allocator), + exception_blocks_(allocator->Adapter(kArenaAllocAssembler)) {} ~Arm64JNIMacroAssembler(); diff --git a/compiler/utils/assembler.cc b/compiler/utils/assembler.cc index 25eca23af6..944c64b591 100644 --- a/compiler/utils/assembler.cc +++ b/compiler/utils/assembler.cc @@ -25,10 +25,10 @@ namespace art { -AssemblerBuffer::AssemblerBuffer(ArenaAllocator* arena) - : arena_(arena) { +AssemblerBuffer::AssemblerBuffer(ArenaAllocator* allocator) + : allocator_(allocator) { static const size_t kInitialBufferCapacity = 4 * KB; - contents_ = arena_->AllocArray<uint8_t>(kInitialBufferCapacity, kArenaAllocAssembler); + contents_ = allocator_->AllocArray<uint8_t>(kInitialBufferCapacity, kArenaAllocAssembler); cursor_ = contents_; limit_ = ComputeLimit(contents_, kInitialBufferCapacity); fixup_ = nullptr; @@ -45,8 +45,8 @@ AssemblerBuffer::AssemblerBuffer(ArenaAllocator* arena) AssemblerBuffer::~AssemblerBuffer() { - if (arena_->IsRunningOnMemoryTool()) { - arena_->MakeInaccessible(contents_, Capacity()); + if (allocator_->IsRunningOnMemoryTool()) { + allocator_->MakeInaccessible(contents_, Capacity()); } } @@ -81,7 +81,7 @@ void AssemblerBuffer::ExtendCapacity(size_t min_capacity) { // Allocate the new data area and copy contents of the old one to it. contents_ = reinterpret_cast<uint8_t*>( - arena_->Realloc(contents_, old_capacity, new_capacity, kArenaAllocAssembler)); + allocator_->Realloc(contents_, old_capacity, new_capacity, kArenaAllocAssembler)); // Update the cursor and recompute the limit. cursor_ = contents_ + old_size; diff --git a/compiler/utils/assembler.h b/compiler/utils/assembler.h index 314ff8cf7a..dbd35abfcf 100644 --- a/compiler/utils/assembler.h +++ b/compiler/utils/assembler.h @@ -89,11 +89,11 @@ class SlowPath : public DeletableArenaObject<kArenaAllocAssembler> { class AssemblerBuffer { public: - explicit AssemblerBuffer(ArenaAllocator* arena); + explicit AssemblerBuffer(ArenaAllocator* allocator); ~AssemblerBuffer(); - ArenaAllocator* GetArena() { - return arena_; + ArenaAllocator* GetAllocator() { + return allocator_; } // Basic support for emitting, loading, and storing. @@ -252,7 +252,7 @@ class AssemblerBuffer { // for a single, fast space check per instruction. static const int kMinimumGap = 32; - ArenaAllocator* arena_; + ArenaAllocator* allocator_; uint8_t* contents_; uint8_t* cursor_; uint8_t* limit_; @@ -392,8 +392,8 @@ class Assembler : public DeletableArenaObject<kArenaAllocAssembler> { */ DebugFrameOpCodeWriterForAssembler& cfi() { return cfi_; } - ArenaAllocator* GetArena() { - return buffer_.GetArena(); + ArenaAllocator* GetAllocator() { + return buffer_.GetAllocator(); } AssemblerBuffer* GetBuffer() { @@ -401,7 +401,7 @@ class Assembler : public DeletableArenaObject<kArenaAllocAssembler> { } protected: - explicit Assembler(ArenaAllocator* arena) : buffer_(arena), cfi_(this) {} + explicit Assembler(ArenaAllocator* allocator) : buffer_(allocator), cfi_(this) {} AssemblerBuffer buffer_; diff --git a/compiler/utils/assembler_test.h b/compiler/utils/assembler_test.h index 227954e21b..11a9b91600 100644 --- a/compiler/utils/assembler_test.h +++ b/compiler/utils/assembler_test.h @@ -741,8 +741,8 @@ class AssemblerTest : public testing::Test { } // Override this to set up any architecture-specific things, e.g., CPU revision. - virtual Ass* CreateAssembler(ArenaAllocator* arena) { - return new (arena) Ass(arena); + virtual Ass* CreateAssembler(ArenaAllocator* allocator) { + return new (allocator) Ass(allocator); } // Override this to set up any architecture-specific things, e.g., register vectors. 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(); } diff --git a/compiler/utils/jni_macro_assembler.h b/compiler/utils/jni_macro_assembler.h index 72f1ce05ce..0fc1353bf5 100644 --- a/compiler/utils/jni_macro_assembler.h +++ b/compiler/utils/jni_macro_assembler.h @@ -46,7 +46,7 @@ template <PointerSize kPointerSize> class JNIMacroAssembler : public DeletableArenaObject<kArenaAllocAssembler> { public: static std::unique_ptr<JNIMacroAssembler<kPointerSize>> Create( - ArenaAllocator* arena, + ArenaAllocator* allocator, InstructionSet instruction_set, const InstructionSetFeatures* instruction_set_features = nullptr); @@ -275,7 +275,7 @@ class JNIMacroAssemblerFwd : public JNIMacroAssembler<kPointerSize> { } protected: - explicit JNIMacroAssemblerFwd(ArenaAllocator* arena) : asm_(arena) {} + explicit JNIMacroAssemblerFwd(ArenaAllocator* allocator) : asm_(allocator) {} T asm_; }; diff --git a/compiler/utils/jni_macro_assembler_test.h b/compiler/utils/jni_macro_assembler_test.h index 61296802f8..ba95e212bb 100644 --- a/compiler/utils/jni_macro_assembler_test.h +++ b/compiler/utils/jni_macro_assembler_test.h @@ -80,8 +80,8 @@ class JNIMacroAssemblerTest : public testing::Test { } // Override this to set up any architecture-specific things, e.g., CPU revision. - virtual Ass* CreateAssembler(ArenaAllocator* arena) { - return new (arena) Ass(arena); + virtual Ass* CreateAssembler(ArenaAllocator* allocator) { + return new (allocator) Ass(allocator); } // Override this to set up any architecture-specific things, e.g., register vectors. diff --git a/compiler/utils/mips/assembler_mips.h b/compiler/utils/mips/assembler_mips.h index e82693a82d..57b3edd03a 100644 --- a/compiler/utils/mips/assembler_mips.h +++ b/compiler/utils/mips/assembler_mips.h @@ -192,16 +192,16 @@ class MipsAssembler FINAL : public Assembler, public JNIMacroAssembler<PointerSi public: using JNIBase = JNIMacroAssembler<PointerSize::k32>; - explicit MipsAssembler(ArenaAllocator* arena, + explicit MipsAssembler(ArenaAllocator* allocator, const MipsInstructionSetFeatures* instruction_set_features = nullptr) - : Assembler(arena), + : Assembler(allocator), overwriting_(false), overwrite_location_(0), reordering_(true), ds_fsm_state_(kExpectingLabel), ds_fsm_target_pc_(0), - literals_(arena->Adapter(kArenaAllocAssembler)), - jump_tables_(arena->Adapter(kArenaAllocAssembler)), + literals_(allocator->Adapter(kArenaAllocAssembler)), + jump_tables_(allocator->Adapter(kArenaAllocAssembler)), last_position_adjustment_(0), last_old_position_(0), last_branch_id_(0), diff --git a/compiler/utils/mips/assembler_mips32r5_test.cc b/compiler/utils/mips/assembler_mips32r5_test.cc index a3662db935..9a69ffd3dd 100644 --- a/compiler/utils/mips/assembler_mips32r5_test.cc +++ b/compiler/utils/mips/assembler_mips32r5_test.cc @@ -72,8 +72,8 @@ class AssemblerMIPS32r5Test : public AssemblerTest<mips::MipsAssembler, return " -D -bbinary -mmips:isa32r5"; } - mips::MipsAssembler* CreateAssembler(ArenaAllocator* arena) OVERRIDE { - return new (arena) mips::MipsAssembler(arena, instruction_set_features_.get()); + mips::MipsAssembler* CreateAssembler(ArenaAllocator* allocator) OVERRIDE { + return new (allocator) mips::MipsAssembler(allocator, instruction_set_features_.get()); } void SetUpHelpers() OVERRIDE { diff --git a/compiler/utils/mips/assembler_mips32r6_test.cc b/compiler/utils/mips/assembler_mips32r6_test.cc index b6cb30a6f0..b12b6b651c 100644 --- a/compiler/utils/mips/assembler_mips32r6_test.cc +++ b/compiler/utils/mips/assembler_mips32r6_test.cc @@ -85,8 +85,8 @@ class AssemblerMIPS32r6Test : public AssemblerTest<mips::MipsAssembler, return " -D -bbinary -mmips:isa32r6"; } - mips::MipsAssembler* CreateAssembler(ArenaAllocator* arena) OVERRIDE { - return new (arena) mips::MipsAssembler(arena, instruction_set_features_.get()); + mips::MipsAssembler* CreateAssembler(ArenaAllocator* allocator) OVERRIDE { + return new (allocator) mips::MipsAssembler(allocator, instruction_set_features_.get()); } void SetUpHelpers() OVERRIDE { diff --git a/compiler/utils/mips64/assembler_mips64.h b/compiler/utils/mips64/assembler_mips64.h index ee78cdba7e..a3787ac6ae 100644 --- a/compiler/utils/mips64/assembler_mips64.h +++ b/compiler/utils/mips64/assembler_mips64.h @@ -418,14 +418,14 @@ class Mips64Assembler FINAL : public Assembler, public JNIMacroAssembler<Pointer public: using JNIBase = JNIMacroAssembler<PointerSize::k64>; - explicit Mips64Assembler(ArenaAllocator* arena, + explicit Mips64Assembler(ArenaAllocator* allocator, const Mips64InstructionSetFeatures* instruction_set_features = nullptr) - : Assembler(arena), + : Assembler(allocator), overwriting_(false), overwrite_location_(0), - literals_(arena->Adapter(kArenaAllocAssembler)), - long_literals_(arena->Adapter(kArenaAllocAssembler)), - jump_tables_(arena->Adapter(kArenaAllocAssembler)), + literals_(allocator->Adapter(kArenaAllocAssembler)), + long_literals_(allocator->Adapter(kArenaAllocAssembler)), + jump_tables_(allocator->Adapter(kArenaAllocAssembler)), last_position_adjustment_(0), last_old_position_(0), last_branch_id_(0), diff --git a/compiler/utils/mips64/assembler_mips64_test.cc b/compiler/utils/mips64/assembler_mips64_test.cc index 16a36f9069..bf0326de87 100644 --- a/compiler/utils/mips64/assembler_mips64_test.cc +++ b/compiler/utils/mips64/assembler_mips64_test.cc @@ -83,8 +83,8 @@ class AssemblerMIPS64Test : public AssemblerTest<mips64::Mips64Assembler, return " -D -bbinary -mmips:isa64r6"; } - mips64::Mips64Assembler* CreateAssembler(ArenaAllocator* arena) OVERRIDE { - return new (arena) mips64::Mips64Assembler(arena, instruction_set_features_.get()); + mips64::Mips64Assembler* CreateAssembler(ArenaAllocator* allocator) OVERRIDE { + return new (allocator) mips64::Mips64Assembler(allocator, instruction_set_features_.get()); } void SetUpHelpers() OVERRIDE { diff --git a/compiler/utils/x86/assembler_x86.h b/compiler/utils/x86/assembler_x86.h index dce3ad228c..f3b516cb7e 100644 --- a/compiler/utils/x86/assembler_x86.h +++ b/compiler/utils/x86/assembler_x86.h @@ -266,7 +266,8 @@ class NearLabel : private Label { */ class ConstantArea { public: - explicit ConstantArea(ArenaAllocator* arena) : buffer_(arena->Adapter(kArenaAllocAssembler)) {} + explicit ConstantArea(ArenaAllocator* allocator) + : buffer_(allocator->Adapter(kArenaAllocAssembler)) {} // Add a double to the constant area, returning the offset into // the constant area where the literal resides. @@ -307,7 +308,8 @@ class ConstantArea { class X86Assembler FINAL : public Assembler { public: - explicit X86Assembler(ArenaAllocator* arena) : Assembler(arena), constant_area_(arena) {} + explicit X86Assembler(ArenaAllocator* allocator) + : Assembler(allocator), constant_area_(allocator) {} virtual ~X86Assembler() {} /* diff --git a/compiler/utils/x86/jni_macro_assembler_x86.cc b/compiler/utils/x86/jni_macro_assembler_x86.cc index 2b3c65b852..7e29c4aa26 100644 --- a/compiler/utils/x86/jni_macro_assembler_x86.cc +++ b/compiler/utils/x86/jni_macro_assembler_x86.cc @@ -518,7 +518,7 @@ void X86JNIMacroAssembler::GetCurrentThread(FrameOffset offset, } void X86JNIMacroAssembler::ExceptionPoll(ManagedRegister /*scratch*/, size_t stack_adjust) { - X86ExceptionSlowPath* slow = new (__ GetArena()) X86ExceptionSlowPath(stack_adjust); + X86ExceptionSlowPath* slow = new (__ GetAllocator()) X86ExceptionSlowPath(stack_adjust); __ GetBuffer()->EnqueueSlowPath(slow); __ fs()->cmpl(Address::Absolute(Thread::ExceptionOffset<kX86PointerSize>()), Immediate(0)); __ j(kNotEqual, slow->Entry()); diff --git a/compiler/utils/x86/jni_macro_assembler_x86.h b/compiler/utils/x86/jni_macro_assembler_x86.h index 75cdd1eefc..56eaf1951e 100644 --- a/compiler/utils/x86/jni_macro_assembler_x86.h +++ b/compiler/utils/x86/jni_macro_assembler_x86.h @@ -34,7 +34,7 @@ class X86JNIMacroLabel; class X86JNIMacroAssembler FINAL : public JNIMacroAssemblerFwd<X86Assembler, PointerSize::k32> { public: - explicit X86JNIMacroAssembler(ArenaAllocator* arena) : JNIMacroAssemblerFwd(arena) {} + explicit X86JNIMacroAssembler(ArenaAllocator* allocator) : JNIMacroAssemblerFwd(allocator) {} virtual ~X86JNIMacroAssembler() {} // diff --git a/compiler/utils/x86_64/assembler_x86_64.h b/compiler/utils/x86_64/assembler_x86_64.h index 11304443e0..0d24a751c0 100644 --- a/compiler/utils/x86_64/assembler_x86_64.h +++ b/compiler/utils/x86_64/assembler_x86_64.h @@ -290,7 +290,8 @@ std::ostream& operator<<(std::ostream& os, const Address& addr); */ class ConstantArea { public: - explicit ConstantArea(ArenaAllocator* arena) : buffer_(arena->Adapter(kArenaAllocAssembler)) {} + explicit ConstantArea(ArenaAllocator* allocator) + : buffer_(allocator->Adapter(kArenaAllocAssembler)) {} // Add a double to the constant area, returning the offset into // the constant area where the literal resides. @@ -352,7 +353,8 @@ class NearLabel : private Label { class X86_64Assembler FINAL : public Assembler { public: - explicit X86_64Assembler(ArenaAllocator* arena) : Assembler(arena), constant_area_(arena) {} + explicit X86_64Assembler(ArenaAllocator* allocator) + : Assembler(allocator), constant_area_(allocator) {} virtual ~X86_64Assembler() {} /* diff --git a/compiler/utils/x86_64/jni_macro_assembler_x86_64.cc b/compiler/utils/x86_64/jni_macro_assembler_x86_64.cc index 72d9c43e9a..5766f9d44b 100644 --- a/compiler/utils/x86_64/jni_macro_assembler_x86_64.cc +++ b/compiler/utils/x86_64/jni_macro_assembler_x86_64.cc @@ -584,9 +584,10 @@ class X86_64ExceptionSlowPath FINAL : public SlowPath { }; void X86_64JNIMacroAssembler::ExceptionPoll(ManagedRegister /*scratch*/, size_t stack_adjust) { - X86_64ExceptionSlowPath* slow = new (__ GetArena()) X86_64ExceptionSlowPath(stack_adjust); + X86_64ExceptionSlowPath* slow = new (__ GetAllocator()) X86_64ExceptionSlowPath(stack_adjust); __ GetBuffer()->EnqueueSlowPath(slow); - __ gs()->cmpl(Address::Absolute(Thread::ExceptionOffset<kX86_64PointerSize>(), true), Immediate(0)); + __ gs()->cmpl(Address::Absolute(Thread::ExceptionOffset<kX86_64PointerSize>(), true), + Immediate(0)); __ j(kNotEqual, slow->Entry()); } diff --git a/compiler/utils/x86_64/jni_macro_assembler_x86_64.h b/compiler/utils/x86_64/jni_macro_assembler_x86_64.h index 734ed964c1..d1a3032a56 100644 --- a/compiler/utils/x86_64/jni_macro_assembler_x86_64.h +++ b/compiler/utils/x86_64/jni_macro_assembler_x86_64.h @@ -34,8 +34,8 @@ namespace x86_64 { class X86_64JNIMacroAssembler FINAL : public JNIMacroAssemblerFwd<X86_64Assembler, PointerSize::k64> { public: - explicit X86_64JNIMacroAssembler(ArenaAllocator* arena) - : JNIMacroAssemblerFwd<X86_64Assembler, PointerSize::k64>(arena) {} + explicit X86_64JNIMacroAssembler(ArenaAllocator* allocator) + : JNIMacroAssemblerFwd<X86_64Assembler, PointerSize::k64>(allocator) {} virtual ~X86_64JNIMacroAssembler() {} // |