public CompactCodeAttributeComposer tableswitch(int defaultOffset, int lowCase, int highCase, int[] jumpOffsets) { return add(new TableSwitchInstruction(InstructionConstants.OP_TABLESWITCH, defaultOffset, lowCase, highCase, jumpOffsets)); }
protected void readInfo(byte[] code, int offset) { // Skip up to three padding bytes. offset += -offset & 3; // Read the three 32-bit arguments. defaultOffset = readInt(code, offset); offset += 4; lowCase = readInt(code, offset); offset += 4; highCase = readInt(code, offset); offset += 4; // Read the jump offsets. jumpOffsets = new int[highCase - lowCase + 1]; for (int index = 0; index < jumpOffsets.length; index++) { jumpOffsets[index] = readInt(code, offset); offset += 4; } }
protected void writeInfo(byte[] code, int offset) { // Write up to three padding bytes. while ((offset & 3) != 0) { writeByte(code, offset++, 0); } // Write the three 32-bit arguments. writeInt(code, offset, defaultOffset); offset += 4; writeInt(code, offset, lowCase); offset += 4; writeInt(code, offset, highCase); offset += 4; // Write the jump offsets. int length = highCase - lowCase + 1; for (int index = 0; index < length; index++) { writeInt(code, offset, jumpOffsets[index]); offset += 4; } }
public void visitTableSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, TableSwitchInstruction tableSwitchInstruction) { println(tableSwitchInstruction.toString(offset)); indent(); int[] jumpOffsets = tableSwitchInstruction.jumpOffsets; for (int index = 0; index < jumpOffsets.length; index++) { int jumpOffset = jumpOffsets[index]; println(Integer.toString(tableSwitchInstruction.lowCase + index) + ": offset = " + jumpOffset + ", target = " + (offset + jumpOffset)); } int defaultOffset = tableSwitchInstruction.defaultOffset; println("default: offset = " + defaultOffset + ", target = "+ (offset + defaultOffset)); outdent(); }
public void visitTableSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, TableSwitchInstruction tableSwitchInstruction) { // Update the default jump offset, relative to the precise new offset. tableSwitchInstruction.defaultOffset = newBranchOffset(offset, tableSwitchInstruction.defaultOffset, newOffset); // Update the jump offsets, relative to the precise new offset. newJumpOffsets(offset, tableSwitchInstruction.jumpOffsets, newOffset); // Write out the instruction. instructionWriter.visitTableSwitchInstruction(clazz, method, codeAttribute, newOffset, tableSwitchInstruction); newOffset += tableSwitchInstruction.length(newOffset); }
public void visitTableSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, TableSwitchInstruction tableSwitchInstruction) { println(tableSwitchInstruction.toString(offset)); indent(); int[] jumpOffsets = tableSwitchInstruction.jumpOffsets; for (int index = 0; index < jumpOffsets.length; index++) { int jumpOffset = jumpOffsets[index]; println(Integer.toString(tableSwitchInstruction.lowCase + index) + ": offset = " + jumpOffset + ", target = " + (offset + jumpOffset)); } int defaultOffset = tableSwitchInstruction.defaultOffset; println("default: offset = " + defaultOffset + ", target = "+ (offset + defaultOffset)); outdent(); }
public void visitTableSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, TableSwitchInstruction tableSwitchInstruction) { // Update the default jump offset, relative to the precise new offset. tableSwitchInstruction.defaultOffset = newBranchOffset(offset, tableSwitchInstruction.defaultOffset, newOffset); // Update the jump offsets, relative to the precise new offset. newJumpOffsets(offset, tableSwitchInstruction.jumpOffsets, newOffset); // Write out the instruction. instructionWriter.visitTableSwitchInstruction(clazz, method, codeAttribute, newOffset, tableSwitchInstruction); newOffset += tableSwitchInstruction.length(newOffset); }
public InstructionSequenceBuilder tableswitch(int defaultOffset, int lowCase, int highCase, int[] jumpOffsets) { return add(new TableSwitchInstruction(InstructionConstants.OP_TABLESWITCH, defaultOffset, lowCase, highCase, jumpOffsets)); }
protected void writeInfo(byte[] code, int offset) { // Write up to three padding bytes. while ((offset & 3) != 0) { writeByte(code, offset++, 0); } // Write the three 32-bit arguments. writeInt(code, offset, defaultOffset); offset += 4; writeInt(code, offset, lowCase); offset += 4; writeInt(code, offset, highCase); offset += 4; // Write the jump offsets. int length = highCase - lowCase + 1; for (int index = 0; index < length; index++) { writeInt(code, offset, jumpOffsets[index]); offset += 4; } }
protected void readInfo(byte[] code, int offset) { // Skip up to three padding bytes. offset += -offset & 3; // Read the three 32-bit arguments. defaultOffset = readInt(code, offset); offset += 4; lowCase = readInt(code, offset); offset += 4; highCase = readInt(code, offset); offset += 4; // Read the jump offsets. jumpOffsets = new int[highCase - lowCase + 1]; for (int index = 0; index < jumpOffsets.length; index++) { jumpOffsets[index] = readInt(code, offset); offset += 4; } }
public void visitTableSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, TableSwitchInstruction tableSwitchInstruction) { println(tableSwitchInstruction.toString(offset)); indent(); int[] jumpOffsets = tableSwitchInstruction.jumpOffsets; for (int index = 0; index < jumpOffsets.length; index++) { int jumpOffset = jumpOffsets[index]; println(Integer.toString(tableSwitchInstruction.lowCase + index) + ": offset = " + jumpOffset + ", target = " + (offset + jumpOffset)); } int defaultOffset = tableSwitchInstruction.defaultOffset; println("default: offset = " + defaultOffset + ", target = "+ (offset + defaultOffset)); outdent(); }
public void visitTableSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, TableSwitchInstruction tableSwitchInstruction) { // Adjust the default jump offset. tableSwitchInstruction.defaultOffset = remapBranchOffset(offset, tableSwitchInstruction.defaultOffset); // Adjust the jump offsets. remapJumpOffsets(offset, tableSwitchInstruction.jumpOffsets); // Write out the instruction. instructionWriter.visitTableSwitchInstruction(clazz, method, codeAttribute, newOffset, tableSwitchInstruction); newOffset += tableSwitchInstruction.length(newOffset); }
public CompactCodeAttributeComposer tableswitch(int defaultOffset, int lowCase, int highCase, int[] jumpOffsets) { return add(new TableSwitchInstruction(InstructionConstants.OP_TABLESWITCH, defaultOffset, lowCase, highCase, jumpOffsets)); }
protected void writeInfo(byte[] code, int offset) { // Write up to three padding bytes. while ((offset & 3) != 0) { writeByte(code, offset++, 0); } // Write the three 32-bit arguments. writeInt(code, offset, defaultOffset); offset += 4; writeInt(code, offset, lowCase); offset += 4; writeInt(code, offset, highCase); offset += 4; // Write the jump offsets. int length = highCase - lowCase + 1; for (int index = 0; index < length; index++) { writeInt(code, offset, jumpOffsets[index]); offset += 4; } }
protected void readInfo(byte[] code, int offset) { // Skip up to three padding bytes. offset += -offset & 3; // Read the three 32-bit arguments. defaultOffset = readInt(code, offset); offset += 4; lowCase = readInt(code, offset); offset += 4; highCase = readInt(code, offset); offset += 4; // Read the jump offsets. jumpOffsets = new int[highCase - lowCase + 1]; for (int index = 0; index < jumpOffsets.length; index++) { jumpOffsets[index] = readInt(code, offset); offset += 4; } }
public void visitTableSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, TableSwitchInstruction tableSwitchInstruction) { println(tableSwitchInstruction.toString(offset)); indent(); int[] jumpOffsets = tableSwitchInstruction.jumpOffsets; for (int index = 0; index < jumpOffsets.length; index++) { int jumpOffset = jumpOffsets[index]; println(Integer.toString(tableSwitchInstruction.lowCase + index) + ": offset = " + jumpOffset + ", target = " + (offset + jumpOffset)); } int defaultOffset = tableSwitchInstruction.defaultOffset; println("default: offset = " + defaultOffset + ", target = "+ (offset + defaultOffset)); outdent(); }
public void visitTableSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, TableSwitchInstruction tableSwitchInstruction) { // Update the default jump offset, relative to the precise new offset. tableSwitchInstruction.defaultOffset = newBranchOffset(offset, tableSwitchInstruction.defaultOffset, newOffset); // Update the jump offsets, relative to the precise new offset. newJumpOffsets(offset, tableSwitchInstruction.jumpOffsets, newOffset); // Write out the instruction. instructionWriter.visitTableSwitchInstruction(clazz, method, codeAttribute, newOffset, tableSwitchInstruction); newOffset += tableSwitchInstruction.length(newOffset); }
public InstructionSequenceBuilder tableswitch(int defaultOffset, int lowCase, int highCase, int[] jumpOffsets) { return add(new TableSwitchInstruction(InstructionConstants.OP_TABLESWITCH, defaultOffset, lowCase, highCase, jumpOffsets)); }
protected void writeInfo(byte[] code, int offset) { // Write up to three padding bytes. while ((offset & 3) != 0) { writeByte(code, offset++, 0); } // Write the three 32-bit arguments. writeInt(code, offset, defaultOffset); offset += 4; writeInt(code, offset, lowCase); offset += 4; writeInt(code, offset, highCase); offset += 4; // Write the jump offsets. int length = highCase - lowCase + 1; for (int index = 0; index < length; index++) { writeInt(code, offset, jumpOffsets[index]); offset += 4; } }
protected void readInfo(byte[] code, int offset) { // Skip up to three padding bytes. offset += -offset & 3; // Read the three 32-bit arguments. defaultOffset = readInt(code, offset); offset += 4; lowCase = readInt(code, offset); offset += 4; highCase = readInt(code, offset); offset += 4; // Read the jump offsets. jumpOffsets = new int[highCase - lowCase + 1]; for (int index = 0; index < jumpOffsets.length; index++) { jumpOffsets[index] = readInt(code, offset); offset += 4; } }