Skip to content

Instantly share code, notes, and snippets.

@achikin
Created February 8, 2020 23:09
Show Gist options
  • Save achikin/f51202a77dae20772c58896a1fb90289 to your computer and use it in GitHub Desktop.
Save achikin/f51202a77dae20772c58896a1fb90289 to your computer and use it in GitHub Desktop.
decomp.core=> (defn xxx [a b] (+ a b))
#'decomp.core/xxx
decomp.core=> (dc/decompile (fn [] (xxx 1 2)))
// Decompiling class: decomp/core$fn__1632
package decomp;
import clojure.lang.*;
public final class core$fn__1632 extends AFunction
{
public static final Var const__0;
public static final Object const__1;
public static final Object const__2;
public static Object invokeStatic() {
return ((IFn)core$fn__1632.const__0.getRawRoot()).invoke(core$fn__1632.const__1, core$fn__1632.const__2);
}
@Override
public Object invoke() {
return invokeStatic();
}
static {
const__0 = RT.var("decomp.core", "xxx");
const__1 = 1L;
const__2 = 2L;
}
}
decomp.core=> (dc/disassemble (fn [] (xxx 1 2)))
// Decompiling class: decomp/core$fn__1636
class decomp.core$fn__1636
Minor version: 0
Major version: 52
Flags: PUBLIC, FINAL, SUPER
public static final clojure.lang.Var const__0;
Flags: PUBLIC, STATIC, FINAL
public static final java.lang.Object const__1;
Flags: PUBLIC, STATIC, FINAL
public static final java.lang.Object const__2;
Flags: PUBLIC, STATIC, FINAL
public void <init>();
Flags: PUBLIC
Code:
linenumber 1
0: aload_0
1: invokespecial clojure/lang/AFunction.<init>:()V
4: return
public static java.lang.Object invokeStatic();
Flags: PUBLIC, STATIC
Code:
linenumber 1
0: getstatic decomp/core$fn__1636.const__0:Lclojure/lang/Var;
3: invokevirtual clojure/lang/Var.getRawRoot:()Ljava/lang/Object;
linenumber 1
6: checkcast Lclojure/lang/IFn;
9: getstatic decomp/core$fn__1636.const__1:Ljava/lang/Object;
12: getstatic decomp/core$fn__1636.const__2:Ljava/lang/Object;
linenumber 1
15: invokeinterface clojure/lang/IFn.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
20: areturn
public java.lang.Object invoke();
Flags: PUBLIC
Code:
linenumber 1
0: invokestatic decomp/core$fn__1636.invokeStatic:()Ljava/lang/Object;
3: areturn
static {};
Flags: PUBLIC, STATIC
Code:
linenumber 1
0: ldc "decomp.core"
2: ldc "xxx"
4: invokestatic clojure/lang/RT.var:(Ljava/lang/String;Ljava/lang/String;)Lclojure/lang/Var;
7: checkcast Lclojure/lang/Var;
10: putstatic decomp/core$fn__1636.const__0:Lclojure/lang/Var;
13: lconst_1
14: invokestatic java/lang/Long.valueOf:(J)Ljava/lang/Long;
17: putstatic decomp/core$fn__1636.const__1:Ljava/lang/Object;
20: ldc2_w 2
23: invokestatic java/lang/Long.valueOf:(J)Ljava/lang/Long;
26: putstatic decomp/core$fn__1636.const__2:Ljava/lang/Object;
29: return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment