Skip to content

Commit 5edb6f4

Browse files
committed
Rename TruffleAST to TruffleDebugAST
1 parent f9a1e76 commit 5edb6f4

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/TruffleCompilerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ public CompilationResult compilePEGraph(StructuredGraph graph,
642642
throw debug.handle(e);
643643
}
644644
if (debug.isDumpEnabled(DebugContext.BASIC_LEVEL)) {
645-
debug.dump(DebugContext.BASIC_LEVEL, TruffleAST.create(partialEvaluator, task, compilable, inlining != null ? inlining.getCallTree() : null), "After TruffleTier");
645+
debug.dump(DebugContext.BASIC_LEVEL, TruffleDebugAST.create(partialEvaluator, task, compilable, inlining != null ? inlining.getCallTree() : null), "After TruffleTier");
646646
}
647647

648648
CompilationResult result = null;

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/TruffleAST.java renamed to compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/TruffleDebugAST.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,25 @@
5454
import jdk.vm.ci.meta.ResolvedJavaType;
5555

5656
/**
57-
* Represents a TruffleAST constructed from Truffle nodes using constant reflection. Note this AST
57+
* Represents a Truffle AST constructed from Truffle nodes using constant reflection. Note this AST
5858
* is currently only constructed for AST dumping to IGV.
5959
*
6060
* @see TruffleDebugHandlersFactory for details on dumping
6161
*/
62-
final class TruffleAST implements JavaMethodContext {
62+
final class TruffleDebugAST implements JavaMethodContext {
6363

6464
static final ASTDumpStructure AST_DUMP_STRUCTURE = new ASTDumpStructure();
6565

6666
private final ASTNode root;
67-
private final List<TruffleAST.ASTBlock> blocks = new ArrayList<>();
67+
private final List<TruffleDebugAST.ASTBlock> blocks = new ArrayList<>();
6868
private final List<ASTNode> nodes = new ArrayList<>();
6969
private final TruffleCompilationTask task;
7070
private final TruffleCompilable compilable;
7171
private final PartialEvaluator partialEvaluator;
7272
private final CallTree callTree;
7373
private int currentId = 0;
7474

75-
private TruffleAST(PartialEvaluator partialEvaluator, TruffleCompilationTask task, TruffleCompilable compilable, CallTree callTree) {
75+
private TruffleDebugAST(PartialEvaluator partialEvaluator, TruffleCompilationTask task, TruffleCompilable compilable, CallTree callTree) {
7676
this.partialEvaluator = partialEvaluator;
7777
this.compilable = compilable;
7878
this.callTree = callTree;
@@ -83,8 +83,8 @@ private TruffleAST(PartialEvaluator partialEvaluator, TruffleCompilationTask tas
8383
buildTree(rootNode, root, root.block);
8484
}
8585

86-
static TruffleAST create(PartialEvaluator config, TruffleCompilationTask task, TruffleCompilable compilable, CallTree callTree) {
87-
return new TruffleAST(config, task, compilable, callTree);
86+
static TruffleDebugAST create(PartialEvaluator config, TruffleCompilationTask task, TruffleCompilable compilable, CallTree callTree) {
87+
return new TruffleDebugAST(config, task, compilable, callTree);
8888
}
8989

9090
private JavaConstant readRootNode(TruffleCompilable c) {
@@ -100,8 +100,8 @@ public JavaMethod asJavaMethod() {
100100
return new TruffleDebugJavaMethod(task, compilable);
101101
}
102102

103-
private ASTNode makeASTNode(ASTNode parent, TruffleAST.ASTBlock blockParent, JavaConstant node) {
104-
TruffleAST.ASTBlock block = null;
103+
private ASTNode makeASTNode(ASTNode parent, TruffleDebugAST.ASTBlock blockParent, JavaConstant node) {
104+
TruffleDebugAST.ASTBlock block = null;
105105
if (blockParent == null) {
106106
block = makeASTBlock(null, callTree != null ? callTree.getRoot() : null);
107107
} else {
@@ -131,7 +131,7 @@ private void makeInlinedAST(ASTNode parent, JavaConstant node, final ASTNode ast
131131
}
132132
}
133133
if (found != null && found.getState() == CallNode.State.Inlined) {
134-
TruffleAST.ASTBlock block = makeASTBlock(parent.block, found);
134+
TruffleDebugAST.ASTBlock block = makeASTBlock(parent.block, found);
135135
TruffleCompilable ast = block.callNode.getDirectCallTarget();
136136
buildTree(readRootNode(ast), astNode, block);
137137

@@ -149,16 +149,16 @@ private static void injectRootName(ASTNode rootNode, TruffleCompilable ast) {
149149
rootNode.properties.put("rootName", rootName);
150150
}
151151

152-
private TruffleAST.ASTBlock makeASTBlock(TruffleAST.ASTBlock parentBlock, CallNode callNode) {
153-
final TruffleAST.ASTBlock astBlock = new ASTBlock(blocks.size(), callNode);
152+
private TruffleDebugAST.ASTBlock makeASTBlock(TruffleDebugAST.ASTBlock parentBlock, CallNode callNode) {
153+
final TruffleDebugAST.ASTBlock astBlock = new ASTBlock(blocks.size(), callNode);
154154
blocks.add(astBlock);
155155
if (parentBlock != null) {
156156
parentBlock.successors.add(astBlock);
157157
}
158158
return astBlock;
159159
}
160160

161-
private void buildTree(JavaConstant parent, ASTNode astParent, TruffleAST.ASTBlock blockParent) {
161+
private void buildTree(JavaConstant parent, ASTNode astParent, TruffleDebugAST.ASTBlock blockParent) {
162162
if (astParent == null) {
163163
return;
164164
}
@@ -197,7 +197,7 @@ private ConstantReflectionProvider constantReflection() {
197197
return partialEvaluator.config.lastTier().providers().getConstantReflection();
198198
}
199199

200-
private ASTNode addNode(ASTNode parent, TruffleAST.ASTBlock blockParent, JavaConstant node, String edgeLabel) {
200+
private ASTNode addNode(ASTNode parent, TruffleDebugAST.ASTBlock blockParent, JavaConstant node, String edgeLabel) {
201201
if (node.isNull()) {
202202
return null;
203203
}
@@ -221,7 +221,7 @@ private static final class ASTNodeClass {
221221

222222
private static class ASTBlock {
223223
private final int id;
224-
private final List<TruffleAST.ASTBlock> successors = new ArrayList<>();
224+
private final List<TruffleDebugAST.ASTBlock> successors = new ArrayList<>();
225225
private final List<ASTNode> nodes = new ArrayList<>();
226226
private final CallNode callNode;
227227

@@ -292,20 +292,20 @@ private static String dropNodeSuffix(String className) {
292292

293293
}
294294

295-
static final class ASTDumpStructure implements GraphStructure<TruffleAST, ASTNode, ASTNodeClass, List<ASTEdge>>, GraphBlocks<TruffleAST, ASTBlock, ASTNode> {
295+
static final class ASTDumpStructure implements GraphStructure<TruffleDebugAST, ASTNode, ASTNodeClass, List<ASTEdge>>, GraphBlocks<TruffleDebugAST, ASTBlock, ASTNode> {
296296

297297
@Override
298-
public TruffleAST graph(TruffleAST currentGraph, Object obj) {
299-
return obj instanceof TruffleAST ? (TruffleAST) obj : null;
298+
public TruffleDebugAST graph(TruffleDebugAST currentGraph, Object obj) {
299+
return obj instanceof TruffleDebugAST ? (TruffleDebugAST) obj : null;
300300
}
301301

302302
@Override
303-
public Iterable<? extends ASTNode> nodes(TruffleAST graph) {
303+
public Iterable<? extends ASTNode> nodes(TruffleDebugAST graph) {
304304
return graph.nodes;
305305
}
306306

307307
@Override
308-
public int nodesCount(TruffleAST graph) {
308+
public int nodesCount(TruffleDebugAST graph) {
309309
return graph.nodes.size();
310310
}
311311

@@ -320,7 +320,7 @@ public boolean nodeHasPredecessor(ASTNode node) {
320320
}
321321

322322
@Override
323-
public void nodeProperties(TruffleAST graph, ASTNode node, Map<String, ? super Object> properties) {
323+
public void nodeProperties(TruffleDebugAST graph, ASTNode node, Map<String, ? super Object> properties) {
324324
properties.putAll(node.properties);
325325
}
326326

@@ -380,12 +380,12 @@ public Object edgeType(List<ASTEdge> port, int index) {
380380
}
381381

382382
@Override
383-
public Collection<? extends ASTNode> edgeNodes(TruffleAST graph, ASTNode node, List<ASTEdge> port, int index) {
383+
public Collection<? extends ASTNode> edgeNodes(TruffleDebugAST graph, ASTNode node, List<ASTEdge> port, int index) {
384384
return List.of(port.get(index).node);
385385
}
386386

387387
@Override
388-
public Collection<? extends ASTBlock> blocks(TruffleAST graph) {
388+
public Collection<? extends ASTBlock> blocks(TruffleDebugAST graph) {
389389
return graph.blocks;
390390
}
391391

@@ -395,7 +395,7 @@ public int blockId(ASTBlock block) {
395395
}
396396

397397
@Override
398-
public Collection<? extends ASTNode> blockNodes(TruffleAST info, ASTBlock block) {
398+
public Collection<? extends ASTNode> blockNodes(TruffleDebugAST info, ASTBlock block) {
399399
return block.nodes;
400400
}
401401

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/TruffleDebugHandlersFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ private final class TruffleASTDumpHandler implements DebugDumpHandler {
5353

5454
@Override
5555
public void dump(Object object, DebugContext debug, boolean forced, String format, Object... arguments) {
56-
if (object instanceof TruffleAST ast && DebugOptions.PrintGraph.getValue(debug.getOptions()) != PrintGraphTarget.Disable) {
56+
if (object instanceof TruffleDebugAST ast && DebugOptions.PrintGraph.getValue(debug.getOptions()) != PrintGraphTarget.Disable) {
5757
try {
58-
var output = debug.buildOutput(GraphOutput.newBuilder(TruffleAST.AST_DUMP_STRUCTURE).blocks(TruffleAST.AST_DUMP_STRUCTURE));
58+
var output = debug.buildOutput(GraphOutput.newBuilder(TruffleDebugAST.AST_DUMP_STRUCTURE).blocks(TruffleDebugAST.AST_DUMP_STRUCTURE));
5959
Map<Object, Object> properties = new EconomicHashMap<>();
6060
output.beginGroup(ast, "AST", "AST", null, 0, null);
61-
output.print((TruffleAST) object, properties, 0, format, arguments);
61+
output.print((TruffleDebugAST) object, properties, 0, format, arguments);
6262
output.endGroup();
6363
output.close();
6464
} catch (IOException e) {

0 commit comments

Comments
 (0)