summaryrefslogtreecommitdiff
path: root/compiler/utils/assembler.cc
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2017-10-09 10:24:27 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-10-09 10:24:27 +0000
commit464f8cd7385a9958c3171e2feaa93c726043bbf8 (patch)
tree3ad72d1411c91c68361a1179581decc0e4d96f03 /compiler/utils/assembler.cc
parente4c00b3af3ccf460e4b0332a04dc9eaeffee5c7a (diff)
parentca6fff898afcb62491458ae8bcd428bfb3043da1 (diff)
Merge "ART: Use ScopedArenaAllocator for pass-local data."
Diffstat (limited to 'compiler/utils/assembler.cc')
-rw-r--r--compiler/utils/assembler.cc12
1 files changed, 6 insertions, 6 deletions
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;