hotspot/src/share/vm/gc/shared/cardTableModRefBS.cpp
author stefank
Wed, 05 Jul 2017 11:33:17 +0200
changeset 46625 edefffab74e2
parent 46619 a3919f5e8d2b
permissions -rw-r--r--
8183552: Move align functions to align.hpp Reviewed-by: stuefe, pliden
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
28830
a252e278c3d9 8064947: Clean up BarrierSet ctor/dtor
jprovino
parents: 28029
diff changeset
     2
 * Copyright (c) 2000, 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: 4461
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4461
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: 4461
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
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5892
diff changeset
    25
#include "precompiled.hpp"
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30291
diff changeset
    26
#include "gc/shared/cardTableModRefBS.inline.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30291
diff changeset
    27
#include "gc/shared/collectedHeap.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30291
diff changeset
    28
#include "gc/shared/genCollectedHeap.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30291
diff changeset
    29
#include "gc/shared/space.inline.hpp"
30291
54cdc5c1a9cb 8068352: Move virtualspace.* out of src/share/vm/runtime to memory directory
coleenp
parents: 30154
diff changeset
    30
#include "memory/virtualspace.hpp"
35061
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31964
diff changeset
    31
#include "logging/log.hpp"
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents: 12268
diff changeset
    32
#include "services/memTracker.hpp"
46625
edefffab74e2 8183552: Move align functions to align.hpp
stefank
parents: 46619
diff changeset
    33
#include "utilities/align.hpp"
15482
470d0b0c09f1 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 13963
diff changeset
    34
#include "utilities/macros.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5892
diff changeset
    35
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
// This kind of "BarrierSet" allows a "CollectedHeap" to detect and
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
// enumerate ref fields that have been modified (since the last
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
// enumeration.)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
size_t CardTableModRefBS::compute_byte_map_size()
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
{
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  assert(_guard_index == cards_required(_whole_heap.word_size()) - 1,
22775
52bc5222f5f1 8026849: Fix typos in the GC code, part 2
jwilhelm
parents: 22551
diff changeset
    43
                                        "uninitialized, check declaration order");
52bc5222f5f1 8026849: Fix typos in the GC code, part 2
jwilhelm
parents: 22551
diff changeset
    44
  assert(_page_size != 0, "uninitialized, check declaration order");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  const size_t granularity = os::vm_allocation_granularity();
46619
a3919f5e8d2b 8178499: Remove _ptr_ and _size_ infixes from align functions
stefank
parents: 46618
diff changeset
    46
  return align_up(_guard_index + 1, MAX2(_page_size, granularity));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
29325
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    49
CardTableModRefBS::CardTableModRefBS(
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    50
  MemRegion whole_heap,
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    51
  const BarrierSet::FakeRtti& fake_rtti) :
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    52
  ModRefBarrierSet(fake_rtti.add_tag(BarrierSet::CardTableModRef)),
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  _whole_heap(whole_heap),
26160
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    54
  _guard_index(0),
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    55
  _guard_region(),
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    56
  _last_valid_index(0),
194
8cdd3d9a4c99 6635560: segv in reference processor on t1000
jcoomes
parents: 1
diff changeset
    57
  _page_size(os::vm_page_size()),
26160
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    58
  _byte_map_size(0),
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    59
  _covered(NULL),
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    60
  _committed(NULL),
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    61
  _cur_covered_regions(0),
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    62
  _byte_map(NULL),
31964
d34ad1715d96 8130931: Refactor CardTableModRefBS[ForCTRS]
kbarrett
parents: 31592
diff changeset
    63
  byte_map_base(NULL)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
{
26160
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    65
  assert((uintptr_t(_whole_heap.start())  & (card_size - 1))  == 0, "heap must start at card boundary");
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    66
  assert((uintptr_t(_whole_heap.end()) & (card_size - 1))  == 0, "heap must end at card boundary");
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    67
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    68
  assert(card_size <= 512, "card_size must be less than 512"); // why?
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    69
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    70
  _covered   = new MemRegion[_max_covered_regions];
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    71
  if (_covered == NULL) {
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    72
    vm_exit_during_initialization("Could not allocate card table covered region set.");
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    73
  }
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    74
}
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    75
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    76
void CardTableModRefBS::initialize() {
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    77
  _guard_index = cards_required(_whole_heap.word_size()) - 1;
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    78
  _last_valid_index = _guard_index - 1;
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    79
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    80
  _byte_map_size = compute_byte_map_size();
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    81
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  HeapWord* low_bound  = _whole_heap.start();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  HeapWord* high_bound = _whole_heap.end();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
26160
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    85
  _cur_covered_regions = 0;
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    86
  _committed = new MemRegion[_max_covered_regions];
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    87
  if (_committed == NULL) {
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
    88
    vm_exit_during_initialization("Could not allocate card table committed region set.");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  }
17376
4ee999c3c007 8012902: remove use of global operator new - take 2
minqi
parents: 17087
diff changeset
    90
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  const size_t rs_align = _page_size == (size_t) os::vm_page_size() ? 0 :
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
    MAX2(_page_size, (size_t) os::vm_allocation_granularity());
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  ReservedSpace heap_rs(_byte_map_size, rs_align, false);
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents: 12268
diff changeset
    94
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents: 12268
diff changeset
    95
  MemTracker::record_virtual_memory_type((address)heap_rs.base(), mtGC);
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents: 12268
diff changeset
    96
37462
58bb9394a98b 8152491: Convert TracePageSizes to use UL
stefank
parents: 37226
diff changeset
    97
  os::trace_page_sizes("Card Table", _guard_index + 1, _guard_index + 1,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
                       _page_size, heap_rs.base(), heap_rs.size());
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  if (!heap_rs.is_reserved()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
    vm_exit_during_initialization("Could not reserve enough space for the "
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
                                  "card marking array");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
22551
9bf46d16dcc6 8025856: Fix typos in the GC code
jwilhelm
parents: 20309
diff changeset
   104
  // The assembler store_check code will do an unsigned shift of the oop,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  // then add it to byte_map_base, i.e.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  //   _byte_map = byte_map_base + (uintptr_t(low_bound) >> card_shift)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  _byte_map = (jbyte*) heap_rs.base();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  byte_map_base = _byte_map - (uintptr_t(low_bound) >> card_shift);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  assert(byte_for(low_bound) == &_byte_map[0], "Checking start of map");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  assert(byte_for(high_bound-1) <= &_byte_map[_last_valid_index], "Checking end of map");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  jbyte* guard_card = &_byte_map[_guard_index];
46619
a3919f5e8d2b 8178499: Remove _ptr_ and _size_ infixes from align functions
stefank
parents: 46618
diff changeset
   114
  uintptr_t guard_page = align_down((uintptr_t)guard_card, _page_size);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  _guard_region = MemRegion((HeapWord*)guard_page, _page_size);
18069
e6d4971c8650 8013057: assert(_needs_gc || SafepointSynchronize::is_at_safepoint()) failed: only read at safepoint
dcubed
parents: 17376
diff changeset
   116
  os::commit_memory_or_exit((char*)guard_page, _page_size, _page_size,
e6d4971c8650 8013057: assert(_needs_gc || SafepointSynchronize::is_at_safepoint()) failed: only read at safepoint
dcubed
parents: 17376
diff changeset
   117
                            !ExecMem, "card table last card");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  *guard_card = last_card;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
35061
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31964
diff changeset
   120
  log_trace(gc, barrier)("CardTableModRefBS::CardTableModRefBS: ");
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31964
diff changeset
   121
  log_trace(gc, barrier)("    &_byte_map[0]: " INTPTR_FORMAT "  &_byte_map[_last_valid_index]: " INTPTR_FORMAT,
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31964
diff changeset
   122
                  p2i(&_byte_map[0]), p2i(&_byte_map[_last_valid_index]));
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31964
diff changeset
   123
  log_trace(gc, barrier)("    byte_map_base: " INTPTR_FORMAT, p2i(byte_map_base));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
17376
4ee999c3c007 8012902: remove use of global operator new - take 2
minqi
parents: 17087
diff changeset
   126
CardTableModRefBS::~CardTableModRefBS() {
4ee999c3c007 8012902: remove use of global operator new - take 2
minqi
parents: 17087
diff changeset
   127
  if (_covered) {
4ee999c3c007 8012902: remove use of global operator new - take 2
minqi
parents: 17087
diff changeset
   128
    delete[] _covered;
4ee999c3c007 8012902: remove use of global operator new - take 2
minqi
parents: 17087
diff changeset
   129
    _covered = NULL;
4ee999c3c007 8012902: remove use of global operator new - take 2
minqi
parents: 17087
diff changeset
   130
  }
4ee999c3c007 8012902: remove use of global operator new - take 2
minqi
parents: 17087
diff changeset
   131
  if (_committed) {
4ee999c3c007 8012902: remove use of global operator new - take 2
minqi
parents: 17087
diff changeset
   132
    delete[] _committed;
4ee999c3c007 8012902: remove use of global operator new - take 2
minqi
parents: 17087
diff changeset
   133
    _committed = NULL;
4ee999c3c007 8012902: remove use of global operator new - take 2
minqi
parents: 17087
diff changeset
   134
  }
4ee999c3c007 8012902: remove use of global operator new - take 2
minqi
parents: 17087
diff changeset
   135
}
4ee999c3c007 8012902: remove use of global operator new - take 2
minqi
parents: 17087
diff changeset
   136
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
int CardTableModRefBS::find_covering_region_by_base(HeapWord* base) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  int i;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  for (i = 0; i < _cur_covered_regions; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
    if (_covered[i].start() == base) return i;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
    if (_covered[i].start() > base) break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
  // If we didn't find it, create a new one.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
  assert(_cur_covered_regions < _max_covered_regions,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
         "too many covered regions");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  // Move the ones above up, to maintain sorted order.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  for (int j = _cur_covered_regions; j > i; j--) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
    _covered[j] = _covered[j-1];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
    _committed[j] = _committed[j-1];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  int res = i;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  _cur_covered_regions++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
  _covered[res].set_start(base);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  _covered[res].set_word_size(0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  jbyte* ct_start = byte_for(base);
46619
a3919f5e8d2b 8178499: Remove _ptr_ and _size_ infixes from align functions
stefank
parents: 46618
diff changeset
   156
  uintptr_t ct_start_aligned = align_down((uintptr_t)ct_start, _page_size);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  _committed[res].set_start((HeapWord*)ct_start_aligned);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  _committed[res].set_word_size(0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  return res;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
int CardTableModRefBS::find_covering_region_containing(HeapWord* addr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  for (int i = 0; i < _cur_covered_regions; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
    if (_covered[i].contains(addr)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
      return i;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  assert(0, "address outside of heap?");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
  return -1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
HeapWord* CardTableModRefBS::largest_prev_committed_end(int ind) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  HeapWord* max_end = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
  for (int j = 0; j < ind; j++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
    HeapWord* this_end = _committed[j].end();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
    if (this_end > max_end) max_end = this_end;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
  return max_end;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
MemRegion CardTableModRefBS::committed_unique_to_self(int self,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
                                                      MemRegion mr) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
  MemRegion result = mr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  for (int r = 0; r < _cur_covered_regions; r += 1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
    if (r != self) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
      result = result.minus(_committed[r]);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  // Never include the guard page.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
  result = result.minus(_guard_region);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  return result;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
void CardTableModRefBS::resize_covered_region(MemRegion new_region) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
  // We don't change the start of a region, only the end.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
  assert(_whole_heap.contains(new_region),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
           "attempt to cover area not in reserved area");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
  debug_only(verify_guard();)
754
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   199
  // collided is true if the expansion would push into another committed region
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   200
  debug_only(bool collided = false;)
179
59e3abf83f72 6624765: Guarantee failure "Unexpected dirty card found"
jmasa
parents: 1
diff changeset
   201
  int const ind = find_covering_region_by_base(new_region.start());
59e3abf83f72 6624765: Guarantee failure "Unexpected dirty card found"
jmasa
parents: 1
diff changeset
   202
  MemRegion const old_region = _covered[ind];
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
  assert(old_region.start() == new_region.start(), "just checking");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  if (new_region.word_size() != old_region.word_size()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
    // Commit new or uncommit old pages, if necessary.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
    MemRegion cur_committed = _committed[ind];
22551
9bf46d16dcc6 8025856: Fix typos in the GC code
jwilhelm
parents: 20309
diff changeset
   207
    // Extend the end of this _committed region
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
    // to cover the end of any lower _committed regions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
    // This forms overlapping regions, but never interior regions.
179
59e3abf83f72 6624765: Guarantee failure "Unexpected dirty card found"
jmasa
parents: 1
diff changeset
   210
    HeapWord* const max_prev_end = largest_prev_committed_end(ind);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
    if (max_prev_end > cur_committed.end()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
      cur_committed.set_end(max_prev_end);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
    // Align the end up to a page size (starts are already aligned).
179
59e3abf83f72 6624765: Guarantee failure "Unexpected dirty card found"
jmasa
parents: 1
diff changeset
   215
    jbyte* const new_end = byte_after(new_region.last());
46619
a3919f5e8d2b 8178499: Remove _ptr_ and _size_ infixes from align functions
stefank
parents: 46618
diff changeset
   216
    HeapWord* new_end_aligned = (HeapWord*) align_up(new_end, _page_size);
46618
d503911aa948 8178489: Make align functions more type safe and consistent
stefank
parents: 42598
diff changeset
   217
    assert((void*)new_end_aligned >= (void*) new_end, "align up, but less");
2107
338528868274 6786346: intermittent Internal Error (src/share/vm/memory/cardTableModRefBS.cpp:226)
jmasa
parents: 1676
diff changeset
   218
    // Check the other regions (excludes "ind") to ensure that
338528868274 6786346: intermittent Internal Error (src/share/vm/memory/cardTableModRefBS.cpp:226)
jmasa
parents: 1676
diff changeset
   219
    // the new_end_aligned does not intrude onto the committed
338528868274 6786346: intermittent Internal Error (src/share/vm/memory/cardTableModRefBS.cpp:226)
jmasa
parents: 1676
diff changeset
   220
    // space of another region.
754
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   221
    int ri = 0;
28026
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   222
    for (ri = ind + 1; ri < _cur_covered_regions; ri++) {
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   223
      if (new_end_aligned > _committed[ri].start()) {
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   224
        assert(new_end_aligned <= _committed[ri].end(),
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   225
               "An earlier committed region can't cover a later committed region");
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   226
        // Any region containing the new end
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   227
        // should start at or beyond the region found (ind)
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   228
        // for the new end (committed regions are not expected to
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   229
        // be proper subsets of other committed regions).
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   230
        assert(_committed[ri].start() >= _committed[ind].start(),
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   231
               "New end of committed region is inconsistent");
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   232
        new_end_aligned = _committed[ri].start();
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   233
        // new_end_aligned can be equal to the start of its
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   234
        // committed region (i.e., of "ind") if a second
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   235
        // region following "ind" also start at the same location
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   236
        // as "ind".
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   237
        assert(new_end_aligned >= _committed[ind].start(),
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   238
          "New end of committed region is before start");
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   239
        debug_only(collided = true;)
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   240
        // Should only collide with 1 region
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents: 27904
diff changeset
   241
        break;
754
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   242
      }
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   243
    }
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   244
#ifdef ASSERT
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   245
    for (++ri; ri < _cur_covered_regions; ri++) {
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   246
      assert(!_committed[ri].contains(new_end_aligned),
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   247
        "New end of committed region is in a second committed region");
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   248
    }
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   249
#endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
    // The guard page is always committed and should not be committed over.
3587
0140e816d000 6843292: "Expect to be beyond new region unless impacting another region" assertion too strong
jmasa
parents: 2154
diff changeset
   251
    // "guarded" is used for assertion checking below and recalls the fact
0140e816d000 6843292: "Expect to be beyond new region unless impacting another region" assertion too strong
jmasa
parents: 2154
diff changeset
   252
    // that the would-be end of the new committed region would have
0140e816d000 6843292: "Expect to be beyond new region unless impacting another region" assertion too strong
jmasa
parents: 2154
diff changeset
   253
    // penetrated the guard page.
0140e816d000 6843292: "Expect to be beyond new region unless impacting another region" assertion too strong
jmasa
parents: 2154
diff changeset
   254
    HeapWord* new_end_for_commit = new_end_aligned;
0140e816d000 6843292: "Expect to be beyond new region unless impacting another region" assertion too strong
jmasa
parents: 2154
diff changeset
   255
0140e816d000 6843292: "Expect to be beyond new region unless impacting another region" assertion too strong
jmasa
parents: 2154
diff changeset
   256
    DEBUG_ONLY(bool guarded = false;)
0140e816d000 6843292: "Expect to be beyond new region unless impacting another region" assertion too strong
jmasa
parents: 2154
diff changeset
   257
    if (new_end_for_commit > _guard_region.start()) {
0140e816d000 6843292: "Expect to be beyond new region unless impacting another region" assertion too strong
jmasa
parents: 2154
diff changeset
   258
      new_end_for_commit = _guard_region.start();
0140e816d000 6843292: "Expect to be beyond new region unless impacting another region" assertion too strong
jmasa
parents: 2154
diff changeset
   259
      DEBUG_ONLY(guarded = true;)
0140e816d000 6843292: "Expect to be beyond new region unless impacting another region" assertion too strong
jmasa
parents: 2154
diff changeset
   260
    }
754
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   261
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
    if (new_end_for_commit > cur_committed.end()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
      // Must commit new pages.
179
59e3abf83f72 6624765: Guarantee failure "Unexpected dirty card found"
jmasa
parents: 1
diff changeset
   264
      MemRegion const new_committed =
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
        MemRegion(cur_committed.end(), new_end_for_commit);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
      assert(!new_committed.is_empty(), "Region should not be empty here");
18069
e6d4971c8650 8013057: assert(_needs_gc || SafepointSynchronize::is_at_safepoint()) failed: only read at safepoint
dcubed
parents: 17376
diff changeset
   268
      os::commit_memory_or_exit((char*)new_committed.start(),
e6d4971c8650 8013057: assert(_needs_gc || SafepointSynchronize::is_at_safepoint()) failed: only read at safepoint
dcubed
parents: 17376
diff changeset
   269
                                new_committed.byte_size(), _page_size,
e6d4971c8650 8013057: assert(_needs_gc || SafepointSynchronize::is_at_safepoint()) failed: only read at safepoint
dcubed
parents: 17376
diff changeset
   270
                                !ExecMem, "card table expansion");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
    // Use new_end_aligned (as opposed to new_end_for_commit) because
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
    // the cur_committed region may include the guard region.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
    } else if (new_end_aligned < cur_committed.end()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
      // Must uncommit pages.
179
59e3abf83f72 6624765: Guarantee failure "Unexpected dirty card found"
jmasa
parents: 1
diff changeset
   275
      MemRegion const uncommit_region =
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
        committed_unique_to_self(ind, MemRegion(new_end_aligned,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
                                                cur_committed.end()));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
      if (!uncommit_region.is_empty()) {
5892
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   279
        // It is not safe to uncommit cards if the boundary between
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   280
        // the generations is moving.  A shrink can uncommit cards
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   281
        // owned by generation A but being used by generation B.
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   282
        if (!UseAdaptiveGCBoundary) {
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   283
          if (!os::uncommit_memory((char*)uncommit_region.start(),
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   284
                                   uncommit_region.byte_size())) {
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   285
            assert(false, "Card table contraction failed");
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   286
            // The call failed so don't change the end of the
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   287
            // committed region.  This is better than taking the
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   288
            // VM down.
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   289
            new_end_aligned = _committed[ind].end();
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   290
          }
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   291
        } else {
754
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   292
          new_end_aligned = _committed[ind].end();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
    // In any case, we can reset the end of the current committed entry.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
    _committed[ind].set_end(new_end_aligned);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
5892
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   299
#ifdef ASSERT
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   300
    // Check that the last card in the new region is committed according
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   301
    // to the tables.
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   302
    bool covered = false;
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   303
    for (int cr = 0; cr < _cur_covered_regions; cr++) {
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   304
      if (_committed[cr].contains(new_end - 1)) {
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   305
        covered = true;
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   306
        break;
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   307
      }
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   308
    }
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   309
    assert(covered, "Card for end of new region not committed");
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   310
#endif
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   311
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
    // The default of 0 is not necessarily clean cards.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
    jbyte* entry;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
    if (old_region.last() < _whole_heap.start()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
      entry = byte_for(_whole_heap.start());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
      entry = byte_after(old_region.last());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
    }
1676
d80e69372634 6653214: MemoryPoolMXBean.setUsageThreshold() does not support large heap sizes.
swamyv
parents: 1388
diff changeset
   319
    assert(index_for(new_region.last()) <  _guard_index,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
      "The guard card will be overwritten");
754
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   321
    // This line commented out cleans the newly expanded region and
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   322
    // not the aligned up expanded region.
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   323
    // jbyte* const end = byte_after(new_region.last());
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   324
    jbyte* const end = (jbyte*) new_end_for_commit;
3587
0140e816d000 6843292: "Expect to be beyond new region unless impacting another region" assertion too strong
jmasa
parents: 2154
diff changeset
   325
    assert((end >= byte_after(new_region.last())) || collided || guarded,
754
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   326
      "Expect to be beyond new region unless impacting another region");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
    // do nothing if we resized downward.
754
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   328
#ifdef ASSERT
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   329
    for (int ri = 0; ri < _cur_covered_regions; ri++) {
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   330
      if (ri != ind) {
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   331
        // The end of the new committed region should not
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   332
        // be in any existing region unless it matches
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   333
        // the start of the next region.
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   334
        assert(!_committed[ri].contains(end) ||
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   335
               (_committed[ri].start() == (HeapWord*) end),
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   336
               "Overlapping committed regions");
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   337
      }
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   338
    }
fb9904179b42 6688799: Second fix for Guarantee failure "Unexpected dirty card found"
jmasa
parents: 360
diff changeset
   339
#endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
    if (entry < end) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
      memset(entry, clean_card, pointer_delta(end, entry, sizeof(jbyte)));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
  // In any case, the covered size changes.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
  _covered[ind].set_word_size(new_region.word_size());
35061
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31964
diff changeset
   346
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31964
diff changeset
   347
  log_trace(gc, barrier)("CardTableModRefBS::resize_covered_region: ");
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31964
diff changeset
   348
  log_trace(gc, barrier)("    _covered[%d].start(): " INTPTR_FORMAT " _covered[%d].last(): " INTPTR_FORMAT,
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31964
diff changeset
   349
                         ind, p2i(_covered[ind].start()), ind, p2i(_covered[ind].last()));
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31964
diff changeset
   350
  log_trace(gc, barrier)("    _committed[%d].start(): " INTPTR_FORMAT "  _committed[%d].last(): " INTPTR_FORMAT,
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31964
diff changeset
   351
                         ind, p2i(_committed[ind].start()), ind, p2i(_committed[ind].last()));
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31964
diff changeset
   352
  log_trace(gc, barrier)("    byte_for(start): " INTPTR_FORMAT "  byte_for(last): " INTPTR_FORMAT,
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31964
diff changeset
   353
                         p2i(byte_for(_covered[ind].start())),  p2i(byte_for(_covered[ind].last())));
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31964
diff changeset
   354
  log_trace(gc, barrier)("    addr_for(start): " INTPTR_FORMAT "  addr_for(last): " INTPTR_FORMAT,
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31964
diff changeset
   355
                         p2i(addr_for((jbyte*) _committed[ind].start())),  p2i(addr_for((jbyte*) _committed[ind].last())));
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31964
diff changeset
   356
5892
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   357
  // Touch the last card of the covered region to show that it
477b32b9d021 6952853: SIGSEGV with UseAdaptiveGCBoundary on 64b linux running jvm2008
jmasa
parents: 5547
diff changeset
   358
  // is committed (or SEGV).
18073
f02460441ddc 8014431: cleanup warnings indicated by the -Wunused-value compiler option on linux
ccheung
parents: 18069
diff changeset
   359
  debug_only((void) (*byte_for(_covered[ind].last()));)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
  debug_only(verify_guard();)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
// Note that these versions are precise!  The scanning code has to handle the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
// fact that the write barrier may be either precise or imprecise.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
22859
7b88983393b7 8029396: PPC64 (part 212): Several memory ordering fixes in C-code.
goetz
parents: 20309
diff changeset
   366
void CardTableModRefBS::write_ref_field_work(void* field, oop newVal, bool release) {
7b88983393b7 8029396: PPC64 (part 212): Several memory ordering fixes in C-code.
goetz
parents: 20309
diff changeset
   367
  inline_write_ref_field(field, newVal, release);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
2142
032f4652700c 6720309: G1: don't synchronously update RSet during evacuation pauses
iveresov
parents: 2107
diff changeset
   370
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
void CardTableModRefBS::dirty_MemRegion(MemRegion mr) {
46619
a3919f5e8d2b 8178499: Remove _ptr_ and _size_ infixes from align functions
stefank
parents: 46618
diff changeset
   372
  assert(align_down(mr.start(), HeapWordSize) == mr.start(), "Unaligned start");
a3919f5e8d2b 8178499: Remove _ptr_ and _size_ infixes from align functions
stefank
parents: 46618
diff changeset
   373
  assert(align_up  (mr.end(),   HeapWordSize) == mr.end(),   "Unaligned end"  );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
  jbyte* cur  = byte_for(mr.start());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
  jbyte* last = byte_after(mr.last());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
  while (cur < last) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
    *cur = dirty_card;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
    cur++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
42598
45562c0473fb 8166898: G1SATBCardTableLoggingModRefBS::invalidate() incorrect with whole_heap == true
lmesnik
parents: 37462
diff changeset
   382
void CardTableModRefBS::invalidate(MemRegion mr) {
46619
a3919f5e8d2b 8178499: Remove _ptr_ and _size_ infixes from align functions
stefank
parents: 46618
diff changeset
   383
  assert(align_down(mr.start(), HeapWordSize) == mr.start(), "Unaligned start");
a3919f5e8d2b 8178499: Remove _ptr_ and _size_ infixes from align functions
stefank
parents: 46618
diff changeset
   384
  assert(align_up  (mr.end(),   HeapWordSize) == mr.end(),   "Unaligned end"  );
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
  for (int i = 0; i < _cur_covered_regions; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
    MemRegion mri = mr.intersection(_covered[i]);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
    if (!mri.is_empty()) dirty_MemRegion(mri);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
void CardTableModRefBS::clear_MemRegion(MemRegion mr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
  // Be conservative: only clean cards entirely contained within the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
  // region.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
  jbyte* cur;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
  if (mr.start() == _whole_heap.start()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
    cur = byte_for(mr.start());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
    assert(mr.start() > _whole_heap.start(), "mr is not covered.");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
    cur = byte_after(mr.start() - 1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
  jbyte* last = byte_after(mr.last());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
  memset(cur, clean_card, pointer_delta(last, cur, sizeof(jbyte)));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
void CardTableModRefBS::clear(MemRegion mr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
  for (int i = 0; i < _cur_covered_regions; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
    MemRegion mri = mr.intersection(_covered[i]);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   408
    if (!mri.is_empty()) clear_MemRegion(mri);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   412
void CardTableModRefBS::dirty(MemRegion mr) {
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   413
  jbyte* first = byte_for(mr.start());
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   414
  jbyte* last  = byte_after(mr.last());
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   415
  memset(first, dirty_card, last-first);
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   416
}
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   417
9183
3d0e0687fe28 7036482: clear argument is redundant and unused in cardtable methods
ysr
parents: 7397
diff changeset
   418
// Unlike several other card table methods, dirty_card_iterate()
3d0e0687fe28 7036482: clear argument is redundant and unused in cardtable methods
ysr
parents: 7397
diff changeset
   419
// iterates over dirty cards ranges in increasing address order.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
void CardTableModRefBS::dirty_card_iterate(MemRegion mr,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
                                           MemRegionClosure* cl) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
  for (int i = 0; i < _cur_covered_regions; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
    MemRegion mri = mr.intersection(_covered[i]);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
    if (!mri.is_empty()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
      jbyte *cur_entry, *next_entry, *limit;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   426
      for (cur_entry = byte_for(mri.start()), limit = byte_for(mri.last());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
           cur_entry <= limit;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
           cur_entry  = next_entry) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
        next_entry = cur_entry + 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   430
        if (*cur_entry == dirty_card) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
          size_t dirty_cards;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
          // Accumulate maximal dirty card range, starting at cur_entry
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
          for (dirty_cards = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   434
               next_entry <= limit && *next_entry == dirty_card;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
               dirty_cards++, next_entry++);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   436
          MemRegion cur_cards(addr_for(cur_entry),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   437
                              dirty_cards*card_size_in_words);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   438
          cl->do_MemRegion(cur_cards);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   439
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   440
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   441
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   442
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   443
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   444
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   445
MemRegion CardTableModRefBS::dirty_card_range_after_reset(MemRegion mr,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   446
                                                          bool reset,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   447
                                                          int reset_val) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   448
  for (int i = 0; i < _cur_covered_regions; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
    MemRegion mri = mr.intersection(_covered[i]);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
    if (!mri.is_empty()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
      jbyte* cur_entry, *next_entry, *limit;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
      for (cur_entry = byte_for(mri.start()), limit = byte_for(mri.last());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
           cur_entry <= limit;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   454
           cur_entry  = next_entry) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
        next_entry = cur_entry + 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   456
        if (*cur_entry == dirty_card) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   457
          size_t dirty_cards;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   458
          // Accumulate maximal dirty card range, starting at cur_entry
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
          for (dirty_cards = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
               next_entry <= limit && *next_entry == dirty_card;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
               dirty_cards++, next_entry++);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   462
          MemRegion cur_cards(addr_for(cur_entry),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   463
                              dirty_cards*card_size_in_words);
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   464
          if (reset) {
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   465
            for (size_t i = 0; i < dirty_cards; i++) {
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   466
              cur_entry[i] = reset_val;
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   467
            }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   468
          }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   469
          return cur_cards;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   470
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   471
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   472
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   473
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   474
  return MemRegion(mr.end(), mr.end());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   475
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   476
489c9b5090e2 Initial load
duke
parents:
diff changeset
   477
uintx CardTableModRefBS::ct_max_alignment_constraint() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   478
  return card_size * os::vm_page_size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   479
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   480
489c9b5090e2 Initial load
duke
parents:
diff changeset
   481
void CardTableModRefBS::verify_guard() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   482
  // For product build verification
489c9b5090e2 Initial load
duke
parents:
diff changeset
   483
  guarantee(_byte_map[_guard_index] == last_card,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   484
            "card table guard has been modified");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   485
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   486
489c9b5090e2 Initial load
duke
parents:
diff changeset
   487
void CardTableModRefBS::verify() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   488
  verify_guard();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   489
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   490
489c9b5090e2 Initial load
duke
parents:
diff changeset
   491
#ifndef PRODUCT
9418
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   492
void CardTableModRefBS::verify_region(MemRegion mr,
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   493
                                      jbyte val, bool val_equals) {
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   494
  jbyte* start    = byte_for(mr.start());
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   495
  jbyte* end      = byte_for(mr.last());
26160
aba6b01cb988 8038423: G1: Decommit memory within heap
tschatzl
parents: 25492
diff changeset
   496
  bool failures = false;
9418
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   497
  for (jbyte* curr = start; curr <= end; ++curr) {
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   498
    jbyte curr_val = *curr;
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   499
    bool failed = (val_equals) ? (curr_val != val) : (curr_val == val);
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   500
    if (failed) {
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   501
      if (!failures) {
37226
9b0d4b523ce4 8153188: Use log_error(gc, verify) for logging in verification code
brutisso
parents: 35061
diff changeset
   502
        log_error(gc, verify)("== CT verification failed: [" INTPTR_FORMAT "," INTPTR_FORMAT "]", p2i(start), p2i(end));
9b0d4b523ce4 8153188: Use log_error(gc, verify) for logging in verification code
brutisso
parents: 35061
diff changeset
   503
        log_error(gc, verify)("==   %sexpecting value: %d", (val_equals) ? "" : "not ", val);
9418
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   504
        failures = true;
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   505
      }
37226
9b0d4b523ce4 8153188: Use log_error(gc, verify) for logging in verification code
brutisso
parents: 35061
diff changeset
   506
      log_error(gc, verify)("==   card " PTR_FORMAT " [" PTR_FORMAT "," PTR_FORMAT "], val: %d",
9b0d4b523ce4 8153188: Use log_error(gc, verify) for logging in verification code
brutisso
parents: 35061
diff changeset
   507
                            p2i(curr), p2i(addr_for(curr)),
9b0d4b523ce4 8153188: Use log_error(gc, verify) for logging in verification code
brutisso
parents: 35061
diff changeset
   508
                            p2i((HeapWord*) (((size_t) addr_for(curr)) + card_size)),
9b0d4b523ce4 8153188: Use log_error(gc, verify) for logging in verification code
brutisso
parents: 35061
diff changeset
   509
                            (int) curr_val);
9418
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   510
    }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   511
  }
9418
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   512
  guarantee(!failures, "there should not have been any failures");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   513
}
3695
421cfcc8843c 6841313: G1: dirty cards of survivor regions in parallel
apetrusenko
parents: 3587
diff changeset
   514
9418
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   515
void CardTableModRefBS::verify_not_dirty_region(MemRegion mr) {
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   516
  verify_region(mr, dirty_card, false /* val_equals */);
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   517
}
3695
421cfcc8843c 6841313: G1: dirty cards of survivor regions in parallel
apetrusenko
parents: 3587
diff changeset
   518
421cfcc8843c 6841313: G1: dirty cards of survivor regions in parallel
apetrusenko
parents: 3587
diff changeset
   519
void CardTableModRefBS::verify_dirty_region(MemRegion mr) {
9418
32a87dd6b746 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
tonyp
parents: 9336
diff changeset
   520
  verify_region(mr, dirty_card, true /* val_equals */);
3695
421cfcc8843c 6841313: G1: dirty cards of survivor regions in parallel
apetrusenko
parents: 3587
diff changeset
   521
}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   522
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   523
12268
f7897aacb9ce 7157141: crash in 64 bit with corrupted oops
never
parents: 11177
diff changeset
   524
void CardTableModRefBS::print_on(outputStream* st) const {
f7897aacb9ce 7157141: crash in 64 bit with corrupted oops
never
parents: 11177
diff changeset
   525
  st->print_cr("Card table byte_map: [" INTPTR_FORMAT "," INTPTR_FORMAT "] byte_map_base: " INTPTR_FORMAT,
24424
2658d7834c6e 8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents: 22876
diff changeset
   526
               p2i(_byte_map), p2i(_byte_map + _byte_map_size), p2i(byte_map_base));
12268
f7897aacb9ce 7157141: crash in 64 bit with corrupted oops
never
parents: 11177
diff changeset
   527
}
f7897aacb9ce 7157141: crash in 64 bit with corrupted oops
never
parents: 11177
diff changeset
   528