hotspot/src/share/vm/oops/constantPoolKlass.cpp
changeset 8296 b1c2163e4e59
parent 8076 96d498ec7ae1
child 8297 f05d10c1c4b8
equal deleted inserted replaced
8295:a2b2a8a3aaee 8296:b1c2163e4e59
    69   // if constant pool may change during RedefineClasses, it is created
    69   // if constant pool may change during RedefineClasses, it is created
    70   // unsafe for GC concurrent processing.
    70   // unsafe for GC concurrent processing.
    71   c->set_is_conc_safe(is_conc_safe);
    71   c->set_is_conc_safe(is_conc_safe);
    72   // all fields are initialized; needed for GC
    72   // all fields are initialized; needed for GC
    73 
    73 
       
    74   // Note: because we may be in this "conc_unsafe" state when allocating
       
    75   // t_oop below, which may in turn cause a GC, it is imperative that our
       
    76   // size be correct, consistent and henceforth stable, at this stage.
       
    77   assert(c->is_parsable(), "Else size() below is unreliable");
       
    78   DEBUG_ONLY(int sz = c->size();)
       
    79 
    74   // initialize tag array
    80   // initialize tag array
    75   // Note: cannot introduce constant pool handle before since it is not
    81   // Note: cannot introduce constant pool handle before since it is not
    76   //       completely initialized (no class) -> would cause assertion failure
    82   //       completely initialized (no class) -> would cause assertion failure
    77   constantPoolHandle pool (THREAD, c);
    83   constantPoolHandle pool (THREAD, c);
    78   typeArrayOop t_oop = oopFactory::new_permanent_byteArray(length, CHECK_NULL);
    84   typeArrayOop t_oop = oopFactory::new_permanent_byteArray(length, CHECK_NULL);
    80   for (int index = 0; index < length; index++) {
    86   for (int index = 0; index < length; index++) {
    81     tags()->byte_at_put(index, JVM_CONSTANT_Invalid);
    87     tags()->byte_at_put(index, JVM_CONSTANT_Invalid);
    82   }
    88   }
    83   pool->set_tags(tags());
    89   pool->set_tags(tags());
    84 
    90 
       
    91   // Check that our size was stable at its old value.
       
    92   assert(sz == c->size(), "size() changed");
    85   return pool();
    93   return pool();
    86 }
    94 }
    87 
    95 
    88 klassOop constantPoolKlass::create_klass(TRAPS) {
    96 klassOop constantPoolKlass::create_klass(TRAPS) {
    89   constantPoolKlass o;
    97   constantPoolKlass o;