use of com.github.anba.es6draft.compiler.assembler.MethodTypeDescriptor in project es6draft by anba.
the class ExpressionGenerator method invokeDynamicNativeCall.
private static ValType invokeDynamicNativeCall(String name, Type[] arguments, CodeVisitor mv) {
// stack: [cx, ...args] -> [result]
MethodTypeDescriptor desc = Type.methodType(Types.Object, arguments);
mv.invokedynamic(NativeCalls.getNativeCallName(name), desc, NativeCalls.getNativeCallBootstrap());
return ValType.of(desc.returnType());
}
use of com.github.anba.es6draft.compiler.assembler.MethodTypeDescriptor in project es6draft by anba.
the class ExpressionGenerator method doExpression.
private OutlinedCall doExpression(DoExpression node, CodeVisitor mv) {
if (!codegen.isEnabled(Compiler.Option.NoCompletion)) {
CompletionValueVisitor.performCompletion(node);
}
MethodTypeDescriptor methodDescriptor = DoExpressionCodeVisitor.methodDescriptor(mv);
MethodCode method = codegen.method(mv, "doexpr", methodDescriptor);
return outlined(new DoExpressionCodeVisitor(node, method, mv), body -> {
return statement(node.getStatement(), body);
});
}
use of com.github.anba.es6draft.compiler.assembler.MethodTypeDescriptor in project es6draft by anba.
the class ExpressionGenerator method spreadElement.
private OutlinedCall spreadElement(SpreadElementMethod node, CodeVisitor mv) {
MethodTypeDescriptor methodDescriptor = SpreadElementCodeVisitor.methodDescriptor(mv);
MethodCode method = codegen.method(mv, "spread", methodDescriptor);
return outlined(new SpreadElementCodeVisitor(node, method, mv), body -> {
Variable<ArrayObject> array = body.getArrayParameter();
Variable<Integer> index = body.getIndexParameter();
MutableValue<Integer> nextIndex = body.iarrayElement(body.getNextIndexParameter(), 0);
spreadArray(node.getElements(), array, index, body);
body.store(nextIndex, index);
return Completion.Normal;
});
}
Aggregations