src/share/vm/gc/g1/g1RootProcessor.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/gc/g1

src/share/vm/gc/g1/g1RootProcessor.cpp

Print this page
rev 29186 : Review changes 2


   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 

  27 #include "classfile/stringTable.hpp"
  28 #include "classfile/systemDictionary.hpp"
  29 #include "code/codeCache.hpp"
  30 #include "gc/g1/bufferingOopClosure.hpp"
  31 #include "gc/g1/g1CodeBlobClosure.hpp"
  32 #include "gc/g1/g1CollectedHeap.inline.hpp"
  33 #include "gc/g1/g1CollectorState.hpp"
  34 #include "gc/g1/g1GCPhaseTimes.hpp"
  35 #include "gc/g1/g1Policy.hpp"
  36 #include "gc/g1/g1RootClosures.hpp"
  37 #include "gc/g1/g1RootProcessor.hpp"
  38 #include "gc/g1/heapRegion.inline.hpp"
  39 #include "memory/allocation.inline.hpp"
  40 #include "aot/aotLoader.hpp"
  41 #include "runtime/fprofiler.hpp"
  42 #include "runtime/mutex.hpp"
  43 #include "services/management.hpp"
  44 
  45 void G1RootProcessor::worker_has_discovered_all_strong_classes() {
  46   assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
  47 
  48   uint new_value = (uint)Atomic::add(1, &_n_workers_discovered_strong_classes);
  49   if (new_value == n_workers()) {
  50     // This thread is last. Notify the others.
  51     MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
  52     _lock.notify_all();
  53   }
  54 }
  55 
  56 void G1RootProcessor::wait_until_all_strong_classes_discovered() {
  57   assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
  58 
  59   if ((uint)_n_workers_discovered_strong_classes != n_workers()) {
  60     MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 
  27 #include "aot/aotLoader.hpp"
  28 #include "classfile/stringTable.hpp"
  29 #include "classfile/systemDictionary.hpp"
  30 #include "code/codeCache.hpp"
  31 #include "gc/g1/bufferingOopClosure.hpp"
  32 #include "gc/g1/g1CodeBlobClosure.hpp"
  33 #include "gc/g1/g1CollectedHeap.inline.hpp"
  34 #include "gc/g1/g1CollectorState.hpp"
  35 #include "gc/g1/g1GCPhaseTimes.hpp"
  36 #include "gc/g1/g1Policy.hpp"
  37 #include "gc/g1/g1RootClosures.hpp"
  38 #include "gc/g1/g1RootProcessor.hpp"
  39 #include "gc/g1/heapRegion.inline.hpp"
  40 #include "memory/allocation.inline.hpp"

  41 #include "runtime/fprofiler.hpp"
  42 #include "runtime/mutex.hpp"
  43 #include "services/management.hpp"
  44 
  45 void G1RootProcessor::worker_has_discovered_all_strong_classes() {
  46   assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
  47 
  48   uint new_value = (uint)Atomic::add(1, &_n_workers_discovered_strong_classes);
  49   if (new_value == n_workers()) {
  50     // This thread is last. Notify the others.
  51     MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
  52     _lock.notify_all();
  53   }
  54 }
  55 
  56 void G1RootProcessor::wait_until_all_strong_classes_discovered() {
  57   assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
  58 
  59   if ((uint)_n_workers_discovered_strong_classes != n_workers()) {
  60     MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);


src/share/vm/gc/g1/g1RootProcessor.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File