diff options
Diffstat (limited to 'openjdkjvmti/events-inl.h')
-rw-r--r-- | openjdkjvmti/events-inl.h | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/openjdkjvmti/events-inl.h b/openjdkjvmti/events-inl.h index 92cfbc9c41..1e309b4938 100644 --- a/openjdkjvmti/events-inl.h +++ b/openjdkjvmti/events-inl.h @@ -360,8 +360,9 @@ template <> inline bool EventHandler::ShouldDispatch<ArtJvmtiEvent::kBreakpoint>( ArtJvmTiEnv* env, art::Thread* thread, - JNIEnv* jnienv ATTRIBUTE_UNUSED, - jthread jni_thread ATTRIBUTE_UNUSED, + + [[maybe_unused]] JNIEnv* jnienv, + [[maybe_unused]] jthread jni_thread, jmethodID jmethod, jlocation location) const { art::ReaderMutexLock lk(art::Thread::Current(), env->event_info_mutex_); @@ -374,10 +375,10 @@ template <> inline bool EventHandler::ShouldDispatch<ArtJvmtiEvent::kFramePop>( ArtJvmTiEnv* env, art::Thread* thread, - JNIEnv* jnienv ATTRIBUTE_UNUSED, - jthread jni_thread ATTRIBUTE_UNUSED, - jmethodID jmethod ATTRIBUTE_UNUSED, - jboolean is_exception ATTRIBUTE_UNUSED, + [[maybe_unused]] JNIEnv* jnienv, + [[maybe_unused]] jthread jni_thread, + [[maybe_unused]] jmethodID jmethod, + [[maybe_unused]] jboolean is_exception, const art::ShadowFrame* frame) const { // Search for the frame. Do this before checking if we need to send the event so that we don't // have to deal with use-after-free or the frames being reallocated later. @@ -395,15 +396,15 @@ template <> inline bool EventHandler::ShouldDispatch<ArtJvmtiEvent::kFieldModification>( ArtJvmTiEnv* env, art::Thread* thread, - JNIEnv* jnienv ATTRIBUTE_UNUSED, - jthread jni_thread ATTRIBUTE_UNUSED, - jmethodID method ATTRIBUTE_UNUSED, - jlocation location ATTRIBUTE_UNUSED, - jclass field_klass ATTRIBUTE_UNUSED, - jobject object ATTRIBUTE_UNUSED, + [[maybe_unused]] JNIEnv* jnienv, + [[maybe_unused]] jthread jni_thread, + [[maybe_unused]] jmethodID method, + [[maybe_unused]] jlocation location, + [[maybe_unused]] jclass field_klass, + [[maybe_unused]] jobject object, jfieldID field, - char type_char ATTRIBUTE_UNUSED, - jvalue val ATTRIBUTE_UNUSED) const { + [[maybe_unused]] char type_char, + [[maybe_unused]] jvalue val) const { art::ReaderMutexLock lk(art::Thread::Current(), env->event_info_mutex_); return ShouldDispatchOnThread<ArtJvmtiEvent::kFieldModification>(env, thread) && env->modify_watched_fields.find( @@ -414,12 +415,12 @@ template <> inline bool EventHandler::ShouldDispatch<ArtJvmtiEvent::kFieldAccess>( ArtJvmTiEnv* env, art::Thread* thread, - JNIEnv* jnienv ATTRIBUTE_UNUSED, - jthread jni_thread ATTRIBUTE_UNUSED, - jmethodID method ATTRIBUTE_UNUSED, - jlocation location ATTRIBUTE_UNUSED, - jclass field_klass ATTRIBUTE_UNUSED, - jobject object ATTRIBUTE_UNUSED, + [[maybe_unused]] JNIEnv* jnienv, + [[maybe_unused]] jthread jni_thread, + [[maybe_unused]] jmethodID method, + [[maybe_unused]] jlocation location, + [[maybe_unused]] jclass field_klass, + [[maybe_unused]] jobject object, jfieldID field) const { art::ReaderMutexLock lk(art::Thread::Current(), env->event_info_mutex_); return ShouldDispatchOnThread<ArtJvmtiEvent::kFieldAccess>(env, thread) && @@ -439,7 +440,7 @@ inline void EventHandler::ExecuteCallback<ArtJvmtiEvent::kFramePop>( jthread jni_thread, jmethodID jmethod, jboolean is_exception, - const art::ShadowFrame* frame ATTRIBUTE_UNUSED) { + [[maybe_unused]] const art::ShadowFrame* frame) { ExecuteCallback<ArtJvmtiEvent::kFramePop>(event, jnienv, jni_thread, jmethod, is_exception); } @@ -628,10 +629,10 @@ inline bool EventHandler::ShouldDispatchOnThread(ArtJvmTiEnv* env, art::Thread* return dispatch; } -template <ArtJvmtiEvent kEvent, typename ...Args> +template <ArtJvmtiEvent kEvent, typename... Args> inline bool EventHandler::ShouldDispatch(ArtJvmTiEnv* env, art::Thread* thread, - Args... args ATTRIBUTE_UNUSED) const { + [[maybe_unused]] Args... args) const { static_assert(std::is_same<typename impl::EventFnType<kEvent>::type, void(*)(jvmtiEnv*, Args...)>::value, "Unexpected different type of shouldDispatch"); |