Optimize stack maps: add fast path for no inline info.
Consumers of CodeInfo can skip significant chunks of work
if they can quickly determine that method has no inlining.
Store this fact as a flag bit at the start of code info.
This changes binary format and adds <0.1% to oat size.
I added the extra flag field as the simplest solution for now,
although I would like to use it for more things in the future.
(e.g. store the special cases of empty/deduped tables in it)
This improves app startup by 0.4% (maps,speed).
PMD on golem seems to gets around 15% faster.
Bug: 133257467
Test: ./art/test.py -b --host --64
Change-Id: Ia498a31bafc74b51cc95b8c70cf1da4b0e3d894e
diff --git a/runtime/entrypoints/entrypoint_utils.cc b/runtime/entrypoints/entrypoint_utils.cc
index ee2ab56..71196d4 100644
--- a/runtime/entrypoints/entrypoint_utils.cc
+++ b/runtime/entrypoints/entrypoint_utils.cc
@@ -203,13 +203,15 @@
const OatQuickMethodHeader* current_code = outer_method->GetOatQuickMethodHeader(caller_pc);
DCHECK(current_code != nullptr);
DCHECK(current_code->IsOptimized());
- uintptr_t native_pc_offset = current_code->NativeQuickPcOffset(caller_pc);
- CodeInfo code_info(current_code, CodeInfo::DecodeFlags::InlineInfoOnly);
- StackMap stack_map = code_info.GetStackMapForNativePcOffset(native_pc_offset);
- DCHECK(stack_map.IsValid());
- BitTableRange<InlineInfo> inline_infos = code_info.GetInlineInfosOf(stack_map);
- if (!inline_infos.empty()) {
- caller = GetResolvedMethod(outer_method, code_info, inline_infos);
+ if (CodeInfo::HasInlineInfo(current_code->GetOptimizedCodeInfoPtr())) {
+ uintptr_t native_pc_offset = current_code->NativeQuickPcOffset(caller_pc);
+ CodeInfo code_info(current_code, CodeInfo::DecodeFlags::InlineInfoOnly);
+ StackMap stack_map = code_info.GetStackMapForNativePcOffset(native_pc_offset);
+ DCHECK(stack_map.IsValid());
+ BitTableRange<InlineInfo> inline_infos = code_info.GetInlineInfosOf(stack_map);
+ if (!inline_infos.empty()) {
+ caller = GetResolvedMethod(outer_method, code_info, inline_infos);
+ }
}
}
if (kIsDebugBuild && do_caller_check) {