< prev index next >

src/share/vm/oops/oop.inline.hpp

Print this page
rev 11483 : [mq]: webrev.01


 241       // filler arrays) which are subject to changing their declared size
 242       // when finally retiring a PLAB; this also can cause the first disjunct
 243       // to fail for another worker thread that is concurrently walking the block
 244       // offset table. Both these invariant failures are benign for their
 245       // current uses; we relax the assertion checking to cover these two cases below:
 246       //     is_objArray() && is_forwarded()   // covers first scenario above
 247       //  || is_typeArray()                    // covers second scenario above
 248       // If and when UseParallelGC uses the same obj array oop stealing/chunking
 249       // technique, we will need to suitably modify the assertion.
 250       assert((s == klass->oop_size(this)) ||
 251              (Universe::heap()->is_gc_active() &&
 252               ((is_typeArray() && UseConcMarkSweepGC) ||
 253                (is_objArray()  && is_forwarded() && (UseConcMarkSweepGC || UseParallelGC || UseG1GC)))),
 254              "wrong array object size");
 255     } else {
 256       // Must be zero, so bite the bullet and take the virtual call.
 257       s = klass->oop_size(this);
 258     }
 259   }
 260 
 261   assert(s % MinObjAlignment == 0, "alignment check");
 262   assert(s > 0, "Bad size calculated");
 263   return s;
 264 }
 265 
 266 bool oopDesc::is_instance()  const { return klass()->is_instance_klass();  }
 267 bool oopDesc::is_array()     const { return klass()->is_array_klass();     }
 268 bool oopDesc::is_objArray()  const { return klass()->is_objArray_klass();  }
 269 bool oopDesc::is_typeArray() const { return klass()->is_typeArray_klass(); }
 270 
 271 void*      oopDesc::field_base(int offset)          const { return (void*)&((char*)this)[offset]; }
 272 
 273 jbyte*     oopDesc::byte_field_addr(int offset)     const { return (jbyte*)    field_base(offset); }
 274 jchar*     oopDesc::char_field_addr(int offset)     const { return (jchar*)    field_base(offset); }
 275 jboolean*  oopDesc::bool_field_addr(int offset)     const { return (jboolean*) field_base(offset); }
 276 jint*      oopDesc::int_field_addr(int offset)      const { return (jint*)     field_base(offset); }
 277 jshort*    oopDesc::short_field_addr(int offset)    const { return (jshort*)   field_base(offset); }
 278 jlong*     oopDesc::long_field_addr(int offset)     const { return (jlong*)    field_base(offset); }
 279 jfloat*    oopDesc::float_field_addr(int offset)    const { return (jfloat*)   field_base(offset); }
 280 jdouble*   oopDesc::double_field_addr(int offset)   const { return (jdouble*)  field_base(offset); }
 281 Metadata** oopDesc::metadata_field_addr(int offset) const { return (Metadata**)field_base(offset); }
 282 




 241       // filler arrays) which are subject to changing their declared size
 242       // when finally retiring a PLAB; this also can cause the first disjunct
 243       // to fail for another worker thread that is concurrently walking the block
 244       // offset table. Both these invariant failures are benign for their
 245       // current uses; we relax the assertion checking to cover these two cases below:
 246       //     is_objArray() && is_forwarded()   // covers first scenario above
 247       //  || is_typeArray()                    // covers second scenario above
 248       // If and when UseParallelGC uses the same obj array oop stealing/chunking
 249       // technique, we will need to suitably modify the assertion.
 250       assert((s == klass->oop_size(this)) ||
 251              (Universe::heap()->is_gc_active() &&
 252               ((is_typeArray() && UseConcMarkSweepGC) ||
 253                (is_objArray()  && is_forwarded() && (UseConcMarkSweepGC || UseParallelGC || UseG1GC)))),
 254              "wrong array object size");
 255     } else {
 256       // Must be zero, so bite the bullet and take the virtual call.
 257       s = klass->oop_size(this);
 258     }
 259   }
 260 
 261   assert(s % MinObjAlignment == 0, "alignment check of %d", s);
 262   assert(s > 0, "Bad size calculated: %d", s);
 263   return s;
 264 }
 265 
 266 bool oopDesc::is_instance()  const { return klass()->is_instance_klass();  }
 267 bool oopDesc::is_array()     const { return klass()->is_array_klass();     }
 268 bool oopDesc::is_objArray()  const { return klass()->is_objArray_klass();  }
 269 bool oopDesc::is_typeArray() const { return klass()->is_typeArray_klass(); }
 270 
 271 void*      oopDesc::field_base(int offset)          const { return (void*)&((char*)this)[offset]; }
 272 
 273 jbyte*     oopDesc::byte_field_addr(int offset)     const { return (jbyte*)    field_base(offset); }
 274 jchar*     oopDesc::char_field_addr(int offset)     const { return (jchar*)    field_base(offset); }
 275 jboolean*  oopDesc::bool_field_addr(int offset)     const { return (jboolean*) field_base(offset); }
 276 jint*      oopDesc::int_field_addr(int offset)      const { return (jint*)     field_base(offset); }
 277 jshort*    oopDesc::short_field_addr(int offset)    const { return (jshort*)   field_base(offset); }
 278 jlong*     oopDesc::long_field_addr(int offset)     const { return (jlong*)    field_base(offset); }
 279 jfloat*    oopDesc::float_field_addr(int offset)    const { return (jfloat*)   field_base(offset); }
 280 jdouble*   oopDesc::double_field_addr(int offset)   const { return (jdouble*)  field_base(offset); }
 281 Metadata** oopDesc::metadata_field_addr(int offset) const { return (Metadata**)field_base(offset); }
 282 


< prev index next >