src/hotspot/share/gc/shared/cardTableRS.hpp
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 42598 hotspot/src/share/vm/gc/shared/cardTableRS.hpp@45562c0473fb
child 47580 96392e113a0a
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 27898
diff changeset
     2
 * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1388
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1388
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1388
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 27898
diff changeset
    25
#ifndef SHARE_VM_GC_SHARED_CARDTABLERS_HPP
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 27898
diff changeset
    26
#define SHARE_VM_GC_SHARED_CARDTABLERS_HPP
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
31964
d34ad1715d96 8130931: Refactor CardTableModRefBS[ForCTRS]
kbarrett
parents: 31358
diff changeset
    28
#include "gc/shared/cardTableModRefBSForCTRS.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "memory/memRegion.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    30
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
class Space;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
class OopsInGenClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
33212
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
    34
// Helper to remember modified oops in all klasses.
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
    35
class KlassRemSet {
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
    36
  bool _accumulate_modified_oops;
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
    37
 public:
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
    38
  KlassRemSet() : _accumulate_modified_oops(false) {}
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
    39
  void set_accumulate_modified_oops(bool value) { _accumulate_modified_oops = value; }
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
    40
  bool accumulate_modified_oops() { return _accumulate_modified_oops; }
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
    41
  bool mod_union_is_clear();
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
    42
  void clear_mod_union();
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
    43
};
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
    44
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
    45
// This RemSet uses a card table both as shared data structure
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
// for a mod ref barrier set and for the rem set information.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
33212
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
    48
class CardTableRS: public CHeapObj<mtGC> {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  friend class VMStructs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  // Below are private classes used in impl.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  friend class VerifyCTSpaceClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  friend class ClearNoncleanCardWrapper;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  static jbyte clean_card_val() {
31964
d34ad1715d96 8130931: Refactor CardTableModRefBS[ForCTRS]
kbarrett
parents: 31358
diff changeset
    55
    return CardTableModRefBSForCTRS::clean_card;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
12118
36458db4ccf5 7068625: Testing 8 bytes of card table entries at a time speeds up card-scanning
brutisso
parents: 9624
diff changeset
    58
  static intptr_t clean_card_row() {
31964
d34ad1715d96 8130931: Refactor CardTableModRefBS[ForCTRS]
kbarrett
parents: 31358
diff changeset
    59
    return CardTableModRefBSForCTRS::clean_card_row;
12118
36458db4ccf5 7068625: Testing 8 bytes of card table entries at a time speeds up card-scanning
brutisso
parents: 9624
diff changeset
    60
  }
36458db4ccf5 7068625: Testing 8 bytes of card table entries at a time speeds up card-scanning
brutisso
parents: 9624
diff changeset
    61
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  static bool
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  card_is_dirty_wrt_gen_iter(jbyte cv) {
31964
d34ad1715d96 8130931: Refactor CardTableModRefBS[ForCTRS]
kbarrett
parents: 31358
diff changeset
    64
    return CardTableModRefBSForCTRS::card_is_dirty_wrt_gen_iter(cv);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
33212
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
    67
  KlassRemSet _klass_rem_set;
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
    68
  BarrierSet* _bs;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
33212
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
    70
  CardTableModRefBSForCTRS* _ct_bs;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  void verify_space(Space* s, HeapWord* gen_start);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  enum ExtendedCardValue {
31964
d34ad1715d96 8130931: Refactor CardTableModRefBS[ForCTRS]
kbarrett
parents: 31358
diff changeset
    75
    youngergen_card   = CardTableModRefBSForCTRS::CT_MR_BS_last_reserved + 1,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
    // These are for parallel collection.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
    // There are three P (parallel) youngergen card values.  In general, this
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
    // needs to be more than the number of generations (including the perm
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
    // gen) that might have younger_refs_do invoked on them separately.  So
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
    // if we add more gens, we have to add more values.
31964
d34ad1715d96 8130931: Refactor CardTableModRefBS[ForCTRS]
kbarrett
parents: 31358
diff changeset
    81
    youngergenP1_card  = CardTableModRefBSForCTRS::CT_MR_BS_last_reserved + 2,
d34ad1715d96 8130931: Refactor CardTableModRefBS[ForCTRS]
kbarrett
parents: 31358
diff changeset
    82
    youngergenP2_card  = CardTableModRefBSForCTRS::CT_MR_BS_last_reserved + 3,
d34ad1715d96 8130931: Refactor CardTableModRefBS[ForCTRS]
kbarrett
parents: 31358
diff changeset
    83
    youngergenP3_card  = CardTableModRefBSForCTRS::CT_MR_BS_last_reserved + 4,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
    cur_youngergen_and_prev_nonclean_card =
31964
d34ad1715d96 8130931: Refactor CardTableModRefBS[ForCTRS]
kbarrett
parents: 31358
diff changeset
    85
      CardTableModRefBSForCTRS::CT_MR_BS_last_reserved + 5
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  // An array that contains, for each generation, the card table value last
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  // used as the current value for a younger_refs_do iteration of that
31358
693058672cc6 8077842: Remove the level parameter passed around in GenCollectedHeap
jwilhelm
parents: 30870
diff changeset
    90
  // portion of the table. The perm gen is index 0. The young gen is index 1,
693058672cc6 8077842: Remove the level parameter passed around in GenCollectedHeap
jwilhelm
parents: 30870
diff changeset
    91
  // but will always have the value "clean_card". The old gen is index 2.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  jbyte* _last_cur_val_in_gen;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  jbyte _cur_youngergen_card_val;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
27687
3a6367d7110b 8064721: The card tables only ever need two covering regions
ehelin
parents: 22548
diff changeset
    96
  // Number of generations, plus one for lingering PermGen issues in CardTableRS.
3a6367d7110b 8064721: The card tables only ever need two covering regions
ehelin
parents: 22548
diff changeset
    97
  static const int _regions_to_iterate = 3;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
    98
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  jbyte cur_youngergen_card_val() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
    return _cur_youngergen_card_val;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  void set_cur_youngergen_card_val(jbyte v) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
    _cur_youngergen_card_val = v;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  bool is_prev_youngergen_card_val(jbyte v) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
    return
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
      youngergen_card <= v &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
      v < cur_youngergen_and_prev_nonclean_card &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
      v != _cur_youngergen_card_val;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  // Return a youngergen_card_value that is not currently in use.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  jbyte find_unused_youngergenP_card_value();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
public:
27687
3a6367d7110b 8064721: The card tables only ever need two covering regions
ehelin
parents: 22548
diff changeset
   115
  CardTableRS(MemRegion whole_heap);
17376
4ee999c3c007 8012902: remove use of global operator new - take 2
minqi
parents: 17031
diff changeset
   116
  ~CardTableRS();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
33212
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
   118
  // Return the barrier set associated with "this."
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
   119
  BarrierSet* bs() { return _bs; }
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
   120
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
   121
  // Set the barrier set.
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
   122
  void set_bs(BarrierSet* bs) { _bs = bs; }
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
   123
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
   124
  KlassRemSet* klass_rem_set() { return &_klass_rem_set; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
31964
d34ad1715d96 8130931: Refactor CardTableModRefBS[ForCTRS]
kbarrett
parents: 31358
diff changeset
   126
  CardTableModRefBSForCTRS* ct_bs() { return _ct_bs; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
33212
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
   128
  void younger_refs_in_space_iterate(Space* sp, OopsInGenClosure* cl, uint n_threads);
906b3d079b13 8139434: Unify GenRemSet and CardTableRS
david
parents: 31964
diff changeset
   129
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  // Override.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  void prepare_for_younger_refs_iterate(bool parallel);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  // Card table entries are cleared before application; "blk" is
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  // responsible for dirtying if the oop is still older-to-younger after
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  // closure application.
30870
3050fdcdc60b 8080112: Replace and remove the last usages of CollectedHeap::n_par_threads()
stefank
parents: 30764
diff changeset
   136
  void younger_refs_iterate(Generation* g, OopsInGenClosure* blk, uint n_threads);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 179
diff changeset
   138
  void inline_write_ref_field_gc(void* field, oop new_val) {
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   139
    jbyte* byte = _ct_bs->byte_for(field);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
    *byte = youngergen_card;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  }
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 179
diff changeset
   142
  void write_ref_field_gc_work(void* field, oop new_val) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
    inline_write_ref_field_gc(field, new_val);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  // Override.  Might want to devirtualize this in the same fashion as
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  // above.  Ensures that the value of the card for field says that it's
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
  // a younger card in the current collection.
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 179
diff changeset
   149
  virtual void write_ref_field_gc_par(void* field, oop new_val);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  void resize_covered_region(MemRegion new_region);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
  bool is_aligned(HeapWord* addr) {
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   154
    return _ct_bs->is_card_aligned(addr);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  void verify();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   159
  void clear(MemRegion mr) { _ct_bs->clear(mr); }
19289
213031f03f61 8023021: Unnecessary clearing of the card table introduced by the fix for JDK-8023013
brutisso
parents: 19286
diff changeset
   160
  void clear_into_younger(Generation* old_gen);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
42598
45562c0473fb 8166898: G1SATBCardTableLoggingModRefBS::invalidate() incorrect with whole_heap == true
lmesnik
parents: 33212
diff changeset
   162
  void invalidate(MemRegion mr) {
45562c0473fb 8166898: G1SATBCardTableLoggingModRefBS::invalidate() incorrect with whole_heap == true
lmesnik
parents: 33212
diff changeset
   163
    _ct_bs->invalidate(mr);
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   164
  }
19289
213031f03f61 8023021: Unnecessary clearing of the card table introduced by the fix for JDK-8023013
brutisso
parents: 19286
diff changeset
   165
  void invalidate_or_clear(Generation* old_gen);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
  static uintx ct_max_alignment_constraint() {
31964
d34ad1715d96 8130931: Refactor CardTableModRefBS[ForCTRS]
kbarrett
parents: 31358
diff changeset
   168
    return CardTableModRefBSForCTRS::ct_max_alignment_constraint();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   171
  jbyte* byte_for(void* p)     { return _ct_bs->byte_for(p); }
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   172
  jbyte* byte_after(void* p)   { return _ct_bs->byte_after(p); }
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   173
  HeapWord* addr_for(jbyte* p) { return _ct_bs->addr_for(p); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
  bool is_prev_nonclean_card_val(jbyte v) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
    return
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
      youngergen_card <= v &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
      v <= cur_youngergen_and_prev_nonclean_card &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
      v != _cur_youngergen_card_val;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  static bool youngergen_may_have_been_dirty(jbyte cv) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
    return cv == CardTableRS::cur_youngergen_and_prev_nonclean_card;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   187
9336
413920193f83 7037276: Unnecessary double traversal of dirty card windows
ysr
parents: 7397
diff changeset
   188
class ClearNoncleanCardWrapper: public MemRegionClosure {
9624
c3657c3324ee 6883834: ParNew: assert(!_g->to()->is_in_reserved(obj),"Scanning field twice?") with LargeObjects tests
ysr
parents: 9336
diff changeset
   189
  DirtyCardToOopClosure* _dirty_card_closure;
9336
413920193f83 7037276: Unnecessary double traversal of dirty card windows
ysr
parents: 7397
diff changeset
   190
  CardTableRS* _ct;
413920193f83 7037276: Unnecessary double traversal of dirty card windows
ysr
parents: 7397
diff changeset
   191
  bool _is_par;
413920193f83 7037276: Unnecessary double traversal of dirty card windows
ysr
parents: 7397
diff changeset
   192
private:
413920193f83 7037276: Unnecessary double traversal of dirty card windows
ysr
parents: 7397
diff changeset
   193
  // Clears the given card, return true if the corresponding card should be
413920193f83 7037276: Unnecessary double traversal of dirty card windows
ysr
parents: 7397
diff changeset
   194
  // processed.
413920193f83 7037276: Unnecessary double traversal of dirty card windows
ysr
parents: 7397
diff changeset
   195
  inline bool clear_card(jbyte* entry);
413920193f83 7037276: Unnecessary double traversal of dirty card windows
ysr
parents: 7397
diff changeset
   196
  // Work methods called by the clear_card()
413920193f83 7037276: Unnecessary double traversal of dirty card windows
ysr
parents: 7397
diff changeset
   197
  inline bool clear_card_serial(jbyte* entry);
413920193f83 7037276: Unnecessary double traversal of dirty card windows
ysr
parents: 7397
diff changeset
   198
  inline bool clear_card_parallel(jbyte* entry);
12118
36458db4ccf5 7068625: Testing 8 bytes of card table entries at a time speeds up card-scanning
brutisso
parents: 9624
diff changeset
   199
  // check alignment of pointer
36458db4ccf5 7068625: Testing 8 bytes of card table entries at a time speeds up card-scanning
brutisso
parents: 9624
diff changeset
   200
  bool is_word_aligned(jbyte* entry);
9336
413920193f83 7037276: Unnecessary double traversal of dirty card windows
ysr
parents: 7397
diff changeset
   201
413920193f83 7037276: Unnecessary double traversal of dirty card windows
ysr
parents: 7397
diff changeset
   202
public:
30870
3050fdcdc60b 8080112: Replace and remove the last usages of CollectedHeap::n_par_threads()
stefank
parents: 30764
diff changeset
   203
  ClearNoncleanCardWrapper(DirtyCardToOopClosure* dirty_card_closure, CardTableRS* ct, bool is_par);
9336
413920193f83 7037276: Unnecessary double traversal of dirty card windows
ysr
parents: 7397
diff changeset
   204
  void do_MemRegion(MemRegion mr);
413920193f83 7037276: Unnecessary double traversal of dirty card windows
ysr
parents: 7397
diff changeset
   205
};
413920193f83 7037276: Unnecessary double traversal of dirty card windows
ysr
parents: 7397
diff changeset
   206
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 27898
diff changeset
   207
#endif // SHARE_VM_GC_SHARED_CARDTABLERS_HPP