Skip to content

Instantly share code, notes, and snippets.

@duongntbk
Created March 23, 2023 07:02
Show Gist options
  • Save duongntbk/330e64b8a1f4fa67b8c3eaf826dafedc to your computer and use it in GitHub Desktop.
Save duongntbk/330e64b8a1f4fa67b8c3eaf826dafedc to your computer and use it in GitHub Desktop.
Kotlin delegation bytecode
// ================WeaponWrapper.class =================
// class version 52.0 (52)
// access flags 0x31
public final class WeaponWrapper implements Weapon {
// access flags 0x2
private LWeapon; weapon
@Lorg/jetbrains/annotations/NotNull;() // invisible
// access flags 0x11
public final getWeapon()LWeapon;
@Lorg/jetbrains/annotations/NotNull;() // invisible
L0
LINENUMBER 8 L0
ALOAD 0
GETFIELD WeaponWrapper.weapon : LWeapon;
ARETURN
L1
LOCALVARIABLE this LWeaponWrapper; L0 L1 0
MAXSTACK = 1
MAXLOCALS = 1
// access flags 0x11
public final setWeapon(LWeapon;)V
// annotable parameter count: 1 (visible)
// annotable parameter count: 1 (invisible)
@Lorg/jetbrains/annotations/NotNull;() // invisible, parameter 0
L0
ALOAD 1
LDC "<set-?>"
INVOKESTATIC kotlin/jvm/internal/Intrinsics.checkNotNullParameter (Ljava/lang/Object;Ljava/lang/String;)V
L1
LINENUMBER 8 L1
ALOAD 0
ALOAD 1
PUTFIELD WeaponWrapper.weapon : LWeapon;
RETURN
L2
LOCALVARIABLE this LWeaponWrapper; L0 L2 0
LOCALVARIABLE <set-?> LWeapon; L0 L2 1
MAXSTACK = 2
MAXLOCALS = 2
// access flags 0x1
public <init>(LWeapon;)V
// annotable parameter count: 1 (visible)
// annotable parameter count: 1 (invisible)
@Lorg/jetbrains/annotations/NotNull;() // invisible, parameter 0
L0
ALOAD 1
LDC "weapon"
INVOKESTATIC kotlin/jvm/internal/Intrinsics.checkNotNullParameter (Ljava/lang/Object;Ljava/lang/String;)V
L1
LINENUMBER 8 L1
ALOAD 0
INVOKESPECIAL java/lang/Object.<init> ()V
ALOAD 0
ALOAD 1
PUTFIELD WeaponWrapper.$$delegate_0 : LWeapon;
ALOAD 0
ALOAD 1
PUTFIELD WeaponWrapper.weapon : LWeapon;
RETURN
L2
LOCALVARIABLE this LWeaponWrapper; L0 L2 0
LOCALVARIABLE weapon LWeapon; L0 L2 1
MAXSTACK = 2
MAXLOCALS = 2
// access flags 0x1012
private final synthetic LWeapon; $$delegate_0
// access flags 0x1
public attack()V
L0
ALOAD 0
GETFIELD WeaponWrapper1.$$delegate_0 : LWeapon;
INVOKEINTERFACE Weapon.attack ()V (itf)
RETURN
L1
LOCALVARIABLE this LWeaponWrapper; L0 L1 0
MAXSTACK = 1
MAXLOCALS = 1
@Lkotlin/Metadata;(mv={1, 7, 0}, k=1, d1={"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0006\n\u0002\u0010\u0002\n\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0001\u00a2\u0006\u0002\u0010\u0003J\u0009\u0010\u0007\u001a\u00020\u0008H\u0096\u0001R\u001a\u0010\u0002\u001a\u00020\u0001X\u0086\u000e\u00a2\u0006\u000e\n\u0000\u001a\u0004\u0008\u0004\u0010\u0005\"\u0004\u0008\u0006\u0010\u0003\u00a8\u0006\u0009"}, d2={"LWeaponWrapper1;", "LWeapon;", "weapon", "(LWeapon;)V", "getWeapon", "()LWeapon;", "setWeapon", "attack", "", "SuspendingDemo"})
// compiled from: Delegation.kt
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment