JVMTI NotifyFramePop support
Adds support for the JVMTI can_generate_frame_pop_events capability.
This includes the NotifyFramePop function and the FramePop event.
We mark the interpreter shadowframes directly to get the events. This
relies on the fact that we never replace extant shadow-frames on the
interpreter stack to ensure that we can distinguish which jvmti-envs
requested the frame pops.
Test: ./test.py --host -j50
Bug: 34414072
Bug: 62821960
Bug: 65129403
Change-Id: I6e79e39f62fdf79268540c5c1be6311df704cff7
diff --git a/openjdkjvmti/ti_method.cc b/openjdkjvmti/ti_method.cc
index 35f2f0c..f99b167 100644
--- a/openjdkjvmti/ti_method.cc
+++ b/openjdkjvmti/ti_method.cc
@@ -51,6 +51,7 @@
#include "stack.h"
#include "thread-current-inl.h"
#include "thread_list.h"
+#include "ti_stack.h"
#include "ti_thread.h"
#include "ti_phase.h"
@@ -533,39 +534,6 @@
return IsMethodT(env, m, test, is_synthetic_ptr);
}
-struct FindFrameAtDepthVisitor : art::StackVisitor {
- public:
- FindFrameAtDepthVisitor(art::Thread* target, art::Context* ctx, jint depth)
- REQUIRES_SHARED(art::Locks::mutator_lock_)
- : art::StackVisitor(target, ctx, art::StackVisitor::StackWalkKind::kIncludeInlinedFrames),
- found_frame_(false),
- cnt_(0),
- depth_(static_cast<size_t>(depth)) { }
-
- bool FoundFrame() {
- return found_frame_;
- }
-
- bool VisitFrame() NO_THREAD_SAFETY_ANALYSIS {
- if (GetMethod()->IsRuntimeMethod()) {
- return true;
- }
- if (cnt_ == depth_) {
- // We found our frame, exit.
- found_frame_ = true;
- return false;
- } else {
- cnt_++;
- return true;
- }
- }
-
- private:
- bool found_frame_;
- size_t cnt_;
- size_t depth_;
-};
-
class CommonLocalVariableClosure : public art::Closure {
public:
CommonLocalVariableClosure(art::Thread* caller,