public InstructionSequenceBuilder lookupswitch(int defaultOffset, int[] cases, int[] jumpOffsets) { return add(new LookUpSwitchInstruction(InstructionConstants.OP_LOOKUPSWITCH, defaultOffset, cases, jumpOffsets)); }
protected void readInfo(byte[] code, int offset) { // Skip up to three padding bytes. offset += -offset & 3; // Read the two 32-bit arguments. defaultOffset = readInt(code, offset); offset += 4; int jumpOffsetCount = readInt(code, offset); offset += 4; // Read the matches-offset pairs. cases = new int[jumpOffsetCount]; jumpOffsets = new int[jumpOffsetCount]; for (int index = 0; index < jumpOffsetCount; index++) { cases[index] = readInt(code, offset); offset += 4; 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 two 32-bit arguments. writeInt(code, offset, defaultOffset); offset += 4; writeInt(code, offset, cases.length); offset += 4; // Write the matches-offset pairs. for (int index = 0; index < cases.length; index++) { writeInt(code, offset, cases[index]); offset += 4; writeInt(code, offset, jumpOffsets[index]); offset += 4; } }
public void visitLookUpSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, LookUpSwitchInstruction lookUpSwitchInstruction) { println(lookUpSwitchInstruction.toString(offset)); indent(); int[] cases = lookUpSwitchInstruction.cases; int[] jumpOffsets = lookUpSwitchInstruction.jumpOffsets; for (int index = 0; index < jumpOffsets.length; index++) { int jumpOffset = jumpOffsets[index]; println(Integer.toString(cases[index]) + ": offset = " + jumpOffset + ", target = " + (offset + jumpOffset)); } int defaultOffset = lookUpSwitchInstruction.defaultOffset; println("default: offset = " + defaultOffset + ", target = "+ (offset + defaultOffset)); outdent(); }
public void visitLookUpSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, LookUpSwitchInstruction lookUpSwitchInstruction) { // Adjust the default jump offset. lookUpSwitchInstruction.defaultOffset = remapBranchOffset(offset, lookUpSwitchInstruction.defaultOffset); // Adjust the jump offsets. remapJumpOffsets(offset, lookUpSwitchInstruction.jumpOffsets); // Write out the instruction. instructionWriter.visitLookUpSwitchInstruction(clazz, method, codeAttribute, newOffset, lookUpSwitchInstruction); newOffset += lookUpSwitchInstruction.length(newOffset); }
public void visitLookUpSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, LookUpSwitchInstruction lookUpSwitchInstruction) { println(lookUpSwitchInstruction.toString(offset)); indent(); int[] cases = lookUpSwitchInstruction.cases; int[] jumpOffsets = lookUpSwitchInstruction.jumpOffsets; for (int index = 0; index < jumpOffsets.length; index++) { int jumpOffset = jumpOffsets[index]; println(Integer.toString(cases[index]) + ": offset = " + jumpOffset + ", target = " + (offset + jumpOffset)); } int defaultOffset = lookUpSwitchInstruction.defaultOffset; println("default: offset = " + defaultOffset + ", target = "+ (offset + defaultOffset)); outdent(); }
public void visitLookUpSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, LookUpSwitchInstruction lookUpSwitchInstruction) { // Update the default jump offset, relative to the precise new offset. lookUpSwitchInstruction.defaultOffset = newBranchOffset(offset, lookUpSwitchInstruction.defaultOffset, newOffset); // Update the jump offsets, relative to the precise new offset. newJumpOffsets(offset, lookUpSwitchInstruction.jumpOffsets, newOffset); // Write out the instruction. instructionWriter.visitLookUpSwitchInstruction(clazz, method, codeAttribute, newOffset, lookUpSwitchInstruction); newOffset += lookUpSwitchInstruction.length(newOffset); }
protected void writeInfo(byte[] code, int offset) { // Write up to three padding bytes. while ((offset & 3) != 0) { writeByte(code, offset++, 0); } // Write the two 32-bit arguments. writeInt(code, offset, defaultOffset); offset += 4; writeInt(code, offset, cases.length); offset += 4; // Write the matches-offset pairs. for (int index = 0; index < cases.length; index++) { writeInt(code, offset, cases[index]); offset += 4; writeInt(code, offset, jumpOffsets[index]); offset += 4; } }
public InstructionSequenceBuilder lookupswitch(int defaultOffset, int[] cases, int[] jumpOffsets) { return add(new LookUpSwitchInstruction(InstructionConstants.OP_LOOKUPSWITCH, defaultOffset, cases, jumpOffsets)); }
public void visitLookUpSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, LookUpSwitchInstruction lookUpSwitchInstruction) { println(lookUpSwitchInstruction.toString(offset)); indent(); int[] cases = lookUpSwitchInstruction.cases; int[] jumpOffsets = lookUpSwitchInstruction.jumpOffsets; for (int index = 0; index < jumpOffsets.length; index++) { int jumpOffset = jumpOffsets[index]; println(Integer.toString(cases[index]) + ": offset = " + jumpOffset + ", target = " + (offset + jumpOffset)); } int defaultOffset = lookUpSwitchInstruction.defaultOffset; println("default: offset = " + defaultOffset + ", target = "+ (offset + defaultOffset)); outdent(); }
protected void readInfo(byte[] code, int offset) { // Skip up to three padding bytes. offset += -offset & 3; // Read the two 32-bit arguments. defaultOffset = readInt(code, offset); offset += 4; int jumpOffsetCount = readInt(code, offset); offset += 4; // Read the matches-offset pairs. cases = new int[jumpOffsetCount]; jumpOffsets = new int[jumpOffsetCount]; for (int index = 0; index < jumpOffsetCount; index++) { cases[index] = readInt(code, offset); offset += 4; jumpOffsets[index] = readInt(code, offset); offset += 4; } }
public void visitLookUpSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, LookUpSwitchInstruction lookUpSwitchInstruction) { // Update the default jump offset, relative to the precise new offset. lookUpSwitchInstruction.defaultOffset = newBranchOffset(offset, lookUpSwitchInstruction.defaultOffset, newOffset); // Update the jump offsets, relative to the precise new offset. newJumpOffsets(offset, lookUpSwitchInstruction.jumpOffsets, newOffset); // Write out the instruction. instructionWriter.visitLookUpSwitchInstruction(clazz, method, codeAttribute, newOffset, lookUpSwitchInstruction); newOffset += lookUpSwitchInstruction.length(newOffset); }
protected void writeInfo(byte[] code, int offset) { // Write up to three padding bytes. while ((offset & 3) != 0) { writeByte(code, offset++, 0); } // Write the two 32-bit arguments. writeInt(code, offset, defaultOffset); offset += 4; writeInt(code, offset, cases.length); offset += 4; // Write the matches-offset pairs. for (int index = 0; index < cases.length; index++) { writeInt(code, offset, cases[index]); offset += 4; writeInt(code, offset, jumpOffsets[index]); offset += 4; } }
public CompactCodeAttributeComposer lookupswitch(int defaultOffset, int[] cases, int[] jumpOffsets) { return add(new LookUpSwitchInstruction(InstructionConstants.OP_LOOKUPSWITCH, defaultOffset, cases, jumpOffsets)); }
public void visitLookUpSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, LookUpSwitchInstruction lookUpSwitchInstruction) { println(lookUpSwitchInstruction.toString(offset)); indent(); int[] cases = lookUpSwitchInstruction.cases; int[] jumpOffsets = lookUpSwitchInstruction.jumpOffsets; for (int index = 0; index < jumpOffsets.length; index++) { int jumpOffset = jumpOffsets[index]; println(Integer.toString(cases[index]) + ": offset = " + jumpOffset + ", target = " + (offset + jumpOffset)); } int defaultOffset = lookUpSwitchInstruction.defaultOffset; println("default: offset = " + defaultOffset + ", target = "+ (offset + defaultOffset)); outdent(); }
protected void readInfo(byte[] code, int offset) { // Skip up to three padding bytes. offset += -offset & 3; // Read the two 32-bit arguments. defaultOffset = readInt(code, offset); offset += 4; int jumpOffsetCount = readInt(code, offset); offset += 4; // Read the matches-offset pairs. cases = new int[jumpOffsetCount]; jumpOffsets = new int[jumpOffsetCount]; for (int index = 0; index < jumpOffsetCount; index++) { cases[index] = readInt(code, offset); offset += 4; jumpOffsets[index] = readInt(code, offset); offset += 4; } }
public void visitLookUpSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, LookUpSwitchInstruction lookUpSwitchInstruction) { // Update the default jump offset, relative to the precise new offset. lookUpSwitchInstruction.defaultOffset = newBranchOffset(offset, lookUpSwitchInstruction.defaultOffset, newOffset); // Update the jump offsets, relative to the precise new offset. newJumpOffsets(offset, lookUpSwitchInstruction.jumpOffsets, newOffset); // Write out the instruction. instructionWriter.visitLookUpSwitchInstruction(clazz, method, codeAttribute, newOffset, lookUpSwitchInstruction); newOffset += lookUpSwitchInstruction.length(newOffset); }
protected void writeInfo(byte[] code, int offset) { // Write up to three padding bytes. while ((offset & 3) != 0) { writeByte(code, offset++, 0); } // Write the two 32-bit arguments. writeInt(code, offset, defaultOffset); offset += 4; writeInt(code, offset, cases.length); offset += 4; // Write the matches-offset pairs. for (int index = 0; index < cases.length; index++) { writeInt(code, offset, cases[index]); offset += 4; writeInt(code, offset, jumpOffsets[index]); offset += 4; } }
public InstructionSequenceBuilder lookupswitch(int defaultOffset, int[] cases, int[] jumpOffsets) { return add(new LookUpSwitchInstruction(InstructionConstants.OP_LOOKUPSWITCH, defaultOffset, cases, jumpOffsets)); }
protected void readInfo(byte[] code, int offset) { // Skip up to three padding bytes. offset += -offset & 3; // Read the two 32-bit arguments. defaultOffset = readInt(code, offset); offset += 4; int jumpOffsetCount = readInt(code, offset); offset += 4; // Read the matches-offset pairs. cases = new int[jumpOffsetCount]; jumpOffsets = new int[jumpOffsetCount]; for (int index = 0; index < jumpOffsetCount; index++) { cases[index] = readInt(code, offset); offset += 4; jumpOffsets[index] = readInt(code, offset); offset += 4; } }