use of com.googlecode.aviator.code.interpreter.IR in project aviatorscript by killme2008.
the class InterpretExpression method traceInstruments.
private void traceInstruments(final Map<String, Object> env, final String name, final boolean traceLambda) {
int pc = 0;
RuntimeUtils.printlnTrace(env, (name == null ? this.sourceFile : name) + " instruments: ");
for (IR ir : this.instruments) {
RuntimeUtils.printlnTrace(env, " " + (pc++) + " " + ir.toString());
}
RuntimeUtils.printlnTrace(env, " " + pc + " return");
if (this.lambdaBootstraps != null) {
final List<LambdaFunctionBootstrap> bootstraps = new ArrayList<>(this.lambdaBootstraps.values());
Collections.sort(bootstraps);
for (LambdaFunctionBootstrap bootstrap : bootstraps) {
final Expression exp = bootstrap.getExpression();
if (exp instanceof InterpretExpression) {
InterpretExpression iexp = (InterpretExpression) exp;
iexp.traceInstruments(env, bootstrap.getName(), traceLambda);
} else {
RuntimeUtils.printlnTrace(env, bootstrap.getName() + " instruments: " + exp);
}
}
}
}
Aggregations