RFR: 8367656: Refactor Constantpool's operand array into two [v5]

Johan Sjölen jsjolen at openjdk.org
Mon Sep 29 17:58:01 UTC 2025


On Thu, 18 Sep 2025 21:27:01 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Johan Sjölen has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix rename
>
> src/hotspot/share/oops/constantPool.inline.hpp line 93:
> 
>> 91: inline BSMAttributeEntry* BSMAttributeEntries::InsertionIterator::reserve_new_entry(u2 bsmi, u2 argc) {
>> 92:   if (_cur_offset + 1 > insert_into->offsets()->length() ||
>> 93:       _cur_array + 1 + 1 + argc > insert_into->bootstrap_methods()->length()) {
> 
> The `+ 1 + 1 + argc` looks a little magical - can we factor it out and explain it e.g.
> 
> int next_array = _cur_array + 1 /* ??? */ + 1 /* ??? */ + argc;
> ...
> _curr_array = next_array;
> ...

I wrapped the size calculation into `BSMAE::u2s_needed`  and annotated the magic numbers there.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27198#discussion_r2388764436


More information about the serviceability-dev mailing list