/** * Constructs instance. * * @param ssaMeth {@code non-null;} method to process * @param interference non-null interference graph for SSA registers * @param minimizeRegisters true if converter should take steps to * minimize rop-form registers */ public FirstFitLocalCombiningAllocator( SsaMethod ssaMeth, InterferenceGraph interference, boolean minimizeRegisters) { super(ssaMeth, interference); ssaRegsMapped = new BitSet(ssaMeth.getRegCount()); mapper = new InterferenceRegisterMapper( interference, ssaMeth.getRegCount()); this.minimizeRegisters = minimizeRegisters; /* * Reserve space for the params at the bottom of the register * space. Later, we'll flip the params to the end of the register * space. */ paramRangeEnd = ssaMeth.getParamWidth(); reservedRopRegs = new BitSet(paramRangeEnd * 2); reservedRopRegs.set(0, paramRangeEnd); usedRopRegs = new BitSet(paramRangeEnd * 2); localVariables = new TreeMap<LocalItem, ArrayList<RegisterSpec>>(); moveResultPseudoInsns = new ArrayList<NormalSsaInsn>(); invokeRangeInsns = new ArrayList<NormalSsaInsn>(); phiInsns = new ArrayList<PhiInsn>(); }
/** * Constructs instance. * * @param ssaMeth {@code non-null;} method to process * @param interference non-null interference graph for SSA registers * @param minimizeRegisters true if converter should take steps to * minimize rop-form registers */ public FirstFitLocalCombiningAllocator( SsaMethod ssaMeth, InterferenceGraph interference, boolean minimizeRegisters) { super(ssaMeth, interference); ssaRegsMapped = new BitSet(ssaMeth.getRegCount()); mapper = new InterferenceRegisterMapper( interference, ssaMeth.getRegCount()); /* * Reserve space for the params at the bottom of the register * space. Later, we'll flip the params to the end of the register * space. */ paramRangeEnd = ssaMeth.getParamWidth(); reservedRopRegs = new BitSet(paramRangeEnd * 2); reservedRopRegs.set(0, paramRangeEnd); usedRopRegs = new BitSet(paramRangeEnd * 2); localVariables = new TreeMap<LocalItem, ArrayList<RegisterSpec>>(); moveResultPseudoInsns = new ArrayList<NormalSsaInsn>(); invokeRangeInsns = new ArrayList<NormalSsaInsn>(); phiInsns = new ArrayList<PhiInsn>(); }
/** * Constructs instance. * * @param ssaMeth {@code non-null;} method to process * @param interference non-null interference graph for SSA registers * @param minimizeRegisters true if converter should take steps to * minimize rop-form registers */ public FirstFitLocalCombiningAllocator( SsaMethod ssaMeth, InterferenceGraph interference, boolean minimizeRegisters) { super(ssaMeth, interference); ssaRegsMapped = new BitSet(ssaMeth.getRegCount()); mapper = new InterferenceRegisterMapper( interference, ssaMeth.getRegCount()); this.minimizeRegisters = minimizeRegisters; /* * Reserve space for the params at the bottom of the register * space. Later, we'll flip the params to the end of the register * space. */ paramRangeEnd = ssaMeth.getParamWidth(); reservedRopRegs = new BitSet(paramRangeEnd * 2); reservedRopRegs.set(0, paramRangeEnd); usedRopRegs = new BitSet(paramRangeEnd * 2); localVariables = new TreeMap<LocalItem, ArrayList<RegisterSpec>>(); moveResultPseudoInsns = new ArrayList<NormalSsaInsn>(); invokeRangeInsns = new ArrayList<NormalSsaInsn>(); phiInsns = new ArrayList<PhiInsn>(); }
/** * Constructs instance. * * @param ssaMeth {@code non-null;} method to process * @param interference non-null interference graph for SSA registers * @param minimizeRegisters true if converter should take steps to * minimize rop-form registers */ public FirstFitLocalCombiningAllocator( SsaMethod ssaMeth, InterferenceGraph interference, boolean minimizeRegisters) { super(ssaMeth, interference); ssaRegsMapped = new BitSet(ssaMeth.getRegCount()); mapper = new InterferenceRegisterMapper( interference, ssaMeth.getRegCount()); this.minimizeRegisters = minimizeRegisters; /* * Reserve space for the params at the bottom of the register * space. Later, we'll flip the params to the end of the register * space. */ paramRangeEnd = ssaMeth.getParamWidth(); reservedRopRegs = new BitSet(paramRangeEnd * 2); reservedRopRegs.set(0, paramRangeEnd); usedRopRegs = new BitSet(paramRangeEnd * 2); localVariables = new TreeMap<LocalItem, ArrayList<RegisterSpec>>(); moveResultPseudoInsns = new ArrayList<NormalSsaInsn>(); invokeRangeInsns = new ArrayList<NormalSsaInsn>(); phiInsns = new ArrayList<PhiInsn>(); }
/** * Constructs instance. * * @param ssaMeth {@code non-null;} method to process * @param interference non-null interference graph for SSA registers * @param minimizeRegisters true if converter should take steps to * minimize rop-form registers */ public FirstFitLocalCombiningAllocator( SsaMethod ssaMeth, InterferenceGraph interference, boolean minimizeRegisters) { super(ssaMeth, interference); ssaRegsMapped = new BitSet(ssaMeth.getRegCount()); mapper = new InterferenceRegisterMapper( interference, ssaMeth.getRegCount()); this.minimizeRegisters = minimizeRegisters; /* * Reserve space for the params at the bottom of the register * space. Later, we'll flip the params to the end of the register * space. */ paramRangeEnd = ssaMeth.getParamWidth(); reservedRopRegs = new BitSet(paramRangeEnd * 2); reservedRopRegs.set(0, paramRangeEnd); usedRopRegs = new BitSet(paramRangeEnd * 2); localVariables = new TreeMap<LocalItem, ArrayList<RegisterSpec>>(); moveResultPseudoInsns = new ArrayList<NormalSsaInsn>(); invokeRangeInsns = new ArrayList<NormalSsaInsn>(); phiInsns = new ArrayList<PhiInsn>(); }
/** * Constructs instance. * * @param ssaMeth {@code non-null;} method to process * @param interference non-null interference graph for SSA registers * @param minimizeRegisters true if converter should take steps to * minimize rop-form registers */ public FirstFitLocalCombiningAllocator( SsaMethod ssaMeth, InterferenceGraph interference, boolean minimizeRegisters) { super(ssaMeth, interference); ssaRegsMapped = new BitSet(ssaMeth.getRegCount()); mapper = new InterferenceRegisterMapper( interference, ssaMeth.getRegCount()); this.minimizeRegisters = minimizeRegisters; /* * Reserve space for the params at the bottom of the register * space. Later, we'll flip the params to the end of the register * space. */ paramRangeEnd = ssaMeth.getParamWidth(); reservedRopRegs = new BitSet(paramRangeEnd * 2); reservedRopRegs.set(0, paramRangeEnd); usedRopRegs = new BitSet(paramRangeEnd * 2); localVariables = new TreeMap<LocalItem, ArrayList<RegisterSpec>>(); moveResultPseudoInsns = new ArrayList<NormalSsaInsn>(); invokeRangeInsns = new ArrayList<NormalSsaInsn>(); phiInsns = new ArrayList<PhiInsn>(); }
/** * Constructs instance. * * @param ssaMeth {@code non-null;} method to process * @param interference non-null interference graph for SSA registers * @param minimizeRegisters true if converter should take steps to * minimize rop-form registers */ public FirstFitLocalCombiningAllocator( SsaMethod ssaMeth, InterferenceGraph interference, boolean minimizeRegisters) { super(ssaMeth, interference); ssaRegsMapped = new BitSet(ssaMeth.getRegCount()); mapper = new InterferenceRegisterMapper( interference, ssaMeth.getRegCount()); this.minimizeRegisters = minimizeRegisters; /* * Reserve space for the params at the bottom of the register * space. Later, we'll flip the params to the end of the register * space. */ paramRangeEnd = ssaMeth.getParamWidth(); reservedRopRegs = new BitSet(paramRangeEnd * 2); reservedRopRegs.set(0, paramRangeEnd); usedRopRegs = new BitSet(paramRangeEnd * 2); localVariables = new TreeMap<LocalItem, ArrayList<RegisterSpec>>(); moveResultPseudoInsns = new ArrayList<NormalSsaInsn>(); invokeRangeInsns = new ArrayList<NormalSsaInsn>(); phiInsns = new ArrayList<PhiInsn>(); }
/** * Constructs instance. * * @param ssaMeth {@code non-null;} method to process * @param interference non-null interference graph for SSA registers * @param minimizeRegisters true if converter should take steps to * minimize rop-form registers */ public FirstFitLocalCombiningAllocator( SsaMethod ssaMeth, InterferenceGraph interference, boolean minimizeRegisters) { super(ssaMeth, interference); ssaRegsMapped = new BitSet(ssaMeth.getRegCount()); mapper = new InterferenceRegisterMapper( interference, ssaMeth.getRegCount()); this.minimizeRegisters = minimizeRegisters; /* * Reserve space for the params at the bottom of the register * space. Later, we'll flip the params to the end of the register * space. */ paramRangeEnd = ssaMeth.getParamWidth(); reservedRopRegs = new BitSet(paramRangeEnd * 2); reservedRopRegs.set(0, paramRangeEnd); usedRopRegs = new BitSet(paramRangeEnd * 2); localVariables = new TreeMap<LocalItem, ArrayList<RegisterSpec>>(); moveResultPseudoInsns = new ArrayList<NormalSsaInsn>(); invokeRangeInsns = new ArrayList<NormalSsaInsn>(); }
/** * Moves the parameter registers, which allocateRegisters() places * at the bottom of the frame, up to the top of the frame to match * Dalvik calling convention. */ private void moveParametersToHighRegisters() { int paramWidth = ssaMeth.getParamWidth(); BasicRegisterMapper mapper = new BasicRegisterMapper(ssaMeth.getRegCount()); int regCount = ssaMeth.getRegCount(); for (int i = 0; i < regCount; i++) { if (i < paramWidth) { mapper.addMapping(i, regCount - paramWidth + i, 1); } else { mapper.addMapping(i, i - paramWidth, 1); } } if (DEBUG) { System.out.printf("Moving %d registers from 0 to %d\n", paramWidth, regCount - paramWidth); } ssaMeth.mapRegisters(mapper); }
/** * Moves the parameter registers, which allocateRegisters() places * at the bottom of the frame, up to the top of the frame to match * Dalvik calling convention. */ private void moveParametersToHighRegisters() { int paramWidth = ssaMeth.getParamWidth(); BasicRegisterMapper mapper = new BasicRegisterMapper(ssaMeth.getRegCount()); int regCount = ssaMeth.getRegCount(); for (int i = 0; i < regCount; i++) { if (i < paramWidth) { mapper.addMapping(i, regCount - paramWidth + i, 1); } else { mapper.addMapping(i, i - paramWidth, 1); } } if (DEBUG) { System.out.printf("Moving %d registers from 0 to %d\n", paramWidth, regCount - paramWidth); } ssaMeth.mapRegisters(mapper); }
/** * Moves the parameter registers, which allocateRegisters() places * at the bottom of the frame, up to the top of the frame to match * Dalvik calling convention. */ private void moveParametersToHighRegisters() { int paramWidth = ssaMeth.getParamWidth(); BasicRegisterMapper mapper = new BasicRegisterMapper(ssaMeth.getRegCount()); int regCount = ssaMeth.getRegCount(); for (int i = 0; i < regCount; i++) { if (i < paramWidth) { mapper.addMapping(i, regCount - paramWidth + i, 1); } else { mapper.addMapping(i, i - paramWidth, 1); } } if (DEBUG) { System.out.printf("Moving %d registers from 0 to %d\n", paramWidth, regCount - paramWidth); } ssaMeth.mapRegisters(mapper); }
/** * Moves the parameter registers, which allocateRegisters() places * at the bottom of the frame, up to the top of the frame to match * Dalvik calling convention. */ private void moveParametersToHighRegisters() { int paramWidth = ssaMeth.getParamWidth(); BasicRegisterMapper mapper = new BasicRegisterMapper(ssaMeth.getRegCount()); int regCount = ssaMeth.getRegCount(); for (int i = 0; i < regCount; i++) { if (i < paramWidth) { mapper.addMapping(i, regCount - paramWidth + i, 1); } else { mapper.addMapping(i, i - paramWidth, 1); } } if (DEBUG) { System.out.printf("Moving %d registers from 0 to %d\n", paramWidth, regCount - paramWidth); } ssaMeth.mapRegisters(mapper); }
/** * Moves the parameter registers, which allocateRegisters() places * at the bottom of the frame, up to the top of the frame to match * Dalvik calling convention. */ private void moveParametersToHighRegisters() { int paramWidth = ssaMeth.getParamWidth(); BasicRegisterMapper mapper = new BasicRegisterMapper(ssaMeth.getRegCount()); int regCount = ssaMeth.getRegCount(); for (int i = 0; i < regCount; i++) { if (i < paramWidth) { mapper.addMapping(i, regCount - paramWidth + i, 1); } else { mapper.addMapping(i, i - paramWidth, 1); } } if (DEBUG) { System.out.printf("Moving %d registers from 0 to %d\n", paramWidth, regCount - paramWidth); } ssaMeth.mapRegisters(mapper); }
/** * Moves the parameter registers, which allocateRegisters() places * at the bottom of the frame, up to the top of the frame to match * Dalvik calling convention. */ private void moveParametersToHighRegisters() { int paramWidth = ssaMeth.getParamWidth(); BasicRegisterMapper mapper = new BasicRegisterMapper(ssaMeth.getRegCount()); int regCount = ssaMeth.getRegCount(); for (int i = 0; i < regCount; i++) { if (i < paramWidth) { mapper.addMapping(i, regCount - paramWidth + i, 1); } else { mapper.addMapping(i, i - paramWidth, 1); } } if (DEBUG) { System.out.printf("Moving %d registers from 0 to %d\n", paramWidth, regCount - paramWidth); } ssaMeth.mapRegisters(mapper); }
/** * Moves the parameter registers, which allocateRegisters() places * at the bottom of the frame, up to the top of the frame to match * Dalvik calling convention. */ private void moveParametersToHighRegisters() { int paramWidth = ssaMeth.getParamWidth(); BasicRegisterMapper mapper = new BasicRegisterMapper(ssaMeth.getRegCount()); int regCount = ssaMeth.getRegCount(); for (int i = 0; i < regCount; i++) { if (i < paramWidth) { mapper.addMapping(i, regCount - paramWidth + i, 1); } else { mapper.addMapping(i, i - paramWidth, 1); } } if (DEBUG) { System.out.printf("Moving %d registers from 0 to %d\n", paramWidth, regCount - paramWidth); } ssaMeth.mapRegisters(mapper); }
/** * Moves the parameter registers, which allocateRegisters() places * at the bottom of the frame, up to the top of the frame to match * Dalvik calling convention. */ private void moveParametersToHighRegisters() { int paramWidth = ssaMeth.getParamWidth(); BasicRegisterMapper mapper = new BasicRegisterMapper(ssaMeth.getRegCount()); int regCount = ssaMeth.getRegCount(); for (int i = 0; i < regCount; i++) { if (i < paramWidth) { mapper.addMapping(i, regCount - paramWidth + i, 1); } else { mapper.addMapping(i, i - paramWidth, 1); } } if (DEBUG) { System.out.printf("Moving %d registers from 0 to %d\n", paramWidth, regCount - paramWidth); } ssaMeth.mapRegisters(mapper); }
nextNewRegister = ssaMeth.getParamWidth();
nextNewRegister = ssaMeth.getParamWidth();
nextNewRegister = ssaMeth.getParamWidth();
nextNewRegister = ssaMeth.getParamWidth();