changeset 11535:8f0fb0ade839

Truffle: add alternate Node/RootNode constructors with SourceSection argument.
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Thu, 05 Sep 2013 15:03:36 -0700
parents 2d759e68c8ca
children 6317ef27930d
files graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java
diffstat 2 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java	Thu Sep 05 20:23:20 2013 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java	Thu Sep 05 15:03:36 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,6 +59,11 @@
         CompilerAsserts.neverPartOfCompilation();
     }
 
+    protected Node(SourceSection sourceSection) {
+        CompilerAsserts.neverPartOfCompilation();
+        this.sourceSection = sourceSection;
+    }
+
     /**
      * Assigns a link to a guest language source section to this node.
      * 
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java	Thu Sep 05 20:23:20 2013 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java	Thu Sep 05 15:03:36 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,13 @@
  */
 public abstract class RootNode extends Node {
 
+    protected RootNode() {
+    }
+
+    protected RootNode(SourceSection sourceSection) {
+        super(sourceSection);
+    }
+
     /**
      * Executes this function using the specified frame and returns the result value.
      *