Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/hotspot/share/prims/jvmtiEventController.inline.hpp
41145 views
1
/*
2
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
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_PRIMS_JVMTIEVENTCONTROLLER_INLINE_HPP
26
#define SHARE_PRIMS_JVMTIEVENTCONTROLLER_INLINE_HPP
27
28
#include "prims/jvmtiEventController.hpp"
29
30
#include "prims/jvmtiImpl.hpp"
31
#include "prims/jvmtiUtil.hpp"
32
33
// these inline functions are in a separate file to break include cycles
34
35
36
///////////////////////////////////////////////////////////////
37
//
38
// JvmtiEventEnabled
39
//
40
41
inline jlong JvmtiEventEnabled::bit_for(jvmtiEvent event_type) {
42
assert(JvmtiEventController::is_valid_event_type(event_type), "invalid event type");
43
return ((jlong)1) << (event_type - TOTAL_MIN_EVENT_TYPE_VAL);
44
}
45
46
inline jlong JvmtiEventEnabled::get_bits() {
47
assert(_init_guard == JEE_INIT_GUARD, "enable bits uninitialized or corrupted");
48
return _enabled_bits;
49
}
50
51
inline void JvmtiEventEnabled::set_bits(jlong bits) {
52
assert(_init_guard == JEE_INIT_GUARD, "enable bits uninitialized or corrupted on set");
53
_enabled_bits = bits;
54
}
55
56
inline bool JvmtiEventEnabled::is_enabled(jvmtiEvent event_type) {
57
return (bit_for(event_type) & get_bits()) != 0;
58
}
59
60
61
///////////////////////////////////////////////////////////////
62
//
63
// JvmtiEnvThreadEventEnable
64
//
65
66
inline bool JvmtiEnvThreadEventEnable::is_enabled(jvmtiEvent event_type) {
67
assert(JvmtiUtil::event_threaded(event_type), "Only thread filtered events should be tested here");
68
return _event_enabled.is_enabled(event_type);
69
}
70
71
inline void JvmtiEnvThreadEventEnable::set_user_enabled(jvmtiEvent event_type, bool enabled) {
72
_event_user_enabled.set_enabled(event_type, enabled);
73
}
74
75
76
///////////////////////////////////////////////////////////////
77
//
78
// JvmtiThreadEventEnable
79
//
80
81
inline bool JvmtiThreadEventEnable::is_enabled(jvmtiEvent event_type) {
82
assert(JvmtiUtil::event_threaded(event_type), "Only thread filtered events should be tested here");
83
return _event_enabled.is_enabled(event_type);
84
}
85
86
87
///////////////////////////////////////////////////////////////
88
//
89
// JvmtiEnvEventEnable
90
//
91
92
inline bool JvmtiEnvEventEnable::is_enabled(jvmtiEvent event_type) {
93
assert(!JvmtiUtil::event_threaded(event_type), "Only non thread filtered events should be tested here");
94
return _event_enabled.is_enabled(event_type);
95
}
96
97
inline void JvmtiEnvEventEnable::set_user_enabled(jvmtiEvent event_type, bool enabled) {
98
_event_user_enabled.set_enabled(event_type, enabled);
99
}
100
101
102
///////////////////////////////////////////////////////////////
103
//
104
// JvmtiEventController
105
//
106
107
inline bool JvmtiEventController::is_enabled(jvmtiEvent event_type) {
108
return _universal_global_event_enabled.is_enabled(event_type);
109
}
110
111
#endif // SHARE_PRIMS_JVMTIEVENTCONTROLLER_INLINE_HPP
112
113