mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8158946: btree009 fails with assert(s > 0) failed: Bad size calculated
Set oop_size before setting _klass Reviewed-by: coleenp, dholmes, kbarrett, tschatzl
This commit is contained in:
parent
4e25b9f930
commit
2e1b011569
6 changed files with 42 additions and 9 deletions
|
@ -871,12 +871,17 @@ void java_lang_Class::fixup_module_field(KlassHandle k, Handle module) {
|
|||
|
||||
int java_lang_Class::oop_size(oop java_class) {
|
||||
assert(_oop_size_offset != 0, "must be set");
|
||||
return java_class->int_field(_oop_size_offset);
|
||||
int size = java_class->int_field(_oop_size_offset);
|
||||
assert(size > 0, "Oop size must be greater than zero, not %d", size);
|
||||
return size;
|
||||
}
|
||||
|
||||
void java_lang_Class::set_oop_size(oop java_class, int size) {
|
||||
assert(_oop_size_offset != 0, "must be set");
|
||||
assert(size > 0, "Oop size must be greater than zero, not %d", size);
|
||||
java_class->int_field_put(_oop_size_offset, size);
|
||||
}
|
||||
|
||||
int java_lang_Class::static_oop_field_count(oop java_class) {
|
||||
assert(_static_oop_field_count_offset != 0, "must be set");
|
||||
return java_class->int_field(_static_oop_field_count_offset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue