< prev index next >

src/share/vm/prims/jvm.cpp

Print this page

        

*** 585,603 **** static void fixup_cloned_reference(ReferenceType ref_type, oop src, oop clone) { // If G1 is enabled then we need to register a non-null referent // with the SATB barrier. #if INCLUDE_ALL_GCS ! if (UseG1GC) { oop referent = java_lang_ref_Reference::referent(clone); if (referent != NULL) { G1SATBCardTableModRefBS::enqueue(referent); } } #endif // INCLUDE_ALL_GCS if ((java_lang_ref_Reference::next(clone) != NULL) || ! (java_lang_ref_Reference::queue(clone) == java_lang_ref_ReferenceQueue::ENQUEUED_queue())) { // If the source has been enqueued or is being enqueued, don't // register the clone with a queue. java_lang_ref_Reference::set_queue(clone, java_lang_ref_ReferenceQueue::NULL_queue()); } // discovered and next are list links; the clone is not in those lists. --- 585,603 ---- static void fixup_cloned_reference(ReferenceType ref_type, oop src, oop clone) { // If G1 is enabled then we need to register a non-null referent // with the SATB barrier. #if INCLUDE_ALL_GCS ! if (UseG1GC || UseShenandoahGC) { oop referent = java_lang_ref_Reference::referent(clone); if (referent != NULL) { G1SATBCardTableModRefBS::enqueue(referent); } } #endif // INCLUDE_ALL_GCS if ((java_lang_ref_Reference::next(clone) != NULL) || ! (oopDesc::equals(java_lang_ref_Reference::queue(clone), java_lang_ref_ReferenceQueue::ENQUEUED_queue()))) { // If the source has been enqueued or is being enqueued, don't // register the clone with a queue. java_lang_ref_Reference::set_queue(clone, java_lang_ref_ReferenceQueue::NULL_queue()); } // discovered and next are list links; the clone is not in those lists.
*** 652,662 **** // won't copy the longs/doubles atomically in 32-bit vm's, so we copy jlongs instead // of oops. We know objects are aligned on a minimum of an jlong boundary. // The same is true of StubRoutines::object_copy and the various oop_copy // variants, and of the code generated by the inline_native_clone intrinsic. assert(MinObjAlignmentInBytes >= BytesPerLong, "objects misaligned"); ! Copy::conjoint_jlongs_atomic((jlong*)obj(), (jlong*)new_obj_oop, (size_t)align_object_size(size) / HeapWordsPerLong); // Clear the header new_obj_oop->init_mark(); // Store check (mark entire object and let gc sort it out) --- 652,662 ---- // won't copy the longs/doubles atomically in 32-bit vm's, so we copy jlongs instead // of oops. We know objects are aligned on a minimum of an jlong boundary. // The same is true of StubRoutines::object_copy and the various oop_copy // variants, and of the code generated by the inline_native_clone intrinsic. assert(MinObjAlignmentInBytes >= BytesPerLong, "objects misaligned"); ! Copy::conjoint_jlongs_atomic((jlong*) oopDesc::bs()->read_barrier(obj()), (jlong*)new_obj_oop, (size_t)align_object_size(size) / HeapWordsPerLong); // Clear the header new_obj_oop->init_mark(); // Store check (mark entire object and let gc sort it out)
*** 1506,1516 **** protection_domain = thread->privileged_stack_top()->protection_domain(); } else { protection_domain = method->method_holder()->protection_domain(); } ! if ((previous_protection_domain != protection_domain) && (protection_domain != NULL)) { local_array->push(protection_domain); previous_protection_domain = protection_domain; } if (is_privileged) break; --- 1506,1516 ---- protection_domain = thread->privileged_stack_top()->protection_domain(); } else { protection_domain = method->method_holder()->protection_domain(); } ! if ((! oopDesc::equals(previous_protection_domain, protection_domain)) && protection_domain != NULL) { local_array->push(protection_domain); previous_protection_domain = protection_domain; } if (is_privileged) break;
*** 3110,3120 **** p2i(receiver), p2i((address)java_thread), p2i(throwable)); // First check if thread is alive if (receiver != NULL) { // Check if exception is getting thrown at self (use oop equality, since the // target object might exit) ! if (java_thread == thread->threadObj()) { THROW_OOP(java_throwable); } else { // Enques a VM_Operation to stop all threads and then deliver the exception... Thread::send_async_exception(java_thread, JNIHandles::resolve(throwable)); } --- 3110,3120 ---- p2i(receiver), p2i((address)java_thread), p2i(throwable)); // First check if thread is alive if (receiver != NULL) { // Check if exception is getting thrown at self (use oop equality, since the // target object might exit) ! if (oopDesc::equals(java_thread, thread->threadObj())) { THROW_OOP(java_throwable); } else { // Enques a VM_Operation to stop all threads and then deliver the exception... Thread::send_async_exception(java_thread, JNIHandles::resolve(throwable)); }
*** 3312,3322 **** oop java_thread = JNIHandles::resolve_non_null(jthread); bool throw_illegal_thread_state = false; int count = 0; { ! MutexLockerEx ml(thread->threadObj() == java_thread ? NULL : Threads_lock); // We need to re-resolve the java_thread, since a GC might have happened during the // acquire of the lock JavaThread* thr = java_lang_Thread::thread(JNIHandles::resolve_non_null(jthread)); if (thr == NULL) { --- 3312,3322 ---- oop java_thread = JNIHandles::resolve_non_null(jthread); bool throw_illegal_thread_state = false; int count = 0; { ! MutexLockerEx ml(oopDesc::equals(thread->threadObj(), java_thread) ? NULL : Threads_lock); // We need to re-resolve the java_thread, since a GC might have happened during the // acquire of the lock JavaThread* thr = java_lang_Thread::thread(JNIHandles::resolve_non_null(jthread)); if (thr == NULL) {
*** 3361,3371 **** JVM_ENTRY(void, JVM_Interrupt(JNIEnv* env, jobject jthread)) JVMWrapper("JVM_Interrupt"); // Ensure that the C++ Thread and OSThread structures aren't freed before we operate oop java_thread = JNIHandles::resolve_non_null(jthread); ! MutexLockerEx ml(thread->threadObj() == java_thread ? NULL : Threads_lock); // We need to re-resolve the java_thread, since a GC might have happened during the // acquire of the lock JavaThread* thr = java_lang_Thread::thread(JNIHandles::resolve_non_null(jthread)); if (thr != NULL) { Thread::interrupt(thr); --- 3361,3371 ---- JVM_ENTRY(void, JVM_Interrupt(JNIEnv* env, jobject jthread)) JVMWrapper("JVM_Interrupt"); // Ensure that the C++ Thread and OSThread structures aren't freed before we operate oop java_thread = JNIHandles::resolve_non_null(jthread); ! MutexLockerEx ml(oopDesc::equals(thread->threadObj(), java_thread) ? NULL : Threads_lock); // We need to re-resolve the java_thread, since a GC might have happened during the // acquire of the lock JavaThread* thr = java_lang_Thread::thread(JNIHandles::resolve_non_null(jthread)); if (thr != NULL) { Thread::interrupt(thr);
*** 3376,3386 **** JVM_QUICK_ENTRY(jboolean, JVM_IsInterrupted(JNIEnv* env, jobject jthread, jboolean clear_interrupted)) JVMWrapper("JVM_IsInterrupted"); // Ensure that the C++ Thread and OSThread structures aren't freed before we operate oop java_thread = JNIHandles::resolve_non_null(jthread); ! MutexLockerEx ml(thread->threadObj() == java_thread ? NULL : Threads_lock); // We need to re-resolve the java_thread, since a GC might have happened during the // acquire of the lock JavaThread* thr = java_lang_Thread::thread(JNIHandles::resolve_non_null(jthread)); if (thr == NULL) { return JNI_FALSE; --- 3376,3386 ---- JVM_QUICK_ENTRY(jboolean, JVM_IsInterrupted(JNIEnv* env, jobject jthread, jboolean clear_interrupted)) JVMWrapper("JVM_IsInterrupted"); // Ensure that the C++ Thread and OSThread structures aren't freed before we operate oop java_thread = JNIHandles::resolve_non_null(jthread); ! MutexLockerEx ml(oopDesc::equals(thread->threadObj(), java_thread) ? NULL : Threads_lock); // We need to re-resolve the java_thread, since a GC might have happened during the // acquire of the lock JavaThread* thr = java_lang_Thread::thread(JNIHandles::resolve_non_null(jthread)); if (thr == NULL) { return JNI_FALSE;
< prev index next >