comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultCallTarget.java @ 19710:48eeda5dfdbf

Move linking of RootNode to CallTarget to ensure final semantics. * "this" was published before complete initialization by being in the constructor. * Make the constructor protected where possible.
author Benoit Daloze <benoit.daloze@jku.at>
date Fri, 06 Mar 2015 18:51:31 +0100
parents e3c95cbbb50c
children
comparison
equal deleted inserted replaced
19709:678a3de139ad 19710:48eeda5dfdbf
34 */ 34 */
35 public class DefaultCallTarget implements RootCallTarget { 35 public class DefaultCallTarget implements RootCallTarget {
36 36
37 private final RootNode rootNode; 37 private final RootNode rootNode;
38 38
39 public DefaultCallTarget(RootNode function) { 39 protected DefaultCallTarget(RootNode function) {
40 this.rootNode = function; 40 this.rootNode = function;
41 this.rootNode.adoptChildren(); 41 this.rootNode.adoptChildren();
42 this.rootNode.applyInstrumentation(); 42 this.rootNode.applyInstrumentation();
43 this.rootNode.setCallTarget(this);
44 } 43 }
45 44
46 @Override 45 @Override
47 public String toString() { 46 public String toString() {
48 return rootNode.toString(); 47 return rootNode.toString();