Methods Summary |
---|
protected java.lang.String | argString(){@inheritDoc}
StringBuffer sb = new StringBuffer(100);
int sz = values.size();
for (int i = 0; i < sz; i++) {
sb.append("\n ");
sb.append(i);
sb.append(": ");
sb.append(values.get(i).toHuman());
}
return sb.toString();
|
public int | codeSize(){@inheritDoc}
int sz = initLength;
// Note: the unit here is 16-bit
return 4 + ((sz * elemWidth) + 1) / 2;
|
protected java.lang.String | listingString0(boolean noteIndices){@inheritDoc}
int baseAddress = user.getAddress();
StringBuffer sb = new StringBuffer(100);
int sz = values.size();
sb.append("array-data // for fill-array-data @ ");
sb.append(Hex.u2(baseAddress));
for (int i = 0; i < sz; i++) {
sb.append("\n ");
sb.append(i);
sb.append(": ");
sb.append(values.get(i).toHuman());
}
return sb.toString();
|
public DalvInsn | withRegisters(com.android.dexgen.rop.code.RegisterSpecList registers){@inheritDoc}
return new ArrayData(getPosition(), user, values, arrayType);
|
public void | writeTo(com.android.dexgen.util.AnnotatedOutput out){@inheritDoc}
int sz = values.size();
out.writeShort(0x300 | DalvOps.NOP);
out.writeShort(elemWidth);
out.writeInt(initLength);
// For speed reasons, replicate the for loop in each case
switch (elemWidth) {
case 1: {
for (int i = 0; i < sz; i++) {
Constant cst = values.get(i);
out.writeByte((byte) ((CstLiteral32) cst).getIntBits());
}
break;
}
case 2: {
for (int i = 0; i < sz; i++) {
Constant cst = values.get(i);
out.writeShort((short) ((CstLiteral32) cst).getIntBits());
}
break;
}
case 4: {
for (int i = 0; i < sz; i++) {
Constant cst = values.get(i);
out.writeInt(((CstLiteral32) cst).getIntBits());
}
break;
}
case 8: {
for (int i = 0; i < sz; i++) {
Constant cst = values.get(i);
out.writeLong(((CstLiteral64) cst).getLongBits());
}
break;
}
default:
break;
}
// Pad one byte to make the size of data table multiples of 16-bits
if (elemWidth == 1 && (sz % 2 != 0)) {
out.writeByte(0x00);
}
|