/** * Prints the memory usage of a control flow graph * @param graph The graph */ public static void printMemoryUsage(ControlFlowGraph graph) { MemoryUsage visitor = new MemoryUsage(); graph.accept(visitor); System.out.println("#Instructions: " + visitor.curLine); System.out.println("#Multivectors: " + visitor.liveStatistics.size()); long sum = 0; for (LiveStatistics live : visitor.liveStatistics.values()) { sum += live.getSize(); } System.out.println("Sum of multivectors sizes (liveness start until end): " + sum); System.out.println("Maximum of used space: " + visitor.maximumUsedSpace()); }