Always log the value when an alignment check fails.
And move checking that the alignment is a power of two to compile-time.
Change-Id: I551f364af05912958ed2d4d095b1ce35b6abaf6e
diff --git a/src/class_linker.cc b/src/class_linker.cc
index bd23b2d..eda60ca 100644
--- a/src/class_linker.cc
+++ b/src/class_linker.cc
@@ -2387,7 +2387,7 @@
// Now we want to pack all of the double-wide fields together. If
// we're not aligned, though, we want to shuffle one 32-bit field
// into place. If we can't find one, we'll have to pad it.
- if (current_field != num_fields && !IsAligned(field_offset.Uint32Value(), 8)) {
+ if (current_field != num_fields && !IsAligned<8>(field_offset.Uint32Value())) {
for (size_t i = 0; i < grouped_and_sorted_fields.size(); i++) {
Field* field = grouped_and_sorted_fields[i];
const Class* type = field->GetTypeDuringLinking();
@@ -2408,7 +2408,7 @@
// Alignment is good, shuffle any double-wide fields forward, and
// finish assigning field offsets to all fields.
- DCHECK(current_field == num_fields || IsAligned(field_offset.Uint32Value(), 8));
+ DCHECK(current_field == num_fields || IsAligned<8>(field_offset.Uint32Value()));
while (!grouped_and_sorted_fields.empty()) {
Field* field = grouped_and_sorted_fields.front();
grouped_and_sorted_fields.pop_front();