/** * Extracts all {@link SwitchData} pseudo-instructions from the given list * of instructions. * * @param instructions * the list of instructions from where to extract * @return a map containing all found {@link SwitchData} instructions, * indexed by address. */ private static Map<Integer, SwitchData> extractSwitchData(DalvInsnList instructions) { Map<Integer, SwitchData> result= new HashMap<Integer, SwitchData>(); for (int i= 0; i < instructions.size(); ++i) { if (instructions.get(i) instanceof SwitchData) { SwitchData switchData= (SwitchData) instructions.get(i); result.put(switchData.getAddress(), switchData); } } return result; }
/** * Extracts all {@link ArrayData} pseudo-instructions from the given list of * instructions. * * @param instructions * the list of instructions from where to extract * @return a map containing all found {@link ArrayData} instructions, * indexed by address. */ private static Map<Integer, ArrayData> extractArrayData(DalvInsnList instructions) { Map<Integer, ArrayData> result= new HashMap<Integer, ArrayData>(); for (int i= 0; i < instructions.size(); ++i) { if (instructions.get(i) instanceof ArrayData) { ArrayData arrayData= (ArrayData) instructions.get(i); result.put(arrayData.getAddress(), arrayData); } } return result; }
/** * Gets the size of this instance, in 16-bit code units. This will only * return a meaningful result if the instructions in this instance all * have valid addresses. * * @return {@code >= 0;} the size */ public int codeSize() { int sz = size(); if (sz == 0) { return 0; } DalvInsn last = get(sz - 1); return last.getNextAddress(); }
/** * Gets the size of this instance, in 16-bit code units. This will only * return a meaningful result if the instructions in this instance all * have valid addresses. * * @return {@code >= 0;} the size */ public int codeSize() { int sz = size(); if (sz == 0) { return 0; } DalvInsn last = get(sz - 1); return last.getNextAddress(); }
/** * Gets the size of this instance, in 16-bit code units. This will only * return a meaningful result if the instructions in this instance all * have valid addresses. * * @return {@code >= 0;} the size */ public int codeSize() { int sz = size(); if (sz == 0) { return 0; } DalvInsn last = get(sz - 1); return last.getNextAddress(); }
/** * Gets the size of this instance, in 16-bit code units. This will only * return a meaningful result if the instructions in this instance all * have valid addresses. * * @return {@code >= 0;} the size */ public int codeSize() { int sz = size(); if (sz == 0) { return 0; } DalvInsn last = get(sz - 1); return last.getNextAddress(); }
/** * Gets the size of this instance, in 16-bit code units. This will only * return a meaningful result if the instructions in this instance all * have valid addresses. * * @return {@code >= 0;} the size */ public int codeSize() { int sz = size(); if (sz == 0) { return 0; } DalvInsn last = get(sz - 1); return last.getNextAddress(); }
/** * Gets the size of this instance, in 16-bit code units. This will only * return a meaningful result if the instructions in this instance all * have valid addresses. * * @return {@code >= 0;} the size */ public int codeSize() { int sz = size(); if (sz == 0) { return 0; } DalvInsn last = get(sz - 1); return last.getNextAddress(); }
/** * Gets the size of this instance, in 16-bit code units. This will only * return a meaningful result if the instructions in this instance all * have valid addresses. * * @return {@code >= 0;} the size */ public int codeSize() { int sz = size(); if (sz == 0) { return 0; } DalvInsn last = get(sz - 1); return last.getNextAddress(); }
/** * Gets the size of this instance, in 16-bit code units. This will only * return a meaningful result if the instructions in this instance all * have valid addresses. * * @return {@code >= 0;} the size */ public int codeSize() { int sz = size(); if (sz == 0) { return 0; } DalvInsn last = get(sz - 1); return last.getNextAddress(); }
private static void processCode(DalvCode code, Dependencies.MethodDeps methodDeps) { if (code == null) { return; } // TODO: We don't need this, as it should be added by code blocks, if // the exception is actually used. If it's not used, we shouldn't care. // processCatchTable(code.getCatches(), dependencies); DalvInsnList instructions= code.getInsns(); for (int i= 0; i < instructions.size(); ++i) { processInstruction(instructions.get(i), methodDeps); } }
if (instructions.get(i) instanceof TargetInsn) TargetInsn targetInsn= (TargetInsn) instructions.get(i); targets.put(targetInsn.getTargetAddress(), new Target(targetInsn.getTargetAddress(), true)); else if (instructions.get(i) instanceof SwitchData) SwitchData switchData= (SwitchData) instructions.get(i); CodeAddress[] caseTargets= switchData.getTargets(); for (CodeAddress caseTarget : caseTargets)
DalvInsn insn = insns.get(i);
DalvInsn insn = insns.get(i);
DalvInsn insn = insns.get(i);
DalvInsn insn = insns.get(i);
DalvInsn insn = insns.get(i);
DalvInsn insn = insns.get(i);
DalvInsn insn = insns.get(i);
DalvInsn insn = insns.get(i);