Skip to content

Commit

Permalink
Improved performance by not generating classes for lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
otabat committed Nov 24, 2017
1 parent 72ad29d commit 655af84
Show file tree
Hide file tree
Showing 39 changed files with 1,105 additions and 208 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'com.shenjvm'
version '0.2.0'
version '0.2.1'

buildscript {
repositories {
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/shenjvm/KLAClosedEnv.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.shenjvm;

abstract public class KLAClosedEnv {}
13 changes: 0 additions & 13 deletions src/main/java/com/shenjvm/KLALambda.java

This file was deleted.

6 changes: 3 additions & 3 deletions src/main/java/com/shenjvm/KLASM.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ public class KLASM {
public static final Type CLASS_TYPE = Type.getType(Class.class);
public static final Type DOUBLE_TYPE = Type.getType(Double.class);
public static final Type EXCEPTION_TYPE = Type.getType(Exception.class);
public static final Type ILLEGAL_ARGUMENT_EXCEPTION_TYPE = Type.getType(IllegalArgumentException.class);
public static final Type LONG_TYPE = Type.getType(Long.class);
public static final Type NUMBER_TYPE = Type.getType(Number.class);
public static final Type OBJECT_ARRAY_TYPE = Type.getType(Object[].class);
public static final Type OBJECT_TYPE = Type.getType(Object.class);
public static final Type REFLECT_FIELD_TYPE = Type.getType(java.lang.reflect.Field.class);
public static final Type REFLECT_METHOD_TYPE = Type.getType(java.lang.reflect.Method.class);
public static final Type STRING_TYPE = Type.getType(String.class);

public static final Type VOID_TYPE = Type.getType(Void.class);

public static final Type ASM_TYPE_TYPE = Type.getType(Type.class);

public static final Type KL_TYPE = Type.getType(KL.class);
public static final Type KLALAMBDA_TYPE = Type.getType(KLALambda.class);
public static final Type KLASM_TYPE = Type.getType(KLASM.class);
public static final Type KLACLOSEDENV_TYPE = Type.getType(KLAClosedEnv.class);
public static final Type KLCONS_TYPE = Type.getType(KLCons.class);
public static final Type KLEXCEPTION_TYPE = Type.getType(KLException.class);
public static final Type KLFUNCTION_TYPE = Type.getType(KLFunction.class);
public static final Type KLINIT_TYPE = Type.getType(KLInit.class);
public static final Type KLISTREAM_TYPE = Type.getType(KLIStream.class);
public static final Type KLLAMBDA_TYPE = Type.getType(KLLambda.class);
public static final Type KLPRIMITIVE_TYPE = Type.getType(KLPrimitive.class);
public static final Type KLSYMBOL_TYPE = Type.getType(KLSymbol.class);
public static final Type KLSYMBOLPOOL_TYPE = Type.getType(KLSymbolPool.class);
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/shenjvm/KLClosedEnv1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.shenjvm;

public class KLClosedEnv1 extends KLAClosedEnv {
public Object l1;

public KLClosedEnv1(Object l1) {
this.l1 = l1;
}
}
28 changes: 28 additions & 0 deletions src/main/java/com/shenjvm/KLClosedEnv10.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.shenjvm;

public class KLClosedEnv10 extends KLAClosedEnv {
public Object l1;
public Object l2;
public Object l3;
public Object l4;
public Object l5;
public Object l6;
public Object l7;
public Object l8;
public Object l9;
public Object l10;

public KLClosedEnv10(Object l1, Object l2, Object l3, Object l4, Object l5, Object l6, Object l7, Object l8,
Object l9, Object l10) {
this.l1 = l1;
this.l2 = l2;
this.l3 = l3;
this.l4 = l4;
this.l5 = l5;
this.l6 = l6;
this.l7 = l7;
this.l8 = l8;
this.l9 = l9;
this.l10 = l10;
}
}
30 changes: 30 additions & 0 deletions src/main/java/com/shenjvm/KLClosedEnv11.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.shenjvm;

public class KLClosedEnv11 extends KLAClosedEnv {
public Object l1;
public Object l2;
public Object l3;
public Object l4;
public Object l5;
public Object l6;
public Object l7;
public Object l8;
public Object l9;
public Object l10;
public Object l11;

public KLClosedEnv11(Object l1, Object l2, Object l3, Object l4, Object l5, Object l6, Object l7, Object l8,
Object l9, Object l10, Object l11) {
this.l1 = l1;
this.l2 = l2;
this.l3 = l3;
this.l4 = l4;
this.l5 = l5;
this.l6 = l6;
this.l7 = l7;
this.l8 = l8;
this.l9 = l9;
this.l10 = l10;
this.l11 = l11;
}
}
32 changes: 32 additions & 0 deletions src/main/java/com/shenjvm/KLClosedEnv12.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.shenjvm;

public class KLClosedEnv12 extends KLAClosedEnv {
public Object l1;
public Object l2;
public Object l3;
public Object l4;
public Object l5;
public Object l6;
public Object l7;
public Object l8;
public Object l9;
public Object l10;
public Object l11;
public Object l12;

public KLClosedEnv12(Object l1, Object l2, Object l3, Object l4, Object l5, Object l6, Object l7, Object l8,
Object l9, Object l10, Object l11, Object l12) {
this.l1 = l1;
this.l2 = l2;
this.l3 = l3;
this.l4 = l4;
this.l5 = l5;
this.l6 = l6;
this.l7 = l7;
this.l8 = l8;
this.l9 = l9;
this.l10 = l10;
this.l11 = l11;
this.l12 = l12;
}
}
34 changes: 34 additions & 0 deletions src/main/java/com/shenjvm/KLClosedEnv13.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.shenjvm;

public class KLClosedEnv13 extends KLAClosedEnv {
public Object l1;
public Object l2;
public Object l3;
public Object l4;
public Object l5;
public Object l6;
public Object l7;
public Object l8;
public Object l9;
public Object l10;
public Object l11;
public Object l12;
public Object l13;

public KLClosedEnv13(Object l1, Object l2, Object l3, Object l4, Object l5, Object l6, Object l7, Object l8,
Object l9, Object l10, Object l11, Object l12, Object l13) {
this.l1 = l1;
this.l2 = l2;
this.l3 = l3;
this.l4 = l4;
this.l5 = l5;
this.l6 = l6;
this.l7 = l7;
this.l8 = l8;
this.l9 = l9;
this.l10 = l10;
this.l11 = l11;
this.l12 = l12;
this.l13 = l13;
}
}
36 changes: 36 additions & 0 deletions src/main/java/com/shenjvm/KLClosedEnv14.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.shenjvm;

public class KLClosedEnv14 extends KLAClosedEnv {
public Object l1;
public Object l2;
public Object l3;
public Object l4;
public Object l5;
public Object l6;
public Object l7;
public Object l8;
public Object l9;
public Object l10;
public Object l11;
public Object l12;
public Object l13;
public Object l14;

public KLClosedEnv14(Object l1, Object l2, Object l3, Object l4, Object l5, Object l6, Object l7, Object l8,
Object l9, Object l10, Object l11, Object l12, Object l13, Object l14) {
this.l1 = l1;
this.l2 = l2;
this.l3 = l3;
this.l4 = l4;
this.l5 = l5;
this.l6 = l6;
this.l7 = l7;
this.l8 = l8;
this.l9 = l9;
this.l10 = l10;
this.l11 = l11;
this.l12 = l12;
this.l13 = l13;
this.l14 = l14;
}
}
38 changes: 38 additions & 0 deletions src/main/java/com/shenjvm/KLClosedEnv15.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.shenjvm;

public class KLClosedEnv15 extends KLAClosedEnv {
public Object l1;
public Object l2;
public Object l3;
public Object l4;
public Object l5;
public Object l6;
public Object l7;
public Object l8;
public Object l9;
public Object l10;
public Object l11;
public Object l12;
public Object l13;
public Object l14;
public Object l15;

public KLClosedEnv15(Object l1, Object l2, Object l3, Object l4, Object l5, Object l6, Object l7, Object l8,
Object l9, Object l10, Object l11, Object l12, Object l13, Object l14, Object l15) {
this.l1 = l1;
this.l2 = l2;
this.l3 = l3;
this.l4 = l4;
this.l5 = l5;
this.l6 = l6;
this.l7 = l7;
this.l8 = l8;
this.l9 = l9;
this.l10 = l10;
this.l11 = l11;
this.l12 = l12;
this.l13 = l13;
this.l14 = l14;
this.l15 = l15;
}
}
41 changes: 41 additions & 0 deletions src/main/java/com/shenjvm/KLClosedEnv16.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.shenjvm;

public class KLClosedEnv16 extends KLAClosedEnv {
public Object l1;
public Object l2;
public Object l3;
public Object l4;
public Object l5;
public Object l6;
public Object l7;
public Object l8;
public Object l9;
public Object l10;
public Object l11;
public Object l12;
public Object l13;
public Object l14;
public Object l15;
public Object l16;

public KLClosedEnv16(Object l1, Object l2, Object l3, Object l4, Object l5, Object l6, Object l7, Object l8,
Object l9, Object l10, Object l11, Object l12, Object l13, Object l14, Object l15,
Object l16) {
this.l1 = l1;
this.l2 = l2;
this.l3 = l3;
this.l4 = l4;
this.l5 = l5;
this.l6 = l6;
this.l7 = l7;
this.l8 = l8;
this.l9 = l9;
this.l10 = l10;
this.l11 = l11;
this.l12 = l12;
this.l13 = l13;
this.l14 = l14;
this.l15 = l15;
this.l16 = l16;
}
}
43 changes: 43 additions & 0 deletions src/main/java/com/shenjvm/KLClosedEnv17.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.shenjvm;

public class KLClosedEnv17 extends KLAClosedEnv {
public Object l1;
public Object l2;
public Object l3;
public Object l4;
public Object l5;
public Object l6;
public Object l7;
public Object l8;
public Object l9;
public Object l10;
public Object l11;
public Object l12;
public Object l13;
public Object l14;
public Object l15;
public Object l16;
public Object l17;

public KLClosedEnv17(Object l1, Object l2, Object l3, Object l4, Object l5, Object l6, Object l7, Object l8,
Object l9, Object l10, Object l11, Object l12, Object l13, Object l14, Object l15,
Object l16, Object l17) {
this.l1 = l1;
this.l2 = l2;
this.l3 = l3;
this.l4 = l4;
this.l5 = l5;
this.l6 = l6;
this.l7 = l7;
this.l8 = l8;
this.l9 = l9;
this.l10 = l10;
this.l11 = l11;
this.l12 = l12;
this.l13 = l13;
this.l14 = l14;
this.l15 = l15;
this.l16 = l16;
this.l17 = l17;
}
}
Loading

0 comments on commit 655af84

Please sign in to comment.