RFR: 8307312: Replace "int which" with "int cp_index" in constantPool

Matias Saavedra Silva matsaave at openjdk.org
Thu Jul 27 20:53:08 UTC 2023


Many accessors in the constant pool take an argument "int which" that is meant to represent an ambiguous index. Despite this, several methods in the API use "int which" when the argument is exclusively a constant pool index. This patch aims to rename all of these instances to "int cp_index" in order to be more clear and to distinguish methods that take constant pool indices and methods that use derived indices.

The callers have been updated to use more clear naming as well. Verified with tier 1-5 tests.

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

Commit messages:
 - 8307312: Replace "int which" with "int cp_index" in constantPool

Changes: https://git.openjdk.org/jdk/pull/15027/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15027&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8307312
  Stats: 381 lines in 8 files changed: 0 ins; 0 del; 381 mod
  Patch: https://git.openjdk.org/jdk/pull/15027.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15027/head:pull/15027

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


More information about the hotspot-dev mailing list