/** * Collects information about a pass P after P finishes running, eg, how much * time P took and what was its impact on code size. * * @param passName short name of the pass * @param runtime execution time in milliseconds */ void recordPassStop(String passName, long runtime) { int allocMem = getAllocatedMegabytes(); Stats logStats = this.currentPass.pop(); checkState(passName.equals(logStats.pass)); this.log.add(logStats); // Update fields that aren't related to code size logStats.runtime = runtime; logStats.allocMem = allocMem; logStats.runs = 1; if (this.codeChange.hasCodeChanged()) { logStats.changes = 1; } if (passName.equals(PassNames.PARSE_INPUTS)) { recordParsingStop(logStats); } else if (this.codeChange.hasCodeChanged() && tracksAstSize()) { recordOtherPassStop(logStats); } }
/** * Returns a new tracer for the given pass name. */ Tracer newTracer(String passName) { String comment = passName + (recentChange.hasCodeChanged() ? " on recently changed AST" : ""); if (options.tracer.isOn()) { tracker.recordPassStart(passName, true); } return new Tracer("Compiler", comment); }
/** * Returns a new tracer for the given pass name. */ Tracer newTracer(String passName) { String comment = passName + (recentChange.hasCodeChanged() ? " on recently changed AST" : ""); if (options.getTracerMode().isOn() && tracker != null) { tracker.recordPassStart(passName, true); } return new Tracer("Compiler", comment); }
summaryStats.runtime += runtime; summaryStats.runs += 1; if (codeChange.hasCodeChanged()) { logStats.changes = 1; summaryStats.changes += 1; if (codeChange.hasCodeChanged() && trackSize) { int newSize = 0; CodeSizeEstimatePrinter estimatePrinter = new CodeSizeEstimatePrinter();
@Override public void enterFunction(AbstractCompiler compiler, Node root) { if (root.isFunction()) { root = root.getLastChild(); } do { handler.reset(); NodeTraversal.traverseEs6(compiler, root, new PeepCallback()); } while (retraverseOnChange && handler.hasCodeChanged()); } });