public LocalVariableState constructorCall(StackEntry entry) { List<StackEntry> newContents = new ArrayList<StackEntry>(contents.size()); if (entry.getType() == StackEntryType.UNINITIALIZED_THIS) { for (int i = 0; i < contents.size(); ++i) { StackEntry stackEntry = contents.get(i); if (stackEntry.getType() == StackEntryType.UNINITIALIZED_THIS) { newContents.add(StackEntry.of(stackEntry.getDescriptor(), constPool)); } else { newContents.add(stackEntry); } } return new LocalVariableState(newContents, constPool); } else if (entry.getType() == StackEntryType.UNITITIALIZED_OBJECT) { for (int i = 0; i < contents.size(); ++i) { StackEntry stackEntry = contents.get(i); if (stackEntry.getType() == StackEntryType.UNITITIALIZED_OBJECT && stackEntry.getNewInstructionLocation() == entry.getNewInstructionLocation()) { newContents.add(StackEntry.of(stackEntry.getDescriptor(), constPool)); } else { newContents.add(stackEntry); } } return new LocalVariableState(newContents, constPool); } else { throw new InvalidBytecodeException("entry is not an unitialized object. " + toString()); } } }
public LocalVariableState constructorCall(StackEntry entry) { List<StackEntry> newContents = new ArrayList<StackEntry>(contents.size()); if (entry.getType() == StackEntryType.UNINITIALIZED_THIS) { for (int i = 0; i < contents.size(); ++i) { StackEntry stackEntry = contents.get(i); if (stackEntry.getType() == StackEntryType.UNINITIALIZED_THIS) { newContents.add(StackEntry.of(stackEntry.getDescriptor(), constPool)); } else { newContents.add(stackEntry); } } return new LocalVariableState(newContents, constPool); } else if (entry.getType() == StackEntryType.UNITITIALIZED_OBJECT) { for (int i = 0; i < contents.size(); ++i) { StackEntry stackEntry = contents.get(i); if (stackEntry.getType() == StackEntryType.UNITITIALIZED_OBJECT && stackEntry.getNewInstructionLocation() == entry.getNewInstructionLocation()) { newContents.add(StackEntry.of(stackEntry.getDescriptor(), constPool)); } else { newContents.add(stackEntry); } } return new LocalVariableState(newContents, constPool); } else { throw new InvalidBytecodeException("entry is not an unitialized object. " + toString()); } }
public void fload(int no) { LocalVariableState locals = getLocalVars(); if (locals.size() <= no) { throw new InvalidBytecodeException("Cannot load variable at " + no + ". Local Variables: " + locals.toString()); } StackEntry entry = locals.get(no); if (entry.getType() != StackEntryType.FLOAT) { throw new InvalidBytecodeException("Invalid local variable at location " + no + " Local Variables " + locals.toString()); } if (no > 0xFF) { // wide version writeByte(Opcode.WIDE); writeByte(Opcode.FLOAD); writeShort(no); currentOffset += 4; } else if (no >= 0 && no < 4) { writeByte(Opcode.FLOAD_0 + no); currentOffset++; } else { writeByte(Opcode.FLOAD); writeByte(no); currentOffset += 2; } advanceFrame(currentFrame.push(entry)); }
public void iload(int no) { LocalVariableState locals = getLocalVars(); if (locals.size() <= no) { throw new InvalidBytecodeException("Cannot load variable at " + no + ". Local Variables: " + locals.toString()); } StackEntry entry = locals.get(no); if (entry.getType() != StackEntryType.INT) { throw new InvalidBytecodeException("Invalid local variable at location " + no + " Local Variables " + locals.toString()); } if (no > 0xFF) { // wide version writeByte(Opcode.WIDE); writeByte(Opcode.ILOAD); writeShort(no); currentOffset += 4; } else if (no >= 0 && no < 4) { writeByte(Opcode.ILOAD_0 + no); currentOffset++; } else { writeByte(Opcode.ILOAD); writeByte(no); currentOffset += 2; } advanceFrame(currentFrame.push(entry)); }
public void lload(int no) { LocalVariableState locals = getLocalVars(); if (locals.size() <= no) { throw new InvalidBytecodeException("Cannot load variable at " + no + ". Local Variables: " + locals.toString()); } StackEntry entry = locals.get(no); if (entry.getType() != StackEntryType.LONG) { throw new InvalidBytecodeException("Invalid local variable at location " + no + " Local Variables " + locals.toString()); } if (no > 0xFF) { // wide version writeByte(Opcode.WIDE); writeByte(Opcode.LLOAD); writeShort(no); currentOffset += 4; } else if (no >= 0 && no < 4) { writeByte(Opcode.LLOAD_0 + no); currentOffset++; } else { writeByte(Opcode.LLOAD); writeByte(no); currentOffset += 2; } advanceFrame(currentFrame.push(entry)); }
public void iload(int no) { LocalVariableState locals = getLocalVars(); if (locals.size() <= no) { throw new InvalidBytecodeException("Cannot load variable at " + no + ". Local Variables: " + locals.toString()); } StackEntry entry = locals.get(no); if (entry.getType() != StackEntryType.INT) { throw new InvalidBytecodeException("Invalid local variable at location " + no + " Local Variables " + locals.toString()); } if (no > 0xFF) { // wide version writeByte(Opcode.WIDE); writeByte(Opcode.ILOAD); writeShort(no); currentOffset += 4; } else if (no >= 0 && no < 4) { writeByte(Opcode.ILOAD_0 + no); currentOffset++; } else { writeByte(Opcode.ILOAD); writeByte(no); currentOffset += 2; } advanceFrame(currentFrame.push(entry)); }
public void iload(int no) { LocalVariableState locals = getLocalVars(); if (locals.size() <= no) { throw new InvalidBytecodeException("Cannot load variable at " + no + ". Local Variables: " + locals.toString()); } StackEntry entry = locals.get(no); if (entry.getType() != StackEntryType.INT) { throw new InvalidBytecodeException("Invalid local variable at location " + no + " Local Variables " + locals.toString()); } if (no > 0xFF) { // wide version writeByte(Opcode.WIDE); writeByte(Opcode.ILOAD); writeShort(no); currentOffset += 4; } else if (no >= 0 && no < 4) { writeByte(Opcode.ILOAD_0 + no); currentOffset++; } else { writeByte(Opcode.ILOAD); writeByte(no); currentOffset += 2; } advanceFrame(currentFrame.push(entry)); }
public void lload(int no) { LocalVariableState locals = getLocalVars(); if (locals.size() <= no) { throw new InvalidBytecodeException("Cannot load variable at " + no + ". Local Variables: " + locals.toString()); } StackEntry entry = locals.get(no); if (entry.getType() != StackEntryType.LONG) { throw new InvalidBytecodeException("Invalid local variable at location " + no + " Local Variables " + locals.toString()); } if (no > 0xFF) { // wide version writeByte(Opcode.WIDE); writeByte(Opcode.LLOAD); writeShort(no); currentOffset += 4; } else if (no >= 0 && no < 4) { writeByte(Opcode.LLOAD_0 + no); currentOffset++; } else { writeByte(Opcode.LLOAD); writeByte(no); currentOffset += 2; } advanceFrame(currentFrame.push(entry)); }
public void fload(int no) { LocalVariableState locals = getLocalVars(); if (locals.size() <= no) { throw new InvalidBytecodeException("Cannot load variable at " + no + ". Local Variables: " + locals.toString()); } StackEntry entry = locals.get(no); if (entry.getType() != StackEntryType.FLOAT) { throw new InvalidBytecodeException("Invalid local variable at location " + no + " Local Variables " + locals.toString()); } if (no > 0xFF) { // wide version writeByte(Opcode.WIDE); writeByte(Opcode.FLOAD); writeShort(no); currentOffset += 4; } else if (no >= 0 && no < 4) { writeByte(Opcode.FLOAD_0 + no); currentOffset++; } else { writeByte(Opcode.FLOAD); writeByte(no); currentOffset += 2; } advanceFrame(currentFrame.push(entry)); }
public void lload(int no) { LocalVariableState locals = getLocalVars(); if (locals.size() <= no) { throw new InvalidBytecodeException("Cannot load variable at " + no + ". Local Variables: " + locals.toString()); } StackEntry entry = locals.get(no); if (entry.getType() != StackEntryType.LONG) { throw new InvalidBytecodeException("Invalid local variable at location " + no + " Local Variables " + locals.toString()); } if (no > 0xFF) { // wide version writeByte(Opcode.WIDE); writeByte(Opcode.LLOAD); writeShort(no); currentOffset += 4; } else if (no >= 0 && no < 4) { writeByte(Opcode.LLOAD_0 + no); currentOffset++; } else { writeByte(Opcode.LLOAD); writeByte(no); currentOffset += 2; } advanceFrame(currentFrame.push(entry)); }
public void lload(int no) { LocalVariableState locals = getLocalVars(); if (locals.size() <= no) { throw new InvalidBytecodeException("Cannot load variable at " + no + ". Local Variables: " + locals.toString()); } StackEntry entry = locals.get(no); if (entry.getType() != StackEntryType.LONG) { throw new InvalidBytecodeException("Invalid local variable at location " + no + " Local Variables " + locals.toString()); } if (no > 0xFF) { // wide version writeByte(Opcode.WIDE); writeByte(Opcode.LLOAD); writeShort(no); currentOffset += 4; } else if (no >= 0 && no < 4) { writeByte(Opcode.LLOAD_0 + no); currentOffset++; } else { writeByte(Opcode.LLOAD); writeByte(no); currentOffset += 2; } advanceFrame(currentFrame.push(entry)); }
public void lload(int no) { LocalVariableState locals = getLocalVars(); if (locals.size() <= no) { throw new InvalidBytecodeException("Cannot load variable at " + no + ". Local Variables: " + locals.toString()); } StackEntry entry = locals.get(no); if (entry.getType() != StackEntryType.LONG) { throw new InvalidBytecodeException("Invalid local variable at location " + no + " Local Variables " + locals.toString()); } if (no > 0xFF) { // wide version writeByte(Opcode.WIDE); writeByte(Opcode.LLOAD); writeShort(no); currentOffset += 4; } else if (no >= 0 && no < 4) { writeByte(Opcode.LLOAD_0 + no); currentOffset++; } else { writeByte(Opcode.LLOAD); writeByte(no); currentOffset += 2; } advanceFrame(currentFrame.push(entry)); }
public void aload(int no) { LocalVariableState locals = getLocalVars(); if (locals.size() <= no) { throw new InvalidBytecodeException("Cannot load variable at " + no + ". Local Variables: " + locals.toString()); } StackEntry entry = locals.get(no); if (entry.getType() != StackEntryType.OBJECT && entry.getType() != StackEntryType.NULL && entry.getType() != StackEntryType.UNINITIALIZED_THIS && entry.getType() != StackEntryType.UNITITIALIZED_OBJECT) { throw new InvalidBytecodeException("Invalid local variable at location " + no + " Local Variables " + locals.toString()); } if (no > 0xFF) { // wide version writeByte(Opcode.WIDE); writeByte(Opcode.ALOAD); writeShort(no); currentOffset += 4; } else if (no >= 0 && no < 4) { writeByte(Opcode.ALOAD_0 + no); currentOffset++; } else { writeByte(Opcode.ALOAD); writeByte(no); currentOffset += 2; } advanceFrame(currentFrame.push(entry)); }
public void aload(int no) { LocalVariableState locals = getLocalVars(); if (locals.size() <= no) { throw new InvalidBytecodeException("Cannot load variable at " + no + ". Local Variables: " + locals.toString()); } StackEntry entry = locals.get(no); if (entry.getType() != StackEntryType.OBJECT && entry.getType() != StackEntryType.NULL && entry.getType() != StackEntryType.UNINITIALIZED_THIS && entry.getType() != StackEntryType.UNITITIALIZED_OBJECT) { throw new InvalidBytecodeException("Invalid local variable at location " + no + " Local Variables " + locals.toString()); } if (no > 0xFF) { // wide version writeByte(Opcode.WIDE); writeByte(Opcode.ALOAD); writeShort(no); currentOffset += 4; } else if (no >= 0 && no < 4) { writeByte(Opcode.ALOAD_0 + no); currentOffset++; } else { writeByte(Opcode.ALOAD); writeByte(no); currentOffset += 2; } advanceFrame(currentFrame.push(entry)); }
public void aload(int no) { LocalVariableState locals = getLocalVars(); if (locals.size() <= no) { throw new InvalidBytecodeException("Cannot load variable at " + no + ". Local Variables: " + locals.toString()); } StackEntry entry = locals.get(no); if (entry.getType() != StackEntryType.OBJECT && entry.getType() != StackEntryType.NULL && entry.getType() != StackEntryType.UNINITIALIZED_THIS && entry.getType() != StackEntryType.UNITITIALIZED_OBJECT) { throw new InvalidBytecodeException("Invalid local variable at location " + no + " Local Variables " + locals.toString()); } if (no > 0xFF) { // wide version writeByte(Opcode.WIDE); writeByte(Opcode.ALOAD); writeShort(no); currentOffset += 4; } else if (no >= 0 && no < 4) { writeByte(Opcode.ALOAD_0 + no); currentOffset++; } else { writeByte(Opcode.ALOAD); writeByte(no); currentOffset += 2; } advanceFrame(currentFrame.push(entry)); }
public void iinc(int local, int amount) { if (getLocalVars().get(local).getType() != StackEntryType.INT) { throw new InvalidBytecodeException("iinc requires int at local variable position " + local + " " + getLocalVars().toString()); } if (local > 0xFF || amount > 0xFF) { writeByte(Opcode.WIDE); writeByte(Opcode.IINC); writeShort(local); writeShort(amount); currentOffset += 6; } else { writeByte(Opcode.IINC); writeByte(local); writeByte(amount); currentOffset += 3; } duplicateFrame(); }
public void iinc(int local, int amount) { if (getLocalVars().get(local).getType() != StackEntryType.INT) { throw new InvalidBytecodeException("iinc requires int at local variable position " + local + " " + getLocalVars().toString()); } if (local > 0xFF || amount > 0xFF) { writeByte(Opcode.WIDE); writeByte(Opcode.IINC); writeShort(local); writeShort(amount); currentOffset += 6; } else { writeByte(Opcode.IINC); writeByte(local); writeByte(amount); currentOffset += 3; } duplicateFrame(); }
public void iinc(int local, int amount) { if (getLocalVars().get(local).getType() != StackEntryType.INT) { throw new InvalidBytecodeException("iinc requires int at local variable position " + local + " " + getLocalVars().toString()); } if (local > 0xFF || amount > 0xFF) { writeByte(Opcode.WIDE); writeByte(Opcode.IINC); writeShort(local); writeShort(amount); currentOffset += 6; } else { writeByte(Opcode.IINC); writeByte(local); writeByte(amount); currentOffset += 3; } duplicateFrame(); }
public void iinc(int local, int amount) { if (getLocalVars().get(local).getType() != StackEntryType.INT) { throw new InvalidBytecodeException("iinc requires int at local variable position " + local + " " + getLocalVars().toString()); } if (local > 0xFF || amount > 0xFF) { writeByte(Opcode.WIDE); writeByte(Opcode.IINC); writeShort(local); writeShort(amount); currentOffset += 6; } else { writeByte(Opcode.IINC); writeByte(local); writeByte(amount); currentOffset += 3; } duplicateFrame(); }
public void iinc(int local, int amount) { if (getLocalVars().get(local).getType() != StackEntryType.INT) { throw new InvalidBytecodeException("iinc requires int at local variable position " + local + " " + getLocalVars().toString()); } if (local > 0xFF || amount > 0xFF) { writeByte(Opcode.WIDE); writeByte(Opcode.IINC); writeShort(local); writeShort(amount); currentOffset += 6; } else { writeByte(Opcode.IINC); writeByte(local); writeByte(amount); currentOffset += 3; } duplicateFrame(); }