mirror of
https://github.com/revanced/smali.git
synced 2025-05-29 04:10:13 +02:00
Remove unneeded format precondition checks
The format precondition check should always occur in the base instruction class
This commit is contained in:
parent
766f285a70
commit
f97289cf3e
@ -45,8 +45,8 @@ public abstract class ImmutableInstruction implements Instruction {
|
|||||||
@Nonnull protected final Opcode opcode;
|
@Nonnull protected final Opcode opcode;
|
||||||
|
|
||||||
protected ImmutableInstruction(@Nonnull Opcode opcode) {
|
protected ImmutableInstruction(@Nonnull Opcode opcode) {
|
||||||
this.opcode = opcode;
|
|
||||||
Preconditions.checkFormat(opcode, getFormat());
|
Preconditions.checkFormat(opcode, getFormat());
|
||||||
|
this.opcode = opcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
|
@ -46,7 +46,6 @@ public class ImmutableInstruction10t extends ImmutableInstruction implements Ins
|
|||||||
public ImmutableInstruction10t(@Nonnull Opcode opcode,
|
public ImmutableInstruction10t(@Nonnull Opcode opcode,
|
||||||
int codeOffset) {
|
int codeOffset) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.codeOffset = Preconditions.checkByteCodeOffset(codeOffset);
|
this.codeOffset = Preconditions.checkByteCodeOffset(codeOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,6 @@ package org.jf.dexlib2.immutable.instruction;
|
|||||||
import org.jf.dexlib2.Format;
|
import org.jf.dexlib2.Format;
|
||||||
import org.jf.dexlib2.Opcode;
|
import org.jf.dexlib2.Opcode;
|
||||||
import org.jf.dexlib2.iface.instruction.formats.Instruction10x;
|
import org.jf.dexlib2.iface.instruction.formats.Instruction10x;
|
||||||
import org.jf.dexlib2.util.Preconditions;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@ -43,7 +42,6 @@ public class ImmutableInstruction10x extends ImmutableInstruction implements Ins
|
|||||||
|
|
||||||
public ImmutableInstruction10x(@Nonnull Opcode opcode) {
|
public ImmutableInstruction10x(@Nonnull Opcode opcode) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ImmutableInstruction10x of(Instruction10x instruction) {
|
public static ImmutableInstruction10x of(Instruction10x instruction) {
|
||||||
|
@ -48,7 +48,6 @@ public class ImmutableInstruction11n extends ImmutableInstruction implements Ins
|
|||||||
int registerA,
|
int registerA,
|
||||||
int literal) {
|
int literal) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkNibbleRegister(registerA);
|
this.registerA = Preconditions.checkNibbleRegister(registerA);
|
||||||
this.literal = Preconditions.checkNibbleLiteral(literal);
|
this.literal = Preconditions.checkNibbleLiteral(literal);
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,6 @@ public class ImmutableInstruction11x extends ImmutableInstruction implements Ins
|
|||||||
public ImmutableInstruction11x(@Nonnull Opcode opcode,
|
public ImmutableInstruction11x(@Nonnull Opcode opcode,
|
||||||
int registerA) {
|
int registerA) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkByteRegister(registerA);
|
this.registerA = Preconditions.checkByteRegister(registerA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,6 @@ public class ImmutableInstruction12x extends ImmutableInstruction implements Ins
|
|||||||
int registerA,
|
int registerA,
|
||||||
int registerB) {
|
int registerB) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkNibbleRegister(registerA);
|
this.registerA = Preconditions.checkNibbleRegister(registerA);
|
||||||
this.registerB = Preconditions.checkNibbleRegister(registerB);
|
this.registerB = Preconditions.checkNibbleRegister(registerB);
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,6 @@ public class ImmutableInstruction20bc extends ImmutableInstruction implements In
|
|||||||
int verificationError,
|
int verificationError,
|
||||||
@Nonnull Reference reference) {
|
@Nonnull Reference reference) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.verificationError = Preconditions.checkVerificationError(verificationError);
|
this.verificationError = Preconditions.checkVerificationError(verificationError);
|
||||||
this.reference = ImmutableReferenceFactory.of(opcode.referenceType, reference);
|
this.reference = ImmutableReferenceFactory.of(opcode.referenceType, reference);
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,6 @@ public class ImmutableInstruction20t extends ImmutableInstruction implements Ins
|
|||||||
public ImmutableInstruction20t(@Nonnull Opcode opcode,
|
public ImmutableInstruction20t(@Nonnull Opcode opcode,
|
||||||
int codeOffset) {
|
int codeOffset) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.codeOffset = Preconditions.checkShortCodeOffset(codeOffset);
|
this.codeOffset = Preconditions.checkShortCodeOffset(codeOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@ public class ImmutableInstruction21c extends ImmutableInstruction implements Ins
|
|||||||
int registerA,
|
int registerA,
|
||||||
@Nonnull Reference reference) {
|
@Nonnull Reference reference) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkByteRegister(registerA);
|
this.registerA = Preconditions.checkByteRegister(registerA);
|
||||||
this.reference = ImmutableReferenceFactory.of(opcode.referenceType, reference);
|
this.reference = ImmutableReferenceFactory.of(opcode.referenceType, reference);
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,6 @@ public class ImmutableInstruction21ih extends ImmutableInstruction implements In
|
|||||||
int registerA,
|
int registerA,
|
||||||
int literal) {
|
int literal) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkByteRegister(registerA);
|
this.registerA = Preconditions.checkByteRegister(registerA);
|
||||||
this.literal = Preconditions.checkIntegerHatLiteral(literal);
|
this.literal = Preconditions.checkIntegerHatLiteral(literal);
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,6 @@ public class ImmutableInstruction21lh extends ImmutableInstruction implements In
|
|||||||
int registerA,
|
int registerA,
|
||||||
long literal) {
|
long literal) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkByteRegister(registerA);
|
this.registerA = Preconditions.checkByteRegister(registerA);
|
||||||
this.literal = Preconditions.checkLongHatLiteral(literal);
|
this.literal = Preconditions.checkLongHatLiteral(literal);
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,6 @@ public class ImmutableInstruction21s extends ImmutableInstruction implements Ins
|
|||||||
int registerA,
|
int registerA,
|
||||||
int literal) {
|
int literal) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkByteRegister(registerA);
|
this.registerA = Preconditions.checkByteRegister(registerA);
|
||||||
this.literal = Preconditions.checkShortLiteral(literal);
|
this.literal = Preconditions.checkShortLiteral(literal);
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,6 @@ public class ImmutableInstruction21t extends ImmutableInstruction implements Ins
|
|||||||
int registerA,
|
int registerA,
|
||||||
int codeOffset) {
|
int codeOffset) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkByteRegister(registerA);
|
this.registerA = Preconditions.checkByteRegister(registerA);
|
||||||
this.codeOffset = Preconditions.checkShortCodeOffset(codeOffset);
|
this.codeOffset = Preconditions.checkShortCodeOffset(codeOffset);
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,6 @@ public class ImmutableInstruction22b extends ImmutableInstruction implements Ins
|
|||||||
int registerB,
|
int registerB,
|
||||||
int literal) {
|
int literal) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkByteRegister(registerA);
|
this.registerA = Preconditions.checkByteRegister(registerA);
|
||||||
this.registerB = Preconditions.checkByteRegister(registerB);
|
this.registerB = Preconditions.checkByteRegister(registerB);
|
||||||
this.literal = Preconditions.checkByteLiteral(literal);
|
this.literal = Preconditions.checkByteLiteral(literal);
|
||||||
|
@ -53,7 +53,6 @@ public class ImmutableInstruction22c extends ImmutableInstruction implements Ins
|
|||||||
int registerB,
|
int registerB,
|
||||||
@Nonnull Reference reference) {
|
@Nonnull Reference reference) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkNibbleRegister(registerA);
|
this.registerA = Preconditions.checkNibbleRegister(registerA);
|
||||||
this.registerB = Preconditions.checkNibbleRegister(registerB);
|
this.registerB = Preconditions.checkNibbleRegister(registerB);
|
||||||
this.reference = ImmutableReferenceFactory.of(opcode.referenceType, reference);
|
this.reference = ImmutableReferenceFactory.of(opcode.referenceType, reference);
|
||||||
|
@ -50,7 +50,6 @@ public class ImmutableInstruction22cs extends ImmutableInstruction implements In
|
|||||||
int registerB,
|
int registerB,
|
||||||
int fieldOffset) {
|
int fieldOffset) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkNibbleRegister(registerA);
|
this.registerA = Preconditions.checkNibbleRegister(registerA);
|
||||||
this.registerB = Preconditions.checkNibbleRegister(registerB);
|
this.registerB = Preconditions.checkNibbleRegister(registerB);
|
||||||
this.fieldOffset = Preconditions.checkFieldOffset(fieldOffset);
|
this.fieldOffset = Preconditions.checkFieldOffset(fieldOffset);
|
||||||
|
@ -50,7 +50,6 @@ public class ImmutableInstruction22s extends ImmutableInstruction implements Ins
|
|||||||
int registerB,
|
int registerB,
|
||||||
int literal) {
|
int literal) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkNibbleRegister(registerA);
|
this.registerA = Preconditions.checkNibbleRegister(registerA);
|
||||||
this.registerB = Preconditions.checkNibbleRegister(registerB);
|
this.registerB = Preconditions.checkNibbleRegister(registerB);
|
||||||
this.literal = Preconditions.checkShortLiteral(literal);
|
this.literal = Preconditions.checkShortLiteral(literal);
|
||||||
|
@ -50,7 +50,6 @@ public class ImmutableInstruction22t extends ImmutableInstruction implements Ins
|
|||||||
int registerB,
|
int registerB,
|
||||||
int codeOffset) {
|
int codeOffset) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkNibbleRegister(registerA);
|
this.registerA = Preconditions.checkNibbleRegister(registerA);
|
||||||
this.registerB = Preconditions.checkNibbleRegister(registerB);
|
this.registerB = Preconditions.checkNibbleRegister(registerB);
|
||||||
this.codeOffset = Preconditions.checkShortCodeOffset(codeOffset);
|
this.codeOffset = Preconditions.checkShortCodeOffset(codeOffset);
|
||||||
|
@ -48,7 +48,6 @@ public class ImmutableInstruction22x extends ImmutableInstruction implements Ins
|
|||||||
int registerA,
|
int registerA,
|
||||||
int registerB) {
|
int registerB) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkByteRegister(registerA);
|
this.registerA = Preconditions.checkByteRegister(registerA);
|
||||||
this.registerB = Preconditions.checkShortRegister(registerB);
|
this.registerB = Preconditions.checkShortRegister(registerB);
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,6 @@ public class ImmutableInstruction23x extends ImmutableInstruction implements Ins
|
|||||||
int registerB,
|
int registerB,
|
||||||
int registerC) {
|
int registerC) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkByteRegister(registerA);
|
this.registerA = Preconditions.checkByteRegister(registerA);
|
||||||
this.registerB = Preconditions.checkByteRegister(registerB);
|
this.registerB = Preconditions.checkByteRegister(registerB);
|
||||||
this.registerC = Preconditions.checkByteRegister(registerC);
|
this.registerC = Preconditions.checkByteRegister(registerC);
|
||||||
|
@ -34,7 +34,6 @@ package org.jf.dexlib2.immutable.instruction;
|
|||||||
import org.jf.dexlib2.Format;
|
import org.jf.dexlib2.Format;
|
||||||
import org.jf.dexlib2.Opcode;
|
import org.jf.dexlib2.Opcode;
|
||||||
import org.jf.dexlib2.iface.instruction.formats.Instruction30t;
|
import org.jf.dexlib2.iface.instruction.formats.Instruction30t;
|
||||||
import org.jf.dexlib2.util.Preconditions;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@ -46,7 +45,6 @@ public class ImmutableInstruction30t extends ImmutableInstruction implements Ins
|
|||||||
public ImmutableInstruction30t(@Nonnull Opcode opcode,
|
public ImmutableInstruction30t(@Nonnull Opcode opcode,
|
||||||
int codeOffset) {
|
int codeOffset) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.codeOffset = codeOffset;
|
this.codeOffset = codeOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@ public class ImmutableInstruction31c extends ImmutableInstruction implements Ins
|
|||||||
int registerA,
|
int registerA,
|
||||||
@Nonnull Reference reference) {
|
@Nonnull Reference reference) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkByteRegister(registerA);
|
this.registerA = Preconditions.checkByteRegister(registerA);
|
||||||
this.reference = ImmutableReferenceFactory.of(opcode.referenceType, reference);
|
this.reference = ImmutableReferenceFactory.of(opcode.referenceType, reference);
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,6 @@ public class ImmutableInstruction31i extends ImmutableInstruction implements Ins
|
|||||||
int registerA,
|
int registerA,
|
||||||
int literal) {
|
int literal) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkByteRegister(registerA);
|
this.registerA = Preconditions.checkByteRegister(registerA);
|
||||||
this.literal = literal;
|
this.literal = literal;
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,6 @@ public class ImmutableInstruction31t extends ImmutableInstruction implements Ins
|
|||||||
int registerA,
|
int registerA,
|
||||||
int codeOffset) {
|
int codeOffset) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkByteRegister(registerA);
|
this.registerA = Preconditions.checkByteRegister(registerA);
|
||||||
this.codeOffset = codeOffset;
|
this.codeOffset = codeOffset;
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,6 @@ public class ImmutableInstruction32x extends ImmutableInstruction implements Ins
|
|||||||
int registerA,
|
int registerA,
|
||||||
int registerB) {
|
int registerB) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkShortRegister(registerA);
|
this.registerA = Preconditions.checkShortRegister(registerA);
|
||||||
this.registerB = Preconditions.checkShortRegister(registerB);
|
this.registerB = Preconditions.checkShortRegister(registerB);
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,6 @@ public class ImmutableInstruction35c extends ImmutableInstruction implements Ins
|
|||||||
int registerG,
|
int registerG,
|
||||||
@Nonnull Reference reference) {
|
@Nonnull Reference reference) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerCount = Preconditions.check35cRegisterCount(registerCount);
|
this.registerCount = Preconditions.check35cRegisterCount(registerCount);
|
||||||
this.registerC = (registerCount>0) ? Preconditions.checkNibbleRegister(registerC) : 0;
|
this.registerC = (registerCount>0) ? Preconditions.checkNibbleRegister(registerC) : 0;
|
||||||
this.registerD = (registerCount>1) ? Preconditions.checkNibbleRegister(registerD) : 0;
|
this.registerD = (registerCount>1) ? Preconditions.checkNibbleRegister(registerD) : 0;
|
||||||
|
@ -58,7 +58,6 @@ public class ImmutableInstruction35mi extends ImmutableInstruction implements In
|
|||||||
int registerG,
|
int registerG,
|
||||||
int inlineIndex) {
|
int inlineIndex) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerCount = Preconditions.check35cRegisterCount(registerCount);
|
this.registerCount = Preconditions.check35cRegisterCount(registerCount);
|
||||||
this.registerC = (registerCount>0) ? Preconditions.checkNibbleRegister(registerC) : 0;
|
this.registerC = (registerCount>0) ? Preconditions.checkNibbleRegister(registerC) : 0;
|
||||||
this.registerD = (registerCount>1) ? Preconditions.checkNibbleRegister(registerD) : 0;
|
this.registerD = (registerCount>1) ? Preconditions.checkNibbleRegister(registerD) : 0;
|
||||||
|
@ -58,7 +58,6 @@ public class ImmutableInstruction35ms extends ImmutableInstruction implements In
|
|||||||
int registerG,
|
int registerG,
|
||||||
int vtableIndex) {
|
int vtableIndex) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerCount = Preconditions.check35cRegisterCount(registerCount);
|
this.registerCount = Preconditions.check35cRegisterCount(registerCount);
|
||||||
this.registerC = (registerCount>0) ? Preconditions.checkNibbleRegister(registerC) : 0;
|
this.registerC = (registerCount>0) ? Preconditions.checkNibbleRegister(registerC) : 0;
|
||||||
this.registerD = (registerCount>1) ? Preconditions.checkNibbleRegister(registerD) : 0;
|
this.registerD = (registerCount>1) ? Preconditions.checkNibbleRegister(registerD) : 0;
|
||||||
|
@ -54,7 +54,6 @@ public class ImmutableInstruction3rc extends ImmutableInstruction implements Ins
|
|||||||
int registerCount,
|
int registerCount,
|
||||||
@Nonnull Reference reference) {
|
@Nonnull Reference reference) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.startRegister = Preconditions.checkShortRegister(startRegister);
|
this.startRegister = Preconditions.checkShortRegister(startRegister);
|
||||||
this.registerCount = Preconditions.checkRegisterRangeCount(registerCount);
|
this.registerCount = Preconditions.checkRegisterRangeCount(registerCount);
|
||||||
this.reference = ImmutableReferenceFactory.of(opcode.referenceType, reference);
|
this.reference = ImmutableReferenceFactory.of(opcode.referenceType, reference);
|
||||||
|
@ -51,7 +51,6 @@ public class ImmutableInstruction3rmi extends ImmutableInstruction implements In
|
|||||||
int registerCount,
|
int registerCount,
|
||||||
int inlineIndex) {
|
int inlineIndex) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.startRegister = Preconditions.checkShortRegister(startRegister);
|
this.startRegister = Preconditions.checkShortRegister(startRegister);
|
||||||
this.registerCount = Preconditions.checkRegisterRangeCount(registerCount);
|
this.registerCount = Preconditions.checkRegisterRangeCount(registerCount);
|
||||||
this.inlineIndex = Preconditions.checkInlineIndex(inlineIndex);
|
this.inlineIndex = Preconditions.checkInlineIndex(inlineIndex);
|
||||||
|
@ -51,7 +51,6 @@ public class ImmutableInstruction3rms extends ImmutableInstruction implements In
|
|||||||
int registerCount,
|
int registerCount,
|
||||||
int vtableIndex) {
|
int vtableIndex) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.startRegister = Preconditions.checkShortRegister(startRegister);
|
this.startRegister = Preconditions.checkShortRegister(startRegister);
|
||||||
this.registerCount = Preconditions.checkRegisterRangeCount(registerCount);
|
this.registerCount = Preconditions.checkRegisterRangeCount(registerCount);
|
||||||
this.vtableIndex = Preconditions.checkVtableIndex(vtableIndex);
|
this.vtableIndex = Preconditions.checkVtableIndex(vtableIndex);
|
||||||
|
@ -48,7 +48,6 @@ public class ImmutableInstruction51l extends ImmutableInstruction implements Ins
|
|||||||
int registerA,
|
int registerA,
|
||||||
long literal) {
|
long literal) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkByteRegister(registerA);
|
this.registerA = Preconditions.checkByteRegister(registerA);
|
||||||
this.literal = literal;
|
this.literal = literal;
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,7 @@ public interface BuilderInstruction extends Instruction {
|
|||||||
@Nonnull protected final Opcode opcode;
|
@Nonnull protected final Opcode opcode;
|
||||||
|
|
||||||
public BaseBuilderInstruction(@Nonnull Opcode opcode) {
|
public BaseBuilderInstruction(@Nonnull Opcode opcode) {
|
||||||
|
Preconditions.checkFormat(opcode, getFormat());
|
||||||
this.opcode = opcode;
|
this.opcode = opcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +104,6 @@ public interface BuilderInstruction extends Instruction {
|
|||||||
int verificationError,
|
int verificationError,
|
||||||
@Nonnull BuilderReference reference) {
|
@Nonnull BuilderReference reference) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.verificationError = Preconditions.checkVerificationError(verificationError);
|
this.verificationError = Preconditions.checkVerificationError(verificationError);
|
||||||
this.reference = Preconditions.checkReference(opcode.referenceType, reference);
|
this.reference = Preconditions.checkReference(opcode.referenceType, reference);
|
||||||
}
|
}
|
||||||
@ -130,7 +130,6 @@ public interface BuilderInstruction extends Instruction {
|
|||||||
int registerA,
|
int registerA,
|
||||||
@Nonnull BuilderReference reference) {
|
@Nonnull BuilderReference reference) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkByteRegister(registerA);
|
this.registerA = Preconditions.checkByteRegister(registerA);
|
||||||
this.reference = Preconditions.checkReference(opcode.referenceType, reference);
|
this.reference = Preconditions.checkReference(opcode.referenceType, reference);
|
||||||
}
|
}
|
||||||
@ -183,7 +182,6 @@ public interface BuilderInstruction extends Instruction {
|
|||||||
int registerB,
|
int registerB,
|
||||||
@Nonnull BuilderReference reference) {
|
@Nonnull BuilderReference reference) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkNibbleRegister(registerA);
|
this.registerA = Preconditions.checkNibbleRegister(registerA);
|
||||||
this.registerB = Preconditions.checkNibbleRegister(registerB);
|
this.registerB = Preconditions.checkNibbleRegister(registerB);
|
||||||
this.reference = Preconditions.checkReference(opcode.referenceType, reference);
|
this.reference = Preconditions.checkReference(opcode.referenceType, reference);
|
||||||
@ -236,7 +234,6 @@ public interface BuilderInstruction extends Instruction {
|
|||||||
int registerA,
|
int registerA,
|
||||||
@Nonnull BuilderReference reference) {
|
@Nonnull BuilderReference reference) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerA = Preconditions.checkByteRegister(registerA);
|
this.registerA = Preconditions.checkByteRegister(registerA);
|
||||||
this.reference = Preconditions.checkReference(opcode.referenceType, reference);
|
this.reference = Preconditions.checkReference(opcode.referenceType, reference);
|
||||||
}
|
}
|
||||||
@ -285,7 +282,6 @@ public interface BuilderInstruction extends Instruction {
|
|||||||
int registerG,
|
int registerG,
|
||||||
@Nonnull BuilderReference reference) {
|
@Nonnull BuilderReference reference) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.registerCount = Preconditions.check35cRegisterCount(registerCount);
|
this.registerCount = Preconditions.check35cRegisterCount(registerCount);
|
||||||
this.registerC = (registerCount>0) ? Preconditions.checkNibbleRegister(registerC) : 0;
|
this.registerC = (registerCount>0) ? Preconditions.checkNibbleRegister(registerC) : 0;
|
||||||
this.registerD = (registerCount>1) ? Preconditions.checkNibbleRegister(registerD) : 0;
|
this.registerD = (registerCount>1) ? Preconditions.checkNibbleRegister(registerD) : 0;
|
||||||
@ -319,8 +315,6 @@ public interface BuilderInstruction extends Instruction {
|
|||||||
int registerCount,
|
int registerCount,
|
||||||
@Nonnull BuilderReference reference) {
|
@Nonnull BuilderReference reference) {
|
||||||
super(opcode);
|
super(opcode);
|
||||||
|
|
||||||
Preconditions.checkFormat(opcode, FORMAT);
|
|
||||||
this.startRegister = Preconditions.checkShortRegister(startRegister);
|
this.startRegister = Preconditions.checkShortRegister(startRegister);
|
||||||
this.registerCount = Preconditions.checkRegisterRangeCount(registerCount);
|
this.registerCount = Preconditions.checkRegisterRangeCount(registerCount);
|
||||||
this.reference = Preconditions.checkReference(opcode.referenceType, reference);
|
this.reference = Preconditions.checkReference(opcode.referenceType, reference);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user