/** * Writes a 16 bit integer at the index. */ public void write16bit(int value, int index) { ByteArray.write16bit(value, bytecode, index); }
/** * Constructs an empty LocalVariableTable. */ public LocalVariableAttribute(ConstPool cp) { super(cp, tag, new byte[2]); ByteArray.write16bit(0, info, 0); }
public void objectOrUninitialized(int tag, int data, int pos) { if (tag == UNINIT) if (where <= data) ByteArray.write16bit(data + gap, info, pos); } }
int write(int srcPos, byte[] code, int destPos, byte[] newcode) { newcode[destPos] = LDC_W; ByteArray.write16bit(index, newcode, destPos + 1); return 2; } }
/** * Sets <code>exception_index_table[]</code>. */ public void setExceptionIndexes(int[] elist) { int n = elist.length; byte[] blist = new byte[n * 2 + 2]; ByteArray.write16bit(n, blist, 0); for (int i = 0; i < n; ++i) ByteArray.write16bit(elist[i], blist, i * 2 + 2); info = blist; }
public void uninitialized(int pos, int offset) { if (where <= offset) ByteArray.write16bit(offset + gap, info, pos + 1); } }
/** * Constructs an empty LocalVariableTypeTable. */ public LocalVariableTypeAttribute(ConstPool cp) { super(cp, tag, new byte[2]); ByteArray.write16bit(0, info, 0); }
public void uninitialized(int pos, int offset) { dest[pos] = UNINIT; ByteArray.write16bit(offset, dest, pos + 1); }
public int locals(int pos, int offset, int num) { if (where == pos + offset) ByteArray.write16bit(offset - gap, info, pos - 4); else if (where == pos) ByteArray.write16bit(offset + gap, info, pos - 4); return super.locals(pos, offset, num); } }
/** * Sets the names of exceptions that the method may throw. */ public void setExceptions(String[] elist) { int n = elist.length; byte[] blist = new byte[n * 2 + 2]; ByteArray.write16bit(n, blist, 0); for (int i = 0; i < n; ++i) ByteArray.write16bit(constPool.addClassInfo(elist[i]), blist, i * 2 + 2); info = blist; }
/** * Constructs an empty InnerClasses attribute. * * @see #append(String, String, String, int) */ public InnerClassesAttribute(ConstPool cp) { super(cp, tag, new byte[2]); ByteArray.write16bit(0, get(), 0); }
public void objectVariable(int pos, int clazz) { dest[pos] = OBJECT; int newClazz = srcCp.copy(clazz, destCp, classnames); ByteArray.write16bit(newClazz, dest, pos + 1); }
/** * Sets <code>classes[nth].inner_class_access_flags</code> to * the given index. */ public void setAccessFlags(int nth, int flags) { ByteArray.write16bit(flags, get(), nth * 8 + 8); }
int write(int src, byte[] code, int dest, byte[] newcode) { if (state == BIT32) write32(src, code, dest, newcode); else { newcode[dest] = code[src]; ByteArray.write16bit(offset, newcode, dest + 1); } return 3; } }
public int locals(int pos, int offset, int num) { if (exclusive ? where <= offset : where < offset) ByteArray.write16bit(offset + gap, info, pos - 4); return super.locals(pos, offset, num); }
/** * Sets <code>classes[nth].outer_class_info_index</code> to * the given index. */ public void setOuterClassIndex(int nth, int index) { ByteArray.write16bit(index, get(), nth * 8 + 4); }
/** * Sets <code>classes[nth].inner_name_index</code> to * the given index. */ public void setInnerNameIndex(int nth, int index) { ByteArray.write16bit(index, get(), nth * 8 + 6); }
/** * Sets <code>classes[nth].inner_class_info_index</code> to * the given index. */ public void setInnerClassIndex(int nth, int index) { ByteArray.write16bit(index, get(), nth * 8 + 2); }
public int locals(int pos, int offset, int num) { ByteArray.write16bit(offset, dest, pos - 4); return super.locals(pos, offset, num); }
private void renameType(int pos, int index) { String name = cpool.getUtf8Info(index); String newName = Descriptor.rename(name, classnames); if (!name.equals(newName)) { int index2 = cpool.addUtf8Info(newName); ByteArray.write16bit(index2, info, pos); } } }