< prev index next >

src/share/vm/oops/instanceRefKlass.cpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 85,134 **** guarantee(next->is_oop(), "next field should be an oop"); guarantee(next->is_instance(), "next field should be an instance"); guarantee(InstanceKlass::cast(next->klass())->is_reference_instance_klass(), "next field verify failed"); } } - - bool InstanceRefKlass::owns_pending_list_lock(JavaThread* thread) { - if (java_lang_ref_Reference::pending_list_lock() == NULL) return false; - Handle h_lock(thread, java_lang_ref_Reference::pending_list_lock()); - return ObjectSynchronizer::current_thread_holds_lock(thread, h_lock); - } - - void InstanceRefKlass::acquire_pending_list_lock(BasicLock *pending_list_basic_lock) { - // we may enter this with pending exception set - PRESERVE_EXCEPTION_MARK; // exceptions are never thrown, needed for TRAPS argument - - // Create a HandleMark in case we retry a GC multiple times. - // Each time we attempt the GC, we allocate the handle below - // to hold the pending list lock. We want to free this handle. - HandleMark hm; - - Handle h_lock(THREAD, java_lang_ref_Reference::pending_list_lock()); - ObjectSynchronizer::fast_enter(h_lock, pending_list_basic_lock, false, THREAD); - assert(ObjectSynchronizer::current_thread_holds_lock( - JavaThread::current(), h_lock), - "Locking should have succeeded"); - if (HAS_PENDING_EXCEPTION) CLEAR_PENDING_EXCEPTION; - } - - void InstanceRefKlass::release_and_notify_pending_list_lock( - BasicLock *pending_list_basic_lock) { - // we may enter this with pending exception set - PRESERVE_EXCEPTION_MARK; // exceptions are never thrown, needed for TRAPS argument - - // Create a HandleMark in case we retry a GC multiple times. - // Each time we attempt the GC, we allocate the handle below - // to hold the pending list lock. We want to free this handle. - HandleMark hm; - - Handle h_lock(THREAD, java_lang_ref_Reference::pending_list_lock()); - assert(ObjectSynchronizer::current_thread_holds_lock( - JavaThread::current(), h_lock), - "Lock should be held"); - // Notify waiters on pending lists lock if there is any reference. - if (java_lang_ref_Reference::pending_list() != NULL) { - ObjectSynchronizer::notifyall(h_lock, THREAD); - } - ObjectSynchronizer::fast_exit(h_lock(), pending_list_basic_lock, THREAD); - if (HAS_PENDING_EXCEPTION) CLEAR_PENDING_EXCEPTION; - } --- 85,89 ----
< prev index next >