got a Truffle Exception

Grace Wang huohuohuomumu at
Mon Jun 1 16:10:37 UTC 2015

Hello Chris,

Yes the testBuilder calls execute directly! 
private static void testBuilder(String src, VirtualFrame frame) {
    Builder builder = parse(src, Builder.builderBuilder(MumAlg.class));
    MumblerNode eval = MumExec(frame.getFrameDescriptor()));
    System.out.println("exec " + src + " = " + eval.execute(frame));

But I don’t know how to create the ‘RootNode’ or ‘CallTarget’.

Thank you for providing these tutorials, I’ll watch them :)


On June 1, 2015 at 11:53:51 PM, Chris Seaton (chris.seaton at wrote:

Hello Grace,

I looks like your program is missing some key concepts of how programs using Truffle need to be structured to work correctly.

The point of failure here looks to be that you are executing a node without any kind of CallTarget or RootNode.

I guess that testBuilder calls execute on a node directly?

It is the RootNode which walks the AST and assigns parent nodes, so if you aren’t using a RootNode that won’t happen and nodes will not know what their parents are (they need to know so they can tell them when they are replaced).

Have you watched the Truffle tutorials? They might be a good place to start.



On 1 Jun 2015, at 16:35, Grace Wang <huohuohuomumu at> wrote:


I’m using truffle in a testing project, but somehow got the following exception. I’m not familiar with the code, but I’d like to know  what could possibly cause this exception?

Thank you very much!

Grace Wang

Exception in thread "main" java.lang.IllegalStateException: This node cannot be replaced, because it does not yet have a parent.
at mumbler.truffle.node.special.QuoteNodeGen$UninitializedNode_.acceptAndExecute(
at mumbler.truffle.node.special.QuoteNodeGen$BaseNode_.executeGeneric(
at mumbler.truffle.node.special.QuoteNodeGen.execute(
at mumbler.truffle.newparser.TruffleMumblerMain2.testBuilder(
at mumbler.truffle.newparser.TruffleMumblerMain2.testMumExec(
at mumbler.truffle.newparser.TruffleMumblerMain2.main(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at com.intellij.rt.execution.application.AppMain.main(

I also show the related code causing the exception here (although these are probably not helpful):

private static final class UninitializedNode_ extends BaseNode_ {

   UninitializedNode_(QuoteNodeGen root) {
       super(root, 2147483647);

   public Object acceptAndExecute(Frame frameValue, Object literalNodeValue) {
       return uninitialized(frameValue, literalNodeValue);

   static BaseNode_ create(QuoteNodeGen root) {
       return new UninitializedNode_(root);

public Object executeGeneric(Frame frameValue) {
   Object literalNodeValue_ = executeLiteralNode_(frameValue);
   return acceptAndExecute(frameValue, literalNodeValue_);
public Object execute(VirtualFrame frameValue) {
   return specialization_.executeGeneric(frameValue);

More information about the graal-dev mailing list