--- old/src/share/vm/oops/valueKlass.cpp 2016-11-16 09:06:11.638498566 +0100 +++ new/src/share/vm/oops/valueKlass.cpp 2016-11-16 09:06:11.574498564 +0100 @@ -42,13 +42,18 @@ } int ValueKlass::first_field_offset() { - // Really inefficient, should be cached somewhere +#ifdef ASSERT instanceKlassHandle k(this); int first_offset = INT_MAX; for (JavaFieldStream fs(k()); !fs.done(); fs.next()) { if (fs.offset() < first_offset) first_offset= fs.offset(); } - return first_offset; +#endif + int base_offset = instanceOopDesc::base_offset_in_bytes(); + // The first field of value types is aligned on a long boundary + base_offset = align_size_up(base_offset, BytesPerLong); + assert(base_offset = first_offset, "inconsistent offsets"); + return base_offset; } bool ValueKlass::is_atomic() {