On Wed, 18 Jun 2025 12:37:07 GMT, Johan Sjölen <jsjo...@openjdk.org> wrote:

>> Hi,
>> 
>>  The constant pool currently has a lot of methods specific to extracting 
>> parts of the operands array. What this array actually is, is a sequence of 
>> bootstrap method attribute entries, where each entry has the following 
>> components:
>> 
>> ```c++
>> struct BSMAE {
>>   u2 bootstrap_method_index;
>>   u2 argument_count;
>>   u2 arguments[argument_count];
>> }
>> 
>> 
>> We can removes some of these operands array specific methods, and instead 
>> allows you to extract BSMAttributeEntrys which you can then use to extract 
>> its piece wise components. This makes for a nicer interface, and a bit 
>> easier to come into as a reader of the code, as it more closely mirrors the 
>> JVMS. 
>> 
>> Please consider!
>> 
>> Testing: Currently GHA, running tier1-tier3
>
> Johan Sjölen has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - Matias's comments
>  - Apply Sergei's comments

src/hotspot/share/oops/constantPool.cpp line 1944:

> 1942:   BSMAttributeEntry* e2 = bsm_attribute_entry(idx2);
> 1943:   int k1 = e1->bootstrap_method_index();
> 1944:   int k2 = cp2->e2->bootstrap_method_index();

I'm kind of confused, this does not look right. It is event not going to be 
compiled.
It is supposed to be as below:

BSMAttributeEntry* e2 = cp2->bsm_attribute_entry(idx2);
. . .
int k2 = e2->bootstrap_method_index();
. . .
    if (argc == e2->argument_count()) {
. . .
    k2 = e2->argument_index(j);

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25298#discussion_r2155183220

Reply via email to