Mercurial > hg > truffle
comparison src/share/vm/oops/constantPoolKlass.cpp @ 518:0af8b0718fc9
6692899: CMS: many vm.parallel_class_loading tests fail with assert "missing Printezis mark"
Summary: The CMS concurrent precleaning and concurrent marking phases should work around classes that are undergoing redefinition.
Reviewed-by: ysr, dcubed
author | jmasa |
---|---|
date | Sun, 11 Jan 2009 16:58:24 -0800 |
parents | a45484ea312d |
children | 0fbdb4381b99 |
comparison
equal
deleted
inserted
replaced
517:e9be0e04635a | 518:0af8b0718fc9 |
---|---|
23 */ | 23 */ |
24 | 24 |
25 # include "incls/_precompiled.incl" | 25 # include "incls/_precompiled.incl" |
26 # include "incls/_constantPoolKlass.cpp.incl" | 26 # include "incls/_constantPoolKlass.cpp.incl" |
27 | 27 |
28 constantPoolOop constantPoolKlass::allocate(int length, TRAPS) { | 28 constantPoolOop constantPoolKlass::allocate(int length, bool is_conc_safe, TRAPS) { |
29 int size = constantPoolOopDesc::object_size(length); | 29 int size = constantPoolOopDesc::object_size(length); |
30 KlassHandle klass (THREAD, as_klassOop()); | 30 KlassHandle klass (THREAD, as_klassOop()); |
31 constantPoolOop c = | 31 constantPoolOop c = |
32 (constantPoolOop)CollectedHeap::permanent_obj_allocate(klass, size, CHECK_NULL); | 32 (constantPoolOop)CollectedHeap::permanent_obj_allocate(klass, size, CHECK_NULL); |
33 | 33 |
36 c->set_cache(NULL); | 36 c->set_cache(NULL); |
37 c->set_pool_holder(NULL); | 37 c->set_pool_holder(NULL); |
38 c->set_flags(0); | 38 c->set_flags(0); |
39 // only set to non-zero if constant pool is merged by RedefineClasses | 39 // only set to non-zero if constant pool is merged by RedefineClasses |
40 c->set_orig_length(0); | 40 c->set_orig_length(0); |
41 // if constant pool may change during RedefineClasses, it is created | |
42 // unsafe for GC concurrent processing. | |
43 c->set_is_conc_safe(is_conc_safe); | |
41 // all fields are initialized; needed for GC | 44 // all fields are initialized; needed for GC |
42 | 45 |
43 // initialize tag array | 46 // initialize tag array |
44 // Note: cannot introduce constant pool handle before since it is not | 47 // Note: cannot introduce constant pool handle before since it is not |
45 // completely initialized (no class) -> would cause assertion failure | 48 // completely initialized (no class) -> would cause assertion failure |
203 addr = cp->cache_addr(); | 206 addr = cp->cache_addr(); |
204 blk->do_oop(addr); | 207 blk->do_oop(addr); |
205 addr = cp->pool_holder_addr(); | 208 addr = cp->pool_holder_addr(); |
206 blk->do_oop(addr); | 209 blk->do_oop(addr); |
207 return size; | 210 return size; |
211 } | |
212 | |
213 bool constantPoolKlass::oop_is_conc_safe(oop obj) const { | |
214 assert(obj->is_constantPool(), "must be constantPool"); | |
215 return constantPoolOop(obj)->is_conc_safe(); | |
208 } | 216 } |
209 | 217 |
210 #ifndef SERIALGC | 218 #ifndef SERIALGC |
211 int constantPoolKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) { | 219 int constantPoolKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) { |
212 assert (obj->is_constantPool(), "obj must be constant pool"); | 220 assert (obj->is_constantPool(), "obj must be constant pool"); |