summaryrefslogtreecommitdiff
path: root/runtime/quick/inline_method_analyser.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2016-03-09 13:45:39 +0000
committer Vladimir Marko <vmarko@google.com> 2016-03-09 14:47:17 +0000
commit8b3f835f0cca5db53a727d1d77fc6c2430d53d51 (patch)
tree6e2615ec05df27d961969c1b1e005acc3b70d245 /runtime/quick/inline_method_analyser.cc
parent5bdcdca7e4b3acc1ed8a7112a93c3f2da490b606 (diff)
ART: Write bit fields together in ComputeSpecialAccessorInfo().
Avoid function calls between storing individual bit fields to allow the compiler (gcc/clang) to merge those writes together. Valgrind then marks the memory as "defined" while individual bit field writes would leave it "undefined" and later trigger the valgrind error: Conditional jump or move depends on uninitialised value(s) on DCHECK()s using the bit fields. Bug: 27552451 Change-Id: If6de5cbe231f99da0f974a0fc9a36c14e3dc071e
Diffstat (limited to 'runtime/quick/inline_method_analyser.cc')
-rw-r--r--runtime/quick/inline_method_analyser.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/quick/inline_method_analyser.cc b/runtime/quick/inline_method_analyser.cc
index 9b10f2e0b8..c7ccee2125 100644
--- a/runtime/quick/inline_method_analyser.cc
+++ b/runtime/quick/inline_method_analyser.cc
@@ -744,9 +744,12 @@ bool InlineMethodAnalyser::ComputeSpecialAccessorInfo(ArtMethod* method,
return false;
}
DCHECK_GE(field->GetOffset().Int32Value(), 0);
+ // Do not interleave function calls with bit field writes to placate valgrind. Bug: 27552451.
+ uint32_t field_offset = field->GetOffset().Uint32Value();
+ bool is_volatile = field->IsVolatile();
result->field_idx = field_idx;
- result->field_offset = field->GetOffset().Int32Value();
- result->is_volatile = field->IsVolatile();
+ result->field_offset = field_offset;
+ result->is_volatile = is_volatile ? 1u : 0u;
return true;
}