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