aoqi@0: /* aoqi@0: * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: * aoqi@0: */ aoqi@0: aoqi@0: #ifndef SHARE_VM_PRIMS_JVMTIEVENTCONTROLLER_INLINE_HPP aoqi@0: #define SHARE_VM_PRIMS_JVMTIEVENTCONTROLLER_INLINE_HPP aoqi@0: aoqi@0: #include "prims/jvmtiEventController.hpp" aoqi@0: #include "prims/jvmtiImpl.hpp" aoqi@0: #include "prims/jvmtiUtil.hpp" aoqi@0: aoqi@0: // these inline functions are in a separate file to break include cycles aoqi@0: aoqi@0: aoqi@0: /////////////////////////////////////////////////////////////// aoqi@0: // aoqi@0: // JvmtiEventEnabled aoqi@0: // aoqi@0: aoqi@0: inline jlong JvmtiEventEnabled::bit_for(jvmtiEvent event_type) { aoqi@0: assert(JvmtiEventController::is_valid_event_type(event_type), "invalid event type"); aoqi@0: return ((jlong)1) << (event_type - TOTAL_MIN_EVENT_TYPE_VAL); aoqi@0: } aoqi@0: aoqi@0: inline jlong JvmtiEventEnabled::get_bits() { aoqi@0: assert(_init_guard == JEE_INIT_GUARD, "enable bits uninitialized or corrupted"); aoqi@0: return _enabled_bits; aoqi@0: } aoqi@0: aoqi@0: inline void JvmtiEventEnabled::set_bits(jlong bits) { aoqi@0: assert(_init_guard == JEE_INIT_GUARD, "enable bits uninitialized or corrupted on set"); aoqi@0: _enabled_bits = bits; aoqi@0: } aoqi@0: aoqi@0: inline bool JvmtiEventEnabled::is_enabled(jvmtiEvent event_type) { aoqi@0: return (bit_for(event_type) & get_bits()) != 0; aoqi@0: } aoqi@0: aoqi@0: aoqi@0: /////////////////////////////////////////////////////////////// aoqi@0: // aoqi@0: // JvmtiEnvThreadEventEnable aoqi@0: // aoqi@0: aoqi@0: inline bool JvmtiEnvThreadEventEnable::is_enabled(jvmtiEvent event_type) { aoqi@0: assert(JvmtiUtil::event_threaded(event_type), "Only thread filtered events should be tested here"); aoqi@0: return _event_enabled.is_enabled(event_type); aoqi@0: } aoqi@0: aoqi@0: inline void JvmtiEnvThreadEventEnable::set_user_enabled(jvmtiEvent event_type, bool enabled) { aoqi@0: _event_user_enabled.set_enabled(event_type, enabled); aoqi@0: } aoqi@0: aoqi@0: aoqi@0: /////////////////////////////////////////////////////////////// aoqi@0: // aoqi@0: // JvmtiThreadEventEnable aoqi@0: // aoqi@0: aoqi@0: inline bool JvmtiThreadEventEnable::is_enabled(jvmtiEvent event_type) { aoqi@0: assert(JvmtiUtil::event_threaded(event_type), "Only thread filtered events should be tested here"); aoqi@0: return _event_enabled.is_enabled(event_type); aoqi@0: } aoqi@0: aoqi@0: aoqi@0: /////////////////////////////////////////////////////////////// aoqi@0: // aoqi@0: // JvmtiEnvEventEnable aoqi@0: // aoqi@0: aoqi@0: inline bool JvmtiEnvEventEnable::is_enabled(jvmtiEvent event_type) { aoqi@0: assert(!JvmtiUtil::event_threaded(event_type), "Only non thread filtered events should be tested here"); aoqi@0: return _event_enabled.is_enabled(event_type); aoqi@0: } aoqi@0: aoqi@0: inline void JvmtiEnvEventEnable::set_user_enabled(jvmtiEvent event_type, bool enabled) { aoqi@0: _event_user_enabled.set_enabled(event_type, enabled); aoqi@0: } aoqi@0: aoqi@0: aoqi@0: /////////////////////////////////////////////////////////////// aoqi@0: // aoqi@0: // JvmtiEventController aoqi@0: // aoqi@0: aoqi@0: inline bool JvmtiEventController::is_enabled(jvmtiEvent event_type) { aoqi@0: return _universal_global_event_enabled.is_enabled(event_type); aoqi@0: } aoqi@0: aoqi@0: #endif // SHARE_VM_PRIMS_JVMTIEVENTCONTROLLER_INLINE_HPP