Use bit-level packing for InlineInfo in stackmaps as well.
Use the same approach as we do for stackmaps to reduce the size.
It saves 4.0 MB from non-debuggable boot.oat (AOSP).
It does not affect debuggable boot.oat.
It saves 3.6 MB (of 96.6 MB) from /system/framework/arm/ (GOOG).
It saves 0.6 MB (of 26.7 MB) from /system/framework/oat/arm/ (GOOG).
Field loads from inline-info get around 5% slower.
(based on the time it takes to load all inline-infos from boot.oat)
Change-Id: I67b0fa5eef74c1fdb013680d0231fd44ea696176
diff --git a/runtime/stack.cc b/runtime/stack.cc
index 2336365..c22eb92 100644
--- a/runtime/stack.cc
+++ b/runtime/stack.cc
@@ -130,11 +130,19 @@
if (IsInInlinedFrame()) {
size_t depth_in_stack_map = current_inlining_depth_ - 1;
InlineInfo inline_info = GetCurrentInlineInfo();
+ const OatQuickMethodHeader* method_header = GetCurrentOatQuickMethodHeader();
+ CodeInfoEncoding encoding = method_header->GetOptimizedCodeInfo().ExtractEncoding();
DCHECK(walk_kind_ != StackWalkKind::kSkipInlinedFrames);
bool allow_resolve = walk_kind_ != StackWalkKind::kIncludeInlinedFramesNoResolve;
return allow_resolve
- ? GetResolvedMethod<true>(*GetCurrentQuickFrame(), inline_info, depth_in_stack_map)
- : GetResolvedMethod<false>(*GetCurrentQuickFrame(), inline_info, depth_in_stack_map);
+ ? GetResolvedMethod<true>(*GetCurrentQuickFrame(),
+ inline_info,
+ encoding.inline_info_encoding,
+ depth_in_stack_map)
+ : GetResolvedMethod<false>(*GetCurrentQuickFrame(),
+ inline_info,
+ encoding.inline_info_encoding,
+ depth_in_stack_map);
} else {
return *cur_quick_frame_;
}
@@ -148,7 +156,10 @@
} else if (cur_quick_frame_ != nullptr) {
if (IsInInlinedFrame()) {
size_t depth_in_stack_map = current_inlining_depth_ - 1;
- return GetCurrentInlineInfo().GetDexPcAtDepth(depth_in_stack_map);
+ const OatQuickMethodHeader* method_header = GetCurrentOatQuickMethodHeader();
+ CodeInfoEncoding encoding = method_header->GetOptimizedCodeInfo().ExtractEncoding();
+ return GetCurrentInlineInfo().GetDexPcAtDepth(encoding.inline_info_encoding,
+ depth_in_stack_map);
} else if (cur_oat_quick_method_header_ == nullptr) {
return DexFile::kDexNoIndex;
} else {
@@ -875,7 +886,7 @@
if (stack_map.IsValid() && stack_map.HasInlineInfo(encoding.stack_map_encoding)) {
InlineInfo inline_info = code_info.GetInlineInfoOf(stack_map, encoding);
DCHECK_EQ(current_inlining_depth_, 0u);
- for (current_inlining_depth_ = inline_info.GetDepth();
+ for (current_inlining_depth_ = inline_info.GetDepth(encoding.inline_info_encoding);
current_inlining_depth_ != 0;
--current_inlining_depth_) {
bool should_continue = VisitFrame();