summaryrefslogtreecommitdiff
path: root/compiler/utils/assembler.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2015-06-16 09:06:59 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-06-16 09:07:00 +0000
commite4394f7de28ae0b517daa033749979e46ff676ab (patch)
tree320596587f320a0becda91cfe4fa72c8052fb90a /compiler/utils/assembler.cc
parentf6c77d7632bdfe564c2ba61690fecc65f10ea9f6 (diff)
parentf38caa68cce551fb153dff37d01db518e58ed00f (diff)
Merge "ART: Implement literal pool for arm, fix branch fixup."
Diffstat (limited to 'compiler/utils/assembler.cc')
-rw-r--r--compiler/utils/assembler.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/utils/assembler.cc b/compiler/utils/assembler.cc
index b016e74aba..6d8a98931f 100644
--- a/compiler/utils/assembler.cc
+++ b/compiler/utils/assembler.cc
@@ -80,10 +80,11 @@ void AssemblerBuffer::FinalizeInstructions(const MemoryRegion& instructions) {
}
-void AssemblerBuffer::ExtendCapacity() {
+void AssemblerBuffer::ExtendCapacity(size_t min_capacity) {
size_t old_size = Size();
size_t old_capacity = Capacity();
size_t new_capacity = std::min(old_capacity * 2, old_capacity + 1 * MB);
+ new_capacity = std::max(new_capacity, min_capacity);
// Allocate the new data area and copy contents of the old one to it.
uint8_t* new_contents = NewContents(new_capacity);