/art/openjdkjvmti/ |
D | OpenjdkJvmTi.cc | 100 static jvmtiError getEnvironmentError(jvmtiEnv* env) { in getEnvironmentError() argument 101 if (env == nullptr) { in getEnvironmentError() 110 #define ENSURE_VALID_ENV(env) \ argument 112 jvmtiError ensure_valid_env_ ## __LINE__ = getEnvironmentError(env); \ 118 #define ENSURE_HAS_CAP(env, cap) \ argument 120 if (ArtJvmTiEnv::AsArtJvmTiEnv(env)->capabilities.cap != 1) { \ 126 static jvmtiError Allocate(jvmtiEnv* env, jlong size, unsigned char** mem_ptr) { in Allocate() argument 127 jvmtiError err = getEnvironmentError(env); in Allocate() 133 return AllocUtil::Allocate(env, size, mem_ptr); in Allocate() 136 static jvmtiError Deallocate(jvmtiEnv* env, unsigned char* mem) { in Deallocate() argument [all …]
|
/art/test/1927-exception-event/ |
D | exception_event.cc | 37 static void ThrowNative(JNIEnv* env) { in ThrowNative() argument 38 ScopedLocalRef<jclass> exception(env, env->FindClass("art/Test1927$TestException")); in ThrowNative() 39 env->ThrowNew(exception.get(), "from native"); in ThrowNative() 42 static void CallMethod(JNIEnv* env, jclass test, const char* name) { in CallMethod() argument 43 jmethodID m = env->GetStaticMethodID(test, name, "()V"); in CallMethod() 44 env->CallStaticVoidMethod(test, m); in CallMethod() 47 static void ClearAndPrintException(JNIEnv* env, jclass test) { in ClearAndPrintException() argument 48 jthrowable e = env->ExceptionOccurred(); in ClearAndPrintException() 49 env->ExceptionClear(); in ClearAndPrintException() 50 jmethodID m = env->GetStaticMethodID(test, "printException", "(Ljava/lang/Throwable;)V"); in ClearAndPrintException() [all …]
|
/art/test/1914-get-local-instance/ |
D | local_instance.cc | 37 JNIEnv* env, jobject thiz, jobject run) { in Java_art_Test1914_00024TargetClass_NativeInstanceMethod() argument 38 ScopedLocalRef<jclass> runnable(env, env->FindClass("java/lang/Runnable")); in Java_art_Test1914_00024TargetClass_NativeInstanceMethod() 39 if (env->ExceptionCheck()) { return; } in Java_art_Test1914_00024TargetClass_NativeInstanceMethod() 40 jmethodID method = env->GetMethodID(runnable.get(), "run", "()V"); in Java_art_Test1914_00024TargetClass_NativeInstanceMethod() 41 if (env->ExceptionCheck()) { return; } in Java_art_Test1914_00024TargetClass_NativeInstanceMethod() 42 env->CallVoidMethod(run, method); in Java_art_Test1914_00024TargetClass_NativeInstanceMethod() 43 if (env->ExceptionCheck()) { return; } in Java_art_Test1914_00024TargetClass_NativeInstanceMethod() 44 ScopedLocalRef<jclass> Test1914(env, env->FindClass("art/Test1914")); in Java_art_Test1914_00024TargetClass_NativeInstanceMethod() 45 if (env->ExceptionCheck()) { return; } in Java_art_Test1914_00024TargetClass_NativeInstanceMethod() 46 jmethodID report = env->GetStaticMethodID(Test1914.get(), "reportValue", "(Ljava/lang/Object;)V"); in Java_art_Test1914_00024TargetClass_NativeInstanceMethod() [all …]
|
/art/test/2009-structural-local-ref/ |
D | local-ref.cc | 35 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject obj, jobject thnk) { in Java_art_Test2009_NativeLocalCallStatic() argument 36 jclass obj_klass = env->GetObjectClass(obj); in Java_art_Test2009_NativeLocalCallStatic() 37 jmethodID run_meth = env->GetMethodID(env->FindClass("java/lang/Runnable"), "run", "()V"); in Java_art_Test2009_NativeLocalCallStatic() 38 env->CallVoidMethod(thnk, run_meth); in Java_art_Test2009_NativeLocalCallStatic() 40 env->GetStaticMethodID(obj_klass, "getGreetingStatic", "()Ljava/lang/String;"); in Java_art_Test2009_NativeLocalCallStatic() 41 if (env->ExceptionCheck()) { in Java_art_Test2009_NativeLocalCallStatic() 44 return reinterpret_cast<jstring>(env->CallStaticObjectMethod(obj_klass, new_method)); in Java_art_Test2009_NativeLocalCallStatic() 49 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject obj, jobject thnk) { in Java_art_Test2009_NativeLocalCallVirtual() argument 50 jclass obj_klass = env->GetObjectClass(obj); in Java_art_Test2009_NativeLocalCallVirtual() 51 jmethodID run_meth = env->GetMethodID(env->FindClass("java/lang/Runnable"), "run", "()V"); in Java_art_Test2009_NativeLocalCallVirtual() [all …]
|
/art/test/674-hiddenapi/ |
D | hiddenapi.cc | 56 JNIEnv* env, jclass klass, jstring jpath, jboolean is_core_platform) { in Java_Main_appendToBootClassLoader() argument 57 ScopedUtfChars utf(env, jpath); in Java_Main_appendToBootClassLoader() 78 Java_Main_setDexDomain(env, klass, int_index, is_core_platform); in Java_Main_appendToBootClassLoader() 96 static jobject NewInstance(JNIEnv* env, jclass klass) { in NewInstance() argument 97 jmethodID constructor = env->GetMethodID(klass, "<init>", "()V"); in NewInstance() 101 return env->NewObject(klass, constructor); in NewInstance() 105 JNIEnv* env, jclass, jclass klass, jstring name, jboolean is_static) { in Java_JNI_canDiscoverField() argument 106 ScopedUtfChars utf_name(env, name); in Java_JNI_canDiscoverField() 107 jfieldID field = is_static ? env->GetStaticFieldID(klass, utf_name.c_str(), "I") in Java_JNI_canDiscoverField() 108 : env->GetFieldID(klass, utf_name.c_str(), "I"); in Java_JNI_canDiscoverField() [all …]
|
/art/test/1922-owned-monitors-info/ |
D | owned_monitors.cc | 37 static bool doMonitorEnter(JNIEnv* env, jobject target) { in doMonitorEnter() argument 38 return env->MonitorEnter(target) != 0; in doMonitorEnter() 40 static bool doMonitorExit(JNIEnv* env, jobject target) { in doMonitorExit() argument 41 return env->MonitorExit(target) != 0; in doMonitorExit() 44 static bool doCallRunnable(JNIEnv* env, jobject next) { in doCallRunnable() argument 45 ScopedLocalRef<jclass> run_class(env, env->FindClass("java/lang/Runnable")); in doCallRunnable() 49 jmethodID run = env->GetMethodID(run_class.get(), "run", "()V"); in doCallRunnable() 50 if (env->ExceptionCheck()) { in doCallRunnable() 53 env->CallVoidMethod(next, run); in doCallRunnable() 54 return env->ExceptionCheck(); in doCallRunnable() [all …]
|
/art/test/986-native-method-bind/ |
D | native_bind.cc | 36 static void doUpPrintCall(JNIEnv* env, const char* function) { in doUpPrintCall() argument 37 ScopedLocalRef<jclass> klass(env, env->FindClass("art/Test986")); in doUpPrintCall() 38 jmethodID targetMethod = env->GetStaticMethodID(klass.get(), function, "()V"); in doUpPrintCall() 39 env->CallStaticVoidMethod(klass.get(), targetMethod); in doUpPrintCall() 43 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) { in Java_art_Test986_00024Transform_sayHi__() argument 44 doUpPrintCall(env, "doSayHi"); in Java_art_Test986_00024Transform_sayHi__() 48 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) { in Java_art_Test986_00024Transform_sayHi2() argument 49 doUpPrintCall(env, "doSayHi2"); in Java_art_Test986_00024Transform_sayHi2() 52 extern "C" JNIEXPORT void JNICALL NoReallySayGoodbye(JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) { in NoReallySayGoodbye() argument 53 doUpPrintCall(env, "doSayBye"); in NoReallySayGoodbye() [all …]
|
/art/test/1968-force-early-return/ |
D | force_early_return.cc | 46 JNIEnv* env, jobject thiz) { in Java_art_Test1968_00024NativeCalledObject_calledFunction() argument 47 env->PushLocalFrame(4); in Java_art_Test1968_00024NativeCalledObject_calledFunction() 48 jclass klass = env->GetObjectClass(thiz); in Java_art_Test1968_00024NativeCalledObject_calledFunction() 49 jfieldID cnt = env->GetFieldID(klass, "cnt", "I"); in Java_art_Test1968_00024NativeCalledObject_calledFunction() 50 env->SetIntField(thiz, cnt, env->GetIntField(thiz, cnt) + 1); in Java_art_Test1968_00024NativeCalledObject_calledFunction() 51 jclass int_container_klass = env->FindClass("art/Test1968$IntContainer"); in Java_art_Test1968_00024NativeCalledObject_calledFunction() 52 jmethodID int_cont_new = env->GetMethodID(int_container_klass, "<init>", "(I)V"); in Java_art_Test1968_00024NativeCalledObject_calledFunction() 53 jobject res = env->NewObject(int_container_klass, int_cont_new, env->GetIntField(thiz, cnt)); in Java_art_Test1968_00024NativeCalledObject_calledFunction() 54 env->SetIntField(thiz, cnt, env->GetIntField(thiz, cnt) + 1); in Java_art_Test1968_00024NativeCalledObject_calledFunction() 56 if (JvmtiErrorToException(env, in Java_art_Test1968_00024NativeCalledObject_calledFunction() [all …]
|
/art/test/1970-force-early-return-long/ |
D | force_early_return_long.cc | 46 JNIEnv* env, jobject thiz) { in Java_art_Test1970_00024NativeCalledObject_calledFunction() argument 47 env->PushLocalFrame(4); in Java_art_Test1970_00024NativeCalledObject_calledFunction() 48 jclass klass = env->GetObjectClass(thiz); in Java_art_Test1970_00024NativeCalledObject_calledFunction() 49 jfieldID cnt = env->GetFieldID(klass, "cnt", "I"); in Java_art_Test1970_00024NativeCalledObject_calledFunction() 50 env->SetIntField(thiz, cnt, env->GetIntField(thiz, cnt) + 1); in Java_art_Test1970_00024NativeCalledObject_calledFunction() 51 jlong res = static_cast<jlong>(env->GetIntField(thiz, cnt)); in Java_art_Test1970_00024NativeCalledObject_calledFunction() 52 env->SetIntField(thiz, cnt, env->GetIntField(thiz, cnt) + 1); in Java_art_Test1970_00024NativeCalledObject_calledFunction() 54 if (JvmtiErrorToException(env, in Java_art_Test1970_00024NativeCalledObject_calledFunction() 58 env->PopLocalFrame(nullptr); in Java_art_Test1970_00024NativeCalledObject_calledFunction() 62 art::common_suspend_event::PerformSuspension(jvmti_env, env); in Java_art_Test1970_00024NativeCalledObject_calledFunction() [all …]
|
/art/runtime/ |
D | well_known_classes.cc | 181 static jclass CacheClass(JNIEnv* env, const char* jni_class_name) { in CacheClass() argument 182 ScopedLocalRef<jclass> c(env, env->FindClass(jni_class_name)); in CacheClass() 186 return reinterpret_cast<jclass>(env->NewGlobalRef(c.get())); in CacheClass() 189 static jfieldID CacheField(JNIEnv* env, jclass c, bool is_static, in CacheField() argument 193 ScopedObjectAccess soa(env); in CacheField() 203 ScopedObjectAccess soa(env); in CacheField() 215 static jmethodID CacheMethod(JNIEnv* env, jclass c, bool is_static, in CacheMethod() argument 219 ScopedObjectAccess soa(env); in CacheMethod() 229 ScopedObjectAccess soa(env); in CacheMethod() 241 static jmethodID CacheMethod(JNIEnv* env, const char* klass, bool is_static, in CacheMethod() argument [all …]
|
/art/test/ti-agent/ |
D | breakpoint_helper.cc | 62 JNIEnv* env, in Java_art_Breakpoint_getLineNumberTableNative() argument 65 jmethodID method = env->FromReflectedMethod(target); in Java_art_Breakpoint_getLineNumberTableNative() 66 if (env->ExceptionCheck()) { in Java_art_Breakpoint_getLineNumberTableNative() 71 if (JvmtiErrorToException(env, jvmti_env, in Java_art_Breakpoint_getLineNumberTableNative() 75 jintArray lines_array = env->NewIntArray(nlines); in Java_art_Breakpoint_getLineNumberTableNative() 76 if (env->ExceptionCheck()) { in Java_art_Breakpoint_getLineNumberTableNative() 80 jlongArray locs_array = env->NewLongArray(nlines); in Java_art_Breakpoint_getLineNumberTableNative() 81 if (env->ExceptionCheck()) { in Java_art_Breakpoint_getLineNumberTableNative() 85 ScopedLocalRef<jclass> object_class(env, env->FindClass("java/lang/Object")); in Java_art_Breakpoint_getLineNumberTableNative() 86 if (env->ExceptionCheck()) { in Java_art_Breakpoint_getLineNumberTableNative() [all …]
|
D | suspend_event_helper.cc | 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() [all …]
|
D | suspension_helper.cc | 29 JNIEnv* env, jclass, jthread thr) { in Java_art_Suspension_isSuspended() argument 31 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->GetThreadState(thr, &state))) { in Java_art_Suspension_isSuspended() 37 static std::vector<jthread> CopyToVector(JNIEnv* env, jobjectArray thrs) { in CopyToVector() argument 38 jsize len = env->GetArrayLength(thrs); in CopyToVector() 41 ret.push_back(reinterpret_cast<jthread>(env->GetObjectArrayElement(thrs, i))); in CopyToVector() 46 extern "C" JNIEXPORT jintArray JNICALL Java_art_Suspension_resumeList(JNIEnv* env, in Java_art_Suspension_resumeList() argument 50 std::vector<jthread> threads(CopyToVector(env, thr)); in Java_art_Suspension_resumeList() 51 if (env->ExceptionCheck()) { in Java_art_Suspension_resumeList() 54 jintArray ret = env->NewIntArray(threads.size()); in Java_art_Suspension_resumeList() 55 if (env->ExceptionCheck()) { in Java_art_Suspension_resumeList() [all …]
|
D | locals_helper.cc | 37 extern "C" JNIEXPORT void Java_art_Locals_EnableLocalVariableAccess(JNIEnv* env, jclass) { in Java_art_Locals_EnableLocalVariableAccess() argument 39 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->GetCapabilities(&caps))) { in Java_art_Locals_EnableLocalVariableAccess() 43 JvmtiErrorToException(env, jvmti_env, jvmti_env->AddCapabilities(&caps)); in Java_art_Locals_EnableLocalVariableAccess() 46 extern "C" JNIEXPORT void Java_art_Locals_SetLocalVariableObject(JNIEnv* env, in Java_art_Locals_SetLocalVariableObject() argument 52 JvmtiErrorToException(env, jvmti_env, jvmti_env->SetLocalObject(t, depth, slot, val)); in Java_art_Locals_SetLocalVariableObject() 55 extern "C" JNIEXPORT void Java_art_Locals_SetLocalVariableDouble(JNIEnv* env, in Java_art_Locals_SetLocalVariableDouble() argument 61 JvmtiErrorToException(env, jvmti_env, jvmti_env->SetLocalDouble(t, depth, slot, val)); in Java_art_Locals_SetLocalVariableDouble() 64 extern "C" JNIEXPORT void Java_art_Locals_SetLocalVariableFloat(JNIEnv* env, in Java_art_Locals_SetLocalVariableFloat() argument 70 JvmtiErrorToException(env, jvmti_env, jvmti_env->SetLocalFloat(t, depth, slot, val)); in Java_art_Locals_SetLocalVariableFloat() 73 extern "C" JNIEXPORT void Java_art_Locals_SetLocalVariableLong(JNIEnv* env, in Java_art_Locals_SetLocalVariableLong() argument [all …]
|
/art/test/1953-pop-frame/ |
D | pop_frame.cc | 46 void JNICALL Java_art_Test1953_popFrame(JNIEnv* env, in Java_art_Test1953_popFrame() argument 49 JvmtiErrorToException(env, jvmti_env, jvmti_env->PopFrame(thr)); in Java_art_Test1953_popFrame() 54 JNIEnv* env, jobject thiz) { in Java_art_Test1953_00024NativeCalledObject_calledFunction() argument 55 env->PushLocalFrame(1); in Java_art_Test1953_00024NativeCalledObject_calledFunction() 56 jclass klass = env->GetObjectClass(thiz); in Java_art_Test1953_00024NativeCalledObject_calledFunction() 57 jfieldID cnt = env->GetFieldID(klass, "cnt", "I"); in Java_art_Test1953_00024NativeCalledObject_calledFunction() 58 env->SetIntField(thiz, cnt, env->GetIntField(thiz, cnt) + 1); in Java_art_Test1953_00024NativeCalledObject_calledFunction() 59 env->PopLocalFrame(nullptr); in Java_art_Test1953_00024NativeCalledObject_calledFunction() 60 art::common_suspend_event::PerformSuspension(jvmti_env, env); in Java_art_Test1953_00024NativeCalledObject_calledFunction() 65 JNIEnv* env, jobject thiz) { in Java_art_Test1953_00024NativeCallerObject_run() argument [all …]
|
/art/test/993-breakpoints/ |
D | breakpoints.cc | 40 jobject JNICALL Java_art_Test993_constructNative(JNIEnv* env, in Java_art_Test993_constructNative() argument 44 jmethodID method = env->FromReflectedMethod(target); in Java_art_Test993_constructNative() 45 if (env->ExceptionCheck()) { in Java_art_Test993_constructNative() 48 return env->NewObject(clazz, method); in Java_art_Test993_constructNative() 52 void JNICALL Java_art_Test993_invokeNativeObject(JNIEnv* env, in Java_art_Test993_invokeNativeObject() argument 57 jmethodID method = env->FromReflectedMethod(target); in Java_art_Test993_invokeNativeObject() 58 if (env->ExceptionCheck()) { in Java_art_Test993_invokeNativeObject() 62 env->CallStaticObjectMethod(clazz, method); in Java_art_Test993_invokeNativeObject() 64 env->CallObjectMethod(thizz, method); in Java_art_Test993_invokeNativeObject() 69 void JNICALL Java_art_Test993_invokeNativeBool(JNIEnv* env, in Java_art_Test993_invokeNativeBool() argument [all …]
|
/art/test/1974-resize-array/ |
D | resize_array.cc | 41 using ChangeArraySize = jvmtiError (*)(jvmtiEnv* env, jobject arr, jint size); 58 static jint FindExtensionEvent(JNIEnv* env, const std::string& name) { in FindExtensionEvent() argument 61 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->GetExtensionEvents(&n_ext, &infos))) { in FindExtensionEvent() 79 ScopedLocalRef<jclass> rt_exception(env, env->FindClass("java/lang/RuntimeException")); in FindExtensionEvent() 80 env->ThrowNew(rt_exception.get(), (name + " extensions not found").c_str()); in FindExtensionEvent() 86 static jvmtiExtensionFunction FindExtensionMethod(JNIEnv* env, const std::string& name) { in FindExtensionMethod() argument 89 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->GetExtensionFunctions(&n_ext, &infos))) { in FindExtensionMethod() 105 ScopedLocalRef<jclass> rt_exception(env, env->FindClass("java/lang/RuntimeException")); in FindExtensionMethod() 106 env->ThrowNew(rt_exception.get(), (name + " extensions not found").c_str()); in FindExtensionMethod() 112 extern "C" JNIEXPORT void JNICALL Java_art_Test1974_ResizeArray(JNIEnv* env, in Java_art_Test1974_ResizeArray() argument [all …]
|
/art/runtime/native/ |
D | dalvik_system_DexFile.cc | 63 JNIEnv* env, in ConvertJavaArrayToDexFiles() argument 69 jsize array_size = env->GetArrayLength(array); in ConvertJavaArrayToDexFiles() 70 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertJavaArrayToDexFiles() 76 jlong* long_data = env->GetLongArrayElements(reinterpret_cast<jlongArray>(array), in ConvertJavaArrayToDexFiles() 78 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertJavaArrayToDexFiles() 88 env->ReleaseLongArrayElements(reinterpret_cast<jlongArray>(array), long_data, JNI_ABORT); in ConvertJavaArrayToDexFiles() 89 return env->ExceptionCheck() != JNI_TRUE; in ConvertJavaArrayToDexFiles() 92 static jlongArray ConvertDexFilesToJavaArray(JNIEnv* env, in ConvertDexFilesToJavaArray() argument 96 jlongArray long_array = env->NewLongArray(static_cast<jsize>(kDexFileIndexStart + vec.size())); in ConvertDexFilesToJavaArray() 97 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertDexFilesToJavaArray() [all …]
|
/art/test/004-JniTest/ |
D | jni_test.cc | 60 JNIEnv* env = nullptr; in AttachHelper() local 62 int attach_result = jvm->AttachCurrentThread(&env, &args); in AttachHelper() 67 fn(env); in AttachHelper() 83 static void testFindClassOnAttachedNativeThread(JNIEnv* env) { in testFindClassOnAttachedNativeThread() argument 84 jclass clazz = env->FindClass("Main"); in testFindClassOnAttachedNativeThread() 86 CHECK(!env->ExceptionCheck()); in testFindClassOnAttachedNativeThread() 88 jobjectArray array = env->NewObjectArray(0, clazz, nullptr); in testFindClassOnAttachedNativeThread() 90 CHECK(!env->ExceptionCheck()); in testFindClassOnAttachedNativeThread() 93 extern "C" JNIEXPORT void JNICALL Java_Main_testUTFRegion(JNIEnv* env, jclass, jstring null_str) { in Java_Main_testUTFRegion() argument 94 jstring foo_str = env->NewStringUTF("FOOBAR"); in Java_Main_testUTFRegion() [all …]
|
/art/test/1919-vminit-thread-start-timing/ |
D | vminit.cc | 51 static void EnableEvent(jvmtiEnv* env, jvmtiEvent evt) { in EnableEvent() argument 52 jvmtiError error = env->SetEventNotificationMode(JVMTI_ENABLE, evt, nullptr); in EnableEvent() 58 static void JNICALL ThreadStartCallback(jvmtiEnv *jvmti, JNIEnv* env, jthread thread) { in ThreadStartCallback() argument 62 list->events.push_back({ "ThreadStart", env->NewGlobalRef(thread) }); in ThreadStartCallback() 67 JNIEnv* env, in Test1919AgentThread() argument 74 list->events.push_back({ "Test1919AgentThread", env->NewGlobalRef(cur) }); in Test1919AgentThread() 75 env->DeleteLocalRef(cur); in Test1919AgentThread() 81 static void CreateAgentThread(jvmtiEnv* jvmti, JNIEnv* env) { in CreateAgentThread() argument 83 ScopedLocalRef<jobject> thread_name(env, env->NewStringUTF("JVMTI_THREAD-Test1919")); in CreateAgentThread() 86 ScopedLocalRef<jclass> thread_klass(env, env->FindClass("java/lang/Thread")); in CreateAgentThread() [all …]
|
/art/test/1969-force-early-return-void/ |
D | force_early_return_void.cc | 46 JNIEnv* env, jobject thiz) { in Java_art_Test1969_00024NativeCalledObject_calledFunction() argument 47 jclass klass = env->GetObjectClass(thiz); in Java_art_Test1969_00024NativeCalledObject_calledFunction() 48 jfieldID cnt = env->GetFieldID(klass, "cnt", "I"); in Java_art_Test1969_00024NativeCalledObject_calledFunction() 49 env->SetIntField(thiz, cnt, env->GetIntField(thiz, cnt) + 1); in Java_art_Test1969_00024NativeCalledObject_calledFunction() 50 env->SetIntField(thiz, cnt, env->GetIntField(thiz, cnt) + 1); in Java_art_Test1969_00024NativeCalledObject_calledFunction() 52 if (JvmtiErrorToException(env, in Java_art_Test1969_00024NativeCalledObject_calledFunction() 59 art::common_suspend_event::PerformSuspension(jvmti_env, env); in Java_art_Test1969_00024NativeCalledObject_calledFunction() 66 JNIEnv* env, jobject thiz) { in Java_art_Test1969_00024NativeCallerObject_run() argument 67 env->PushLocalFrame(1); in Java_art_Test1969_00024NativeCallerObject_run() 68 jclass klass = env->GetObjectClass(thiz); in Java_art_Test1969_00024NativeCallerObject_run() [all …]
|
/art/test/1934-jvmti-signal-thread/ |
D | signal_threads.cc | 44 extern "C" JNIEXPORT jlong JNICALL Java_art_Test1934_allocNativeMonitor(JNIEnv* env, jclass) { in Java_art_Test1934_allocNativeMonitor() argument 46 if (JvmtiErrorToException(env, in Java_art_Test1934_allocNativeMonitor() 52 if (JvmtiErrorToException(env, in Java_art_Test1934_allocNativeMonitor() 58 if (JvmtiErrorToException(env, in Java_art_Test1934_allocNativeMonitor() 69 extern "C" JNIEXPORT void Java_art_Test1934_nativeWaitForOtherThread(JNIEnv* env, in Java_art_Test1934_nativeWaitForOtherThread() argument 74 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->RawMonitorEnter(mon->start_monitor))) { in Java_art_Test1934_nativeWaitForOtherThread() 78 if (JvmtiErrorToException(env, in Java_art_Test1934_nativeWaitForOtherThread() 81 JvmtiErrorToException(env, jvmti_env, jvmti_env->RawMonitorExit(mon->start_monitor)); in Java_art_Test1934_nativeWaitForOtherThread() 84 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->RawMonitorExit(mon->start_monitor))) { in Java_art_Test1934_nativeWaitForOtherThread() 89 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->RawMonitorEnter(mon->continue_monitor))) { in Java_art_Test1934_nativeWaitForOtherThread() [all …]
|
/art/test/1900-track-alloc/ |
D | alloc.cc | 27 using GetGlobalState = jvmtiError(*)(jvmtiEnv* env, jlong* allocated); 44 extern "C" JNIEXPORT void JNICALL Java_art_Test1900_doDeallocate(JNIEnv* env, in Java_art_Test1900_doDeallocate() argument 48 JvmtiErrorToException(env, in Java_art_Test1900_doDeallocate() 54 extern "C" JNIEXPORT jlong JNICALL Java_art_Test1900_doAllocate(JNIEnv* env, in Java_art_Test1900_doAllocate() argument 59 JvmtiErrorToException(env, in Java_art_Test1900_doAllocate() 65 extern "C" JNIEXPORT jlong JNICALL Java_art_Test1900_getAmountAllocated(JNIEnv* env, jclass) { in Java_art_Test1900_getAmountAllocated() argument 68 env, jvmti_env, jvmti_env->GetEnvironmentLocalStorage(reinterpret_cast<void**>(&data)))) { in Java_art_Test1900_getAmountAllocated() 72 ScopedLocalRef<jclass> rt_exception(env, env->FindClass("java/lang/RuntimeException")); in Java_art_Test1900_getAmountAllocated() 73 env->ThrowNew(rt_exception.get(), "Alloc tracking data not initialized."); in Java_art_Test1900_getAmountAllocated() 77 JvmtiErrorToException(env, jvmti_env, data->get_global_state(jvmti_env, &allocated)); in Java_art_Test1900_getAmountAllocated() [all …]
|
/art/test/1930-monitor-info/ |
D | monitor.cc | 37 extern "C" JNIEXPORT void JNICALL Java_art_Test1930_executeLockedNative(JNIEnv* env, in Java_art_Test1930_executeLockedNative() argument 41 ScopedLocalRef<jclass> runnable(env, env->FindClass("java/lang/Runnable")); in Java_art_Test1930_executeLockedNative() 42 if (env->ExceptionCheck()) { in Java_art_Test1930_executeLockedNative() 45 jmethodID method = env->GetMethodID(runnable.get(), "run", "()V"); in Java_art_Test1930_executeLockedNative() 47 if (env->ExceptionCheck()) { in Java_art_Test1930_executeLockedNative() 50 jmethodID printMethod = env->GetStaticMethodID(klass, "printPreLock", "(Ljava/lang/Object;)V"); in Java_art_Test1930_executeLockedNative() 51 if (env->ExceptionCheck()) { in Java_art_Test1930_executeLockedNative() 55 env->CallStaticVoidMethod(klass, printMethod, l); in Java_art_Test1930_executeLockedNative() 56 if (env->ExceptionCheck()) { in Java_art_Test1930_executeLockedNative() 59 if (env->MonitorEnter(l) != 0) { in Java_art_Test1930_executeLockedNative() [all …]
|
/art/test/1940-ddms-ext/ |
D | ddm_ext.cc | 31 using DdmHandleChunk = jvmtiError(*)(jvmtiEnv* env, 62 extern "C" JNIEXPORT jobject JNICALL Java_art_Test1940_processChunk(JNIEnv* env, in Java_art_Test1940_processChunk() argument 67 env, jvmti_env, jvmti_env->GetEnvironmentLocalStorage(reinterpret_cast<void**>(&data)))) { in Java_art_Test1940_processChunk() 73 ScopedLocalRef<jclass> chunk_class(env, env->FindClass("org/apache/harmony/dalvik/ddmc/Chunk")); in Java_art_Test1940_processChunk() 74 if (env->ExceptionCheck()) { in Java_art_Test1940_processChunk() 77 jfieldID type_field_id = env->GetFieldID(chunk_class.get(), "type", "I"); in Java_art_Test1940_processChunk() 78 jfieldID offset_field_id = env->GetFieldID(chunk_class.get(), "offset", "I"); in Java_art_Test1940_processChunk() 79 jfieldID length_field_id = env->GetFieldID(chunk_class.get(), "length", "I"); in Java_art_Test1940_processChunk() 80 jfieldID data_field_id = env->GetFieldID(chunk_class.get(), "data", "[B"); in Java_art_Test1940_processChunk() 81 jint type = env->GetIntField(chunk, type_field_id); in Java_art_Test1940_processChunk() [all …]
|