summaryrefslogtreecommitdiffstats
path: root/runtime/stack.cc
diff options
context:
space:
mode:
authorDavid Srbecky <dsrbecky@google.com>2018-06-03 12:00:14 +0100
committerDavid Srbecky <dsrbecky@google.com>2018-06-05 16:50:38 +0100
commit6e69e52a12883386f91d014324bebee867ca7877 (patch)
tree7d1850f0a59e4ea2d013d6d479cd616b66922970 /runtime/stack.cc
parent6eb4d5e4bc2ce068004c1d7c85dbfff0c5efd11d (diff)
downloadart-6e69e52a12883386f91d014324bebee867ca7877.tar.gz
art-6e69e52a12883386f91d014324bebee867ca7877.tar.bz2
art-6e69e52a12883386f91d014324bebee867ca7877.zip
Remove depth argument from InlineInfo accessors in stack maps.
The InlineInfo class actually represented a list of inlining information for a given stack map, and the depth argument was used everywhere to select to desired element from the list. This was verbose and inconsistent with the other classes. Change the InlineInfo class to represent a single inlining, and select the desired depth when getting it from CodeInfo. Test: test-art-host-gtest-stack_map_test Change-Id: I35b73e6704854f0203f51d4dbdbed5b1d1cd5a3b
Diffstat (limited to 'runtime/stack.cc')
-rw-r--r--runtime/stack.cc26
1 files changed, 11 insertions, 15 deletions
diff --git a/runtime/stack.cc b/runtime/stack.cc
index 6da7dcb697..bd0d5d680e 100644
--- a/runtime/stack.cc
+++ b/runtime/stack.cc
@@ -76,14 +76,14 @@ StackVisitor::StackVisitor(Thread* thread,
}
}
-static InlineInfo GetCurrentInlineInfo(CodeInfo& code_info,
- const OatQuickMethodHeader* method_header,
- uintptr_t cur_quick_frame_pc)
+static StackMap GetCurrentStackMap(CodeInfo& code_info,
+ const OatQuickMethodHeader* method_header,
+ uintptr_t cur_quick_frame_pc)
REQUIRES_SHARED(Locks::mutator_lock_) {
uint32_t native_pc_offset = method_header->NativeQuickPcOffset(cur_quick_frame_pc);
StackMap stack_map = code_info.GetStackMapForNativePcOffset(native_pc_offset);
DCHECK(stack_map.IsValid());
- return code_info.GetInlineInfoOf(stack_map);
+ return stack_map;
}
ArtMethod* StackVisitor::GetMethod() const {
@@ -94,14 +94,13 @@ ArtMethod* StackVisitor::GetMethod() const {
size_t depth_in_stack_map = current_inlining_depth_ - 1;
const OatQuickMethodHeader* method_header = GetCurrentOatQuickMethodHeader();
CodeInfo code_info(method_header);
- InlineInfo inline_info = GetCurrentInlineInfo(code_info,
- method_header,
- cur_quick_frame_pc_);
+ StackMap stack_map = GetCurrentStackMap(code_info, method_header, cur_quick_frame_pc_);
MethodInfo method_info = method_header->GetOptimizedMethodInfo();
DCHECK(walk_kind_ != StackWalkKind::kSkipInlinedFrames);
return GetResolvedMethod(*GetCurrentQuickFrame(),
method_info,
- inline_info,
+ code_info,
+ stack_map,
depth_in_stack_map);
} else {
return *cur_quick_frame_;
@@ -118,8 +117,8 @@ uint32_t StackVisitor::GetDexPc(bool abort_on_failure) const {
const OatQuickMethodHeader* method_header = GetCurrentOatQuickMethodHeader();
CodeInfo code_info(method_header);
size_t depth_in_stack_map = current_inlining_depth_ - 1;
- return GetCurrentInlineInfo(code_info, method_header, cur_quick_frame_pc_).
- GetDexPcAtDepth(depth_in_stack_map);
+ StackMap stack_map = GetCurrentStackMap(code_info, method_header, cur_quick_frame_pc_);
+ return code_info.GetInlineInfoAtDepth(stack_map, depth_in_stack_map).GetDexPc();
} else if (cur_oat_quick_method_header_ == nullptr) {
return dex::kDexNoIndex;
} else {
@@ -237,9 +236,7 @@ bool StackVisitor::GetVRegFromOptimizedCode(ArtMethod* m, uint16_t vreg, VRegKin
size_t depth_in_stack_map = current_inlining_depth_ - 1;
DexRegisterMap dex_register_map = IsInInlinedFrame()
- ? code_info.GetDexRegisterMapAtDepth(depth_in_stack_map,
- code_info.GetInlineInfoOf(stack_map),
- number_of_dex_registers)
+ ? code_info.GetDexRegisterMapAtDepth(depth_in_stack_map, stack_map, number_of_dex_registers)
: code_info.GetDexRegisterMapOf(stack_map, number_of_dex_registers);
if (!dex_register_map.IsValid()) {
@@ -825,9 +822,8 @@ void StackVisitor::WalkStack(bool include_transitions) {
cur_oat_quick_method_header_->NativeQuickPcOffset(cur_quick_frame_pc_);
StackMap stack_map = code_info.GetStackMapForNativePcOffset(native_pc_offset);
if (stack_map.IsValid() && stack_map.HasInlineInfo()) {
- InlineInfo inline_info = code_info.GetInlineInfoOf(stack_map);
DCHECK_EQ(current_inlining_depth_, 0u);
- for (current_inlining_depth_ = inline_info.GetDepth();
+ for (current_inlining_depth_ = code_info.GetInlineDepthOf(stack_map);
current_inlining_depth_ != 0;
--current_inlining_depth_) {
bool should_continue = VisitFrame();