Re: RFR: 8333748: javap crash - Fatal error: Unmatched bit position 0x2 for location CLASS [v4]

2024-06-17 Thread Chen Liang
On Mon, 17 Jun 2024 17:38:56 GMT, Chen Liang  wrote:

>> Currently, javap crashes for class files that have set non-zero values for 
>> undefined access flag bits, as 
>> `java.lang.reflect.AccessFlag.maskToAccessFlag` and 
>> `java.lang.classfile.AccessFlags.flags` fail. In contrast, the JVMS, though 
>> asking for these bits to be set to 0, requires VM to proceed and ignore 
>> these bits. javap should emulate the VM behavior and proceed rendering, 
>> ignoring these undefined bits.
>> 
>> In addition, a few bytecode generation utilities in the JDK set unused bits, 
>> such as in 
>> `java.lang.invoke.MethodHandleImpl.BindCaller#generateInvokerTemplate` and 
>> `java.lang.invoke.GenerateJLIClassesHelper#generateCodeBytesForLFs`. Those 
>> can be updated in a later cleanup.
>
> Chen Liang has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Improved error message

I have created a CSR for this patch at 
https://bugs.openjdk.org/browse/JDK-8334406; please review. Also I am not sure 
about the correct interface kind and scope for this CSR: is "other" and 
"implementation" correct?

-

PR Comment: https://git.openjdk.org/jdk/pull/19708#issuecomment-2174128620


Re: RFR: 8333748: javap crash - Fatal error: Unmatched bit position 0x2 for location CLASS [v4]

2024-06-17 Thread Adam Sotona
On Mon, 17 Jun 2024 17:38:56 GMT, Chen Liang  wrote:

>> Currently, javap crashes for class files that have set non-zero values for 
>> undefined access flag bits, as 
>> `java.lang.reflect.AccessFlag.maskToAccessFlag` and 
>> `java.lang.classfile.AccessFlags.flags` fail. In contrast, the JVMS, though 
>> asking for these bits to be set to 0, requires VM to proceed and ignore 
>> these bits. javap should emulate the VM behavior and proceed rendering, 
>> ignoring these undefined bits.
>> 
>> In addition, a few bytecode generation utilities in the JDK set unused bits, 
>> such as in 
>> `java.lang.invoke.MethodHandleImpl.BindCaller#generateInvokerTemplate` and 
>> `java.lang.invoke.GenerateJLIClassesHelper#generateCodeBytesForLFs`. Those 
>> can be updated in a later cleanup.
>
> Chen Liang has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Improved error message

Now it looks good to me, thanks.

-

Marked as reviewed by asotona (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19708#pullrequestreview-2123504238


Re: RFR: 8333748: javap crash - Fatal error: Unmatched bit position 0x2 for location CLASS [v4]

2024-06-17 Thread Chen Liang
> Currently, javap crashes for class files that have set non-zero values for 
> undefined access flag bits, as 
> `java.lang.reflect.AccessFlag.maskToAccessFlag` and 
> `java.lang.classfile.AccessFlags.flags` fail. In contrast, the JVMS, though 
> asking for these bits to be set to 0, requires VM to proceed and ignore these 
> bits. javap should emulate the VM behavior and proceed rendering, ignoring 
> these undefined bits.
> 
> In addition, a few bytecode generation utilities in the JDK set unused bits, 
> such as in 
> `java.lang.invoke.MethodHandleImpl.BindCaller#generateInvokerTemplate` and 
> `java.lang.invoke.GenerateJLIClassesHelper#generateCodeBytesForLFs`. Those 
> can be updated in a later cleanup.

Chen Liang has updated the pull request incrementally with one additional 
commit since the last revision:

  Improved error message

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19708/files
  - new: https://git.openjdk.org/jdk/pull/19708/files/0f3e1a97..c8eee028

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19708=03
 - incr: https://webrevs.openjdk.org/?repo=jdk=19708=02-03

  Stats: 20 lines in 2 files changed: 16 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/19708.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19708/head:pull/19708

PR: https://git.openjdk.org/jdk/pull/19708