Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8296960: [JVMCI] list HotSpotConstantPool.loadReferencedType to Const…
…antPool

Reviewed-by: never
  • Loading branch information
Doug Simon committed Nov 16, 2022
1 parent f0474b8 commit b3ef337
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Expand Up @@ -836,6 +836,7 @@ public void loadReferencedType(int cpi, int opcode) {
loadReferencedType(cpi, opcode, true /* initialize */);
}

@Override
@SuppressWarnings("fallthrough")
public void loadReferencedType(int cpi, int opcode, boolean initialize) {
int index;
Expand Down
Expand Up @@ -49,6 +49,24 @@ public interface ConstantPool {
*/
void loadReferencedType(int cpi, int opcode);

/**
* Ensures that the type referenced by the specified constant pool entry is loaded. This can be
* used to compile time resolve a type. It works for field, method, or type constant pool
* entries.
*
* @param cpi the index of the constant pool entry that references the type
* @param opcode the opcode of the instruction that references the type
* @param initialize if {@code true}, the referenced type is either guaranteed to be initialized
* upon return or an initialization exception is thrown
*/
default void loadReferencedType(int cpi, int opcode, boolean initialize) {
if (initialize) {
loadReferencedType(cpi, opcode);
} else {
throw new UnsupportedOperationException();
}
}

/**
* Looks up the type referenced by the constant pool entry at {@code cpi} as referenced by the
* {@code opcode} bytecode instruction.
Expand Down

1 comment on commit b3ef337

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.