< prev index next >

src/hotspot/share/oops/instanceMirrorKlass.cpp

Print this page


  49   // Query before forming handle.
  50   int size = instance_size(k);
  51   assert(size > 0, "total object size must be positive: %d", size);
  52 
  53   // Since mirrors can be variable sized because of the static fields, store
  54   // the size in the mirror itself.
  55   return (instanceOop)Universe::heap()->class_allocate(this, size, CHECK_NULL);
  56 }
  57 
  58 int InstanceMirrorKlass::oop_size(oop obj) const {
  59   return java_lang_Class::oop_size(obj);
  60 }
  61 
  62 int InstanceMirrorKlass::compute_static_oop_field_count(oop obj) {
  63   Klass* k = java_lang_Class::as_Klass(obj);
  64   if (k != NULL && k->is_instance_klass()) {
  65     return InstanceKlass::cast(k)->static_oop_field_count();
  66   }
  67   return 0;
  68 }








  49   // Query before forming handle.
  50   int size = instance_size(k);
  51   assert(size > 0, "total object size must be positive: %d", size);
  52 
  53   // Since mirrors can be variable sized because of the static fields, store
  54   // the size in the mirror itself.
  55   return (instanceOop)Universe::heap()->class_allocate(this, size, CHECK_NULL);
  56 }
  57 
  58 int InstanceMirrorKlass::oop_size(oop obj) const {
  59   return java_lang_Class::oop_size(obj);
  60 }
  61 
  62 int InstanceMirrorKlass::compute_static_oop_field_count(oop obj) {
  63   Klass* k = java_lang_Class::as_Klass(obj);
  64   if (k != NULL && k->is_instance_klass()) {
  65     return InstanceKlass::cast(k)->static_oop_field_count();
  66   }
  67   return 0;
  68 }
  69 
  70 #if INCLUDE_CDS
  71 void InstanceMirrorKlass::serialize(SerializeClosure* f) {
  72   f->do_u4((u4*)&_offset_of_static_fields);
  73 }
  74 #endif
< prev index next >