/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "jvmtifiles/jvmti.h"
#include "memory/allocation.hpp"
#include "memory/allocation.inline.hpp"
#include "oops/instanceKlass.hpp"
#include "prims/jvmtiEventController.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/growableArray.hpp"
class JvmtiEnv;
///////////////////////////////////////////////////////////////
//
// class JvmtiFramePop
// Used by : JvmtiFramePops
// Used by JVMTI methods: none directly.
//
// Wrapper class for FramePop, used in the JvmtiFramePops class.
//
// Two problems: 1) this isn't being used as a ValueObj class, in
// several places there are constructors for it. 2) It seems like
// overkill as a means to get an assert and name the geater than
// operator. I'm trying to to rewrite everything.
private:
// Frame number counting from BOTTOM (oldest) frame;
// bottom frame == #0
int _frame_number;
public:
JvmtiFramePop() {}
}
};
///////////////////////////////////////////////////////////////
//
// class JvmtiFramePops
// Used by : JvmtiThreadState
// Used by JVMTI methods: none directly.
//
// A collection of JvmtiFramePop.
// It records what frames on a threads stack should post frame_pop events when they're exited.
//
private:
// should only be used by JvmtiEventControllerPrivate
// to insure they only occur at safepoints.
// Todo: add checks for safepoint
friend class JvmtiEventControllerPrivate;
public:
~JvmtiFramePops();
};
///////////////////////////////////////////////////////////////
//
// class JvmtiEnvThreadState
//
// 2. Cache of pending frame_pop_events, created by NotifyFramePop
// and lazily initialized.
// 3: Location of last executed instruction, used to filter out duplicate
// events due to instruction rewriting.
private:
friend class JvmtiEnv;
int _current_bci;
bool _breakpoint_posted;
bool _single_stepping_posted;
// Class used to store pending framepops.
// lazily initialized by get_frame_pops();
_current_bci = bci;
}
friend class JvmtiEnvThreadStateIterator;
friend class JvmtiThreadState;
public:
// If the thread is in the given method at the given
// location just return. Otherwise, reset the current location
// and reset _breakpoint_posted and _single_stepping_posted.
// _breakpoint_posted and _single_stepping_posted are only cleared
// here.
inline void set_single_stepping_posted() {
_single_stepping_posted = true;
}
inline bool single_stepping_posted() {
return _single_stepping_posted;
}
// lazily initialize _frame_pops
bool has_frame_pops();
// quickly test whether we should deliver a frame pop event on return from sp
bool is_frame_pop(int cur_stack_depth);
void set_frame_pop(int frame_number);
void clear_frame_pop(int frame_number);
void clear_to_frame_pop(int frame_number);
};
#endif // SHARE_VM_PRIMS_JVMTIENVTHREADSTATE_HPP