RFR: 8158045: Improve large object handling during evacuation

Albert Yang albert.m.yang at oracle.com
Thu Aug 27 16:24:48 UTC 2020


Hi,

```
   81   bool _old_gen_is_full;
   82
   83   int _objarray_scan_chunk_size;
   84   int _objarray_length_offset_in_bytes;
```

I think these three fields can be reordered/shrunk to be more compact, something like:

```
int32_t _objarray_scan_chunk_size;
uint8_t _objarray_length_offset_in_bytes;
bool _old_gen_is_full;
```

Not directly changed by this patch, but close enough. In 
`G1ParScanThreadState::do_copy_to_survivor_space`:

```
if (forward_ptr == NULL) {
   // 60 lines; partially covered in this patch
} else {
   _plab_allocator->undo_allocation(dest_attr, obj_ptr, word_sz, node_index);
   return forward_ptr;
}
```

could be turned into the following using early-return, which feels nicer, IMO.

```
if (forward_ptr) {
   _plab_allocator->undo_allocation(dest_attr, obj_ptr, word_sz, node_index);
   return forward_ptr;
}
// 60 lines
```

-- 
/Albert



More information about the hotspot-gc-dev mailing list