use of com.github.anba.es6draft.ast.LegacyGeneratorDeclaration in project es6draft by anba.
the class DeclarationBindingInstantiationGenerator method InstantiateGeneratorObject.
/**
* Emit function call for:
* {@link ScriptRuntime#InstantiateGeneratorObject(LexicalEnvironment, ExecutionContext, RuntimeInfo.Function)}
* <p>
* stack: [] {@literal ->} [fo]
*
* @param context
* the variable which holds the execution context
* @param env
* the variable which holds the lexical environment
* @param f
* the generator declaration to instantiate
* @param mv
* the instruction visitor
*/
private void InstantiateGeneratorObject(Variable<ExecutionContext> context, Variable<? extends LexicalEnvironment<?>> env, GeneratorDeclaration f, InstructionVisitor mv) {
MethodName method = codegen.compile(f);
mv.load(env);
mv.load(context);
mv.invoke(method);
if (f instanceof LegacyGeneratorDeclaration) {
mv.invoke(Methods.ScriptRuntime_InstantiateLegacyGeneratorObject);
} else if (f.isConstructor()) {
mv.invoke(Methods.ScriptRuntime_InstantiateConstructorGeneratorObject);
} else {
mv.invoke(Methods.ScriptRuntime_InstantiateGeneratorObject);
}
}
Aggregations