Summary
-------
A NotifyFramePop request is only cleared if the JVMTI_EVENT_FRAME_POP is enabled but it must be always cleared when the corresponding frame is popped regardless of whether the JVMTI_EVENT_FRAME_POP event is enabled or not.
For reference, see the JVMTI NotifyFramePop spec:
https://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html#NotifyFramePop
Problem
-------
Current implementation behavior is incorrect and has to be changed.
The problem is that if a NotifyFramePop request is not cleared when the JVMTI_EVENT_FRAME_POP events notification
is disabled then an unrelated FRAME_POP event can be sent after the notification is re-enabled.
Solution
--------
The solution is to clear the NotifyFramePop request when the specified frame is popped, even if the JVMTI_EVENT_FRAME_POP event is disabled.
The full set of changes can be viewed here:
http://cr.openjdk.java.net/%7Esspitsyn/webrevs/2017/hotspot/8187289-jvmti-framepop.2/
Specification
-------------
The specification of the JVMTI NotifyFramePop function is not changed as the expected (correct) behavior is pretty intuitive.
The full set of changes can be viewed here:
http://cr.openjdk.java.net/%7Esspitsyn/webrevs/2017/hotspot/8187289-jvmti-framepop.2/