oatdump: Dump embedded vtable. am: 0ccf2d58c6
Original change: https://android-review.googlesource.com/c/platform/art/+/2982031
Change-Id: I0463881e25255418a66c50a4ab8c31e4df7b6204
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc
index 69dc23a..a93ad37 100644
--- a/oatdump/oatdump.cc
+++ b/oatdump/oatdump.cc
@@ -2109,7 +2109,7 @@
if (obj_class->IsArrayClass()) {
os << StringPrintf("%p: %s length:%d\n", obj, obj_class->PrettyDescriptor().c_str(),
obj->AsArray()->GetLength());
- } else if (obj->IsClass()) {
+ } else if (obj_class->IsClassClass()) {
ObjPtr<mirror::Class> klass = obj->AsClass();
os << StringPrintf("%p: java.lang.Class \"%s\" (",
obj,
@@ -2146,7 +2146,7 @@
(value == nullptr) ? obj_class->GetComponentType() : value->GetClass();
PrettyObjectValue(os, value_class, value);
}
- } else if (obj->IsClass()) {
+ } else if (obj_class->IsClassClass()) {
ObjPtr<mirror::Class> klass = obj->AsClass();
if (kBitstringSubtypeCheckEnabled) {
@@ -2155,6 +2155,16 @@
os << "\n";
}
+ if (klass->ShouldHaveEmbeddedVTable()) {
+ os << "EMBEDDED VTABLE:\n";
+ ScopedIndentation indent2(&vios_);
+ const PointerSize pointer_size = image_header_.GetPointerSize();
+ for (size_t i = 0, length = klass->GetEmbeddedVTableLength(); i != length; ++i) {
+ os << i << ": "
+ << ArtMethod::PrettyMethod(klass->GetEmbeddedVTableEntry(i, pointer_size)) << '\n';
+ }
+ }
+
if (klass->NumStaticFields() != 0) {
os << "STATICS:\n";
ScopedIndentation indent2(&vios_);