Lines Matching refs:cst

21 import com.android.dexgen.rop.cst.Constant;
22 import com.android.dexgen.rop.cst.CstAnnotation;
23 import com.android.dexgen.rop.cst.CstArray;
24 import com.android.dexgen.rop.cst.CstBoolean;
25 import com.android.dexgen.rop.cst.CstByte;
26 import com.android.dexgen.rop.cst.CstChar;
27 import com.android.dexgen.rop.cst.CstDouble;
28 import com.android.dexgen.rop.cst.CstEnumRef;
29 import com.android.dexgen.rop.cst.CstFieldRef;
30 import com.android.dexgen.rop.cst.CstFloat;
31 import com.android.dexgen.rop.cst.CstInteger;
32 import com.android.dexgen.rop.cst.CstKnownNull;
33 import com.android.dexgen.rop.cst.CstLiteralBits;
34 import com.android.dexgen.rop.cst.CstLong;
35 import com.android.dexgen.rop.cst.CstMethodRef;
36 import com.android.dexgen.rop.cst.CstShort;
37 import com.android.dexgen.rop.cst.CstString;
38 import com.android.dexgen.rop.cst.CstType;
39 import com.android.dexgen.rop.cst.CstUtf8;
126 * @param cst {@code non-null;} the constant to write
128 public void writeConstant(Constant cst) {
129 int type = constantToValueType(cst);
137 long value = ((CstLiteralBits) cst).getLongBits();
142 long value = ((CstLiteralBits) cst).getLongBits();
148 long value = ((CstFloat) cst).getLongBits() << 32;
153 long value = ((CstDouble) cst).getLongBits();
158 int index = file.getStringIds().indexOf((CstString) cst);
163 int index = file.getTypeIds().indexOf((CstType) cst);
168 int index = file.getFieldIds().indexOf((CstFieldRef) cst);
173 int index = file.getMethodIds().indexOf((CstMethodRef) cst);
178 CstFieldRef fieldRef = ((CstEnumRef) cst).getFieldRef();
185 writeArray((CstArray) cst, false);
190 writeAnnotation(((CstAnnotation) cst).getAnnotation(),
199 int value = ((CstBoolean) cst).getIntBits();
212 * @param cst {@code non-null;} the constant
216 private static int constantToValueType(Constant cst) {
221 if (cst instanceof CstByte) {
223 } else if (cst instanceof CstShort) {
225 } else if (cst instanceof CstChar) {
227 } else if (cst instanceof CstInteger) {
229 } else if (cst instanceof CstLong) {
231 } else if (cst instanceof CstFloat) {
233 } else if (cst instanceof CstDouble) {
235 } else if (cst instanceof CstString) {
237 } else if (cst instanceof CstType) {
239 } else if (cst instanceof CstFieldRef) {
241 } else if (cst instanceof CstMethodRef) {
243 } else if (cst instanceof CstEnumRef) {
245 } else if (cst instanceof CstArray) {
247 } else if (cst instanceof CstAnnotation) {
249 } else if (cst instanceof CstKnownNull) {
251 } else if (cst instanceof CstBoolean) {
283 Constant cst = list.get(i);
286 constantToHuman(cst));
288 writeConstant(cst);
364 * @param cst {@code non-null;} the constant
367 public static String constantToHuman(Constant cst) {
368 int type = constantToValueType(cst);
376 sb.append(cst.typeName());
378 sb.append(cst.toHuman());
514 * @param cst {@code non-null;} the constant to add contents for
516 public static void addContents(DexFile file, Constant cst) {
517 if (cst instanceof CstAnnotation) {
518 addContents(file, ((CstAnnotation) cst).getAnnotation());
519 } else if (cst instanceof CstArray) {
520 CstArray.List list = ((CstArray) cst).getList();
526 file.internIfAppropriate(cst);