Search in sources :

Example 6 with OutlinedCall

use of com.github.anba.es6draft.compiler.CodeVisitor.OutlinedCall in project es6draft by anba.

the class PropertyGenerator method visit.

@Override
public ValType visit(PropertyDefinitionsMethod node, CodeVisitor mv) {
    // Sync array indices on recompilation.
    if (mv.isCompiled(node)) {
        if (decorators.array != null) {
            DecoratedMethods(node.getProperties(), method -> decorators.skip(method.getDecorators().size()));
        }
    }
    // stack: [<object>] -> []
    mv.enterVariableScope();
    Variable<OrdinaryObject> object = mv.newVariable("object", OrdinaryObject.class);
    mv.store(object);
    OutlinedCall call = mv.compile(node, this::propertyDefinitions);
    mv.invoke(call, false, object, decorators);
    mv.exitVariableScope();
    return null;
}
Also used : OutlinedCall(com.github.anba.es6draft.compiler.CodeVisitor.OutlinedCall) OrdinaryObject(com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject)

Example 7 with OutlinedCall

use of com.github.anba.es6draft.compiler.CodeVisitor.OutlinedCall in project es6draft by anba.

the class ExpressionGenerator method visit.

/**
 * Extension: 'do-expressions'
 */
@Override
public ValType visit(DoExpression node, CodeVisitor mv) {
    OutlinedCall call = mv.compile(node, this::doExpression);
    mv.invoke(call, node.hasCompletion());
    return node.hasCompletion() ? ValType.Any : ValType.Empty;
}
Also used : OutlinedCall(com.github.anba.es6draft.compiler.CodeVisitor.OutlinedCall)

Example 8 with OutlinedCall

use of com.github.anba.es6draft.compiler.CodeVisitor.OutlinedCall in project es6draft by anba.

the class ExpressionGenerator method visit.

@Override
public ValType visit(ExpressionMethod node, CodeVisitor mv) {
    OutlinedCall call = mv.compile(node, this::expressionMethod);
    mv.invoke(call, true);
    return ValType.Any;
}
Also used : OutlinedCall(com.github.anba.es6draft.compiler.CodeVisitor.OutlinedCall)

Aggregations

OutlinedCall (com.github.anba.es6draft.compiler.CodeVisitor.OutlinedCall)8 Completion (com.github.anba.es6draft.compiler.StatementGenerator.Completion)3 SwitchClause (com.github.anba.es6draft.ast.SwitchClause)2 SpreadElementMethod (com.github.anba.es6draft.ast.synthetic.SpreadElementMethod)1 GeneratorState (com.github.anba.es6draft.compiler.CodeVisitor.GeneratorState)1 LabelState (com.github.anba.es6draft.compiler.CodeVisitor.LabelState)1 Jump (com.github.anba.es6draft.compiler.assembler.Jump)1 OrdinaryObject (com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject)1