diff -r c798c277ddd1 -r c5a923563727 src/share/vm/oops/constantPoolKlass.cpp --- a/src/share/vm/oops/constantPoolKlass.cpp Thu Feb 03 20:49:09 2011 -0800 +++ b/src/share/vm/oops/constantPoolKlass.cpp Mon Feb 07 22:19:57 2011 -0800 @@ -71,6 +71,12 @@ c->set_is_conc_safe(is_conc_safe); // all fields are initialized; needed for GC + // Note: because we may be in this "conc_unsafe" state when allocating + // t_oop below, which may in turn cause a GC, it is imperative that our + // size be correct, consistent and henceforth stable, at this stage. + assert(c->is_parsable(), "Else size() below is unreliable"); + DEBUG_ONLY(int sz = c->size();) + // initialize tag array // Note: cannot introduce constant pool handle before since it is not // completely initialized (no class) -> would cause assertion failure @@ -82,6 +88,8 @@ } pool->set_tags(tags()); + // Check that our size was stable at its old value. + assert(sz == c->size(), "size() changed"); return pool(); }