/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/openjdkjvmti/ |
D | OpenjdkJvmTi.cc | 98 static jvmtiError getEnvironmentError(jvmtiEnv* env) { in getEnvironmentError() argument 99 if (env == nullptr) { in getEnvironmentError() 108 #define ENSURE_VALID_ENV(env) \ argument 110 jvmtiError ensure_valid_env_ ## __LINE__ = getEnvironmentError(env); \ 116 #define ENSURE_HAS_CAP(env, cap) \ argument 118 if (ArtJvmTiEnv::AsArtJvmTiEnv(env)->capabilities.cap != 1) { \ 124 static jvmtiError Allocate(jvmtiEnv* env, jlong size, unsigned char** mem_ptr) { in Allocate() argument 125 jvmtiError err = getEnvironmentError(env); in Allocate() 131 return AllocUtil::Allocate(env, size, mem_ptr); in Allocate() 134 static jvmtiError Deallocate(jvmtiEnv* env, unsigned char* mem) { in Deallocate() argument [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/674-hiddenapi/ |
D | hiddenapi.cc | 53 JNIEnv* env, jclass klass, jstring jpath, jboolean is_core_platform) { in Java_Main_appendToBootClassLoader() argument 54 ScopedUtfChars utf(env, jpath); in Java_Main_appendToBootClassLoader() 75 Java_Main_setDexDomain(env, klass, int_index, is_core_platform); in Java_Main_appendToBootClassLoader() 93 static jobject NewInstance(JNIEnv* env, jclass klass) { in NewInstance() argument 94 jmethodID constructor = env->GetMethodID(klass, "<init>", "()V"); in NewInstance() 98 return env->NewObject(klass, constructor); in NewInstance() 102 JNIEnv* env, jclass, jclass klass, jstring name, jboolean is_static) { in Java_JNI_canDiscoverField() argument 103 ScopedUtfChars utf_name(env, name); in Java_JNI_canDiscoverField() 104 jfieldID field = is_static ? env->GetStaticFieldID(klass, utf_name.c_str(), "I") in Java_JNI_canDiscoverField() 105 : env->GetFieldID(klass, utf_name.c_str(), "I"); in Java_JNI_canDiscoverField() [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/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/1953-pop-frame/ |
D | pop_frame.cc | 54 JNIEnv* env, in TestData() 63 target_method(meth != nullptr ? env->FromReflectedMethod(meth) : nullptr), in TestData() 64 target_klass(reinterpret_cast<jclass>(env->NewGlobalRef(klass))), in TestData() 65 target_field(field != nullptr ? env->FromReflectedField(field) : nullptr), in TestData() 67 frame_pop_setup_method(setup_meth != nullptr ? env->FromReflectedMethod(setup_meth) in TestData() 71 JvmtiErrorToException(env, jvmti, jvmti->CreateRawMonitor("SuspendStopMonitor", 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 …]
|
/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 | 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 …]
|
D | stack_trace_helper.cc | 31 JNIEnv* env, jclass, jthread thr) { in Java_art_StackTrace_GetStackDepth() argument 33 JvmtiErrorToException(env, jvmti_env, jvmti_env->GetFrameCount(thr, &ret)); in Java_art_StackTrace_GetStackDepth() 37 extern "C" JNIEXPORT jobjectArray Java_art_StackTrace_nativeGetStackTrace(JNIEnv* env, in Java_art_StackTrace_nativeGetStackTrace() argument 41 ScopedLocalRef<jclass> klass(env, env->FindClass("art/StackTrace$StackFrameData")); in Java_art_StackTrace_nativeGetStackTrace() 42 if (env->ExceptionCheck()) { in Java_art_StackTrace_nativeGetStackTrace() 45 jmethodID constructor = env->GetMethodID( in Java_art_StackTrace_nativeGetStackTrace() 47 if (env->ExceptionCheck()) { in Java_art_StackTrace_nativeGetStackTrace() 50 if (JvmtiErrorToException(env, jvmti_env, jvmti_env->GetFrameCount(thr, &depth))) { in Java_art_StackTrace_nativeGetStackTrace() 57 env, jvmti_env, jvmti_env->Allocate(depth * sizeof(jvmtiFrameInfo), in Java_art_StackTrace_nativeGetStackTrace() 63 env, jvmti_env, jvmti_env->GetStackTrace(thr, 0, depth, frames, &nframes))) { in Java_art_StackTrace_nativeGetStackTrace() [all …]
|
/art/runtime/ |
D | well_known_classes.cc | 163 static jclass CacheClass(JNIEnv* env, const char* jni_class_name) { in CacheClass() argument 164 ScopedLocalRef<jclass> c(env, env->FindClass(jni_class_name)); in CacheClass() 168 return reinterpret_cast<jclass>(env->NewGlobalRef(c.get())); in CacheClass() 171 static jfieldID CacheField(JNIEnv* env, jclass c, bool is_static, in CacheField() argument 173 jfieldID fid = is_static ? env->GetStaticFieldID(c, name, signature) : in CacheField() 174 env->GetFieldID(c, name, signature); in CacheField() 176 ScopedObjectAccess soa(env); in CacheField() 188 static jmethodID CacheMethod(JNIEnv* env, jclass c, bool is_static, in CacheMethod() argument 190 jmethodID mid = is_static ? env->GetStaticMethodID(c, name, signature) : in CacheMethod() 191 env->GetMethodID(c, name, signature); in CacheMethod() [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/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/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/runtime/native/ |
D | dalvik_system_DexFile.cc | 60 JNIEnv* env, in ConvertJavaArrayToDexFiles() argument 66 jsize array_size = env->GetArrayLength(array); in ConvertJavaArrayToDexFiles() 67 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertJavaArrayToDexFiles() 73 jlong* long_data = env->GetLongArrayElements(reinterpret_cast<jlongArray>(array), in ConvertJavaArrayToDexFiles() 75 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertJavaArrayToDexFiles() 85 env->ReleaseLongArrayElements(reinterpret_cast<jlongArray>(array), long_data, JNI_ABORT); in ConvertJavaArrayToDexFiles() 86 return env->ExceptionCheck() != JNI_TRUE; in ConvertJavaArrayToDexFiles() 89 static jlongArray ConvertDexFilesToJavaArray(JNIEnv* env, in ConvertDexFilesToJavaArray() argument 93 jlongArray long_array = env->NewLongArray(static_cast<jsize>(kDexFileIndexStart + vec.size())); in ConvertDexFilesToJavaArray() 94 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertDexFilesToJavaArray() [all …]
|
/art/test/989-method-trace-throw/ |
D | method_trace.cc | 40 jfloat JNICALL Java_art_Test989_returnFloatNative(JNIEnv* env, jclass klass) { in Java_art_Test989_returnFloatNative() argument 41 jmethodID targetMethod = env->GetStaticMethodID(klass, "doGetFloat", "()F"); in Java_art_Test989_returnFloatNative() 42 return env->CallStaticFloatMethod(klass, targetMethod); in Java_art_Test989_returnFloatNative() 45 jdouble JNICALL Java_art_Test989_returnDoubleNative(JNIEnv* env, jclass klass) { in Java_art_Test989_returnDoubleNative() argument 46 jmethodID targetMethod = env->GetStaticMethodID(klass, "doGetDouble", "()D"); in Java_art_Test989_returnDoubleNative() 47 return env->CallStaticDoubleMethod(klass, targetMethod); in Java_art_Test989_returnDoubleNative() 50 extern "C" JNIEXPORT jobject JNICALL Java_art_Test989_returnValueNative(JNIEnv* env, jclass klass) { in Java_art_Test989_returnValueNative() argument 51 jmethodID targetMethod = env->GetStaticMethodID(klass, "mkTestObject", "()Ljava/lang/Object;"); in Java_art_Test989_returnValueNative() 52 return env->CallStaticObjectMethod(klass, targetMethod); in Java_art_Test989_returnValueNative() 55 extern "C" JNIEXPORT void JNICALL Java_art_Test989_doNothingNative(JNIEnv* env ATTRIBUTE_UNUSED, in Java_art_Test989_doNothingNative() [all …]
|
/art/test/1936-thread-end-events/ |
D | method_trace.cc | 40 jfloat JNICALL Java_art_Test989_returnFloatNative(JNIEnv* env, jclass klass) { in Java_art_Test989_returnFloatNative() argument 41 jmethodID targetMethod = env->GetStaticMethodID(klass, "doGetFloat", "()F"); in Java_art_Test989_returnFloatNative() 42 return env->CallStaticFloatMethod(klass, targetMethod); in Java_art_Test989_returnFloatNative() 45 jdouble JNICALL Java_art_Test989_returnDoubleNative(JNIEnv* env, jclass klass) { in Java_art_Test989_returnDoubleNative() argument 46 jmethodID targetMethod = env->GetStaticMethodID(klass, "doGetDouble", "()D"); in Java_art_Test989_returnDoubleNative() 47 return env->CallStaticDoubleMethod(klass, targetMethod); in Java_art_Test989_returnDoubleNative() 50 extern "C" JNIEXPORT jobject JNICALL Java_art_Test989_returnValueNative(JNIEnv* env, jclass klass) { in Java_art_Test989_returnValueNative() argument 51 jmethodID targetMethod = env->GetStaticMethodID(klass, "mkTestObject", "()Ljava/lang/Object;"); in Java_art_Test989_returnValueNative() 52 return env->CallStaticObjectMethod(klass, targetMethod); in Java_art_Test989_returnValueNative() 55 extern "C" JNIEXPORT void JNICALL Java_art_Test989_doNothingNative(JNIEnv* env ATTRIBUTE_UNUSED, in Java_art_Test989_doNothingNative() [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/1940-ddms-ext/ |
D | ddm_ext.cc | 28 using DdmHandleChunk = jvmtiError(*)(jvmtiEnv* env, 53 extern "C" JNIEXPORT jobject JNICALL Java_art_Test1940_processChunk(JNIEnv* env, in Java_art_Test1940_processChunk() argument 58 env, jvmti_env, jvmti_env->GetEnvironmentLocalStorage(reinterpret_cast<void**>(&data)))) { in Java_art_Test1940_processChunk() 64 ScopedLocalRef<jclass> chunk_class(env, env->FindClass("org/apache/harmony/dalvik/ddmc/Chunk")); in Java_art_Test1940_processChunk() 65 if (env->ExceptionCheck()) { in Java_art_Test1940_processChunk() 68 jfieldID type_field_id = env->GetFieldID(chunk_class.get(), "type", "I"); in Java_art_Test1940_processChunk() 69 jfieldID offset_field_id = env->GetFieldID(chunk_class.get(), "offset", "I"); in Java_art_Test1940_processChunk() 70 jfieldID length_field_id = env->GetFieldID(chunk_class.get(), "length", "I"); in Java_art_Test1940_processChunk() 71 jfieldID data_field_id = env->GetFieldID(chunk_class.get(), "data", "[B"); in Java_art_Test1940_processChunk() 72 jint type = env->GetIntField(chunk, type_field_id); in Java_art_Test1940_processChunk() [all …]
|
/art/test/common/ |
D | stack_inspect.cc | 40 extern "C" JNIEXPORT void JNICALL Java_Main_disableStackFrameAsserts(JNIEnv* env ATTRIBUTE_UNUSED, in Java_Main_disableStackFrameAsserts() 45 static jboolean IsInterpreted(JNIEnv* env, jclass, size_t level) { in IsInterpreted() argument 46 ScopedObjectAccess soa(env); in IsInterpreted() 55 extern "C" JNIEXPORT jboolean JNICALL Java_Main_isInterpreted(JNIEnv* env, jclass klass) { in Java_Main_isInterpreted() argument 56 return IsInterpreted(env, klass, 1); in Java_Main_isInterpreted() 61 extern "C" JNIEXPORT jboolean JNICALL Java_Main_isInterpretedAt(JNIEnv* env, in Java_Main_isInterpretedAt() argument 64 return IsInterpreted(env, klass, depth); in Java_Main_isInterpretedAt() 97 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method, jboolean require_deoptimizable) { in Java_Main_isInterpretedFunction() argument 103 env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "method is null!"); in Java_Main_isInterpretedFunction() 106 jmethodID id = env->FromReflectedMethod(method); in Java_Main_isInterpretedFunction() [all …]
|
/art/test/991-field-trace-2/ |
D | field_trace.cc | 34 JNIEnv* env, jclass klass, jobject testclass) { in Java_art_Test991_doNativeReadWrite() argument 36 ScopedLocalRef<jclass> testclass_klass(env, env->GetObjectClass(testclass)); in Java_art_Test991_doNativeReadWrite() 37 jmethodID notifyMethod = env->GetStaticMethodID(klass, "doPrintNativeNotification", "(I)V"); in Java_art_Test991_doNativeReadWrite() 38 if (env->ExceptionCheck()) { in Java_art_Test991_doNativeReadWrite() 41 jfieldID xyz_field = env->GetFieldID(testclass_klass.get(), "xyz", "I"); in Java_art_Test991_doNativeReadWrite() 42 if (env->ExceptionCheck()) { in Java_art_Test991_doNativeReadWrite() 45 jint val = env->GetIntField(testclass, xyz_field); in Java_art_Test991_doNativeReadWrite() 46 if (env->ExceptionCheck()) { in Java_art_Test991_doNativeReadWrite() 49 env->CallStaticVoidMethod(klass, notifyMethod, val); in Java_art_Test991_doNativeReadWrite() 50 if (env->ExceptionCheck()) { in Java_art_Test991_doNativeReadWrite() [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 jint JNICALL Java_Main_getFieldSubclass(JNIEnv* env, in Java_Main_getFieldSubclass() argument 97 jfieldID f = env->FromReflectedField(f_obj); in Java_Main_getFieldSubclass() [all …]
|
/art/test/910-methods/ |
D | methods.cc | 34 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) { in Java_art_Test910_getMethodName() argument 35 jmethodID id = env->FromReflectedMethod(method); in Java_art_Test910_getMethodName() 41 if (JvmtiErrorToException(env, jvmti_env, result)) { in Java_art_Test910_getMethodName() 47 return name == nullptr ? nullptr : env->NewStringUTF(name); in Java_art_Test910_getMethodName() 49 return sig == nullptr ? nullptr : env->NewStringUTF(sig); in Java_art_Test910_getMethodName() 51 return gen == nullptr ? nullptr : env->NewStringUTF(gen); in Java_art_Test910_getMethodName() 54 jobjectArray ret = CreateObjectArray(env, 3, "java/lang/String", callback); in Java_art_Test910_getMethodName() 69 if (JvmtiErrorToException(env, jvmti_env, result2)) { in Java_art_Test910_getMethodName() 77 JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) { in Java_art_Test910_getMethodDeclaringClass() argument 78 jmethodID id = env->FromReflectedMethod(method); in Java_art_Test910_getMethodDeclaringClass() [all …]
|