public void emit(DexFile dexFile, Output out, List<Item> referencedItems) { emitAdvancePC(out, address); emitSetFile(out); if (fileName != null) { referencedItems.add(StringIdItem.internStringIdItem(dexFile, fileName)); } } }
public void emit(DexFile dexFile, Output out, List<Item> referencedItems) { emitAdvancePC(out, address); emitStartLocal(out, registerNum); referencedItems.add(localName==null?null:StringIdItem.internStringIdItem(dexFile, localName)); referencedItems.add(localType==null?null:TypeIdItem.internTypeIdItem(dexFile, StringIdItem.internStringIdItem(dexFile, localType))); } }
public void emit(DexFile dexFile, Output out, List<Item> referencedItems) { emitAdvancePC(out, address); emitStartLocalExtended(out, registerNum); if (localName != null) { referencedItems.add(StringIdItem.internStringIdItem(dexFile, localName)); } if (localType != null) { referencedItems.add(TypeIdItem.internTypeIdItem(dexFile, StringIdItem.internStringIdItem(dexFile, localType))); } if (signature != null) { referencedItems.add(StringIdItem.internStringIdItem(dexFile, signature)); } } }
/** * Creates a new <code>ProtoIdItem</code> with the given values * @param dexFile The <code>DexFile</code> that this item belongs to * @param returnType the return type * @param parameters a <code>TypeListItem</code> containing a list of the parameter types */ private ProtoIdItem(DexFile dexFile, TypeIdItem returnType, TypeListItem parameters) { this(dexFile); String shortyString = returnType.toShorty(); if (parameters != null) { shortyString += parameters.getShortyString(); } this.shortyDescriptor = StringIdItem.internStringIdItem(dexFile, shortyString); this.returnType = returnType; this.parameters = parameters; }
/** * Returns a <code>TypeIdItem</code> for the given values, and that has been interned into * the given <code>DexFile</code> * @param dexFile The <code>DexFile</code> that this item will belong to * @param typeDescriptor The string containing the type descriptor that this * <code>TypeIdItem</code> represents * @return a <code>TypeIdItem</code> for the given values, and that has been interned into * the given <code>DexFile</code> */ public static TypeIdItem internTypeIdItem(DexFile dexFile, String typeDescriptor) { StringIdItem stringIdItem = StringIdItem.internStringIdItem(dexFile, typeDescriptor); if (stringIdItem == null) { return null; } TypeIdItem typeIdItem = new TypeIdItem(dexFile, stringIdItem); return dexFile.TypeIdsSection.intern(typeIdItem); }
public DebugInfoItem encodeDebugInfo(DexFile dexFile) { if (!hasData) { return null; } ByteArrayOutput out = new ByteArrayOutput(); StringIdItem[] parameterNamesArray = new StringIdItem[parameterNames.size()]; ArrayList<Item> referencedItems = new ArrayList<Item>(); if (lineStart == 0) { lineStart = 1; } currentLine = lineStart; for (Event event: events) { event.emit(dexFile, out, referencedItems); } emitEndSequence(out); int index = 0; for (String parameterName: parameterNames) { if (parameterName == null) { parameterNamesArray[index++] = null; } else { parameterNamesArray[index++] = StringIdItem.internStringIdItem(dexFile, parameterName); } } Item[] referencedItemsArray = new Item[referencedItems.size()]; referencedItems.toArray(referencedItemsArray); return DebugInfoItem.internDebugInfoItem(dexFile, lineStart, parameterNamesArray, out.toByteArray(), referencedItemsArray); }
public void emit(DexFile dexFile, Output out, List<Item> referencedItems) { emitAdvancePC(out, address); emitSetFile(out); if (fileName != null) { referencedItems.add(StringIdItem.internStringIdItem(dexFile, fileName)); } } }
public void emit(DexFile dexFile, Output out, List<Item> referencedItems) { emitAdvancePC(out, address); emitStartLocal(out, registerNum); referencedItems.add(localName==null?null:StringIdItem.internStringIdItem(dexFile, localName)); referencedItems.add(localType==null?null:TypeIdItem.internTypeIdItem(dexFile, StringIdItem.internStringIdItem(dexFile, localType))); } }
public void emit(DexFile dexFile, Output out, List<Item> referencedItems) { emitAdvancePC(out, address); emitStartLocalExtended(out, registerNum); if (localName != null) { referencedItems.add(StringIdItem.internStringIdItem(dexFile, localName)); } if (localType != null) { referencedItems.add(TypeIdItem.internTypeIdItem(dexFile, StringIdItem.internStringIdItem(dexFile, localType))); } if (signature != null) { referencedItems.add(StringIdItem.internStringIdItem(dexFile, signature)); } } }
/** * Creates a new <code>ProtoIdItem</code> with the given values * @param dexFile The <code>DexFile</code> that this item belongs to * @param returnType the return type * @param parameters a <code>TypeListItem</code> containing a list of the parameter types */ private ProtoIdItem(DexFile dexFile, TypeIdItem returnType, TypeListItem parameters) { this(dexFile); String shortyString = returnType.toShorty(); if (parameters != null) { shortyString += parameters.getShortyString(); } this.shortyDescriptor = StringIdItem.internStringIdItem(dexFile, shortyString); this.returnType = returnType; this.parameters = parameters; }
/** * Returns a <code>TypeIdItem</code> for the given values, and that has been interned into * the given <code>DexFile</code> * @param dexFile The <code>DexFile</code> that this item will belong to * @param typeDescriptor The string containing the type descriptor that this * <code>TypeIdItem</code> represents * @return a <code>TypeIdItem</code> for the given values, and that has been interned into * the given <code>DexFile</code> */ public static TypeIdItem internTypeIdItem(DexFile dexFile, String typeDescriptor) { StringIdItem stringIdItem = StringIdItem.internStringIdItem(dexFile, typeDescriptor); if (stringIdItem == null) { return null; } TypeIdItem typeIdItem = new TypeIdItem(dexFile, stringIdItem); return dexFile.TypeIdsSection.intern(typeIdItem); }
public DebugInfoItem encodeDebugInfo(DexFile dexFile) { if (!hasData) { return null; } ByteArrayOutput out = new ByteArrayOutput(); StringIdItem[] parameterNamesArray = new StringIdItem[parameterNames.size()]; ArrayList<Item> referencedItems = new ArrayList<Item>(); if (lineStart == 0) { lineStart = 1; } currentLine = lineStart; for (Event event: events) { event.emit(dexFile, out, referencedItems); } emitEndSequence(out); int index = 0; for (String parameterName: parameterNames) { if (parameterName == null) { parameterNamesArray[index++] = null; } else { parameterNamesArray[index++] = StringIdItem.internStringIdItem(dexFile, parameterName); } } Item[] referencedItemsArray = new Item[referencedItems.size()]; referencedItems.toArray(referencedItemsArray); return DebugInfoItem.internDebugInfoItem(dexFile, lineStart, parameterNamesArray, out.toByteArray(), referencedItemsArray); }