src/hotspot/share/gc/g1/g1CodeCacheRemSet.cpp
author tschatzl
Wed, 17 Jul 2019 16:33:19 +0200
changeset 55722 5ee183a90e65
parent 52631 3009ca99de32
child 59247 56bf71d64d51
permissions -rw-r--r--
8227084: Add timing information for merge heap root preparation Reviewed-by: sangheki, kbarrett
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
     1
/*
52631
3009ca99de32 8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents: 49592
diff changeset
     2
 * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
     4
 *
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
     7
 * published by the Free Software Foundation.
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
     8
 *
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    13
 * accompanied this code).
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    14
 *
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    18
 *
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    21
 * questions.
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    22
 *
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    23
 */
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    24
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    25
#include "precompiled.hpp"
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    26
#include "code/codeCache.hpp"
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    27
#include "code/nmethod.hpp"
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
    28
#include "gc/g1/g1CodeRootSetTable.hpp"
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29796
diff changeset
    29
#include "gc/g1/g1CodeCacheRemSet.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29796
diff changeset
    30
#include "gc/g1/heapRegion.hpp"
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    31
#include "memory/heap.hpp"
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    32
#include "memory/iterator.hpp"
49592
77fb0be7d19f 8199946: Move load/store and encode/decode out of oopDesc
stefank
parents: 47634
diff changeset
    33
#include "oops/access.inline.hpp"
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    34
#include "oops/oop.inline.hpp"
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    35
#include "utilities/hashtable.inline.hpp"
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    36
#include "utilities/stack.inline.hpp"
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    37
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
    38
G1CodeRootSetTable* volatile G1CodeRootSetTable::_purge_list = NULL;
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    39
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
    40
size_t G1CodeRootSetTable::mem_size() {
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
    41
  return sizeof(G1CodeRootSetTable) + (entry_size() * number_of_entries()) + (sizeof(HashtableBucket<mtGC>) * table_size());
35879
9892f53e92c9 8141421: Various test fail with OOME on win x86
drwhite
parents: 33105
diff changeset
    42
}
9892f53e92c9 8141421: Various test fail with OOME on win x86
drwhite
parents: 33105
diff changeset
    43
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
    44
G1CodeRootSetTable::Entry* G1CodeRootSetTable::new_entry(nmethod* nm) {
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    45
  unsigned int hash = compute_hash(nm);
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    46
  Entry* entry = (Entry*) new_entry_free_list();
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    47
  if (entry == NULL) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    48
    entry = (Entry*) NEW_C_HEAP_ARRAY2(char, entry_size(), mtGC, CURRENT_PC);
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    49
  }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    50
  entry->set_next(NULL);
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    51
  entry->set_hash(hash);
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    52
  entry->set_literal(nm);
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    53
  return entry;
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    54
}
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    55
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
    56
void G1CodeRootSetTable::remove_entry(Entry* e, Entry* previous) {
26574
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
    57
  int index = hash_to_index(e->hash());
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
    58
  assert((e == bucket(index)) == (previous == NULL), "if e is the first entry then previous should be null");
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
    59
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
    60
  if (previous == NULL) {
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
    61
    set_entry(index, e->next());
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
    62
  } else {
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
    63
    previous->set_next(e->next());
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
    64
  }
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
    65
  free_entry(e);
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
    66
}
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
    67
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
    68
G1CodeRootSetTable::~G1CodeRootSetTable() {
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    69
  for (int index = 0; index < table_size(); ++index) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    70
    for (Entry* e = bucket(index); e != NULL; ) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    71
      Entry* to_remove = e;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    72
      // read next before freeing.
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    73
      e = e->next();
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    74
      unlink_entry(to_remove);
27880
afb974a04396 8060074: os::free() takes MemoryTrackingLevel but doesn't need it
coleenp
parents: 26574
diff changeset
    75
      FREE_C_HEAP_ARRAY(char, to_remove);
25492
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
    76
    }
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    77
  }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    78
  assert(number_of_entries() == 0, "should have removed all entries");
52631
3009ca99de32 8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents: 49592
diff changeset
    79
  // Each of the entries in new_entry_free_list() have been allocated in
3009ca99de32 8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents: 49592
diff changeset
    80
  // G1CodeRootSetTable::new_entry(). We never call the block allocator
3009ca99de32 8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents: 49592
diff changeset
    81
  // in BasicHashtable::new_entry().
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    82
  for (BasicHashtableEntry<mtGC>* e = new_entry_free_list(); e != NULL; e = new_entry_free_list()) {
27880
afb974a04396 8060074: os::free() takes MemoryTrackingLevel but doesn't need it
coleenp
parents: 26574
diff changeset
    83
    FREE_C_HEAP_ARRAY(char, e);
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    84
  }
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    85
}
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
    86
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
    87
bool G1CodeRootSetTable::add(nmethod* nm) {
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    88
  if (!contains(nm)) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    89
    Entry* e = new_entry(nm);
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    90
    int index = hash_to_index(e->hash());
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    91
    add_entry(index, e);
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    92
    return true;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    93
  }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    94
  return false;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    95
}
25492
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
    96
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
    97
bool G1CodeRootSetTable::contains(nmethod* nm) {
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    98
  int index = hash_to_index(compute_hash(nm));
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
    99
  for (Entry* e = bucket(index); e != NULL; e = e->next()) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   100
    if (e->literal() == nm) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   101
      return true;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   102
    }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   103
  }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   104
  return false;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   105
}
25492
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   106
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
   107
bool G1CodeRootSetTable::remove(nmethod* nm) {
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   108
  int index = hash_to_index(compute_hash(nm));
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   109
  Entry* previous = NULL;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   110
  for (Entry* e = bucket(index); e != NULL; previous = e, e = e->next()) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   111
    if (e->literal() == nm) {
26574
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
   112
      remove_entry(e, previous);
25492
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   113
      return true;
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   114
    }
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   115
  }
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   116
  return false;
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   117
}
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   118
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
   119
void G1CodeRootSetTable::copy_to(G1CodeRootSetTable* new_table) {
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   120
  for (int index = 0; index < table_size(); ++index) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   121
    for (Entry* e = bucket(index); e != NULL; e = e->next()) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   122
      new_table->add(e->literal());
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   123
    }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   124
  }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   125
  new_table->copy_freelist(this);
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   126
}
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   127
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
   128
void G1CodeRootSetTable::nmethods_do(CodeBlobClosure* blk) {
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   129
  for (int index = 0; index < table_size(); ++index) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   130
    for (Entry* e = bucket(index); e != NULL; e = e->next()) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   131
      blk->do_code_blob(e->literal());
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   132
    }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   133
  }
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   134
}
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   135
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   136
template<typename CB>
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
   137
int G1CodeRootSetTable::remove_if(CB& should_remove) {
26574
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
   138
  int num_removed = 0;
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   139
  for (int index = 0; index < table_size(); ++index) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   140
    Entry* previous = NULL;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   141
    Entry* e = bucket(index);
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   142
    while (e != NULL) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   143
      Entry* next = e->next();
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   144
      if (should_remove(e->literal())) {
26574
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
   145
        remove_entry(e, previous);
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
   146
        ++num_removed;
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   147
      } else {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   148
        previous = e;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   149
      }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   150
      e = next;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   151
    }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   152
  }
26574
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
   153
  return num_removed;
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   154
}
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   155
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   156
G1CodeRootSet::~G1CodeRootSet() {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   157
  delete _table;
24099
9c132a88935d 8038930: G1CodeRootSet::test fails with assert(_num_chunks_handed_out == 0) failed: No elements must have been handed out yet
tschatzl
parents: 23451
diff changeset
   158
}
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   159
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
   160
G1CodeRootSetTable* G1CodeRootSet::load_acquire_table() {
47634
6a0c42c40cd1 8188220: Remove Atomic::*_ptr() uses and overloads from hotspot
coleenp
parents: 47216
diff changeset
   161
  return OrderAccess::load_acquire(&_table);
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   162
}
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   163
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   164
void G1CodeRootSet::allocate_small_table() {
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
   165
  G1CodeRootSetTable* temp = new G1CodeRootSetTable(SmallSize);
33093
5aa0f908f8cd 8131645: [ARM64] crash on Cavium when using G1
ecaspole
parents: 31592
diff changeset
   166
47634
6a0c42c40cd1 8188220: Remove Atomic::*_ptr() uses and overloads from hotspot
coleenp
parents: 47216
diff changeset
   167
  OrderAccess::release_store(&_table, temp);
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   168
}
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   169
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
   170
void G1CodeRootSetTable::purge_list_append(G1CodeRootSetTable* table) {
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   171
  for (;;) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   172
    table->_purge_next = _purge_list;
47634
6a0c42c40cd1 8188220: Remove Atomic::*_ptr() uses and overloads from hotspot
coleenp
parents: 47216
diff changeset
   173
    G1CodeRootSetTable* old = Atomic::cmpxchg(table, &_purge_list, table->_purge_next);
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   174
    if (old == table->_purge_next) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   175
      break;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   176
    }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   177
  }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   178
}
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   179
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
   180
void G1CodeRootSetTable::purge() {
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
   181
  G1CodeRootSetTable* table = _purge_list;
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   182
  _purge_list = NULL;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   183
  while (table != NULL) {
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
   184
    G1CodeRootSetTable* to_purge = table;
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   185
    table = table->_purge_next;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   186
    delete to_purge;
23451
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   187
  }
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   188
}
ed2b8bb28fed 8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff changeset
   189
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   190
void G1CodeRootSet::move_to_large() {
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
   191
  G1CodeRootSetTable* temp = new G1CodeRootSetTable(LargeSize);
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   192
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   193
  _table->copy_to(temp);
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   194
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
   195
  G1CodeRootSetTable::purge_list_append(_table);
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   196
47634
6a0c42c40cd1 8188220: Remove Atomic::*_ptr() uses and overloads from hotspot
coleenp
parents: 47216
diff changeset
   197
  OrderAccess::release_store(&_table, temp);
24099
9c132a88935d 8038930: G1CodeRootSet::test fails with assert(_num_chunks_handed_out == 0) failed: No elements must have been handed out yet
tschatzl
parents: 23451
diff changeset
   198
}
9c132a88935d 8038930: G1CodeRootSet::test fails with assert(_num_chunks_handed_out == 0) failed: No elements must have been handed out yet
tschatzl
parents: 23451
diff changeset
   199
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   200
void G1CodeRootSet::purge() {
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
   201
  G1CodeRootSetTable::purge();
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   202
}
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   203
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   204
size_t G1CodeRootSet::static_mem_size() {
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
   205
  return G1CodeRootSetTable::static_mem_size();
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   206
}
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   207
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   208
void G1CodeRootSet::add(nmethod* method) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   209
  bool added = false;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   210
  if (is_empty()) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   211
    allocate_small_table();
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   212
  }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   213
  added = _table->add(method);
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   214
  if (added) {
35879
9892f53e92c9 8141421: Various test fail with OOME on win x86
drwhite
parents: 33105
diff changeset
   215
    if (_length == Threshold) {
9892f53e92c9 8141421: Various test fail with OOME on win x86
drwhite
parents: 33105
diff changeset
   216
      move_to_large();
9892f53e92c9 8141421: Various test fail with OOME on win x86
drwhite
parents: 33105
diff changeset
   217
    }
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   218
    ++_length;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   219
  }
35879
9892f53e92c9 8141421: Various test fail with OOME on win x86
drwhite
parents: 33105
diff changeset
   220
  assert(_length == (size_t)_table->number_of_entries(), "sizes should match");
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   221
}
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   222
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   223
bool G1CodeRootSet::remove(nmethod* method) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   224
  bool removed = false;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   225
  if (_table != NULL) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   226
    removed = _table->remove(method);
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   227
  }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   228
  if (removed) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   229
    _length--;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   230
    if (_length == 0) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   231
      clear();
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   232
    }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   233
  }
35879
9892f53e92c9 8141421: Various test fail with OOME on win x86
drwhite
parents: 33105
diff changeset
   234
  assert((_length == 0 && _table == NULL) ||
9892f53e92c9 8141421: Various test fail with OOME on win x86
drwhite
parents: 33105
diff changeset
   235
         (_length == (size_t)_table->number_of_entries()), "sizes should match");
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   236
  return removed;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   237
}
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   238
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   239
bool G1CodeRootSet::contains(nmethod* method) {
40905
94ffc131534f 8164230: Convert TestCodeCacheRemSet_test to GTest
kzhaldyb
parents: 35879
diff changeset
   240
  G1CodeRootSetTable* table = load_acquire_table(); // contains() may be called outside of lock, so ensure mem sync.
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   241
  if (table != NULL) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   242
    return table->contains(method);
24099
9c132a88935d 8038930: G1CodeRootSet::test fails with assert(_num_chunks_handed_out == 0) failed: No elements must have been handed out yet
tschatzl
parents: 23451
diff changeset
   243
  }
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   244
  return false;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   245
}
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   246
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   247
void G1CodeRootSet::clear() {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   248
  delete _table;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   249
  _table = NULL;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   250
  _length = 0;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   251
}
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   252
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   253
size_t G1CodeRootSet::mem_size() {
35879
9892f53e92c9 8141421: Various test fail with OOME on win x86
drwhite
parents: 33105
diff changeset
   254
  return sizeof(*this) + (_table != NULL ? _table->mem_size() : 0);
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   255
}
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   256
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   257
void G1CodeRootSet::nmethods_do(CodeBlobClosure* blk) const {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   258
  if (_table != NULL) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   259
    _table->nmethods_do(blk);
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   260
  }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   261
}
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   262
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   263
class CleanCallback : public StackObj {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   264
  class PointsIntoHRDetectionClosure : public OopClosure {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   265
    HeapRegion* _hr;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   266
   public:
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   267
    bool _points_into;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   268
    PointsIntoHRDetectionClosure(HeapRegion* hr) : _hr(hr), _points_into(false) {}
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   269
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   270
    void do_oop(narrowOop* o) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   271
      do_oop_work(o);
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   272
    }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   273
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   274
    void do_oop(oop* o) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   275
      do_oop_work(o);
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   276
    }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   277
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   278
    template <typename T>
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   279
    void do_oop_work(T* p) {
49592
77fb0be7d19f 8199946: Move load/store and encode/decode out of oopDesc
stefank
parents: 47634
diff changeset
   280
      if (_hr->is_in(RawAccess<>::oop_load(p))) {
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   281
        _points_into = true;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   282
      }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   283
    }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   284
  };
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   285
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   286
  PointsIntoHRDetectionClosure _detector;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   287
  CodeBlobToOopClosure _blobs;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   288
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   289
 public:
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   290
  CleanCallback(HeapRegion* hr) : _detector(hr), _blobs(&_detector, !CodeBlobToOopClosure::FixRelocations) {}
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   291
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   292
  bool operator() (nmethod* nm) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   293
    _detector._points_into = false;
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   294
    _blobs.do_code_blob(nm);
26574
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
   295
    return !_detector._points_into;
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   296
  }
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   297
};
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   298
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   299
void G1CodeRootSet::clean(HeapRegion* owner) {
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   300
  CleanCallback should_clean(owner);
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   301
  if (_table != NULL) {
26574
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
   302
    int removed = _table->remove_if(should_clean);
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
   303
    assert((size_t)removed <= _length, "impossible");
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
   304
    _length -= removed;
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
   305
  }
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
   306
  if (_length == 0) {
59219d1be209 8057722: G1: Code root hashtable updated incorrectly when evacuation failed
mgerdin
parents: 26422
diff changeset
   307
    clear();
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 25500
diff changeset
   308
  }
24099
9c132a88935d 8038930: G1CodeRootSet::test fails with assert(_num_chunks_handed_out == 0) failed: No elements must have been handed out yet
tschatzl
parents: 23451
diff changeset
   309
}