Home | History | Annotate | Download | only in vm

Lines Matching refs:vm

54 when the native method returns into the VM, or global, which are held
95 JNI allows the VM to choose whether it wants to pin the array object or
160 * interpreted code during VM initialization and immediately after JNI
1048 * These functions aren't called directly from elsewhere in the VM.
1216 * code right after creating the VM, the spec says we need to use the class
1219 * We can't get that until after the VM has initialized though.
1400 * Kill the VM. This function does not return.
2497 * method that is pointing at unmapped memory, crashing the VM. In theory
2551 static jint GetJavaVM(JNIEnv* env, JavaVM** vm) {
2553 *vm = gDvmJni.jniVm;
2554 return (*vm == NULL) ? JNI_ERR : JNI_OK;
2757 * We need to make sure the VM is actually running. For example, if we start
2758 * up, issue an Attach, and the VM exits almost immediately, by the time the
2759 * attaching happens the VM could already be shutting down.
2763 * increment the thread count to prevent a VM exit.
2766 * while the VM is shutting down. dvmThreadSelf() will work, since it just
2767 * uses pthread TLS, but dereferencing "vm" could fail. Such is life when
2768 * you shut down a VM while threads are still running inside it.
2773 static jint attachThread(JavaVM* vm, JNIEnv** p_env, void* thr_args, bool isDaemon) {
2777 * Return immediately if we're already one with the VM.
2792 /* increment the count to keep the VM from bailing while we run */
2796 ALOGV("Refusing to attach thread '%s' -- VM is shutting down",
2847 * Attach the current thread to the VM. If the thread is already attached,
2850 static jint AttachCurrentThread(JavaVM* vm, JNIEnv** p_env, void* thr_args) {
2851 return attachThread(vm, p_env, thr_args, false);
2857 static jint AttachCurrentThreadAsDaemon(JavaVM* vm, JNIEnv** p_env, void* thr_args)
2859 return attachThread(vm, p_env, thr_args, true);
2863 * Dissociate the current thread from the VM.
2865 static jint DetachCurrentThread(JavaVM* vm) {
2883 * If current thread is attached to VM, return the associated JNIEnv.
2889 static jint GetEnv(JavaVM* vm, void** env, jint version) {
2908 * Destroy the VM. This may be called from any thread.
2914 * exited and the VM doesn't want to let us back in.)
2921 static jint DestroyJavaVM(JavaVM* vm) {
2922 JavaVMExt* ext = (JavaVMExt*) vm;
2937 if (AttachCurrentThread(vm, &tmpEnv, NULL) != JNI_OK) {
2938 ALOGV("Unable to reattach main for Destroy; assuming VM is shutting down (count=%d)",
2962 ALOGD("DestroyJavaVM shutting VM down");
3270 * VM/Env creation
3275 * Create a new JNIEnv struct and add it to the VM's list.
3277 * "self" will be NULL for the main thread, since the VM hasn't started
3281 JavaVMExt* vm = (JavaVMExt*) gDvmJni.jniVm;
3286 assert(vm != NULL);
3302 ScopedPthreadMutexLock lock(&vm->envListLock);
3305 newEnv->next = vm->envList;
3307 if (vm->envList == NULL) {
3309 vm->envList = newEnv;
3311 vm->envList->prev = newEnv;
3313 vm->envList = newEnv;
3331 JavaVMExt* vm = (JavaVMExt*) gDvmJni.jniVm;
3333 ScopedPthreadMutexLock lock(&vm->envListLock);
3335 if (extEnv == vm->envList) {
3337 vm->envList = extEnv->next;
3351 * Enable "checked JNI" after the VM has partially started. This must
3401 * Create a new VM instance.
3403 * The current thread becomes the main VM thread. We return immediately,
3414 /* zero globals; not strictly necessary the first time a VM is started */
3418 * Set up structures for JNIEnv and VM.
3487 dvmFprintf(stderr, "ERROR: Dalvik only supports one VM per process\n");
3495 * up the VM will call into native code.
3499 /* Initialize VM. */