All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.oracle.truffle.sl.builtins.SLReadlnBuiltinFactory Maven / Gradle / Ivy

The newest version!
// CheckStyle: start generated
package com.oracle.truffle.sl.builtins;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.NeverDefault;
import com.oracle.truffle.api.dsl.NodeFactory;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.strings.TruffleString;
import com.oracle.truffle.api.strings.TruffleString.FromJavaStringNode;
import com.oracle.truffle.sl.nodes.SLExpressionNode;
import java.lang.invoke.VarHandle;
import java.util.List;
import java.util.Objects;

@GeneratedBy(SLReadlnBuiltin.class)
@SuppressWarnings({"javadoc", "unused"})
public final class SLReadlnBuiltinFactory implements NodeFactory {

    private static final SLReadlnBuiltinFactory INSTANCE = new SLReadlnBuiltinFactory();

    private SLReadlnBuiltinFactory() {
    }

    @Override
    public Class getNodeClass() {
        return SLReadlnBuiltin.class;
    }

    @Override
    public List> getExecutionSignature() {
        return List.of();
    }

    @Override
    public List>> getNodeSignatures() {
        return List.of(List.of(SLExpressionNode[].class));
    }

    @Override
    public SLReadlnBuiltin createNode(Object... arguments) {
        if (arguments.length == 1 && (arguments[0] == null || arguments[0] instanceof SLExpressionNode[])) {
            return create((SLExpressionNode[]) arguments[0]);
        } else {
            throw new IllegalArgumentException("Invalid create signature.");
        }
    }

    public static NodeFactory getInstance() {
        return INSTANCE;
    }

    @NeverDefault
    public static SLReadlnBuiltin create(SLExpressionNode[] arguments) {
        return new SLReadlnBuiltinNodeGen(arguments);
    }

    /**
     * Debug Info: 
     *   Specialization {@link SLReadlnBuiltin#readln}
     *     Activation probability: 1.00000
     *     With/without class size: 24/4 bytes
     * 
*/ @GeneratedBy(SLReadlnBuiltin.class) @SuppressWarnings("javadoc") public static final class SLReadlnBuiltinNodeGen extends SLReadlnBuiltin { /** * State Info:
         *   0: SpecializationActive {@link SLReadlnBuiltin#readln}
         * 
*/ @CompilationFinal private int state_0_; /** * Source Info:
         *   Specialization: {@link SLReadlnBuiltin#readln}
         *   Parameter: {@link FromJavaStringNode} fromJavaStringNode
*/ @Child private FromJavaStringNode fromJavaStringNode_; private SLReadlnBuiltinNodeGen(SLExpressionNode[] arguments) { } @Override protected Object execute(VirtualFrame frameValue) { int state_0 = this.state_0_; if (state_0 != 0 /* is SpecializationActive[SLReadlnBuiltin.readln(FromJavaStringNode)] */) { { FromJavaStringNode fromJavaStringNode__ = this.fromJavaStringNode_; if (fromJavaStringNode__ != null) { return readln(fromJavaStringNode__); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(); } private TruffleString executeAndSpecialize() { int state_0 = this.state_0_; FromJavaStringNode fromJavaStringNode__ = this.insert((FromJavaStringNode.create())); Objects.requireNonNull(fromJavaStringNode__, "A specialization cache returned a default value. The cache initializer must never return a default value for this cache. Use @Cached(neverDefault=false) to allow default values for this cached value or make sure the cache initializer never returns the default value."); VarHandle.storeStoreFence(); this.fromJavaStringNode_ = fromJavaStringNode__; state_0 = state_0 | 0b1 /* add SpecializationActive[SLReadlnBuiltin.readln(FromJavaStringNode)] */; this.state_0_ = state_0; return readln(fromJavaStringNode__); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy