mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-08 00:36:15 +00:00
Use static ints instead of enum
This commit is contained in:
@@ -3,20 +3,15 @@ package com.dfsek.terra.addons.terrascript.codegen.asm;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
|
||||
public enum OpcodeAlias {
|
||||
CMP_GREATER_THAN(Opcodes.IFGT),
|
||||
CMP_GREATER_EQUALS(Opcodes.IFGE),
|
||||
CMP_LESS_THAN(Opcodes.IFLT),
|
||||
CMP_LESS_EQUALS(Opcodes.IFLE),
|
||||
CMP_EQUALS(Opcodes.IFEQ),
|
||||
CMP_NOT_EQUALS(Opcodes.IFNE),
|
||||
BOOL_FALSE(Opcodes.IFEQ),
|
||||
BOOL_TRUE(Opcodes.IFNE),
|
||||
INTEGERS_EQUAL(Opcodes.IF_ICMPEQ),
|
||||
INTEGERS_NOT_EQUAL(Opcodes.IF_ICMPNE),
|
||||
;
|
||||
|
||||
public final int opcode;
|
||||
|
||||
OpcodeAlias(int opcode) { this.opcode = opcode; }
|
||||
public class OpcodeAlias {
|
||||
public static int CMP_GREATER_THAN = Opcodes.IFGT;
|
||||
public static int CMP_GREATER_EQUALS = Opcodes.IFGE;
|
||||
public static int CMP_LESS_THAN = Opcodes.IFLT;
|
||||
public static int CMP_LESS_EQUALS = Opcodes.IFLE;
|
||||
public static int CMP_EQUALS = Opcodes.IFEQ;
|
||||
public static int CMP_NOT_EQUALS = Opcodes.IFNE;
|
||||
public static int BOOL_FALSE = Opcodes.IFEQ;
|
||||
public static int BOOL_TRUE = Opcodes.IFNE;
|
||||
public static int INTEGERS_EQUAL = Opcodes.IF_ICMPEQ;
|
||||
public static int INTEGERS_NOT_EQUAL = Opcodes.IF_ICMPNE;
|
||||
}
|
||||
|
||||
@@ -466,8 +466,8 @@ public class TerraScriptClassGenerator {
|
||||
method.visitInsn(Opcodes.ICONST_0);
|
||||
}
|
||||
|
||||
private void jumpIf(OpcodeAlias insn, Label label) {
|
||||
method.visitJumpInsn(insn.opcode, label);
|
||||
private void jumpIf(int opcode, Label label) {
|
||||
method.visitJumpInsn(opcode, label);
|
||||
}
|
||||
|
||||
private void jump(Label label) {
|
||||
|
||||
Reference in New Issue
Block a user