Java Code Examples for com.android.dx.ssa.SsaInsn#getResult()
The following examples show how to use
com.android.dx.ssa.SsaInsn#getResult() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LivenessAnalyzer.java From Box with Apache License 2.0 | 5 votes |
/** * "v is live-out at s." */ private void liveOutAtStatement() { SsaInsn statement = blockN.getInsns().get(statementIndex); RegisterSpec rs = statement.getResult(); if (!statement.isResultReg(regV)) { if (rs != null) { interference.add(regV, rs.getReg()); } nextFunction = NextFunction.LIVE_IN_AT_STATEMENT; } }
Example 2
Source File: LivenessAnalyzer.java From Box with Apache License 2.0 | 5 votes |
/** * "v is live-out at s." */ private void liveOutAtStatement() { SsaInsn statement = blockN.getInsns().get(statementIndex); RegisterSpec rs = statement.getResult(); if (!statement.isResultReg(regV)) { if (rs != null) { interference.add(regV, rs.getReg()); } nextFunction = NextFunction.LIVE_IN_AT_STATEMENT; } }
Example 3
Source File: LivenessAnalyzer.java From J2ME-Loader with Apache License 2.0 | 5 votes |
/** * "v is live-out at s." */ private void liveOutAtStatement() { SsaInsn statement = blockN.getInsns().get(statementIndex); RegisterSpec rs = statement.getResult(); if (!statement.isResultReg(regV)) { if (rs != null) { interference.add(regV, rs.getReg()); } nextFunction = NextFunction.LIVE_IN_AT_STATEMENT; } }
Example 4
Source File: LivenessAnalyzer.java From buck with Apache License 2.0 | 5 votes |
/** * "v is live-out at s." */ private void liveOutAtStatement() { SsaInsn statement = blockN.getInsns().get(statementIndex); RegisterSpec rs = statement.getResult(); if (!statement.isResultReg(regV)) { if (rs != null) { interference.add(regV, rs.getReg()); } nextFunction = NextFunction.LIVE_IN_AT_STATEMENT; } }
Example 5
Source File: FirstFitLocalCombiningAllocator.java From Box with Apache License 2.0 | 4 votes |
/** * Attempts to map the sources and result of a phi to a common register. * Will try existing mappings first, from most to least common. If none * of the registers have mappings yet, a new mapping is created. */ private void processPhiInsn(PhiInsn insn) { RegisterSpec result = insn.getResult(); int resultReg = result.getReg(); int category = result.getCategory(); RegisterSpecList sources = insn.getSources(); int sourcesSize = sources.size(); // List of phi sources / result that need mapping ArrayList<RegisterSpec> ssaRegs = new ArrayList<RegisterSpec>(); // Track how many times a particular mapping is found Multiset mapSet = new Multiset(sourcesSize + 1); /* * If the result of the phi has an existing mapping, get it. * Otherwise, add it to the list of regs that need mapping. */ if (ssaRegsMapped.get(resultReg)) { mapSet.add(mapper.oldToNew(resultReg)); } else { ssaRegs.add(result); } for (int i = 0; i < sourcesSize; i++) { RegisterSpec source = sources.get(i); SsaInsn def = ssaMeth.getDefinitionForRegister(source.getReg()); RegisterSpec sourceDef = def.getResult(); int sourceReg = sourceDef.getReg(); /* * If a source of the phi has an existing mapping, get it. * Otherwise, add it to the list of regs that need mapping. */ if (ssaRegsMapped.get(sourceReg)) { mapSet.add(mapper.oldToNew(sourceReg)); } else { ssaRegs.add(sourceDef); } } // Try all existing mappings, with the most common ones first for (int i = 0; i < mapSet.getSize(); i++) { int maxReg = mapSet.getAndRemoveHighestCount(); tryMapRegs(ssaRegs, maxReg, category, false); } // Map any remaining unmapped regs with whatever fits int mapReg = findNextUnreservedRopReg(paramRangeEnd, category); while (!tryMapRegs(ssaRegs, mapReg, category, false)) { mapReg = findNextUnreservedRopReg(mapReg + 1, category); } }
Example 6
Source File: FirstFitLocalCombiningAllocator.java From Box with Apache License 2.0 | 4 votes |
/** * Attempts to map the sources and result of a phi to a common register. * Will try existing mappings first, from most to least common. If none * of the registers have mappings yet, a new mapping is created. */ private void processPhiInsn(PhiInsn insn) { RegisterSpec result = insn.getResult(); int resultReg = result.getReg(); int category = result.getCategory(); RegisterSpecList sources = insn.getSources(); int sourcesSize = sources.size(); // List of phi sources / result that need mapping ArrayList<RegisterSpec> ssaRegs = new ArrayList<RegisterSpec>(); // Track how many times a particular mapping is found Multiset mapSet = new Multiset(sourcesSize + 1); /* * If the result of the phi has an existing mapping, get it. * Otherwise, add it to the list of regs that need mapping. */ if (ssaRegsMapped.get(resultReg)) { mapSet.add(mapper.oldToNew(resultReg)); } else { ssaRegs.add(result); } for (int i = 0; i < sourcesSize; i++) { RegisterSpec source = sources.get(i); SsaInsn def = ssaMeth.getDefinitionForRegister(source.getReg()); RegisterSpec sourceDef = def.getResult(); int sourceReg = sourceDef.getReg(); /* * If a source of the phi has an existing mapping, get it. * Otherwise, add it to the list of regs that need mapping. */ if (ssaRegsMapped.get(sourceReg)) { mapSet.add(mapper.oldToNew(sourceReg)); } else { ssaRegs.add(sourceDef); } } // Try all existing mappings, with the most common ones first for (int i = 0; i < mapSet.getSize(); i++) { int maxReg = mapSet.getAndRemoveHighestCount(); tryMapRegs(ssaRegs, maxReg, category, false); } // Map any remaining unmapped regs with whatever fits int mapReg = findNextUnreservedRopReg(paramRangeEnd, category); while (!tryMapRegs(ssaRegs, mapReg, category, false)) { mapReg = findNextUnreservedRopReg(mapReg + 1, category); } }
Example 7
Source File: FirstFitLocalCombiningAllocator.java From J2ME-Loader with Apache License 2.0 | 4 votes |
/** * Attempts to map the sources and result of a phi to a common register. * Will try existing mappings first, from most to least common. If none * of the registers have mappings yet, a new mapping is created. */ private void processPhiInsn(PhiInsn insn) { RegisterSpec result = insn.getResult(); int resultReg = result.getReg(); int category = result.getCategory(); RegisterSpecList sources = insn.getSources(); int sourcesSize = sources.size(); // List of phi sources / result that need mapping ArrayList<RegisterSpec> ssaRegs = new ArrayList<RegisterSpec>(); // Track how many times a particular mapping is found Multiset mapSet = new Multiset(sourcesSize + 1); /* * If the result of the phi has an existing mapping, get it. * Otherwise, add it to the list of regs that need mapping. */ if (ssaRegsMapped.get(resultReg)) { mapSet.add(mapper.oldToNew(resultReg)); } else { ssaRegs.add(result); } for (int i = 0; i < sourcesSize; i++) { RegisterSpec source = sources.get(i); SsaInsn def = ssaMeth.getDefinitionForRegister(source.getReg()); RegisterSpec sourceDef = def.getResult(); int sourceReg = sourceDef.getReg(); /* * If a source of the phi has an existing mapping, get it. * Otherwise, add it to the list of regs that need mapping. */ if (ssaRegsMapped.get(sourceReg)) { mapSet.add(mapper.oldToNew(sourceReg)); } else { ssaRegs.add(sourceDef); } } // Try all existing mappings, with the most common ones first for (int i = 0; i < mapSet.getSize(); i++) { int maxReg = mapSet.getAndRemoveHighestCount(); tryMapRegs(ssaRegs, maxReg, category, false); } // Map any remaining unmapped regs with whatever fits int mapReg = findNextUnreservedRopReg(paramRangeEnd, category); while (!tryMapRegs(ssaRegs, mapReg, category, false)) { mapReg = findNextUnreservedRopReg(mapReg + 1, category); } }
Example 8
Source File: FirstFitLocalCombiningAllocator.java From buck with Apache License 2.0 | 4 votes |
/** * Attempts to map the sources and result of a phi to a common register. * Will try existing mappings first, from most to least common. If none * of the registers have mappings yet, a new mapping is created. */ private void processPhiInsn(PhiInsn insn) { RegisterSpec result = insn.getResult(); int resultReg = result.getReg(); int category = result.getCategory(); RegisterSpecList sources = insn.getSources(); int sourcesSize = sources.size(); // List of phi sources / result that need mapping ArrayList<RegisterSpec> ssaRegs = new ArrayList<RegisterSpec>(); // Track how many times a particular mapping is found Multiset mapSet = new Multiset(sourcesSize + 1); /* * If the result of the phi has an existing mapping, get it. * Otherwise, add it to the list of regs that need mapping. */ if (ssaRegsMapped.get(resultReg)) { mapSet.add(mapper.oldToNew(resultReg)); } else { ssaRegs.add(result); } for (int i = 0; i < sourcesSize; i++) { RegisterSpec source = sources.get(i); SsaInsn def = ssaMeth.getDefinitionForRegister(source.getReg()); RegisterSpec sourceDef = def.getResult(); int sourceReg = sourceDef.getReg(); /* * If a source of the phi has an existing mapping, get it. * Otherwise, add it to the list of regs that need mapping. */ if (ssaRegsMapped.get(sourceReg)) { mapSet.add(mapper.oldToNew(sourceReg)); } else { ssaRegs.add(sourceDef); } } // Try all existing mappings, with the most common ones first for (int i = 0; i < mapSet.getSize(); i++) { int maxReg = mapSet.getAndRemoveHighestCount(); tryMapRegs(ssaRegs, maxReg, category, false); } // Map any remaining unmapped regs with whatever fits int mapReg = findNextUnreservedRopReg(paramRangeEnd, category); while (!tryMapRegs(ssaRegs, mapReg, category, false)) { mapReg = findNextUnreservedRopReg(mapReg + 1, category); } }
Example 9
Source File: RegisterAllocator.java From Box with Apache License 2.0 | 2 votes |
/** * Returns the RegisterSpec of the definition of the register. * * @param reg {@code >= 0;} SSA register * @return definition spec of the register or null if it is never defined * (for the case of "version 0" SSA registers) */ protected final RegisterSpec getDefinitionSpecForSsaReg(int reg) { SsaInsn definition = ssaMeth.getDefinitionForRegister(reg); return definition == null ? null : definition.getResult(); }
Example 10
Source File: RegisterAllocator.java From Box with Apache License 2.0 | 2 votes |
/** * Returns the RegisterSpec of the definition of the register. * * @param reg {@code >= 0;} SSA register * @return definition spec of the register or null if it is never defined * (for the case of "version 0" SSA registers) */ protected final RegisterSpec getDefinitionSpecForSsaReg(int reg) { SsaInsn definition = ssaMeth.getDefinitionForRegister(reg); return definition == null ? null : definition.getResult(); }
Example 11
Source File: RegisterAllocator.java From J2ME-Loader with Apache License 2.0 | 2 votes |
/** * Returns the RegisterSpec of the definition of the register. * * @param reg {@code >= 0;} SSA register * @return definition spec of the register or null if it is never defined * (for the case of "version 0" SSA registers) */ protected final RegisterSpec getDefinitionSpecForSsaReg(int reg) { SsaInsn definition = ssaMeth.getDefinitionForRegister(reg); return definition == null ? null : definition.getResult(); }
Example 12
Source File: RegisterAllocator.java From buck with Apache License 2.0 | 2 votes |
/** * Returns the RegisterSpec of the definition of the register. * * @param reg {@code >= 0;} SSA register * @return definition spec of the register or null if it is never defined * (for the case of "version 0" SSA registers) */ protected final RegisterSpec getDefinitionSpecForSsaReg(int reg) { SsaInsn definition = ssaMeth.getDefinitionForRegister(reg); return definition == null ? null : definition.getResult(); }