oatdump: Dump embedded vtable.
Test: m dump-oat
Bug: 324173873
Change-Id: I9058f5d3172f3cc685f77305885f94db3b7391fd
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_);