Search in sources :

Example 1 with ExecutableNode

use of com.oracle.truffle.api.nodes.ExecutableNode in project graal by oracle.

the class TruffleLanguageSnippets method parseInline.

ExecutableNode parseInline(Source source, Node context, MaterializedFrame frame) {
    assert context != null;
    InlineParsingRequest request = new InlineParsingRequest(source, context, frame);
    ExecutableNode snippet;
    try {
        snippet = request.parse(this);
    } catch (RuntimeException ex) {
        throw ex;
    } catch (Exception ex) {
        throw new RuntimeException(ex);
    } finally {
        request.dispose();
    }
    return snippet;
}
Also used : ExecutableNode(com.oracle.truffle.api.nodes.ExecutableNode) FileSystemNotFoundException(java.nio.file.FileSystemNotFoundException) IOException(java.io.IOException)

Example 2 with ExecutableNode

use of com.oracle.truffle.api.nodes.ExecutableNode in project graal by oracle.

the class Context method parse.

@Override
protected ExecutableNode parse(InlineParsingRequest request) throws Exception {
    Source code = request.getSource();
    Node location = request.getLocation();
    if (location == null) {
        throw new IllegalArgumentException("Location must not be null.");
    }
    BaseNode node;
    try {
        node = parse(code);
    } catch (LanguageError e) {
        throw new IOException(e);
    }
    return new InlineExecutableNode(this, node);
}
Also used : RootNode(com.oracle.truffle.api.nodes.RootNode) DirectCallNode(com.oracle.truffle.api.nodes.DirectCallNode) ExecutableNode(com.oracle.truffle.api.nodes.ExecutableNode) ProbeNode(com.oracle.truffle.api.instrumentation.ProbeNode) Node(com.oracle.truffle.api.nodes.Node) InstrumentableNode(com.oracle.truffle.api.instrumentation.InstrumentableNode) IOException(java.io.IOException) Source(com.oracle.truffle.api.source.Source)

Aggregations

ExecutableNode (com.oracle.truffle.api.nodes.ExecutableNode)2 IOException (java.io.IOException)2 InstrumentableNode (com.oracle.truffle.api.instrumentation.InstrumentableNode)1 ProbeNode (com.oracle.truffle.api.instrumentation.ProbeNode)1 DirectCallNode (com.oracle.truffle.api.nodes.DirectCallNode)1 Node (com.oracle.truffle.api.nodes.Node)1 RootNode (com.oracle.truffle.api.nodes.RootNode)1 Source (com.oracle.truffle.api.source.Source)1 FileSystemNotFoundException (java.nio.file.FileSystemNotFoundException)1