src/share/vm/oops/constantPoolKlass.cpp

changeset 953
0af8b0718fc9
parent 866
a45484ea312d
child 1014
0fbdb4381b99
     1.1 --- a/src/share/vm/oops/constantPoolKlass.cpp	Tue Jan 06 07:05:05 2009 -0800
     1.2 +++ b/src/share/vm/oops/constantPoolKlass.cpp	Sun Jan 11 16:58:24 2009 -0800
     1.3 @@ -25,7 +25,7 @@
     1.4  # include "incls/_precompiled.incl"
     1.5  # include "incls/_constantPoolKlass.cpp.incl"
     1.6  
     1.7 -constantPoolOop constantPoolKlass::allocate(int length, TRAPS) {
     1.8 +constantPoolOop constantPoolKlass::allocate(int length, bool is_conc_safe, TRAPS) {
     1.9    int size = constantPoolOopDesc::object_size(length);
    1.10    KlassHandle klass (THREAD, as_klassOop());
    1.11    constantPoolOop c =
    1.12 @@ -38,6 +38,9 @@
    1.13    c->set_flags(0);
    1.14    // only set to non-zero if constant pool is merged by RedefineClasses
    1.15    c->set_orig_length(0);
    1.16 +  // if constant pool may change during RedefineClasses, it is created
    1.17 +  // unsafe for GC concurrent processing.
    1.18 +  c->set_is_conc_safe(is_conc_safe);
    1.19    // all fields are initialized; needed for GC
    1.20  
    1.21    // initialize tag array
    1.22 @@ -207,6 +210,11 @@
    1.23    return size;
    1.24  }
    1.25  
    1.26 +bool constantPoolKlass::oop_is_conc_safe(oop obj) const {
    1.27 +  assert(obj->is_constantPool(), "must be constantPool");
    1.28 +  return constantPoolOop(obj)->is_conc_safe();
    1.29 +}
    1.30 +
    1.31  #ifndef SERIALGC
    1.32  int constantPoolKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
    1.33    assert (obj->is_constantPool(), "obj must be constant pool");

mercurial