/** * Constructs an instance. * * @param ssaMethod {@code non-null;} method to process * @param minimizeRegisters {@code true} if the converter should * attempt to minimize the rop-form register count */ private SsaToRop(SsaMethod ssaMethod, boolean minimizeRegisters) { this.minimizeRegisters = minimizeRegisters; this.ssaMeth = ssaMethod; this.interference = LivenessAnalyzer.constructInterferenceGraph(ssaMethod); }
/** * The algorithm in Appel is presented in partial tail-recursion * form. Obviously, that's not efficient in java, so this function * serves as the dispatcher instead. */ private void handleTailRecursion() { while (nextFunction != NextFunction.DONE) { switch (nextFunction) { case LIVE_IN_AT_STATEMENT: nextFunction = NextFunction.DONE; liveInAtStatement(); break; case LIVE_OUT_AT_STATEMENT: nextFunction = NextFunction.DONE; liveOutAtStatement(); break; case LIVE_OUT_AT_BLOCK: nextFunction = NextFunction.DONE; liveOutAtBlock(); break; default: } } }
/** * Runs register liveness algorithm for a method, updating the * live in/out information in {@code SsaBasicBlock} instances and * returning an interference graph. * * @param ssaMeth {@code non-null;} method to process * @return {@code non-null;} interference graph indexed by SSA * registers in both directions */ public static InterferenceGraph constructInterferenceGraph( SsaMethod ssaMeth) { int szRegs = ssaMeth.getRegCount(); InterferenceGraph interference = new InterferenceGraph(szRegs); for (int i = 0; i < szRegs; i++) { new LivenessAnalyzer(ssaMeth, i, interference).run(); } coInterferePhis(ssaMeth, interference); return interference; }
handleTailRecursion(); handleTailRecursion(); liveOutBlocks.clear(nextLiveOutBlock); nextFunction = NextFunction.LIVE_OUT_AT_BLOCK; handleTailRecursion();
/** * Runs register liveness algorithm for a method, updating the * live in/out information in {@code SsaBasicBlock} instances and * returning an interference graph. * * @param ssaMeth {@code non-null;} method to process * @return {@code non-null;} interference graph indexed by SSA * registers in both directions */ public static InterferenceGraph constructInterferenceGraph( SsaMethod ssaMeth) { int szRegs = ssaMeth.getRegCount(); InterferenceGraph interference = new InterferenceGraph(szRegs); for (int i = 0; i < szRegs; i++) { new LivenessAnalyzer(ssaMeth, i, interference).run(); } coInterferePhis(ssaMeth, interference); return interference; }
handleTailRecursion(); handleTailRecursion(); liveOutBlocks.clear(nextLiveOutBlock); nextFunction = NextFunction.LIVE_OUT_AT_BLOCK; handleTailRecursion();
/** * Runs register liveness algorithm for a method, updating the * live in/out information in {@code SsaBasicBlock} instances and * returning an interference graph. * * @param ssaMeth {@code non-null;} method to process * @return {@code non-null;} interference graph indexed by SSA * registers in both directions */ public static InterferenceGraph constructInterferenceGraph( SsaMethod ssaMeth) { int szRegs = ssaMeth.getRegCount(); InterferenceGraph interference = new InterferenceGraph(szRegs); for (int i = 0; i < szRegs; i++) { new LivenessAnalyzer(ssaMeth, i, interference).run(); } coInterferePhis(ssaMeth, interference); return interference; }
/** * The algorithm in Appel is presented in partial tail-recursion * form. Obviously, that's not efficient in java, so this function * serves as the dispatcher instead. */ private void handleTailRecursion() { while (nextFunction != NextFunction.DONE) { switch (nextFunction) { case LIVE_IN_AT_STATEMENT: nextFunction = NextFunction.DONE; liveInAtStatement(); break; case LIVE_OUT_AT_STATEMENT: nextFunction = NextFunction.DONE; liveOutAtStatement(); break; case LIVE_OUT_AT_BLOCK: nextFunction = NextFunction.DONE; liveOutAtBlock(); break; default: } } }
/** * Constructs an instance. * * @param ssaMeth {@code non-null;} method to process * @param minimizeRegisters {@code true} if the converter should * attempt to minimize the rop-form register count */ private SsaToRop(SsaMethod ssaMethod, boolean minimizeRegisters) { this.minimizeRegisters = minimizeRegisters; this.ssaMeth = ssaMethod; this.interference = LivenessAnalyzer.constructInterferenceGraph(ssaMethod); }
handleTailRecursion(); handleTailRecursion(); liveOutBlocks.clear(nextLiveOutBlock); nextFunction = NextFunction.LIVE_OUT_AT_BLOCK; handleTailRecursion();
/** * Runs register liveness algorithm for a method, updating the * live in/out information in {@code SsaBasicBlock} instances and * returning an interference graph. * * @param ssaMeth {@code non-null;} method to process * @return {@code non-null;} interference graph indexed by SSA * registers in both directions */ public static InterferenceGraph constructInterferenceGraph( SsaMethod ssaMeth) { int szRegs = ssaMeth.getRegCount(); InterferenceGraph interference = new InterferenceGraph(szRegs); for (int i = 0; i < szRegs; i++) { new LivenessAnalyzer(ssaMeth, i, interference).run(); } coInterferePhis(ssaMeth, interference); return interference; }
/** * The algorithm in Appel is presented in partial tail-recursion * form. Obviously, that's not efficient in java, so this function * serves as the dispatcher instead. */ private void handleTailRecursion() { while (nextFunction != NextFunction.DONE) { switch (nextFunction) { case LIVE_IN_AT_STATEMENT: nextFunction = NextFunction.DONE; liveInAtStatement(); break; case LIVE_OUT_AT_STATEMENT: nextFunction = NextFunction.DONE; liveOutAtStatement(); break; case LIVE_OUT_AT_BLOCK: nextFunction = NextFunction.DONE; liveOutAtBlock(); break; default: } } }
/** * Constructs an instance. * * @param ssaMeth {@code non-null;} method to process * @param minimizeRegisters {@code true} if the converter should * attempt to minimize the rop-form register count */ private SsaToRop(SsaMethod ssaMethod, boolean minimizeRegisters) { this.minimizeRegisters = minimizeRegisters; this.ssaMeth = ssaMethod; this.interference = LivenessAnalyzer.constructInterferenceGraph(ssaMethod); }
handleTailRecursion(); handleTailRecursion(); liveOutBlocks.clear(nextLiveOutBlock); nextFunction = NextFunction.LIVE_OUT_AT_BLOCK; handleTailRecursion();
/** * Runs register liveness algorithm for a method, updating the * live in/out information in {@code SsaBasicBlock} instances and * returning an interference graph. * * @param ssaMeth {@code non-null;} method to process * @return {@code non-null;} interference graph indexed by SSA * registers in both directions */ public static InterferenceGraph constructInterferenceGraph( SsaMethod ssaMeth) { int szRegs = ssaMeth.getRegCount(); InterferenceGraph interference = new InterferenceGraph(szRegs); for (int i = 0; i < szRegs; i++) { new LivenessAnalyzer(ssaMeth, i, interference).run(); } coInterferePhis(ssaMeth, interference); return interference; }
/** * The algorithm in Appel is presented in partial tail-recursion * form. Obviously, that's not efficient in java, so this function * serves as the dispatcher instead. */ private void handleTailRecursion() { while (nextFunction != NextFunction.DONE) { switch (nextFunction) { case LIVE_IN_AT_STATEMENT: nextFunction = NextFunction.DONE; liveInAtStatement(); break; case LIVE_OUT_AT_STATEMENT: nextFunction = NextFunction.DONE; liveOutAtStatement(); break; case LIVE_OUT_AT_BLOCK: nextFunction = NextFunction.DONE; liveOutAtBlock(); break; default: } } }
/** * Constructs an instance. * * @param ssaMeth {@code non-null;} method to process * @param minimizeRegisters {@code true} if the converter should * attempt to minimize the rop-form register count */ private SsaToRop(SsaMethod ssaMethod, boolean minimizeRegisters) { this.minimizeRegisters = minimizeRegisters; this.ssaMeth = ssaMethod; this.interference = LivenessAnalyzer.constructInterferenceGraph(ssaMethod); }
handleTailRecursion(); handleTailRecursion(); liveOutBlocks.clear(nextLiveOutBlock); nextFunction = NextFunction.LIVE_OUT_AT_BLOCK; handleTailRecursion();
/** * Runs register liveness algorithm for a method, updating the * live in/out information in {@code SsaBasicBlock} instances and * returning an interference graph. * * @param ssaMeth {@code non-null;} method to process * @return {@code non-null;} interference graph indexed by SSA * registers in both directions */ public static InterferenceGraph constructInterferenceGraph( SsaMethod ssaMeth) { int szRegs = ssaMeth.getRegCount(); InterferenceGraph interference = new InterferenceGraph(szRegs); for (int i = 0; i < szRegs; i++) { new LivenessAnalyzer(ssaMeth, i, interference).run(); } coInterferePhis(ssaMeth, interference); return interference; }
/** * The algorithm in Appel is presented in partial tail-recursion * form. Obviously, that's not efficient in java, so this function * serves as the dispatcher instead. */ private void handleTailRecursion() { while (nextFunction != NextFunction.DONE) { switch (nextFunction) { case LIVE_IN_AT_STATEMENT: nextFunction = NextFunction.DONE; liveInAtStatement(); break; case LIVE_OUT_AT_STATEMENT: nextFunction = NextFunction.DONE; liveOutAtStatement(); break; case LIVE_OUT_AT_BLOCK: nextFunction = NextFunction.DONE; liveOutAtBlock(); break; default: } } }