< prev index next >
src/share/vm/oops/valueKlass.cpp
Print this page
*** 40,56 ****
}
return NULL;
}
int ValueKlass::first_field_offset() {
! // Really inefficient, should be cached somewhere
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;
}
bool ValueKlass::is_atomic() {
return (nonstatic_field_size() * heapOopSize) <= longSize;
}
--- 40,61 ----
}
return NULL;
}
int ValueKlass::first_field_offset() {
! #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();
}
! #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() {
return (nonstatic_field_size() * heapOopSize) <= longSize;
}
< prev index next >