On Mon, 28 Oct 2024 15:29:33 GMT, Chen Liang <li...@openjdk.org> wrote:

> There are currently some issues with our handling of "load constant" 
> instructions: namely, there is some problem with writing unbounded/external 
> constants and handling of entry index changes, that we currently generate 
> invalid bytecode for condy loading double/long that has index over 255.
> 
> This patch propose the following solution:
> 1. We write the instruction as-is, without changes, if we are writing a 
> compatible constant pool entry, such as from shared-CP transformation or 
> explicitly using CodeBuilder's constant pool + instruction factory.
> 2. Otherwise, we convert the instruction from/to ldc/ldc_w depends on if the 
> instruction is encodable with ldc. ldc2_w can always be preserved by this 
> rule.
> 
> Test changes verify the fix for the said condy issue and the intended 
> adaption behaviors.

Thanks for the reviews!

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

PR Comment: https://git.openjdk.org/jdk/pull/21743#issuecomment-2449914965

Reply via email to