use of com.github.anba.es6draft.compiler.analyzer.CodeSizeException in project es6draft by anba.
the class Compiler method compile.
private CompiledFunction compile(FunctionNode function, String className) {
Script script = functionScript(function);
if (!isEnabled(Compiler.Option.NoByteCodeSizeValidation)) {
try {
CodeSize.analyze(function);
} catch (CodeSizeException e) {
throw new CompilationException(e.getMessage());
}
}
Code code = new Code(Modifier.PUBLIC | Modifier.FINAL, className, ClassSignature.NONE, Types.CompiledFunction, Collections.<Type>emptyList(), NodeSourceInfo.create(function, compilerOptions));
CodeGenerator codegen = new CodeGenerator(code, script, executor, compilerOptions);
codegen.compileFunction(function);
return defineAndLoad(code, className);
}
Aggregations