Skip to content

Commit b8d3b40

Browse files
committed
Refactor to remove asm-commons dep; install asm-tree
1 parent a468f3d commit b8d3b40

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

3rdparty/asm/asm-commons-4.1.jar

-37.2 KB
Binary file not shown.

src/vm/jvm/runtime/org/perl6/nqp/jast2bc/AutosplitMethodWriter.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import org.objectweb.asm.MethodVisitor;
77
import org.objectweb.asm.Opcodes;
88
import org.objectweb.asm.Type;
9-
import org.objectweb.asm.commons.CodeSizeEvaluator;
109
import org.objectweb.asm.tree.AbstractInsnNode;
1110
import org.objectweb.asm.tree.FieldInsnNode;
1211
import org.objectweb.asm.tree.IincInsnNode;
@@ -85,10 +84,11 @@ public AutosplitMethodWriter(ClassVisitor target, String tgtype, int access, Str
8584
public void visitEnd() {
8685
super.visitEnd();
8786

88-
CodeSizeEvaluator cse = new CodeSizeEvaluator(null);
89-
accept(cse);
87+
int maxsize = 0;
88+
for (AbstractInsnNode ai = instructions.getFirst(); ai != null; ai = ai.getNext())
89+
maxsize += insnSize(ai);
9090

91-
if (cse.getMaxSize() <= MAX_UNSPLIT_METHOD) {
91+
if (maxsize <= MAX_UNSPLIT_METHOD) {
9292
// hey cool, we don't need to do anything fancy here
9393
MethodVisitor mw = target.visitMethod(access, name, desc, signature, ((List<String>)exceptions).toArray(new String[0]));
9494
accept(mw);
@@ -97,7 +97,7 @@ public void visitEnd() {
9797

9898
/* we need to split this thing */
9999

100-
if (DEBUG_FRAGMENT) System.out.printf("method=%s min=%d max=%d\n", name, cse.getMinSize(), cse.getMaxSize());
100+
if (DEBUG_FRAGMENT) System.out.printf("method=%s max=%d\n", name, maxsize);
101101

102102
splitSwitches();
103103
getInstructions();
@@ -946,7 +946,7 @@ private int insnSize(AbstractInsnNode ai) {
946946
case AbstractInsnNode.MULTIANEWARRAY_INSN:
947947
return 4;
948948
default:
949-
throw new RuntimeException();
949+
return 0;
950950
}
951951
}
952952

tools/build/Makefile-JVM.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUNTIME_JAVAS = \
1919

2020
RUNTIME_JAR = nqp-runtime.jar
2121

22-
THIRDPARTY_JARS = $(ASM)asm-4.1.jar@cpsep@$(ASM)asm-tree-4.1.jar@cpsep@$(ASM)asm-commons-4.1.jar@cpsep@3rdparty/jline/jline-1.0.jar
22+
THIRDPARTY_JARS = $(ASM)asm-4.1.jar@cpsep@$(ASM)asm-tree-4.1.jar@cpsep@3rdparty/jline/jline-1.0.jar
2323
STAGE0 = src/vm/jvm/stage0
2424
STAGE1 = src/stage1
2525
STAGE2 = src/stage2
@@ -162,6 +162,7 @@ all: $(ALL_OUTPUT) $(RUNNER) $(P5QREGEX_JAR)
162162
install: all
163163
$(MKPATH) $(PREFIX)
164164
$(CP) 3rdparty/asm/asm-4.1.jar $(PREFIX)
165+
$(CP) 3rdparty/asm/asm-tree-4.1.jar $(PREFIX)
165166
$(CP) 3rdparty/jline/jline-1.0.jar $(PREFIX)
166167
$(CP) $(RUNTIME_JAR) $(PREFIX)
167168
$(CP) $(NQP_MO_JAR) $(PREFIX)

0 commit comments

Comments
 (0)