protected void writeInfo(byte[] code, int offset) { int constantSize = constantSize(); if (requiredConstantSize() > constantSize) { throw new IllegalArgumentException("Instruction has invalid constant size ("+this.toString(offset)+")"); } writeSignedValue(code, offset, constant, constantSize); }
protected void readInfo(byte[] code, int offset) { int constantSize = constantSize(); // Also initialize embedded constants that are different from 0. constant = constantSize == 0 ? embeddedConstant(opcode) : readSignedValue(code, offset, constantSize); }
public String toString() { return getName() + (constantSize() > 0 ? " "+constant : ""); }
public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction) { replacementInstruction = new SimpleInstruction(simpleInstruction.opcode, instructionSequenceMatcher.matchedArgument(simpleInstruction.constant)); }
throw new UnsupportedOperationException("Can't handle "+simpleInstruction.toString()+" instruction at ["+offset +"]"); Instruction replacementInstruction = new SimpleInstruction(newOpcode); codeAttributeEditor.replaceInstruction(offset, replacementInstruction); while (newOpcodes != 0) SimpleInstruction replacementInstruction = new SimpleInstruction((byte)newOpcodes); replacementInstructions[count++] = replacementInstruction;
public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction) { // Write out the instruction. instructionWriter.visitSimpleInstruction(clazz, method, codeAttribute, newOffset, simpleInstruction); newOffset += simpleInstruction.length(newOffset); }
public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction) { // Try to write out the instruction. // Simple instructions should always fit. simpleInstruction.write(codeAttribute, offset); }
/** * Creates a new SimpleInstruction with the given opcode. */ public SimpleInstruction(byte opcode) { this(opcode, embeddedConstant(opcode)); }
case InstructionConstants.OP_BIPUSH: case InstructionConstants.OP_SIPUSH: switch (requiredConstantSize())
public int length(int offset) { return 1 + constantSize(); }
public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction) { replacementInstruction = new SimpleInstruction(simpleInstruction.opcode, matchedArgument(clazz, method, codeAttribute, offset, simpleInstruction.constant)); }
throw new UnsupportedOperationException("Can't handle "+simpleInstruction.toString()+" instruction at ["+offset +"]"); Instruction replacementInstruction = new SimpleInstruction(newOpcode); codeAttributeEditor.replaceInstruction(offset, replacementInstruction); while (newOpcodes != 0) SimpleInstruction replacementInstruction = new SimpleInstruction((byte)newOpcodes); replacementInstructions[count++] = replacementInstruction;
public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction) { // Write out the instruction. instructionWriter.visitSimpleInstruction(clazz, method, codeAttribute, newOffset, simpleInstruction); newOffset += simpleInstruction.length(newOffset); }
public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction) { // Try to write out the instruction. // Simple instructions should always fit. simpleInstruction.write(codeAttribute, offset); }
/** * Creates a new SimpleInstruction with the given opcode. */ public SimpleInstruction(byte opcode) { this(opcode, embeddedConstant(opcode)); }
case InstructionConstants.OP_BIPUSH: case InstructionConstants.OP_SIPUSH: switch (requiredConstantSize())
public int length(int offset) { return 1 + constantSize(); }
protected void writeInfo(byte[] code, int offset) { int constantSize = constantSize(); if (requiredConstantSize() > constantSize) { throw new IllegalArgumentException("Instruction has invalid constant size ("+this.toString(offset)+")"); } writeSignedValue(code, offset, constant, constantSize); }
public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction) { replacementInstruction = new SimpleInstruction(simpleInstruction.opcode, matchedArgument(clazz, method, codeAttribute, offset, simpleInstruction.constant)); }
protected void readInfo(byte[] code, int offset) { int constantSize = constantSize(); // Also initialize embedded constants that are different from 0. constant = constantSize == 0 ? embeddedConstant(opcode) : readSignedValue(code, offset, constantSize); }