8329099: Undocumented exception thrown by Instruction factory methods accepting Opcode

Reviewed-by: briangoetz
This commit is contained in:
Adam Sotona 2024-04-16 08:23:31 +00:00
parent def257727d
commit 97c180892b
17 changed files with 48 additions and 0 deletions

View file

@ -68,6 +68,8 @@ public sealed interface DiscontinuedInstruction extends Instruction {
* @param op the opcode for the specific type of JSR instruction,
* which must be of kind {@link Opcode.Kind#DISCONTINUED_JSR}
* @param target target label of the subroutine
* @throws IllegalArgumentException if the opcode kind is not
* {@link Opcode.Kind#DISCONTINUED_JSR}.
*/
static JsrInstruction of(Opcode op, Label target) {
Util.checkKind(op, Opcode.Kind.DISCONTINUED_JSR);
@ -109,6 +111,8 @@ public sealed interface DiscontinuedInstruction extends Instruction {
* @param op the opcode for the specific type of RET instruction,
* which must be of kind {@link Opcode.Kind#DISCONTINUED_RET}
* @param slot the local variable slot to load return address from
* @throws IllegalArgumentException if the opcode kind is not
* {@link Opcode.Kind#DISCONTINUED_RET}.
*/
static RetInstruction of(Opcode op, int slot) {
Util.checkKind(op, Opcode.Kind.DISCONTINUED_RET);