< prev index next >

src/share/vm/oops/instanceMirrorKlass.cpp

Print this page
rev 11546 : imported patch webrev.02
rev 11547 : [mq]: webrev.03

*** 48,64 **** instanceOop InstanceMirrorKlass::allocate_instance(KlassHandle k, TRAPS) { // Query before forming handle. int size = instance_size(k); KlassHandle h_k(THREAD, this); ! instanceOop i = (instanceOop)CollectedHeap::obj_allocate(h_k, size, CHECK_NULL); ! // Since mirrors can be variable sized because of the static fields, store ! // the size in the mirror itself. ! java_lang_Class::set_oop_size(i, size); ! return i; } int InstanceMirrorKlass::oop_size(oop obj) const { return java_lang_Class::oop_size(obj); } --- 48,63 ---- instanceOop InstanceMirrorKlass::allocate_instance(KlassHandle k, TRAPS) { // Query before forming handle. int size = instance_size(k); KlassHandle h_k(THREAD, this); ! int field_offset = java_lang_Class::oop_size_offset(); ! assert(field_offset != 0, "must be set"); ! assert(size > 0, "total object size must be positive: %d", size); ! return (instanceOop)CollectedHeap::class_allocate(h_k, size, field_offset, CHECK_NULL); } int InstanceMirrorKlass::oop_size(oop obj) const { return java_lang_Class::oop_size(obj); }
< prev index next >