private void setLabelSequentialNumbers() { HashMap<String, Integer> nextLabelSequenceByType = new HashMap<String, Integer>(); ArrayList<LabelMethodItem> sortedLabels = new ArrayList<LabelMethodItem>(labelCache.getLabels()); //sort the labels by their location in the method Collections.sort(sortedLabels); for (LabelMethodItem labelMethodItem: sortedLabels) { Integer labelSequence = nextLabelSequenceByType.get(labelMethodItem.getLabelPrefix()); if (labelSequence == null) { labelSequence = 0; } labelMethodItem.setLabelSequence(labelSequence); nextLabelSequenceByType.put(labelMethodItem.getLabelPrefix(), labelSequence + 1); } }
public CatchMethodItem(@Nonnull BaksmaliOptions options, @Nonnull MethodDefinition.LabelCache labelCache, int codeAddress, @Nullable String exceptionType, int startAddress, int endAddress, int handlerAddress) { super(codeAddress); this.exceptionType = exceptionType; tryStartLabel = labelCache.internLabel(new LabelMethodItem(options, startAddress, "try_start_")); //use the address from the last covered instruction, but make the label //name refer to the address of the next instruction tryEndLabel = labelCache.internLabel(new EndTryLabelMethodItem(options, codeAddress, endAddress)); if (exceptionType == null) { handlerLabel = labelCache.internLabel(new LabelMethodItem(options, handlerAddress, "catchall_")); } else { handlerLabel = labelCache.internLabel(new LabelMethodItem(options, handlerAddress, "catch_")); } }
@Override protected void writeTargetLabel(IndentingWriter writer) throws IOException { label.writeTo(writer); }
public int hashCode() { //force it to call equals when two labels are at the same address return getCodeAddress(); }
public boolean equals(Object o) { if (!(o instanceof LabelMethodItem)) { return false; } return this.compareTo((MethodItem)o) == 0; }
public boolean writeTo(IndentingWriter writer) throws IOException { writer.write(':'); writer.write(labelPrefix); if (options.sequentialLabels) { writer.printUnsignedLongAsHex(labelSequence); } else { writer.printUnsignedLongAsHex(this.getLabelAddress()); } return true; }
public CatchMethodItem(@Nonnull BaksmaliOptions options, @Nonnull MethodDefinition.LabelCache labelCache, int codeAddress, @Nullable String exceptionType, int startAddress, int endAddress, int handlerAddress) { super(codeAddress); this.exceptionType = exceptionType; tryStartLabel = labelCache.internLabel(new LabelMethodItem(options, startAddress, "try_start_")); //use the address from the last covered instruction, but make the label //name refer to the address of the next instruction tryEndLabel = labelCache.internLabel(new EndTryLabelMethodItem(options, codeAddress, endAddress)); if (exceptionType == null) { handlerLabel = labelCache.internLabel(new LabelMethodItem(options, handlerAddress, "catchall_")); } else { handlerLabel = labelCache.internLabel(new LabelMethodItem(options, handlerAddress, "catch_")); } }
public void writeTargetTo(IndentingWriter writer) throws IOException { target.writeTo(writer); } }
public int hashCode() { //force it to call equals when two labels are at the same address return getCodeAddress(); }
public boolean equals(Object o) { if (!(o instanceof LabelMethodItem)) { return false; } return this.compareTo((MethodItem)o) == 0; }
public boolean writeTo(IndentingWriter writer) throws IOException { writer.write(':'); writer.write(labelPrefix); if (options.sequentialLabels) { writer.printUnsignedLongAsHex(labelSequence); } else { writer.printUnsignedLongAsHex(this.getLabelAddress()); } return true; }
private void setLabelSequentialNumbers() { HashMap<String, Integer> nextLabelSequenceByType = new HashMap<String, Integer>(); ArrayList<LabelMethodItem> sortedLabels = new ArrayList<LabelMethodItem>(labelCache.getLabels()); //sort the labels by their location in the method Collections.sort(sortedLabels); for (LabelMethodItem labelMethodItem: sortedLabels) { Integer labelSequence = nextLabelSequenceByType.get(labelMethodItem.getLabelPrefix()); if (labelSequence == null) { labelSequence = 0; } labelMethodItem.setLabelSequence(labelSequence); nextLabelSequenceByType.put(labelMethodItem.getLabelPrefix(), labelSequence + 1); } }
public CatchMethodItem(@Nonnull baksmaliOptions options, @Nonnull MethodDefinition.LabelCache labelCache, int codeAddress, @Nullable String exceptionType, int startAddress, int endAddress, int handlerAddress) { super(codeAddress); this.exceptionType = exceptionType; tryStartLabel = labelCache.internLabel(new LabelMethodItem(options, startAddress, "try_start_")); //use the address from the last covered instruction, but make the label //name refer to the address of the next instruction tryEndLabel = labelCache.internLabel(new EndTryLabelMethodItem(options, codeAddress, endAddress)); if (exceptionType == null) { handlerLabel = labelCache.internLabel(new LabelMethodItem(options, handlerAddress, "catchall_")); } else { handlerLabel = labelCache.internLabel(new LabelMethodItem(options, handlerAddress, "catch_")); } }
public void writeTargetTo(IndentingWriter writer) throws IOException { target.writeTo(writer); } }
public int getLabelAddress() { return this.getCodeAddress(); }
public boolean equals(Object o) { if (!(o instanceof LabelMethodItem)) { return false; } return this.compareTo((MethodItem)o) == 0; }
public boolean writeTo(IndentingWriter writer) throws IOException { writer.write(':'); writer.write(labelPrefix); if (options.useSequentialLabels) { writer.printUnsignedLongAsHex(labelSequence); } else { writer.printUnsignedLongAsHex(this.getLabelAddress()); } return true; }
private void setLabelSequentialNumbers() { HashMap<String, Integer> nextLabelSequenceByType = new HashMap<String, Integer>(); ArrayList<LabelMethodItem> sortedLabels = new ArrayList<LabelMethodItem>(labelCache.getLabels()); //sort the labels by their location in the method Collections.sort(sortedLabels); for (LabelMethodItem labelMethodItem: sortedLabels) { Integer labelSequence = nextLabelSequenceByType.get(labelMethodItem.getLabelPrefix()); if (labelSequence == null) { labelSequence = 0; } labelMethodItem.setLabelSequence(labelSequence); nextLabelSequenceByType.put(labelMethodItem.getLabelPrefix(), labelSequence + 1); } }
public OffsetInstructionFormatMethodItem(@Nonnull BaksmaliOptions options, @Nonnull MethodDefinition methodDef, int codeAddress, OffsetInstruction instruction) { super(methodDef, codeAddress, instruction); label = new LabelMethodItem(options, codeAddress + instruction.getCodeOffset(), getLabelPrefix()); label = methodDef.getLabelCache().internLabel(label); }
public void writeTargetTo(IndentingWriter writer) throws IOException { target.writeTo(writer); } }