summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2015-06-03 10:51:13 -0700
committer Mathieu Chartier <mathieuc@google.com> 2015-06-03 11:08:37 -0700
commit7c1f53e4253e6acff5e76f00e6bf666518068c4d (patch)
tree3b07161966b6f3f7d0c475ef06d9b274b19f2f16
parent0c46694c182655150d1f8faf7992e844c07710f2 (diff)
Emit instance fields for java.lang.Object in hprof
Previously we omitted these fields. (cherry picked from commit 0adc90eb0592e220f787f87dbef3a9b5c1db2080) Bug: 20726205 Change-Id: I81c55919a4bd015bc0a4e7259a41a05dab534e11
-rw-r--r--runtime/hprof/hprof.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/hprof/hprof.cc b/runtime/hprof/hprof.cc
index 917fe4360f..922fc5f530 100644
--- a/runtime/hprof/hprof.cc
+++ b/runtime/hprof/hprof.cc
@@ -1040,7 +1040,7 @@ void Hprof::DumpHeapClass(mirror::Class* klass) {
}
// Instance fields for this class (no superclass fields)
- int iFieldCount = klass->IsObjectClass() ? 0 : klass->NumInstanceFields();
+ int iFieldCount = klass->NumInstanceFields();
if (klass->IsStringClass()) {
__ AddU2((uint16_t)iFieldCount + 1);
} else {
@@ -1114,7 +1114,7 @@ void Hprof::DumpHeapInstanceObject(mirror::Object* obj, mirror::Class* klass) {
// Write the instance data; fields for this class, followed by super class fields,
// and so on. Don't write the klass or monitor fields of Object.class.
mirror::Class* orig_klass = klass;
- while (!klass->IsObjectClass()) {
+ do {
int ifieldCount = klass->NumInstanceFields();
for (int i = 0; i < ifieldCount; ++i) {
ArtField* f = klass->GetInstanceField(i);
@@ -1146,7 +1146,7 @@ void Hprof::DumpHeapInstanceObject(mirror::Object* obj, mirror::Class* klass) {
}
klass = klass->GetSuperClass();
- }
+ } while (klass != nullptr);
// Output native value character array for strings.
if (orig_klass->IsStringClass()) {