summaryrefslogtreecommitdiff
path: root/compiler/dex/quick/codegen_util.cc
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2014-05-06 21:39:56 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2014-05-06 21:39:56 +0000
commit1f1d2513a11eaaa59601d7599ac2e80ddfa1bcf5 (patch)
tree6c79b4c5babe26d3ae83c06ae3b7119293315359 /compiler/dex/quick/codegen_util.cc
parent9780f97d4864f33150407707e6ca09a8a7a20914 (diff)
parent660188264dee3c8f3510e2e24c11816c6b60f197 (diff)
Merge "ART: Use utils.h::RoundUp instead of explicit bit-fiddling"
Diffstat (limited to 'compiler/dex/quick/codegen_util.cc')
-rw-r--r--compiler/dex/quick/codegen_util.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/dex/quick/codegen_util.cc b/compiler/dex/quick/codegen_util.cc
index 9f84e098d9..de13a2ee69 100644
--- a/compiler/dex/quick/codegen_util.cc
+++ b/compiler/dex/quick/codegen_util.cc
@@ -558,7 +558,7 @@ static int AssignLiteralOffsetCommon(LIR* lir, CodeOffset offset) {
static int AssignLiteralPointerOffsetCommon(LIR* lir, CodeOffset offset,
unsigned int element_size) {
// Align to natural pointer size.
- offset = (offset + (element_size - 1)) & ~(element_size - 1);
+ offset = RoundUp(offset, element_size);
for (; lir != NULL; lir = lir->next) {
lir->offset = offset;
offset += element_size;
@@ -758,7 +758,7 @@ int Mir2Lir::AssignFillArrayDataOffset(CodeOffset offset) {
tab_rec->offset = offset;
offset += tab_rec->size;
// word align
- offset = (offset + 3) & ~3;
+ offset = RoundUp(offset, 4);
}
return offset;
}
@@ -1049,14 +1049,13 @@ size_t Mir2Lir::GetNumBytesForCompilerTempSpillRegion() {
int Mir2Lir::ComputeFrameSize() {
/* Figure out the frame size */
- static const uint32_t kAlignMask = kStackAlignment - 1;
uint32_t size = num_core_spills_ * GetBytesPerGprSpillLocation(cu_->instruction_set)
+ num_fp_spills_ * GetBytesPerFprSpillLocation(cu_->instruction_set)
+ sizeof(uint32_t) // Filler.
+ (cu_->num_regs + cu_->num_outs) * sizeof(uint32_t)
+ GetNumBytesForCompilerTempSpillRegion();
/* Align and set */
- return (size + kAlignMask) & ~(kAlignMask);
+ return RoundUp(size, kStackAlignment);
}
/*