Add more code info size dumping to oatdump
Helps break down where oat bytes are being used, example output on
a large app:
OAT FILE STATS:
Dumping cumulative use of 95784720 accounted bytes
Code = 68894196 (72% of total)
QuickMethodHeader = 3071080 ( 3% of total)
CodeInfoEncoding = 1226080 ( 1% of total)
CodeInfoLocationCatalog = 1005716 ( 1% of total)
CodeInfoDexRegisterMap = 5813389 ( 6% of total)
CodeInfoInlineInfo = 2391251 ( 2% of total)
CodeInfoStackMap = 13383008 (14% of total)
StackMapNativePc = 1607888 (12% of stack map)
StackMapDexPcEncoding = 1116724 ( 8% of stack map)
StackMapDexRegisterMap = 1277680 (10% of stack map)
StackMapInlineInfo = 1082720 ( 8% of stack map)
StackMapRegisterMaskEncoding = 5104960 (38% of stack map)
StackMapMask = 3193034 (24% of stack map)
StackMapOther = 0 ( 0% of stack map)
Test: test-art-host, oatdump
Bug: 34621054
Change-Id: I5daf0f1308d126b6a30928f523c6051585f1491f
diff --git a/runtime/stack_map.h b/runtime/stack_map.h
index 28c4b88..cd9a3f0 100644
--- a/runtime/stack_map.h
+++ b/runtime/stack_map.h
@@ -1182,6 +1182,17 @@
}
}
+ size_t GetDexRegisterMapsSize(const CodeInfoEncoding& encoding,
+ uint32_t number_of_dex_registers) const {
+ size_t total = 0;
+ for (size_t i = 0, e = GetNumberOfStackMaps(encoding); i < e; ++i) {
+ StackMap stack_map = GetStackMapAt(i, encoding);
+ DexRegisterMap map(GetDexRegisterMapOf(stack_map, encoding, number_of_dex_registers));
+ total += map.Size();
+ }
+ return total;
+ }
+
// Return the `DexRegisterMap` pointed by `inline_info` at depth `depth`.
DexRegisterMap GetDexRegisterMapAtDepth(uint8_t depth,
InlineInfo inline_info,