Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/SLRootNode.java @ 17006:e9c119927199
SL: added internal APIs to SL for the Graal runtime tests.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 01 Sep 2014 20:08:18 +0200 |
parents | 158c9ba66e45 |
children | ab62800259ff |
comparison
equal
deleted
inserted
replaced
17005:112ab4a3de3a | 17006:e9c119927199 |
---|---|
20 * or visit www.oracle.com if you need additional information or have any | 20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. | 21 * questions. |
22 */ | 22 */ |
23 package com.oracle.truffle.sl.nodes; | 23 package com.oracle.truffle.sl.nodes; |
24 | 24 |
25 import com.oracle.truffle.api.CompilerDirectives.*; | |
25 import com.oracle.truffle.api.frame.*; | 26 import com.oracle.truffle.api.frame.*; |
26 import com.oracle.truffle.api.nodes.*; | 27 import com.oracle.truffle.api.nodes.*; |
27 import com.oracle.truffle.sl.builtins.*; | 28 import com.oracle.truffle.sl.builtins.*; |
28 import com.oracle.truffle.sl.nodes.controlflow.*; | 29 import com.oracle.truffle.sl.nodes.controlflow.*; |
29 import com.oracle.truffle.sl.runtime.*; | 30 import com.oracle.truffle.sl.runtime.*; |
51 private final String name; | 52 private final String name; |
52 | 53 |
53 /** The Simple execution context for this tree **/ | 54 /** The Simple execution context for this tree **/ |
54 private final SLContext context; | 55 private final SLContext context; |
55 | 56 |
57 @CompilationFinal private boolean isSplittable; | |
58 | |
56 public SLRootNode(SLContext context, FrameDescriptor frameDescriptor, SLExpressionNode bodyNode, String name) { | 59 public SLRootNode(SLContext context, FrameDescriptor frameDescriptor, SLExpressionNode bodyNode, String name) { |
57 super(null, frameDescriptor); | 60 super(null, frameDescriptor); |
58 /* Deep copy the body before any specialization occurs during execution. */ | 61 /* Deep copy the body before any specialization occurs during execution. */ |
59 this.uninitializedBodyNode = NodeUtil.cloneNode(bodyNode); | 62 this.uninitializedBodyNode = NodeUtil.cloneNode(bodyNode); |
60 this.bodyNode = bodyNode; | 63 this.bodyNode = bodyNode; |
69 | 72 |
70 public String getName() { | 73 public String getName() { |
71 return name; | 74 return name; |
72 } | 75 } |
73 | 76 |
77 public void setSplittable(boolean isSplittable) { | |
78 this.isSplittable = isSplittable; | |
79 } | |
80 | |
81 public SLExpressionNode getBodyNode() { | |
82 return bodyNode; | |
83 } | |
84 | |
74 @Override | 85 @Override |
75 public boolean isSplittable() { | 86 public boolean isSplittable() { |
76 return true; | 87 return isSplittable; |
77 } | 88 } |
78 | 89 |
79 @Override | 90 @Override |
80 public RootNode split() { | 91 public RootNode split() { |
81 return new SLRootNode(this.context, getFrameDescriptor().shallowCopy(), NodeUtil.cloneNode(uninitializedBodyNode), name); | 92 return new SLRootNode(this.context, getFrameDescriptor().shallowCopy(), NodeUtil.cloneNode(uninitializedBodyNode), name); |