public void caseClassConstant(ClassConstant c) { // "array class" types are unmodified boolean classIsArray = c.value.startsWith("["); String className = classIsArray ? c.value : SootToDexUtils.getDexClassName(c.value); TypeIdItem referencedClass = TypeIdItem.internTypeIdItem(stmtV.getBelongingFile(), className); stmtV.addInsn(new Insn21c(Opcode.CONST_CLASS, destinationReg, referencedClass)); }
public void caseFloatConstant(FloatConstant f) { int intBits = Float.floatToIntBits(f.value); stmtV.addInsn(buildConstInsn(intBits)); }
public void caseDoubleConstant(DoubleConstant d) { long longBits = Double.doubleToLongBits(d.value); stmtV.addInsn(buildConstWideInsn(longBits)); }
public void caseLongConstant(LongConstant l) { long constant = l.value; stmtV.addInsn(buildConstWideInsn(constant)); }
public void caseStringConstant(StringConstant s) { StringIdItem referencedString = StringIdItem.internStringIdItem(stmtV.getBelongingFile(), s.value); stmtV.addInsn(new Insn21c(Opcode.CONST_STRING, destinationReg, referencedString)); }
public void caseNullConstant(NullConstant v) { // dex bytecode spec says: "In terms of bitwise representation, (Object) null == (int) 0." stmtV.addInsn(buildConstInsn(0)); }
public void caseIntConstant(IntConstant i) { stmtV.addInsn(buildConstInsn(i.value)); }