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/runtime/interpreter/shadow_frame.h b/runtime/interpreter/shadow_frame.h
index 05768cd..6903af2 100644
--- a/runtime/interpreter/shadow_frame.h
+++ b/runtime/interpreter/shadow_frame.h
@@ -361,6 +361,14 @@
return result_register_;
}
+ bool NeedsNotifyPop() const {
+ return needs_notify_pop_;
+ }
+
+ void SetNotifyPop(bool notify) {
+ needs_notify_pop_ = notify;
+ }
+
private:
ShadowFrame(uint32_t num_vregs, ShadowFrame* link, ArtMethod* method,
uint32_t dex_pc, bool has_reference_array)
@@ -372,7 +380,8 @@
number_of_vregs_(num_vregs),
dex_pc_(dex_pc),
cached_hotness_countdown_(0),
- hotness_countdown_(0) {
+ hotness_countdown_(0),
+ needs_notify_pop_(0) {
// TODO(iam): Remove this parameter, it's an an artifact of portable removal
DCHECK(has_reference_array);
if (has_reference_array) {
@@ -404,6 +413,9 @@
uint32_t dex_pc_;
int16_t cached_hotness_countdown_;
int16_t hotness_countdown_;
+ // TODO Might be worth it to try to bit-pack this into some other field to reduce stack usage.
+ // NB alignment requires that this field takes 4 bytes. Only 1 bit is actually ever used.
+ bool needs_notify_pop_;
// This is a two-part array:
// - [0..number_of_vregs) holds the raw virtual registers, and each element here is always 4