インタフェースDiscontinuedInstruction.RetInstruction
- すべてのスーパー・インタフェース:
ClassFileElement,CodeElement,DiscontinuedInstruction,Instruction
- 含まれているインタフェース:
DiscontinuedInstruction
public static sealed interface DiscontinuedInstruction.RetInstruction extends DiscontinuedInstruction
モデルは、クラス・ファイルのメジャー・バージョン51 (JVMS 4.9.1)以降、
ここで、
Code属性の code配列から中断されたサブルーチン命令から戻されます。 対応するopcodesのkindはOpcode.Kind.DISCONTINUED_RETです。 CodeModelの要素をトラバースするときに、CodeElementとして提供されます。
サブルーチン命令からの戻り値はコンポジットです:
RetInstruction(int slot)
slotは[0, 65535]内に存在する必要があります。
astoreシリーズの命令は、returnAddress値をローカル変数スロットに格納し、サブルーチン命令からの戻りによってスロットを使用できるようにします。
- APIのノート:
- サブルーチンからの戻り命令は中止され、
StackMapTable属性を使用して(JVMS 4.10.1)型による検証が強制されます。 - Java Virtual Machine仕様を参照してください:
-
6.5.ret ret
- 導入されたバージョン:
- 24
- 関連項目:
-
ネストされたクラスのサマリー
インタフェースjava.lang.classfile.instruction.DiscontinuedInstructionで宣言されたネストされたクラス/インタフェース
DiscontinuedInstruction.JsrInstruction, DiscontinuedInstruction.RetInstruction -
メソッドのサマリー
インタフェースjava.lang.classfile.Instructionで宣言されたメソッド
opcode, sizeInBytes
-
メソッドの詳細
-
slot
int slot()戻りアドレスを持つローカル変数スロットを返します。 値は[0, 65535]内にあります。- 戻り値:
- 戻りアドレスを持つローカル変数スロット
-
of
static DiscontinuedInstruction.RetInstruction of(Opcode op, int slot) - APIのノート:
- 明示的な
op引数を使用すると、通常のret命令の範囲でslotを使用してwide ret命令を作成できます。 - パラメータ:
op- サブルーチン命令からの戻り値の特定のタイプのopcode。Opcode.Kind.DISCONTINUED_RETの種類である必要がありますslot- 戻りアドレスをロードするローカル変数スロット- 戻り値:
- サブルーチン命令からの復帰
- スロー:
IllegalArgumentException- opcodeの種類がOpcode.Kind.DISCONTINUED_RETでない場合、またはslotが範囲外の場合
-
of
static DiscontinuedInstruction.RetInstruction of(int slot) サブルーチン命令からの戻り値を返します。slotは、[0, 65535]内に存在する必要があります。- パラメータ:
slot- 戻りアドレスをロードするローカル変数スロット- 戻り値:
- サブルーチン命令からの復帰
- スロー:
IllegalArgumentException-slotが範囲外の場合
-