Lines Matching refs:env
56 JNIEnv* env, in TestData()
64 : target_loc(loc), target_method(meth != nullptr ? env->FromReflectedMethod(meth) : nullptr), in TestData()
65 target_klass(reinterpret_cast<jclass>(env->NewGlobalRef(klass))), in TestData()
66 target_field(field != nullptr ? env->FromReflectedField(field) : nullptr), in TestData()
68 frame_pop_setup_method(setup_meth != nullptr ? env->FromReflectedMethod(setup_meth) in TestData()
72 env, jvmti, jvmti->CreateRawMonitor("SuspendStopMonitor", ¬ify_monitor)); in TestData()
75 void PerformSuspend(jvmtiEnv* jvmti, JNIEnv* env) { in PerformSuspend()
77 JvmtiErrorToException(env, jvmti, jvmti->RawMonitorEnter(notify_monitor)); in PerformSuspend()
79 JvmtiErrorToException(env, jvmti, jvmti->RawMonitorNotifyAll(notify_monitor)); in PerformSuspend()
80 JvmtiErrorToException(env, jvmti, jvmti->RawMonitorExit(notify_monitor)); in PerformSuspend()
86 void PerformSuspension(jvmtiEnv* jvmti, JNIEnv* env) { in PerformSuspension() argument
89 env, in PerformSuspension()
95 data->PerformSuspend(jvmti, env); in PerformSuspension()
99 cbSingleStep(jvmtiEnv* jvmti, JNIEnv* env, jthread thr, jmethodID meth, jlocation loc) { in cbSingleStep() argument
102 env, jvmti, jvmti->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in cbSingleStep()
109 data->PerformSuspend(jvmti, env); in cbSingleStep()
113 JNIEnv* env, in cbExceptionCatch() argument
120 env, jvmti, jvmti->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in cbExceptionCatch()
127 data->PerformSuspend(jvmti, env); in cbExceptionCatch()
131 JNIEnv* env, in cbException() argument
140 env, jvmti, jvmti->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in cbException()
147 data->PerformSuspend(jvmti, env); in cbException()
150 void JNICALL cbMethodEntry(jvmtiEnv* jvmti, JNIEnv* env, jthread thr, jmethodID method) { in cbMethodEntry() argument
153 env, jvmti, jvmti->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in cbMethodEntry()
160 data->PerformSuspend(jvmti, env); in cbMethodEntry()
164 JNIEnv* env, in cbMethodExit() argument
171 env, jvmti, jvmti->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in cbMethodExit()
178 data->PerformSuspend(jvmti, env); in cbMethodExit()
182 JNIEnv* env, in cbFieldModification() argument
193 env, jvmti, jvmti->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in cbFieldModification()
201 data->PerformSuspend(jvmti, env); in cbFieldModification()
205 JNIEnv* env, in cbFieldAccess() argument
214 env, jvmti, jvmti->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in cbFieldAccess()
218 if (field != data->target_field || !env->IsSameObject(field_klass, data->target_klass)) { in cbFieldAccess()
222 data->PerformSuspend(jvmti, env); in cbFieldAccess()
226 cbBreakpointHit(jvmtiEnv* jvmti, JNIEnv* env, jthread thr, jmethodID method, jlocation loc) { in cbBreakpointHit() argument
229 env, jvmti, jvmti->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in cbBreakpointHit()
235 if (JvmtiErrorToException(env, jvmti, jvmti->NotifyFramePop(thr, data->frame_pop_offset))) { in cbBreakpointHit()
244 data->PerformSuspend(jvmti, env); in cbBreakpointHit()
248 JNIEnv* env, in cbFramePop() argument
254 env, jvmti, jvmti->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in cbFramePop()
258 data->PerformSuspend(jvmti, env); in cbFramePop()
261 void JNICALL cbClassLoadOrPrepare(jvmtiEnv* jvmti, JNIEnv* env, jthread thr, jclass klass) { in cbClassLoadOrPrepare() argument
264 env, jvmti, jvmti->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in cbClassLoadOrPrepare()
269 if (JvmtiErrorToException(env, jvmti, jvmti->GetClassSignature(klass, &name, nullptr))) { in cbClassLoadOrPrepare()
274 env, jvmti, jvmti->Deallocate(reinterpret_cast<unsigned char*>(name)))) { in cbClassLoadOrPrepare()
279 data->PerformSuspend(jvmti, env); in cbClassLoadOrPrepare()
283 extern "C" JNIEXPORT void JNICALL Java_art_SuspendEvents_setupTest(JNIEnv* env, in Java_art_SuspendEvents_setupTest() argument
301 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->AddCapabilities(&caps))) { in Java_art_SuspendEvents_setupTest()
318 JvmtiErrorToException(env, jvmti_env, jvmti_env->SetEventCallbacks(&cb, sizeof(cb))); in Java_art_SuspendEvents_setupTest()
321 static bool DeleteTestData(JNIEnv* env, jthread thr, TestData* data) { in DeleteTestData() argument
322 env->DeleteGlobalRef(data->target_klass); in DeleteTestData()
323 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->SetThreadLocalStorage(thr, nullptr))) { in DeleteTestData()
327 env, jvmti_env, jvmti_env->Deallocate(reinterpret_cast<uint8_t*>(data))); in DeleteTestData()
330 static TestData* SetupTestData(JNIEnv* env, in SetupTestData() argument
341 env, in SetupTestData()
347 env, in SetupTestData()
355 if (env->ExceptionCheck()) { in SetupTestData()
356 env->DeleteGlobalRef(data->target_klass); in SetupTestData()
363 static TestData* SetupTestData(JNIEnv* env, in SetupTestData() argument
372 env, meth, loc, target_klass, field, setup_meth, pop_offset, std::move(empty)); in SetupTestData()
376 Java_art_SuspendEvents_setupSuspendClassEvent(JNIEnv* env, in Java_art_SuspendEvents_setupSuspendClassEvent() argument
383 jint cnt = env->GetArrayLength(interesting_names); in Java_art_SuspendEvents_setupSuspendClassEvent()
385 env->PushLocalFrame(1); in Java_art_SuspendEvents_setupSuspendClassEvent()
386 jstring name_obj = reinterpret_cast<jstring>(env->GetObjectArrayElement(interesting_names, i)); in Java_art_SuspendEvents_setupSuspendClassEvent()
387 const char* name_chr = env->GetStringUTFChars(name_obj, nullptr); in Java_art_SuspendEvents_setupSuspendClassEvent()
389 env->ReleaseStringUTFChars(name_obj, name_chr); in Java_art_SuspendEvents_setupSuspendClassEvent()
390 env->PopLocalFrame(nullptr); in Java_art_SuspendEvents_setupSuspendClassEvent()
394 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_setupSuspendClassEvent()
398 data = SetupTestData(env, nullptr, 0, nullptr, nullptr, nullptr, 0, std::move(names)); in Java_art_SuspendEvents_setupSuspendClassEvent()
402 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->SetThreadLocalStorage(thr, data))) { in Java_art_SuspendEvents_setupSuspendClassEvent()
406 env, in Java_art_SuspendEvents_setupSuspendClassEvent()
412 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) { in Java_art_SuspendEvents_clearSuspendClassEvent() argument
415 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_clearSuspendClassEvent()
420 env, in Java_art_SuspendEvents_clearSuspendClassEvent()
426 env, in Java_art_SuspendEvents_clearSuspendClassEvent()
431 DeleteTestData(env, thr, data); in Java_art_SuspendEvents_clearSuspendClassEvent()
435 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject meth, jlocation loc, jthread thr) { in Java_art_SuspendEvents_setupSuspendSingleStepAt() argument
438 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_setupSuspendSingleStepAt()
442 data = SetupTestData(env, meth, loc, nullptr, nullptr, nullptr, 0); in Java_art_SuspendEvents_setupSuspendSingleStepAt()
446 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->SetThreadLocalStorage(thr, data))) { in Java_art_SuspendEvents_setupSuspendSingleStepAt()
450 env, in Java_art_SuspendEvents_setupSuspendSingleStepAt()
456 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) { in Java_art_SuspendEvents_clearSuspendSingleStepFor() argument
459 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_clearSuspendSingleStepFor()
464 env, in Java_art_SuspendEvents_clearSuspendSingleStepFor()
469 DeleteTestData(env, thr, data); in Java_art_SuspendEvents_clearSuspendSingleStepFor()
473 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jint offset, jobject breakpoint_func, jthread thr) { in Java_art_SuspendEvents_setupSuspendPopFrameEvent() argument
476 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_setupSuspendPopFrameEvent()
480 data = SetupTestData(env, nullptr, 0, nullptr, nullptr, breakpoint_func, offset); in Java_art_SuspendEvents_setupSuspendPopFrameEvent()
482 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->SetThreadLocalStorage(thr, data))) { in Java_art_SuspendEvents_setupSuspendPopFrameEvent()
486 env, in Java_art_SuspendEvents_setupSuspendPopFrameEvent()
492 env, in Java_art_SuspendEvents_setupSuspendPopFrameEvent()
498 env, jvmti_env, jvmti_env->SetBreakpoint(data->frame_pop_setup_method, 0))) { in Java_art_SuspendEvents_setupSuspendPopFrameEvent()
504 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) { in Java_art_SuspendEvents_clearSuspendPopFrameEvent() argument
507 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_clearSuspendPopFrameEvent()
512 env, in Java_art_SuspendEvents_clearSuspendPopFrameEvent()
518 env, in Java_art_SuspendEvents_clearSuspendPopFrameEvent()
524 env, jvmti_env, jvmti_env->ClearBreakpoint(data->frame_pop_setup_method, 0))) { in Java_art_SuspendEvents_clearSuspendPopFrameEvent()
527 DeleteTestData(env, thr, data); in Java_art_SuspendEvents_clearSuspendPopFrameEvent()
531 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject meth, jlocation loc, jthread thr) { in Java_art_SuspendEvents_setupSuspendBreakpointFor() argument
534 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_setupSuspendBreakpointFor()
538 data = SetupTestData(env, meth, loc, nullptr, nullptr, nullptr, 0); in Java_art_SuspendEvents_setupSuspendBreakpointFor()
542 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->SetThreadLocalStorage(thr, data))) { in Java_art_SuspendEvents_setupSuspendBreakpointFor()
546 env, in Java_art_SuspendEvents_setupSuspendBreakpointFor()
552 env, jvmti_env, jvmti_env->SetBreakpoint(data->target_method, data->target_loc)); in Java_art_SuspendEvents_setupSuspendBreakpointFor()
556 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) { in Java_art_SuspendEvents_clearSuspendBreakpointFor() argument
559 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_clearSuspendBreakpointFor()
564 env, in Java_art_SuspendEvents_clearSuspendBreakpointFor()
570 env, jvmti_env, jvmti_env->ClearBreakpoint(data->target_method, data->target_loc))) { in Java_art_SuspendEvents_clearSuspendBreakpointFor()
573 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->SetThreadLocalStorage(thr, nullptr))) { in Java_art_SuspendEvents_clearSuspendBreakpointFor()
576 DeleteTestData(env, thr, data); in Java_art_SuspendEvents_clearSuspendBreakpointFor()
580 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method, jboolean is_catch, jthread thr) { in Java_art_SuspendEvents_setupSuspendExceptionEvent() argument
583 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_setupSuspendExceptionEvent()
587 data = SetupTestData(env, method, 0, nullptr, nullptr, nullptr, 0); in Java_art_SuspendEvents_setupSuspendExceptionEvent()
591 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->SetThreadLocalStorage(thr, data))) { in Java_art_SuspendEvents_setupSuspendExceptionEvent()
595 env, in Java_art_SuspendEvents_setupSuspendExceptionEvent()
602 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) { in Java_art_SuspendEvents_clearSuspendExceptionEvent() argument
605 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_clearSuspendExceptionEvent()
610 env, in Java_art_SuspendEvents_clearSuspendExceptionEvent()
616 env, in Java_art_SuspendEvents_clearSuspendExceptionEvent()
621 DeleteTestData(env, thr, data); in Java_art_SuspendEvents_clearSuspendExceptionEvent()
625 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method, jboolean enter, jthread thr) { in Java_art_SuspendEvents_setupSuspendMethodEvent() argument
628 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_setupSuspendMethodEvent()
632 data = SetupTestData(env, method, 0, nullptr, nullptr, nullptr, 0); in Java_art_SuspendEvents_setupSuspendMethodEvent()
636 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->SetThreadLocalStorage(thr, data))) { in Java_art_SuspendEvents_setupSuspendMethodEvent()
640 env, in Java_art_SuspendEvents_setupSuspendMethodEvent()
647 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) { in Java_art_SuspendEvents_clearSuspendMethodEvent() argument
650 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_clearSuspendMethodEvent()
655 env, in Java_art_SuspendEvents_clearSuspendMethodEvent()
661 env, in Java_art_SuspendEvents_clearSuspendMethodEvent()
666 DeleteTestData(env, thr, data); in Java_art_SuspendEvents_clearSuspendMethodEvent()
670 Java_art_SuspendEvents_setupFieldSuspendFor(JNIEnv* env, in Java_art_SuspendEvents_setupFieldSuspendFor() argument
678 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_setupFieldSuspendFor()
682 data = SetupTestData(env, nullptr, 0, target_klass, field, nullptr, 0); in Java_art_SuspendEvents_setupFieldSuspendFor()
686 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->SetThreadLocalStorage(thr, data))) { in Java_art_SuspendEvents_setupFieldSuspendFor()
689 if (JvmtiErrorToException(env, in Java_art_SuspendEvents_setupFieldSuspendFor()
699 env, jvmti_env, jvmti_env->SetFieldAccessWatch(data->target_klass, data->target_field)); in Java_art_SuspendEvents_setupFieldSuspendFor()
702 env, in Java_art_SuspendEvents_setupFieldSuspendFor()
709 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) { in Java_art_SuspendEvents_clearFieldSuspendFor() argument
712 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_clearFieldSuspendFor()
717 env, in Java_art_SuspendEvents_clearFieldSuspendFor()
722 if (JvmtiErrorToException(env, in Java_art_SuspendEvents_clearFieldSuspendFor()
729 env, in Java_art_SuspendEvents_clearFieldSuspendFor()
733 env, in Java_art_SuspendEvents_clearFieldSuspendFor()
738 env->ExceptionClear(); in Java_art_SuspendEvents_clearFieldSuspendFor()
740 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->SetThreadLocalStorage(thr, nullptr))) { in Java_art_SuspendEvents_clearFieldSuspendFor()
743 DeleteTestData(env, thr, data); in Java_art_SuspendEvents_clearFieldSuspendFor()
747 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) { in Java_art_SuspendEvents_setupWaitForNativeCall() argument
750 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_setupWaitForNativeCall()
754 data = SetupTestData(env, nullptr, 0, nullptr, nullptr, nullptr, 0); in Java_art_SuspendEvents_setupWaitForNativeCall()
758 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->SetThreadLocalStorage(thr, data))) { in Java_art_SuspendEvents_setupWaitForNativeCall()
764 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) { in Java_art_SuspendEvents_clearWaitForNativeCall() argument
767 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_clearWaitForNativeCall()
771 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->SetThreadLocalStorage(thr, nullptr))) { in Java_art_SuspendEvents_clearWaitForNativeCall()
774 DeleteTestData(env, thr, data); in Java_art_SuspendEvents_clearWaitForNativeCall()
778 Java_art_SuspendEvents_waitForSuspendHit(JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thr) { in Java_art_SuspendEvents_waitForSuspendHit() argument
781 env, jvmti_env, jvmti_env->GetThreadLocalStorage(thr, reinterpret_cast<void**>(&data)))) { in Java_art_SuspendEvents_waitForSuspendHit()
785 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->RawMonitorEnter(data->notify_monitor))) { in Java_art_SuspendEvents_waitForSuspendHit()
790 env, jvmti_env, jvmti_env->RawMonitorWait(data->notify_monitor, -1))) { in Java_art_SuspendEvents_waitForSuspendHit()
794 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->RawMonitorExit(data->notify_monitor))) { in Java_art_SuspendEvents_waitForSuspendHit()
798 while (!JvmtiErrorToException(env, jvmti_env, jvmti_env->GetThreadState(thr, &state)) && in Java_art_SuspendEvents_waitForSuspendHit()