RFR: 8339214: Remove misleading CodeBuilder.loadConstant(Opcode, ConstantDesc) [v2]

Chen Liang liach at openjdk.org
Thu Aug 29 21:46:52 UTC 2024


> `CodeBuilder::loadConstant(Opcode, ConstantDesc)` is error-prone and confusing. Users should almost always use `loadConstant(ConstantDesc)` for optimized instructions, or use specific factories `iconst_0` etc. or `bipush` with arguments or `LoadConstantInstruction.of` if they want to specify the exact type of LDC opcode.

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

  Move bipush and sipush fix from Opcode cleanup to this patch

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20779/files
  - new: https://git.openjdk.org/jdk/pull/20779/files/8c5e6fd8..86c4104d

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20779&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20779&range=00-01

  Stats: 3 lines in 1 file changed: 0 ins; 1 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/20779.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20779/head:pull/20779

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


More information about the core-libs-dev mailing list