summaryrefslogtreecommitdiff
path: root/compiler/utils/assembler.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2015-06-17 08:45:51 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-06-17 08:45:52 +0000
commit088bd0d28acb70302d20f6e19a9db7f0536c09ee (patch)
treef1c8201a5704b984569b839695a50b9423247ae7 /compiler/utils/assembler.cc
parentb3daa2312747eaf852c948c189ca0745db116447 (diff)
parentcf93a5cd9c978f59113d42f9f642fab5e2cc8877 (diff)
Merge "Revert "Revert "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);