public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction) { try { // Try to write out the instruction. constantInstruction.write(codeAttribute, offset); } catch (IllegalArgumentException exception) { // Create a new constant instruction that will fit. Instruction replacementInstruction = new ConstantInstruction(constantInstruction.opcode, constantInstruction.constantIndex, constantInstruction.constant); if (DEBUG) { System.out.println(" "+constantInstruction.toString(offset)+" will be widened to "+replacementInstruction.toString()); } replaceInstruction(offset, replacementInstruction); // Write out a dummy constant instruction for now. constantInstruction.constantIndex = 0; constantInstruction.constant = 0; constantInstruction.write(codeAttribute, offset); } }
public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction) { try { // Try to write out the instruction. constantInstruction.write(codeAttribute, offset); } catch (IllegalArgumentException exception) { // Create a new constant instruction that will fit. Instruction replacementInstruction = new ConstantInstruction(constantInstruction.opcode, constantInstruction.constantIndex, constantInstruction.constant); if (DEBUG) { System.out.println(" "+constantInstruction.toString(offset)+" will be widened to "+replacementInstruction.toString()); } replaceInstruction(offset, replacementInstruction); // Write out a dummy constant instruction for now. constantInstruction.constantIndex = 0; constantInstruction.constant = 0; constantInstruction.write(codeAttribute, offset); } }
public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction) { try { // Try to write out the instruction. constantInstruction.write(codeAttribute, offset); } catch (IllegalArgumentException exception) { // Create a new constant instruction that will fit. Instruction replacementInstruction = new ConstantInstruction(constantInstruction.opcode, constantInstruction.constantIndex, constantInstruction.constant); if (DEBUG) { System.out.println(" "+constantInstruction.toString(offset)+" will be widened to "+replacementInstruction.toString()); } replaceInstruction(offset, replacementInstruction); // Write out a dummy constant instruction for now. constantInstruction.constantIndex = 0; constantInstruction.constant = 0; constantInstruction.write(codeAttribute, offset); } }
public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction) { try { // Try to write out the instruction. constantInstruction.write(codeAttribute, offset); } catch (IllegalArgumentException exception) { // Create a new constant instruction that will fit. Instruction replacementInstruction = new ConstantInstruction(constantInstruction.opcode, constantInstruction.constantIndex, constantInstruction.constant).shrink(); replaceInstruction(offset, replacementInstruction); // Write out a dummy constant instruction for now. constantInstruction.constantIndex = 0; constantInstruction.constant = 0; constantInstruction.write(codeAttribute, offset); } }