Home
last modified time | relevance | path

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

12345678910>>...16

/art/openjdkjvmti/
DOpenjdkJvmTi.cc94 static jvmtiError getEnvironmentError(jvmtiEnv* env) { in getEnvironmentError() argument
95 if (env == nullptr) { in getEnvironmentError()
104 #define ENSURE_VALID_ENV(env) \ argument
106 jvmtiError ensure_valid_env_ ## __LINE__ = getEnvironmentError(env); \
112 #define ENSURE_HAS_CAP(env, cap) \ argument
114 if (ArtJvmTiEnv::AsArtJvmTiEnv(env)->capabilities.cap != 1) { \
120 static jvmtiError Allocate(jvmtiEnv* env, jlong size, unsigned char** mem_ptr) { in Allocate() argument
121 jvmtiError err = getEnvironmentError(env); in Allocate()
127 return AllocUtil::Allocate(env, size, mem_ptr); in Allocate()
130 static jvmtiError Deallocate(jvmtiEnv* env, unsigned char* mem) { in Deallocate() argument
[all …]
/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/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/674-hiddenapi/
Dhiddenapi.cc53 JNIEnv* env, jclass klass, jstring jpath, jboolean is_core_platform) { in Java_Main_appendToBootClassLoader() argument
54 ScopedUtfChars utf(env, jpath); in Java_Main_appendToBootClassLoader()
73 Java_Main_setDexDomain(env, klass, int_index, is_core_platform); in Java_Main_appendToBootClassLoader()
88 static jobject NewInstance(JNIEnv* env, jclass klass) { in NewInstance() argument
89 jmethodID constructor = env->GetMethodID(klass, "<init>", "()V"); in NewInstance()
93 return env->NewObject(klass, constructor); in NewInstance()
97 JNIEnv* env, jclass, jclass klass, jstring name, jboolean is_static) { in Java_JNI_canDiscoverField() argument
98 ScopedUtfChars utf_name(env, name); in Java_JNI_canDiscoverField()
99 jfieldID field = is_static ? env->GetStaticFieldID(klass, utf_name.c_str(), "I") in Java_JNI_canDiscoverField()
100 : env->GetFieldID(klass, utf_name.c_str(), "I"); in Java_JNI_canDiscoverField()
[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/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/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/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/ti-agent/
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 …]
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 …]
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()
42 ret.push_back(reinterpret_cast<jthread>(env->GetObjectArrayElement(thrs, i))); in CopyToVector()
47 extern "C" JNIEXPORT jintArray JNICALL Java_art_Suspension_resumeList(JNIEnv* env, in Java_art_Suspension_resumeList() argument
51 std::vector<jthread> threads(CopyToVector(env, thr)); in Java_art_Suspension_resumeList()
52 if (env->ExceptionCheck()) { in Java_art_Suspension_resumeList()
55 jintArray ret = env->NewIntArray(threads.size()); in Java_art_Suspension_resumeList()
56 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/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/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/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/test/004-JniTest/
Djni_test.cc60 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/
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/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/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/native/
Ddalvik_system_DexFile.cc73 JNIEnv* env, in ConvertJavaArrayToDexFiles() argument
79 jsize array_size = env->GetArrayLength(array); in ConvertJavaArrayToDexFiles()
80 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertJavaArrayToDexFiles()
86 jlong* long_data = env->GetLongArrayElements(reinterpret_cast<jlongArray>(array), in ConvertJavaArrayToDexFiles()
88 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertJavaArrayToDexFiles()
98 env->ReleaseLongArrayElements(reinterpret_cast<jlongArray>(array), long_data, JNI_ABORT); in ConvertJavaArrayToDexFiles()
99 return env->ExceptionCheck() != JNI_TRUE; in ConvertJavaArrayToDexFiles()
102 static jlongArray ConvertDexFilesToJavaArray(JNIEnv* env, in ConvertDexFilesToJavaArray() argument
106 jlongArray long_array = env->NewLongArray(static_cast<jsize>(kDexFileIndexStart + vec.size())); in ConvertDexFilesToJavaArray()
107 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertDexFilesToJavaArray()
[all …]
/art/test/1940-ddms-ext/
Dddm_ext.cc31 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 …]
/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/910-methods/
Dmethods.cc34 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 …]

12345678910>>...16