5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
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 _JAVA_JVMTITHREADSTATE_H_
26 #define _JAVA_JVMTITHREADSTATE_H_
27
28 //
29 // Forward Declarations
30 //
31
32 class JvmtiEnvBase;
33 class JvmtiEnvThreadState;
34 class JvmtiDynamicCodeEventCollector;
35
36 enum JvmtiClassLoadKind {
37 jvmti_class_load_kind_load = 100,
38 jvmti_class_load_kind_retransform,
39 jvmti_class_load_kind_redefine
40 };
41
42 ///////////////////////////////////////////////////////////////
43 //
44 // class JvmtiEnvThreadStateIterator
45 //
46 // The only safe means of iterating through the JvmtiEnvThreadStates
386 void set_should_post_on_exceptions(bool val) { _thread->set_should_post_on_exceptions_flag(val ? JNI_TRUE : JNI_FALSE); }
387 };
388
389 class RedefineVerifyMark : public StackObj {
390 private:
391 JvmtiThreadState *_state;
392
393 public:
394 RedefineVerifyMark(KlassHandle *the_class, KlassHandle *scratch_class,
395 JvmtiThreadState *state) : _state(state)
396 {
397 _state->set_class_versions_map(the_class, scratch_class);
398 (*scratch_class)->set_java_mirror((*the_class)->java_mirror());
399 }
400
401 ~RedefineVerifyMark() {
402 _state->clear_class_versions_map();
403 }
404 };
405
406 #endif /* _JAVA_JVMTITHREADSTATE_H_ */
|
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
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_JVMTITHREADSTATE_HPP
26 #define SHARE_VM_PRIMS_JVMTITHREADSTATE_HPP
27
28 #include "jvmtifiles/jvmti.h"
29 #include "memory/allocation.hpp"
30 #include "memory/allocation.inline.hpp"
31 #include "prims/jvmtiEventController.hpp"
32 #include "runtime/thread.hpp"
33 #include "utilities/growableArray.hpp"
34
35 //
36 // Forward Declarations
37 //
38
39 class JvmtiEnvBase;
40 class JvmtiEnvThreadState;
41 class JvmtiDynamicCodeEventCollector;
42
43 enum JvmtiClassLoadKind {
44 jvmti_class_load_kind_load = 100,
45 jvmti_class_load_kind_retransform,
46 jvmti_class_load_kind_redefine
47 };
48
49 ///////////////////////////////////////////////////////////////
50 //
51 // class JvmtiEnvThreadStateIterator
52 //
53 // The only safe means of iterating through the JvmtiEnvThreadStates
393 void set_should_post_on_exceptions(bool val) { _thread->set_should_post_on_exceptions_flag(val ? JNI_TRUE : JNI_FALSE); }
394 };
395
396 class RedefineVerifyMark : public StackObj {
397 private:
398 JvmtiThreadState *_state;
399
400 public:
401 RedefineVerifyMark(KlassHandle *the_class, KlassHandle *scratch_class,
402 JvmtiThreadState *state) : _state(state)
403 {
404 _state->set_class_versions_map(the_class, scratch_class);
405 (*scratch_class)->set_java_mirror((*the_class)->java_mirror());
406 }
407
408 ~RedefineVerifyMark() {
409 _state->clear_class_versions_map();
410 }
411 };
412
413 #endif // SHARE_VM_PRIMS_JVMTITHREADSTATE_HPP
|