13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_PRIMS_JVMTIENVBASE_HPP
26 #define SHARE_VM_PRIMS_JVMTIENVBASE_HPP
27
28 #include "classfile/classLoader.hpp"
29 #include "prims/jvmtiEnvThreadState.hpp"
30 #include "prims/jvmtiEventController.hpp"
31 #include "prims/jvmtiThreadState.hpp"
32 #include "prims/jvmtiThreadState.inline.hpp"
33 #include "runtime/fieldDescriptor.hpp"
34 #include "runtime/frame.hpp"
35 #include "runtime/handles.inline.hpp"
36 #include "runtime/thread.hpp"
37 #include "runtime/vm_operations.hpp"
38 #include "utilities/growableArray.hpp"
39 #include "utilities/macros.hpp"
40
41 //
42 // Forward Declarations
43 //
44
45 class JvmtiEnv;
46 class JvmtiThreadState;
47 class JvmtiRawMonitor; // for jvmtiEnv.hpp
48 class JvmtiEventControllerPrivate;
49 class JvmtiTagMap;
50
51
52
687 JvmtiEnvBase *_env;
688
689 public:
690 JvmtiMonitorClosure(JavaThread* thread, JavaThread *calling_thread,
691 GrowableArray<jvmtiMonitorStackDepthInfo*> *owned_monitors,
692 JvmtiEnvBase *env) {
693 _java_thread = thread;
694 _calling_thread = calling_thread;
695 _owned_monitors_list = owned_monitors;
696 _error = JVMTI_ERROR_NONE;
697 _env = env;
698 }
699 void do_monitor(ObjectMonitor* mon);
700 jvmtiError error() { return _error;}
701 };
702
703
704 // Jvmti module closure to collect all modules loaded to the system.
705 class JvmtiModuleClosure : public StackObj {
706 private:
707 static GrowableArray<jobject> *_tbl; // Protected with Module_lock
708
709 static void do_module(ModuleEntry* entry) {
710 assert_locked_or_safepoint(Module_lock);
711 jobject module = entry->module_handle();
712 guarantee(module != NULL, "module object is NULL");
713 _tbl->push(module);
714 }
715
716 public:
717 jvmtiError get_all_modules(JvmtiEnv* env, jint* module_count_ptr, jobject** modules_ptr);
718 };
719
720 #endif // SHARE_VM_PRIMS_JVMTIENVBASE_HPP
|
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_PRIMS_JVMTIENVBASE_HPP
26 #define SHARE_VM_PRIMS_JVMTIENVBASE_HPP
27
28 #include "classfile/classLoader.hpp"
29 #include "prims/jvmtiEnvThreadState.hpp"
30 #include "prims/jvmtiEventController.hpp"
31 #include "prims/jvmtiThreadState.hpp"
32 #include "prims/jvmtiThreadState.inline.hpp"
33 #include "oops/oopHandle.hpp"
34 #include "runtime/fieldDescriptor.hpp"
35 #include "runtime/frame.hpp"
36 #include "runtime/handles.inline.hpp"
37 #include "runtime/thread.hpp"
38 #include "runtime/vm_operations.hpp"
39 #include "utilities/growableArray.hpp"
40 #include "utilities/macros.hpp"
41
42 //
43 // Forward Declarations
44 //
45
46 class JvmtiEnv;
47 class JvmtiThreadState;
48 class JvmtiRawMonitor; // for jvmtiEnv.hpp
49 class JvmtiEventControllerPrivate;
50 class JvmtiTagMap;
51
52
53
688 JvmtiEnvBase *_env;
689
690 public:
691 JvmtiMonitorClosure(JavaThread* thread, JavaThread *calling_thread,
692 GrowableArray<jvmtiMonitorStackDepthInfo*> *owned_monitors,
693 JvmtiEnvBase *env) {
694 _java_thread = thread;
695 _calling_thread = calling_thread;
696 _owned_monitors_list = owned_monitors;
697 _error = JVMTI_ERROR_NONE;
698 _env = env;
699 }
700 void do_monitor(ObjectMonitor* mon);
701 jvmtiError error() { return _error;}
702 };
703
704
705 // Jvmti module closure to collect all modules loaded to the system.
706 class JvmtiModuleClosure : public StackObj {
707 private:
708 static GrowableArray<OopHandle> *_tbl; // Protected with Module_lock
709
710 static void do_module(ModuleEntry* entry) {
711 assert_locked_or_safepoint(Module_lock);
712 OopHandle module = entry->module_handle();
713 guarantee(module.resolve() != NULL, "module object is NULL");
714 _tbl->push(module);
715 }
716
717 public:
718 jvmtiError get_all_modules(JvmtiEnv* env, jint* module_count_ptr, jobject** modules_ptr);
719 };
720
721 #endif // SHARE_VM_PRIMS_JVMTIENVBASE_HPP
|