RFR: 8307190: Refactor ref_at methods in Constant Pool
Coleen Phillimore
coleenp at openjdk.org
Thu May 11 18:09:37 UTC 2023
On Mon, 8 May 2023 19:23:51 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:
> In anticipation of [JDK-8301996](https://bugs.openjdk.org/browse/JDK-8301996), some of the accessors in constantpool.cpp need to be updated. The CPCache rework introduces multiple new meanings to the index argument passed to these functions, so they need to be restructured in a way that facilitates different paths depending on the input. For this enhancement, the bytecode is propagated by the callers to determine how to handle the index. Thanks to this and JDK-8307306, `bool uncached` is no longer needed in these functions.
>
> Tests have been altered to suit the changes to JVMCI. Verified with tier1-5 tests.
Changes requested by coleenp (Reviewer).
src/hotspot/share/oops/constantPool.cpp line 678:
> 676: }
> 677:
> 678: int ConstantPool::cp_index_helper(int index, Bytecodes::Code code) {
How about a comment and rename to_cp_index()?
src/hotspot/share/oops/constantPool.cpp line 720:
> 718: // which may be either a Constant Pool index or a rewritten index
> 719: int pool_index = which;
> 720: if (cache() != nullptr) {
Should be assert.
src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java line 438:
> 436: *
> 437: * @param which constant pool index or constant pool cache index
> 438: * @param opcode bytecode
Is this a param? You should remove the jvmci changes because they're not needed for this change.
-------------
PR Review: https://git.openjdk.org/jdk/pull/13872#pullrequestreview-1423101271
PR Review Comment: https://git.openjdk.org/jdk/pull/13872#discussion_r1191527022
PR Review Comment: https://git.openjdk.org/jdk/pull/13872#discussion_r1191486047
PR Review Comment: https://git.openjdk.org/jdk/pull/13872#discussion_r1191528628
More information about the hotspot-dev
mailing list