--- a/hotspot/src/share/vm/oops/constantPoolKlass.cpp Tue Jan 06 07:05:05 2009 -0800
+++ b/hotspot/src/share/vm/oops/constantPoolKlass.cpp Sun Jan 11 16:58:24 2009 -0800
@@ -25,7 +25,7 @@
# include "incls/_precompiled.incl"
# include "incls/_constantPoolKlass.cpp.incl"
-constantPoolOop constantPoolKlass::allocate(int length, TRAPS) {
+constantPoolOop constantPoolKlass::allocate(int length, bool is_conc_safe, TRAPS) {
int size = constantPoolOopDesc::object_size(length);
KlassHandle klass (THREAD, as_klassOop());
constantPoolOop c =
@@ -38,6 +38,9 @@
c->set_flags(0);
// only set to non-zero if constant pool is merged by RedefineClasses
c->set_orig_length(0);
+ // if constant pool may change during RedefineClasses, it is created
+ // unsafe for GC concurrent processing.
+ c->set_is_conc_safe(is_conc_safe);
// all fields are initialized; needed for GC
// initialize tag array
@@ -207,6 +210,11 @@
return size;
}
+bool constantPoolKlass::oop_is_conc_safe(oop obj) const {
+ assert(obj->is_constantPool(), "must be constantPool");
+ return constantPoolOop(obj)->is_conc_safe();
+}
+
#ifndef SERIALGC
int constantPoolKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
assert (obj->is_constantPool(), "obj must be constant pool");