void CollectedHeap::post_allocation_setup_common(KlassHandle klass, HeapWord* obj_ptr) { post_allocation_setup_no_klass_install(klass, obj_ptr); oop obj = (oop)obj_ptr; #if ! INCLUDE_ALL_GCS obj->set_klass(klass()); #else // Need a release store to ensure array/class length, mark word, and // object zeroing are visible before setting the klass non-NULL, for // concurrent collectors. obj->release_set_klass(klass()); #endif }
void CollectedHeap::post_allocation_setup_common(KlassHandle klass, HeapWord* obj) { post_allocation_setup_no_klass_install(klass, obj); post_allocation_install_obj_klass(klass, oop(obj)); }