diff options
| author | 2016-04-13 11:59:46 +0100 | |
|---|---|---|
| committer | 2016-04-13 17:50:16 +0100 | |
| commit | 93205e395f777c1dd81d3f164cf9a4aec4bde45f (patch) | |
| tree | 1d08efd9b7bca9fe23df9ae9489c5dd575d3c6df /compiler/utils/x86/assembler_x86.h | |
| parent | 6990775e323cd9164d6cc10955a047b9d9f15f32 (diff) | |
Move Assemblers to the Arena.
And clean up some APIs to return std::unique_ptr<> instead
of raw pointers that don't communicate ownership.
Change-Id: I3017302307a0253d661240750298802fb0d9585e
Diffstat (limited to 'compiler/utils/x86/assembler_x86.h')
| -rw-r--r-- | compiler/utils/x86/assembler_x86.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/compiler/utils/x86/assembler_x86.h b/compiler/utils/x86/assembler_x86.h index 00ff7bdbbd..8567ad2a17 100644 --- a/compiler/utils/x86/assembler_x86.h +++ b/compiler/utils/x86/assembler_x86.h @@ -18,12 +18,15 @@ #define ART_COMPILER_UTILS_X86_ASSEMBLER_X86_H_ #include <vector> + +#include "base/arena_containers.h" #include "base/bit_utils.h" #include "base/macros.h" #include "constants_x86.h" #include "globals.h" #include "managed_register_x86.h" #include "offsets.h" +#include "utils/array_ref.h" #include "utils/assembler.h" namespace art { @@ -260,7 +263,7 @@ class NearLabel : private Label { */ class ConstantArea { public: - ConstantArea() {} + explicit ConstantArea(ArenaAllocator* arena) : buffer_(arena->Adapter(kArenaAllocAssembler)) {} // Add a double to the constant area, returning the offset into // the constant area where the literal resides. @@ -290,18 +293,18 @@ class ConstantArea { return buffer_.size() * elem_size_; } - const std::vector<int32_t>& GetBuffer() const { - return buffer_; + ArrayRef<const int32_t> GetBuffer() const { + return ArrayRef<const int32_t>(buffer_); } private: static constexpr size_t elem_size_ = sizeof(int32_t); - std::vector<int32_t> buffer_; + ArenaVector<int32_t> buffer_; }; class X86Assembler FINAL : public Assembler { public: - X86Assembler() {} + explicit X86Assembler(ArenaAllocator* arena) : Assembler(arena), constant_area_(arena) {} virtual ~X86Assembler() {} /* |