Home
last modified time | relevance | path

Searched refs:env (Results 1 – 25 of 355) sorted by relevance

12345678910>>...15

/art/test/1927-exception-event/
Dexception_event.cc37 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/
Dlocal_instance.cc37 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/
DOpenjdkJvmTi.cc100 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/2009-structural-local-ref/
Dlocal-ref.cc35 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/1968-force-early-return/
Dforce_early_return.cc46 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/1922-owned-monitors-info/
Downed_monitors.cc37 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/
Dhiddenapi.cc56 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/986-native-method-bind/
Dnative_bind.cc36 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/1970-force-early-return-long/
Dforce_early_return_long.cc46 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/test/1953-pop-frame/
Dpop_frame.cc46 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/
Dbreakpoints.cc40 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/ti-agent/
Dbreakpoint_helper.cc62 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 …]
Dsuspend_event_helper.cc56 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", &notify_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 …]
Dsuspension_helper.cc29 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 …]
Dlocals_helper.cc37 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/1974-resize-array/
Dresize_array.cc41 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/
Dwell_known_classes.cc173 static jclass CacheClass(JNIEnv* env, const char* jni_class_name) { in CacheClass() argument
174 ScopedLocalRef<jclass> c(env, env->FindClass(jni_class_name)); in CacheClass()
178 return reinterpret_cast<jclass>(env->NewGlobalRef(c.get())); in CacheClass()
181 static jfieldID CacheField(JNIEnv* env, jclass c, bool is_static, in CacheField() argument
185 ScopedObjectAccess soa(env); in CacheField()
195 ScopedObjectAccess soa(env); in CacheField()
207 static jmethodID CacheMethod(JNIEnv* env, jclass c, bool is_static, in CacheMethod() argument
211 ScopedObjectAccess soa(env); in CacheMethod()
221 ScopedObjectAccess soa(env); in CacheMethod()
233 static jmethodID CacheMethod(JNIEnv* env, const char* klass, bool is_static, in CacheMethod() argument
[all …]
/art/test/1969-force-early-return-void/
Dforce_early_return_void.cc46 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/1930-monitor-info/
Dmonitor.cc37 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/1919-vminit-thread-start-timing/
Dvminit.cc51 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/
Ddalvik_system_DexFile.cc61 JNIEnv* env, in ConvertJavaArrayToDexFiles() argument
67 jsize array_size = env->GetArrayLength(array); in ConvertJavaArrayToDexFiles()
68 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertJavaArrayToDexFiles()
74 jlong* long_data = env->GetLongArrayElements(reinterpret_cast<jlongArray>(array), in ConvertJavaArrayToDexFiles()
76 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertJavaArrayToDexFiles()
86 env->ReleaseLongArrayElements(reinterpret_cast<jlongArray>(array), long_data, JNI_ABORT); in ConvertJavaArrayToDexFiles()
87 return env->ExceptionCheck() != JNI_TRUE; in ConvertJavaArrayToDexFiles()
90 static jlongArray ConvertDexFilesToJavaArray(JNIEnv* env, in ConvertDexFilesToJavaArray() argument
94 jlongArray long_array = env->NewLongArray(static_cast<jsize>(kDexFileIndexStart + vec.size())); in ConvertDexFilesToJavaArray()
95 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertDexFilesToJavaArray()
[all …]
/art/test/1934-jvmti-signal-thread/
Dsignal_threads.cc44 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/
Dalloc.cc27 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/runtime/jni/
Dcheck_jni.cc288 JNIEnv* env; in CheckAttachedThread() local
289 Runtime::Current()->GetJavaVM()->AttachCurrentThread(&env, /* thr_args= */ nullptr); in CheckAttachedThread()
1297 bool CheckThread(JNIEnv* env) REQUIRES_SHARED(Locks::mutator_lock_) { in CheckThread() argument
1306 if (env != threadEnv) { in CheckThread()
1308 Thread* envThread = reinterpret_cast<JNIEnvExt*>(env)->GetSelf(); in CheckThread()
1543 static void* CreateGuardedPACopy(JNIEnv* env, const jarray java_array, jboolean* is_copy, in CreateGuardedPACopy() argument
1545 ScopedObjectAccess soa(env); in CreateGuardedPACopy()
1561 static void* ReleaseGuardedPACopy(const char* function_name, JNIEnv* env, in ReleaseGuardedPACopy() argument
1564 ScopedObjectAccess soa(env); in ReleaseGuardedPACopy()
1748 static jint GetVersion(JNIEnv* env) { in GetVersion() argument
[all …]
/art/test/989-method-trace-throw/
Dmethod_trace.cc40 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 …]

12345678910>>...15