< prev index next >

src/hotspot/share/gc/z/zRootsIterator.cpp

Print this page


   1 /*
   2  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   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  */


 303       _jni_weak_handles.unlink_or_oops_do(is_alive, cl);
 304     }
 305     _jvmti_weak_export.unlink_or_oops_do(is_alive, cl);
 306     _trace.unlink_or_oops_do(is_alive, cl);
 307     _string_table.unlink_or_oops_do(is_alive, cl);
 308   }
 309 }
 310 
 311 void ZWeakRootsIterator::oops_do(OopClosure* cl) {
 312   AlwaysTrueClosure always_alive;
 313   unlink_or_oops_do(&always_alive, cl);
 314 }
 315 
 316 void ZConcurrentWeakRootsIterator::do_jni_weak_handles(OopClosure* cl) {
 317   ZStatTimer timer(ZSubPhaseConcurrentWeakRootsJNIWeakHandles);
 318   _par_state.oops_do(cl);
 319 }
 320 
 321 ZConcurrentWeakRootsIterator::ZConcurrentWeakRootsIterator() :
 322     _par_state(JNIHandles::weak_global_handles()),
 323     _jni_weak_handles(this) {
 324 }
 325 
 326 ZConcurrentWeakRootsIterator::~ZConcurrentWeakRootsIterator() {
 327 }
 328 
 329 void ZConcurrentWeakRootsIterator::oops_do(OopClosure* cl) {
 330   ZStatTimer timer(ZSubPhaseConcurrentWeakRoots);
 331   if (ZWeakRoots) {
 332     if (ZConcurrentJNIWeakGlobalHandles) {
 333       _jni_weak_handles.oops_do(cl);
 334     }
 335   }
 336 }
 337 
 338 ZThreadRootsIterator::ZThreadRootsIterator() :
 339     _threads(this) {
 340   assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
 341   ZStatTimer timer(ZSubPhasePauseRootsSetup);
 342   Threads::change_thread_claim_parity();
 343 }
 344 
 345 ZThreadRootsIterator::~ZThreadRootsIterator() {
 346   ZStatTimer timer(ZSubPhasePauseRootsTeardown);
 347   Threads::assert_all_threads_claimed();
   1 /*
   2  * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   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  */


 303       _jni_weak_handles.unlink_or_oops_do(is_alive, cl);
 304     }
 305     _jvmti_weak_export.unlink_or_oops_do(is_alive, cl);
 306     _trace.unlink_or_oops_do(is_alive, cl);
 307     _string_table.unlink_or_oops_do(is_alive, cl);
 308   }
 309 }
 310 
 311 void ZWeakRootsIterator::oops_do(OopClosure* cl) {
 312   AlwaysTrueClosure always_alive;
 313   unlink_or_oops_do(&always_alive, cl);
 314 }
 315 
 316 void ZConcurrentWeakRootsIterator::do_jni_weak_handles(OopClosure* cl) {
 317   ZStatTimer timer(ZSubPhaseConcurrentWeakRootsJNIWeakHandles);
 318   _par_state.oops_do(cl);
 319 }
 320 
 321 ZConcurrentWeakRootsIterator::ZConcurrentWeakRootsIterator() :
 322     _par_state(JNIHandles::weak_global_handles()),
 323     _jni_weak_handles(this) {}




 324 
 325 void ZConcurrentWeakRootsIterator::oops_do(OopClosure* cl) {
 326   ZStatTimer timer(ZSubPhaseConcurrentWeakRoots);
 327   if (ZWeakRoots) {
 328     if (ZConcurrentJNIWeakGlobalHandles) {
 329       _jni_weak_handles.oops_do(cl);
 330     }
 331   }
 332 }
 333 
 334 ZThreadRootsIterator::ZThreadRootsIterator() :
 335     _threads(this) {
 336   assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
 337   ZStatTimer timer(ZSubPhasePauseRootsSetup);
 338   Threads::change_thread_claim_parity();
 339 }
 340 
 341 ZThreadRootsIterator::~ZThreadRootsIterator() {
 342   ZStatTimer timer(ZSubPhasePauseRootsTeardown);
 343   Threads::assert_all_threads_claimed();
< prev index next >