src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp

Print this page




   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  *
  23  */
  24 
  25 # include "incls/_precompiled.incl"
  26 # include "incls/_parCardTableModRefBS.cpp.incl"








  27 
  28 void CardTableModRefBS::par_non_clean_card_iterate_work(Space* sp, MemRegion mr,
  29                                                         DirtyCardToOopClosure* dcto_cl,
  30                                                         MemRegionClosure* cl,
  31                                                         bool clear,
  32                                                         int n_threads) {
  33   if (n_threads > 0) {
  34     assert((n_threads == 1 && ParallelGCThreads == 0) ||
  35            n_threads <= (int)ParallelGCThreads,
  36            "# worker threads != # requested!");
  37     // Make sure the LNC array is valid for the space.
  38     jbyte**   lowest_non_clean;
  39     uintptr_t lowest_non_clean_base_chunk_index;
  40     size_t    lowest_non_clean_chunk_size;
  41     get_LNC_array_for_space(sp, lowest_non_clean,
  42                             lowest_non_clean_base_chunk_index,
  43                             lowest_non_clean_chunk_size);
  44 
  45     int n_strides = n_threads * StridesPerThread;
  46     SequentialSubTasksDone* pst = sp->par_seq_tasks();




   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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "memory/allocation.inline.hpp"
  27 #include "memory/cardTableModRefBS.hpp"
  28 #include "memory/cardTableRS.hpp"
  29 #include "memory/sharedHeap.hpp"
  30 #include "memory/space.inline.hpp"
  31 #include "memory/universe.hpp"
  32 #include "runtime/java.hpp"
  33 #include "runtime/mutexLocker.hpp"
  34 #include "runtime/virtualspace.hpp"
  35 
  36 void CardTableModRefBS::par_non_clean_card_iterate_work(Space* sp, MemRegion mr,
  37                                                         DirtyCardToOopClosure* dcto_cl,
  38                                                         MemRegionClosure* cl,
  39                                                         bool clear,
  40                                                         int n_threads) {
  41   if (n_threads > 0) {
  42     assert((n_threads == 1 && ParallelGCThreads == 0) ||
  43            n_threads <= (int)ParallelGCThreads,
  44            "# worker threads != # requested!");
  45     // Make sure the LNC array is valid for the space.
  46     jbyte**   lowest_non_clean;
  47     uintptr_t lowest_non_clean_base_chunk_index;
  48     size_t    lowest_non_clean_chunk_size;
  49     get_LNC_array_for_space(sp, lowest_non_clean,
  50                             lowest_non_clean_base_chunk_index,
  51                             lowest_non_clean_chunk_size);
  52 
  53     int n_strides = n_threads * StridesPerThread;
  54     SequentialSubTasksDone* pst = sp->par_seq_tasks();