summaryrefslogtreecommitdiff
path: root/runtime/stack.h
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2022-06-24 11:16:35 +0100
committer Santiago Aboy Solanes <solanes@google.com> 2022-10-07 14:48:14 +0000
commitab1d559aee05873f70494514922ad4b767c6a709 (patch)
tree0a0831e8b9fe543b050a56fc03b2e395721cca46 /runtime/stack.h
parent8c5e881904c30de5dbc03536ea67bbe2d48088fd (diff)
Runtime implementation of try catch inlining
The main differences in the runtime are: 1) We now use a list of dex_pcs to find the correct catch handler instead of a single dex pc 2) We now need to restore vregs of the whole frame, which may be an inline frame. Bug: 227283224 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I95d2f32088e1d420c83962a1693be18f3b63f8b4
Diffstat (limited to 'runtime/stack.h')
-rw-r--r--runtime/stack.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/runtime/stack.h b/runtime/stack.h
index bfda57b136..56f38aecef 100644
--- a/runtime/stack.h
+++ b/runtime/stack.h
@@ -192,6 +192,12 @@ class StackVisitor {
uint32_t GetDexPc(bool abort_on_failure = true) const REQUIRES_SHARED(Locks::mutator_lock_);
+ // Returns a vector of the inlined dex pcs, in order from outermost to innermost but it replaces
+ // the innermost one with `handler_dex_pc`. In essence, (outermost dex pc, mid dex pc #1, ..., mid
+ // dex pc #n-1, `handler_dex_pc`).
+ std::vector<uint32_t> ComputeDexPcList(uint32_t handler_dex_pc) const
+ REQUIRES_SHARED(Locks::mutator_lock_);
+
ObjPtr<mirror::Object> GetThisObject() const REQUIRES_SHARED(Locks::mutator_lock_);
size_t GetNativePcOffset() const REQUIRES_SHARED(Locks::mutator_lock_);
@@ -225,9 +231,8 @@ class StackVisitor {
uint16_t vreg,
VRegKind kind,
uint32_t* val,
- std::optional<DexRegisterLocation> location =
- std::optional<DexRegisterLocation>()) const
- REQUIRES_SHARED(Locks::mutator_lock_);
+ std::optional<DexRegisterLocation> location = std::optional<DexRegisterLocation>(),
+ bool need_full_register_list = false) const REQUIRES_SHARED(Locks::mutator_lock_);
bool GetVRegPair(ArtMethod* m, uint16_t vreg, VRegKind kind_lo, VRegKind kind_hi,
uint64_t* val) const
@@ -263,10 +268,16 @@ class StackVisitor {
return !current_inline_frames_.empty();
}
+ size_t InlineDepth() const { return current_inline_frames_.size(); }
+
InlineInfo GetCurrentInlinedFrame() const {
return current_inline_frames_.back();
}
+ const BitTableRange<InlineInfo>& GetCurrentInlinedFrames() const {
+ return current_inline_frames_;
+ }
+
uintptr_t GetCurrentQuickFramePc() const {
return cur_quick_frame_pc_;
}
@@ -306,6 +317,11 @@ class StackVisitor {
return (should_deopt_flag & static_cast<uint8_t>(DeoptimizeFlagValue::kDebug)) != 0;
}
+ // Return the number of dex register in the map from the outermost frame to the number of inlined
+ // frames indicated by `depth`. If `depth` is 0, grab just the registers from the outermost level.
+ // If it is greater than 0, grab as many inline frames as `depth` indicates.
+ size_t GetNumberOfRegisters(CodeInfo* code_info, int depth) const;
+
private:
// Private constructor known in the case that num_frames_ has already been computed.
StackVisitor(Thread* thread,
@@ -334,7 +350,8 @@ class StackVisitor {
bool GetVRegFromOptimizedCode(ArtMethod* m,
uint16_t vreg,
VRegKind kind,
- uint32_t* val) const
+ uint32_t* val,
+ bool need_full_register_list = false) const
REQUIRES_SHARED(Locks::mutator_lock_);
bool GetVRegPairFromDebuggerShadowFrame(uint16_t vreg,