diff options
| author | 2015-05-29 16:29:43 +0100 | |
|---|---|---|
| committer | 2015-06-04 17:25:02 +0100 | |
| commit | f677ebfd832c9c614fea5e6735725fec2f7a3f2a (patch) | |
| tree | 051b3ba6343bdbca4929d728dd5c0341e4383a08 /runtime/entrypoints/entrypoint_utils-inl.h | |
| parent | c47908e8c32fd58bc4dc75998a80f706954db1dc (diff) | |
Cache stack map encoding
Operations on CodeInfo and StackMap objects repeatedly read encoding
information from the MemoryRegion. Since these are 3-bit-loads of
values that never change, caching them can measurably reduce compile
times.
According to benchmarks, this patch saves 1-3% on armv7, 2-4% on x86,
and 0-1% on x64.
Change-Id: I46b197513601325d8bab562cc80100c00ec28a3b
Diffstat (limited to 'runtime/entrypoints/entrypoint_utils-inl.h')
| -rw-r--r-- | runtime/entrypoints/entrypoint_utils-inl.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/entrypoints/entrypoint_utils-inl.h b/runtime/entrypoints/entrypoint_utils-inl.h index dbd24a276f..b0cbd02880 100644 --- a/runtime/entrypoints/entrypoint_utils-inl.h +++ b/runtime/entrypoints/entrypoint_utils-inl.h @@ -77,10 +77,11 @@ inline ArtMethod* GetCalleeSaveMethodCaller(ArtMethod** sp, (reinterpret_cast<uint8_t*>(sp) + callee_return_pc_offset)); uintptr_t native_pc_offset = outer_method->NativeQuickPcOffset(caller_pc); CodeInfo code_info = outer_method->GetOptimizedCodeInfo(); - StackMap stack_map = code_info.GetStackMapForNativePcOffset(native_pc_offset); + StackMapEncoding encoding = code_info.ExtractEncoding(); + StackMap stack_map = code_info.GetStackMapForNativePcOffset(native_pc_offset, encoding); DCHECK(stack_map.IsValid()); - if (stack_map.HasInlineInfo(code_info)) { - InlineInfo inline_info = code_info.GetInlineInfoOf(stack_map); + if (stack_map.HasInlineInfo(encoding)) { + InlineInfo inline_info = code_info.GetInlineInfoOf(stack_map, encoding); uint32_t method_index = inline_info.GetMethodIndexAtDepth(inline_info.GetDepth() - 1); InvokeType invoke_type = static_cast<InvokeType>( inline_info.GetInvokeTypeAtDepth(inline_info.GetDepth() - 1)); |