43972
|
1 |
/*
|
|
2 |
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
*
|
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
|
7 |
* published by the Free Software Foundation.
|
|
8 |
*
|
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
13 |
* accompanied this code).
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License version
|
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
18 |
*
|
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
20 |
* or visit www.oracle.com if you need additional information or have any
|
|
21 |
* questions.
|
|
22 |
*/
|
|
23 |
package org.graalvm.compiler.nodes;
|
|
24 |
|
49451
|
25 |
import static org.graalvm.compiler.graph.Graph.SourcePositionTracking.Default;
|
|
26 |
|
43972
|
27 |
import java.util.ArrayList;
|
|
28 |
import java.util.Iterator;
|
|
29 |
import java.util.List;
|
|
30 |
import java.util.concurrent.atomic.AtomicLong;
|
|
31 |
import java.util.function.Consumer;
|
|
32 |
|
48861
|
33 |
import org.graalvm.collections.EconomicMap;
|
|
34 |
import org.graalvm.collections.EconomicSet;
|
|
35 |
import org.graalvm.collections.Equivalence;
|
|
36 |
import org.graalvm.collections.UnmodifiableEconomicMap;
|
46344
|
37 |
import org.graalvm.compiler.core.common.CancellationBailoutException;
|
43972
|
38 |
import org.graalvm.compiler.core.common.CompilationIdentifier;
|
46344
|
39 |
import org.graalvm.compiler.core.common.GraalOptions;
|
43972
|
40 |
import org.graalvm.compiler.core.common.cfg.BlockMap;
|
|
41 |
import org.graalvm.compiler.core.common.type.Stamp;
|
46640
|
42 |
import org.graalvm.compiler.debug.DebugContext;
|
43972
|
43 |
import org.graalvm.compiler.debug.JavaMethodContext;
|
49451
|
44 |
import org.graalvm.compiler.debug.TTY;
|
43972
|
45 |
import org.graalvm.compiler.graph.Graph;
|
|
46 |
import org.graalvm.compiler.graph.Node;
|
|
47 |
import org.graalvm.compiler.graph.NodeMap;
|
48861
|
48 |
import org.graalvm.compiler.graph.NodeSourcePosition;
|
43972
|
49 |
import org.graalvm.compiler.nodes.calc.FloatingNode;
|
|
50 |
import org.graalvm.compiler.nodes.cfg.Block;
|
|
51 |
import org.graalvm.compiler.nodes.cfg.ControlFlowGraph;
|
|
52 |
import org.graalvm.compiler.nodes.java.MethodCallTargetNode;
|
|
53 |
import org.graalvm.compiler.nodes.spi.VirtualizableAllocation;
|
|
54 |
import org.graalvm.compiler.nodes.util.GraphUtil;
|
46344
|
55 |
import org.graalvm.compiler.options.OptionValues;
|
43972
|
56 |
|
|
57 |
import jdk.vm.ci.meta.Assumptions;
|
|
58 |
import jdk.vm.ci.meta.Assumptions.Assumption;
|
|
59 |
import jdk.vm.ci.meta.DefaultProfilingInfo;
|
|
60 |
import jdk.vm.ci.meta.JavaMethod;
|
|
61 |
import jdk.vm.ci.meta.ProfilingInfo;
|
|
62 |
import jdk.vm.ci.meta.ResolvedJavaField;
|
|
63 |
import jdk.vm.ci.meta.ResolvedJavaMethod;
|
|
64 |
import jdk.vm.ci.meta.SpeculationLog;
|
|
65 |
import jdk.vm.ci.meta.TriState;
|
|
66 |
import jdk.vm.ci.runtime.JVMCICompiler;
|
|
67 |
|
|
68 |
/**
|
|
69 |
* A graph that contains at least one distinguished node : the {@link #start() start} node. This
|
|
70 |
* node is the start of the control flow of the graph.
|
|
71 |
*/
|
46344
|
72 |
public final class StructuredGraph extends Graph implements JavaMethodContext {
|
43972
|
73 |
|
|
74 |
/**
|
|
75 |
* The different stages of the compilation of a {@link Graph} regarding the status of
|
|
76 |
* {@link GuardNode guards}, {@link DeoptimizingNode deoptimizations} and {@link FrameState
|
|
77 |
* framestates}. The stage of a graph progresses monotonously.
|
|
78 |
*
|
|
79 |
*/
|
|
80 |
public enum GuardsStage {
|
|
81 |
/**
|
|
82 |
* During this stage, there can be {@link FloatingNode floating} {@link DeoptimizingNode}
|
|
83 |
* such as {@link GuardNode GuardNodes}. New {@link DeoptimizingNode DeoptimizingNodes} can
|
|
84 |
* be introduced without constraints. {@link FrameState} nodes are associated with
|
|
85 |
* {@link StateSplit} nodes.
|
|
86 |
*/
|
|
87 |
FLOATING_GUARDS,
|
|
88 |
/**
|
|
89 |
* During this stage, all {@link DeoptimizingNode DeoptimizingNodes} must be
|
|
90 |
* {@link FixedNode fixed} but new {@link DeoptimizingNode DeoptimizingNodes} can still be
|
|
91 |
* introduced. {@link FrameState} nodes are still associated with {@link StateSplit} nodes.
|
|
92 |
*/
|
|
93 |
FIXED_DEOPTS,
|
|
94 |
/**
|
|
95 |
* During this stage, all {@link DeoptimizingNode DeoptimizingNodes} must be
|
|
96 |
* {@link FixedNode fixed}. New {@link DeoptimizingNode DeoptimizingNodes} can not be
|
|
97 |
* introduced any more. {@link FrameState} nodes are now associated with
|
|
98 |
* {@link DeoptimizingNode} nodes.
|
|
99 |
*/
|
|
100 |
AFTER_FSA;
|
|
101 |
|
|
102 |
public boolean allowsFloatingGuards() {
|
|
103 |
return this == FLOATING_GUARDS;
|
|
104 |
}
|
|
105 |
|
|
106 |
public boolean areFrameStatesAtDeopts() {
|
|
107 |
return this == AFTER_FSA;
|
|
108 |
}
|
|
109 |
|
|
110 |
public boolean areFrameStatesAtSideEffects() {
|
|
111 |
return !this.areFrameStatesAtDeopts();
|
|
112 |
}
|
|
113 |
|
|
114 |
public boolean areDeoptsFixed() {
|
|
115 |
return this.ordinal() >= FIXED_DEOPTS.ordinal();
|
|
116 |
}
|
|
117 |
}
|
|
118 |
|
|
119 |
/**
|
|
120 |
* Constants denoting whether or not {@link Assumption}s can be made while processing a graph.
|
|
121 |
*/
|
|
122 |
public enum AllowAssumptions {
|
|
123 |
YES,
|
|
124 |
NO;
|
46344
|
125 |
public static AllowAssumptions ifTrue(boolean flag) {
|
43972
|
126 |
return flag ? YES : NO;
|
|
127 |
}
|
46344
|
128 |
|
|
129 |
public static AllowAssumptions ifNonNull(Assumptions assumptions) {
|
|
130 |
return assumptions != null ? YES : NO;
|
|
131 |
}
|
43972
|
132 |
}
|
|
133 |
|
|
134 |
public static class ScheduleResult {
|
|
135 |
private final ControlFlowGraph cfg;
|
|
136 |
private final NodeMap<Block> nodeToBlockMap;
|
|
137 |
private final BlockMap<List<Node>> blockToNodesMap;
|
|
138 |
|
|
139 |
public ScheduleResult(ControlFlowGraph cfg, NodeMap<Block> nodeToBlockMap, BlockMap<List<Node>> blockToNodesMap) {
|
|
140 |
this.cfg = cfg;
|
|
141 |
this.nodeToBlockMap = nodeToBlockMap;
|
|
142 |
this.blockToNodesMap = blockToNodesMap;
|
|
143 |
}
|
|
144 |
|
|
145 |
public ControlFlowGraph getCFG() {
|
|
146 |
return cfg;
|
|
147 |
}
|
|
148 |
|
|
149 |
public NodeMap<Block> getNodeToBlockMap() {
|
|
150 |
return nodeToBlockMap;
|
|
151 |
}
|
|
152 |
|
|
153 |
public BlockMap<List<Node>> getBlockToNodesMap() {
|
|
154 |
return blockToNodesMap;
|
|
155 |
}
|
|
156 |
|
|
157 |
public List<Node> nodesFor(Block block) {
|
|
158 |
return blockToNodesMap.get(block);
|
|
159 |
}
|
|
160 |
}
|
|
161 |
|
46344
|
162 |
/**
|
|
163 |
* Object used to create a {@link StructuredGraph}.
|
|
164 |
*/
|
|
165 |
public static class Builder {
|
|
166 |
private String name;
|
|
167 |
private final Assumptions assumptions;
|
|
168 |
private SpeculationLog speculationLog;
|
|
169 |
private ResolvedJavaMethod rootMethod;
|
|
170 |
private CompilationIdentifier compilationId = CompilationIdentifier.INVALID_COMPILATION_ID;
|
|
171 |
private int entryBCI = JVMCICompiler.INVOCATION_ENTRY_BCI;
|
|
172 |
private boolean useProfilingInfo = true;
|
49451
|
173 |
private SourcePositionTracking trackNodeSourcePosition = Default;
|
46344
|
174 |
private final OptionValues options;
|
|
175 |
private Cancellable cancellable = null;
|
46640
|
176 |
private final DebugContext debug;
|
48861
|
177 |
private NodeSourcePosition callerContext;
|
46344
|
178 |
|
|
179 |
/**
|
|
180 |
* Creates a builder for a graph.
|
|
181 |
*/
|
46640
|
182 |
public Builder(OptionValues options, DebugContext debug, AllowAssumptions allowAssumptions) {
|
46344
|
183 |
this.options = options;
|
46640
|
184 |
this.debug = debug;
|
46344
|
185 |
this.assumptions = allowAssumptions == AllowAssumptions.YES ? new Assumptions() : null;
|
49451
|
186 |
this.trackNodeSourcePosition = Graph.trackNodeSourcePositionDefault(options, debug);
|
46344
|
187 |
}
|
|
188 |
|
|
189 |
/**
|
|
190 |
* Creates a builder for a graph that does not support {@link Assumptions}.
|
|
191 |
*/
|
46640
|
192 |
public Builder(OptionValues options, DebugContext debug) {
|
46344
|
193 |
this.options = options;
|
46640
|
194 |
this.debug = debug;
|
49451
|
195 |
this.assumptions = null;
|
|
196 |
this.trackNodeSourcePosition = Graph.trackNodeSourcePositionDefault(options, debug);
|
46344
|
197 |
}
|
|
198 |
|
46640
|
199 |
public String getName() {
|
|
200 |
return name;
|
|
201 |
}
|
|
202 |
|
46344
|
203 |
public Builder name(String s) {
|
|
204 |
this.name = s;
|
|
205 |
return this;
|
|
206 |
}
|
|
207 |
|
46640
|
208 |
public ResolvedJavaMethod getMethod() {
|
|
209 |
return rootMethod;
|
|
210 |
}
|
|
211 |
|
46344
|
212 |
public Builder method(ResolvedJavaMethod method) {
|
|
213 |
this.rootMethod = method;
|
|
214 |
return this;
|
|
215 |
}
|
|
216 |
|
46640
|
217 |
public DebugContext getDebug() {
|
|
218 |
return debug;
|
|
219 |
}
|
|
220 |
|
|
221 |
public SpeculationLog getSpeculationLog() {
|
|
222 |
return speculationLog;
|
|
223 |
}
|
|
224 |
|
46344
|
225 |
public Builder speculationLog(SpeculationLog log) {
|
|
226 |
this.speculationLog = log;
|
|
227 |
return this;
|
|
228 |
}
|
|
229 |
|
46640
|
230 |
public CompilationIdentifier getCompilationId() {
|
|
231 |
return compilationId;
|
|
232 |
}
|
|
233 |
|
46344
|
234 |
public Builder compilationId(CompilationIdentifier id) {
|
|
235 |
this.compilationId = id;
|
|
236 |
return this;
|
|
237 |
}
|
|
238 |
|
46640
|
239 |
public Cancellable getCancellable() {
|
|
240 |
return cancellable;
|
|
241 |
}
|
|
242 |
|
46344
|
243 |
public Builder cancellable(Cancellable cancel) {
|
|
244 |
this.cancellable = cancel;
|
|
245 |
return this;
|
|
246 |
}
|
|
247 |
|
46640
|
248 |
public int getEntryBCI() {
|
|
249 |
return entryBCI;
|
|
250 |
}
|
|
251 |
|
46344
|
252 |
public Builder entryBCI(int bci) {
|
|
253 |
this.entryBCI = bci;
|
|
254 |
return this;
|
|
255 |
}
|
|
256 |
|
46640
|
257 |
public boolean getUseProfilingInfo() {
|
|
258 |
return useProfilingInfo;
|
|
259 |
}
|
|
260 |
|
46344
|
261 |
public Builder useProfilingInfo(boolean flag) {
|
|
262 |
this.useProfilingInfo = flag;
|
|
263 |
return this;
|
|
264 |
}
|
|
265 |
|
49451
|
266 |
public Builder trackNodeSourcePosition(SourcePositionTracking tracking) {
|
|
267 |
this.trackNodeSourcePosition = tracking;
|
|
268 |
return this;
|
|
269 |
}
|
|
270 |
|
|
271 |
public Builder trackNodeSourcePosition(boolean flag) {
|
|
272 |
if (flag) {
|
|
273 |
this.trackNodeSourcePosition = SourcePositionTracking.Track;
|
|
274 |
}
|
|
275 |
return this;
|
|
276 |
}
|
|
277 |
|
48861
|
278 |
public Builder callerContext(NodeSourcePosition context) {
|
|
279 |
this.callerContext = context;
|
|
280 |
return this;
|
|
281 |
}
|
|
282 |
|
46344
|
283 |
public StructuredGraph build() {
|
49451
|
284 |
return new StructuredGraph(name, rootMethod, entryBCI, assumptions, speculationLog, useProfilingInfo, trackNodeSourcePosition, compilationId, options, debug, cancellable, callerContext);
|
46344
|
285 |
}
|
|
286 |
}
|
|
287 |
|
43972
|
288 |
public static final long INVALID_GRAPH_ID = -1;
|
|
289 |
private static final AtomicLong uniqueGraphIds = new AtomicLong();
|
|
290 |
|
|
291 |
private StartNode start;
|
|
292 |
private ResolvedJavaMethod rootMethod;
|
|
293 |
private final long graphId;
|
|
294 |
private final CompilationIdentifier compilationId;
|
|
295 |
private final int entryBCI;
|
|
296 |
private GuardsStage guardsStage = GuardsStage.FLOATING_GUARDS;
|
|
297 |
private boolean isAfterFloatingReadPhase = false;
|
46551
|
298 |
private boolean isAfterFixedReadPhase = false;
|
43972
|
299 |
private boolean hasValueProxies = true;
|
46459
|
300 |
private boolean isAfterExpandLogic = false;
|
43972
|
301 |
private final boolean useProfilingInfo;
|
46344
|
302 |
private final Cancellable cancellable;
|
43972
|
303 |
/**
|
|
304 |
* The assumptions made while constructing and transforming this graph.
|
|
305 |
*/
|
|
306 |
private final Assumptions assumptions;
|
|
307 |
|
46566
|
308 |
private SpeculationLog speculationLog;
|
43972
|
309 |
|
|
310 |
private ScheduleResult lastSchedule;
|
|
311 |
|
48861
|
312 |
private final InliningLog inliningLog;
|
|
313 |
|
|
314 |
/**
|
|
315 |
* Call stack (context) leading to construction of this graph.
|
|
316 |
*/
|
|
317 |
private final NodeSourcePosition callerContext;
|
|
318 |
|
43972
|
319 |
/**
|
|
320 |
* Records the methods that were used while constructing this graph, one entry for each time a
|
|
321 |
* specific method is used.
|
|
322 |
*/
|
|
323 |
private final List<ResolvedJavaMethod> methods = new ArrayList<>();
|
|
324 |
|
|
325 |
/**
|
|
326 |
* Records the fields that were accessed while constructing this graph.
|
|
327 |
*/
|
|
328 |
|
46344
|
329 |
private EconomicSet<ResolvedJavaField> fields = null;
|
43972
|
330 |
|
|
331 |
private enum UnsafeAccessState {
|
|
332 |
NO_ACCESS,
|
|
333 |
HAS_ACCESS,
|
|
334 |
DISABLED
|
|
335 |
}
|
|
336 |
|
|
337 |
private UnsafeAccessState hasUnsafeAccess = UnsafeAccessState.NO_ACCESS;
|
|
338 |
|
|
339 |
public static final boolean USE_PROFILING_INFO = true;
|
|
340 |
|
|
341 |
public static final boolean NO_PROFILING_INFO = false;
|
|
342 |
|
46344
|
343 |
private StructuredGraph(String name,
|
|
344 |
ResolvedJavaMethod method,
|
|
345 |
int entryBCI,
|
|
346 |
Assumptions assumptions,
|
|
347 |
SpeculationLog speculationLog,
|
|
348 |
boolean useProfilingInfo,
|
49451
|
349 |
SourcePositionTracking trackNodeSourcePosition,
|
46344
|
350 |
CompilationIdentifier compilationId,
|
|
351 |
OptionValues options,
|
46640
|
352 |
DebugContext debug,
|
48861
|
353 |
Cancellable cancellable,
|
|
354 |
NodeSourcePosition context) {
|
46640
|
355 |
super(name, options, debug);
|
43972
|
356 |
this.setStart(add(new StartNode()));
|
|
357 |
this.rootMethod = method;
|
|
358 |
this.graphId = uniqueGraphIds.incrementAndGet();
|
|
359 |
this.compilationId = compilationId;
|
|
360 |
this.entryBCI = entryBCI;
|
46344
|
361 |
this.assumptions = assumptions;
|
43972
|
362 |
this.speculationLog = speculationLog;
|
|
363 |
this.useProfilingInfo = useProfilingInfo;
|
49451
|
364 |
this.trackNodeSourcePosition = trackNodeSourcePosition;
|
|
365 |
assert trackNodeSourcePosition != null;
|
46344
|
366 |
this.cancellable = cancellable;
|
49451
|
367 |
this.inliningLog = new InliningLog(rootMethod, options);
|
48861
|
368 |
this.callerContext = context;
|
43972
|
369 |
}
|
|
370 |
|
|
371 |
public void setLastSchedule(ScheduleResult result) {
|
|
372 |
lastSchedule = result;
|
|
373 |
}
|
|
374 |
|
|
375 |
public ScheduleResult getLastSchedule() {
|
|
376 |
return lastSchedule;
|
|
377 |
}
|
|
378 |
|
|
379 |
public void clearLastSchedule() {
|
|
380 |
setLastSchedule(null);
|
|
381 |
}
|
|
382 |
|
|
383 |
@Override
|
|
384 |
public boolean maybeCompress() {
|
|
385 |
if (super.maybeCompress()) {
|
|
386 |
/*
|
|
387 |
* The schedule contains a NodeMap which is unusable after compression.
|
|
388 |
*/
|
|
389 |
clearLastSchedule();
|
|
390 |
return true;
|
|
391 |
}
|
|
392 |
return false;
|
|
393 |
}
|
|
394 |
|
|
395 |
public Stamp getReturnStamp() {
|
|
396 |
Stamp returnStamp = null;
|
|
397 |
for (ReturnNode returnNode : getNodes(ReturnNode.TYPE)) {
|
|
398 |
ValueNode result = returnNode.result();
|
|
399 |
if (result != null) {
|
|
400 |
if (returnStamp == null) {
|
48190
|
401 |
returnStamp = result.stamp(NodeView.DEFAULT);
|
43972
|
402 |
} else {
|
48190
|
403 |
returnStamp = returnStamp.meet(result.stamp(NodeView.DEFAULT));
|
43972
|
404 |
}
|
|
405 |
}
|
|
406 |
}
|
|
407 |
return returnStamp;
|
|
408 |
}
|
|
409 |
|
|
410 |
@Override
|
|
411 |
public String toString() {
|
|
412 |
StringBuilder buf = new StringBuilder(getClass().getSimpleName() + ":" + graphId);
|
|
413 |
String sep = "{";
|
|
414 |
if (name != null) {
|
|
415 |
buf.append(sep);
|
|
416 |
buf.append(name);
|
|
417 |
sep = ", ";
|
|
418 |
}
|
|
419 |
if (method() != null) {
|
|
420 |
buf.append(sep);
|
|
421 |
buf.append(method());
|
|
422 |
sep = ", ";
|
|
423 |
}
|
|
424 |
|
|
425 |
if (!sep.equals("{")) {
|
|
426 |
buf.append("}");
|
|
427 |
}
|
|
428 |
return buf.toString();
|
|
429 |
}
|
|
430 |
|
|
431 |
public StartNode start() {
|
|
432 |
return start;
|
|
433 |
}
|
|
434 |
|
|
435 |
/**
|
|
436 |
* Gets the root method from which this graph was built.
|
|
437 |
*
|
|
438 |
* @return null if this method was not built from a method or the method is not available
|
|
439 |
*/
|
|
440 |
public ResolvedJavaMethod method() {
|
|
441 |
return rootMethod;
|
|
442 |
}
|
|
443 |
|
|
444 |
public int getEntryBCI() {
|
|
445 |
return entryBCI;
|
|
446 |
}
|
|
447 |
|
46344
|
448 |
public Cancellable getCancellable() {
|
|
449 |
return cancellable;
|
|
450 |
}
|
|
451 |
|
|
452 |
public void checkCancellation() {
|
|
453 |
if (cancellable != null && cancellable.isCancelled()) {
|
|
454 |
CancellationBailoutException.cancelCompilation();
|
|
455 |
}
|
|
456 |
}
|
|
457 |
|
43972
|
458 |
public boolean isOSR() {
|
|
459 |
return entryBCI != JVMCICompiler.INVOCATION_ENTRY_BCI;
|
|
460 |
}
|
|
461 |
|
|
462 |
public long graphId() {
|
|
463 |
return graphId;
|
|
464 |
}
|
|
465 |
|
|
466 |
/**
|
|
467 |
* @see CompilationIdentifier
|
|
468 |
*/
|
|
469 |
public CompilationIdentifier compilationId() {
|
|
470 |
return compilationId;
|
|
471 |
}
|
|
472 |
|
|
473 |
public void setStart(StartNode start) {
|
|
474 |
this.start = start;
|
|
475 |
}
|
|
476 |
|
48861
|
477 |
public InliningLog getInliningLog() {
|
|
478 |
return inliningLog;
|
|
479 |
}
|
|
480 |
|
49451
|
481 |
public void logInliningTree() {
|
|
482 |
if (GraalOptions.TraceInlining.getValue(getOptions())) {
|
|
483 |
TTY.println(getInliningLog().formatAsTree());
|
|
484 |
}
|
|
485 |
}
|
|
486 |
|
43972
|
487 |
/**
|
|
488 |
* Creates a copy of this graph.
|
|
489 |
*
|
|
490 |
* @param newName the name of the copy, used for debugging purposes (can be null)
|
|
491 |
* @param duplicationMapCallback consumer of the duplication map created during the copying
|
46640
|
492 |
* @param debugForCopy the debug context for the graph copy. This must not be the debug for this
|
|
493 |
* graph if this graph can be accessed from multiple threads (e.g., it's in a cache
|
|
494 |
* accessed by multiple threads).
|
43972
|
495 |
*/
|
|
496 |
@Override
|
46640
|
497 |
protected Graph copy(String newName, Consumer<UnmodifiableEconomicMap<Node, Node>> duplicationMapCallback, DebugContext debugForCopy) {
|
|
498 |
return copy(newName, duplicationMapCallback, compilationId, debugForCopy);
|
43972
|
499 |
}
|
|
500 |
|
49451
|
501 |
@SuppressWarnings("try")
|
46640
|
502 |
private StructuredGraph copy(String newName, Consumer<UnmodifiableEconomicMap<Node, Node>> duplicationMapCallback, CompilationIdentifier newCompilationId, DebugContext debugForCopy) {
|
46344
|
503 |
AllowAssumptions allowAssumptions = AllowAssumptions.ifNonNull(assumptions);
|
|
504 |
StructuredGraph copy = new StructuredGraph(newName,
|
|
505 |
method(),
|
|
506 |
entryBCI,
|
|
507 |
assumptions == null ? null : new Assumptions(),
|
|
508 |
speculationLog,
|
|
509 |
useProfilingInfo,
|
49451
|
510 |
trackNodeSourcePosition,
|
46344
|
511 |
newCompilationId,
|
48861
|
512 |
getOptions(), debugForCopy, null, callerContext);
|
43972
|
513 |
if (allowAssumptions == AllowAssumptions.YES && assumptions != null) {
|
|
514 |
copy.assumptions.record(assumptions);
|
|
515 |
}
|
|
516 |
copy.hasUnsafeAccess = hasUnsafeAccess;
|
|
517 |
copy.setGuardsStage(getGuardsStage());
|
|
518 |
copy.isAfterFloatingReadPhase = isAfterFloatingReadPhase;
|
|
519 |
copy.hasValueProxies = hasValueProxies;
|
46459
|
520 |
copy.isAfterExpandLogic = isAfterExpandLogic;
|
46344
|
521 |
EconomicMap<Node, Node> replacements = EconomicMap.create(Equivalence.IDENTITY);
|
43972
|
522 |
replacements.put(start, copy.start);
|
49451
|
523 |
UnmodifiableEconomicMap<Node, Node> duplicates;
|
|
524 |
try (InliningLog.UpdateScope scope = copy.getInliningLog().openDefaultUpdateScope()) {
|
|
525 |
duplicates = copy.addDuplicates(getNodes(), this, this.getNodeCount(), replacements);
|
|
526 |
if (scope != null) {
|
|
527 |
copy.getInliningLog().replaceLog(duplicates, this.getInliningLog());
|
|
528 |
}
|
|
529 |
}
|
43972
|
530 |
if (duplicationMapCallback != null) {
|
|
531 |
duplicationMapCallback.accept(duplicates);
|
|
532 |
}
|
|
533 |
return copy;
|
|
534 |
}
|
|
535 |
|
46640
|
536 |
/**
|
|
537 |
* @param debugForCopy the debug context for the graph copy. This must not be the debug for this
|
|
538 |
* graph if this graph can be accessed from multiple threads (e.g., it's in a cache
|
|
539 |
* accessed by multiple threads).
|
|
540 |
*/
|
|
541 |
public StructuredGraph copyWithIdentifier(CompilationIdentifier newCompilationId, DebugContext debugForCopy) {
|
|
542 |
return copy(name, null, newCompilationId, debugForCopy);
|
43972
|
543 |
}
|
|
544 |
|
|
545 |
public ParameterNode getParameter(int index) {
|
|
546 |
for (ParameterNode param : getNodes(ParameterNode.TYPE)) {
|
|
547 |
if (param.index() == index) {
|
|
548 |
return param;
|
|
549 |
}
|
|
550 |
}
|
|
551 |
return null;
|
|
552 |
}
|
|
553 |
|
|
554 |
public Iterable<Invoke> getInvokes() {
|
|
555 |
final Iterator<MethodCallTargetNode> callTargets = getNodes(MethodCallTargetNode.TYPE).iterator();
|
|
556 |
return new Iterable<Invoke>() {
|
|
557 |
|
|
558 |
private Invoke next;
|
|
559 |
|
|
560 |
@Override
|
|
561 |
public Iterator<Invoke> iterator() {
|
|
562 |
return new Iterator<Invoke>() {
|
|
563 |
|
|
564 |
@Override
|
|
565 |
public boolean hasNext() {
|
|
566 |
if (next == null) {
|
|
567 |
while (callTargets.hasNext()) {
|
|
568 |
Invoke i = callTargets.next().invoke();
|
|
569 |
if (i != null) {
|
|
570 |
next = i;
|
|
571 |
return true;
|
|
572 |
}
|
|
573 |
}
|
|
574 |
return false;
|
|
575 |
} else {
|
|
576 |
return true;
|
|
577 |
}
|
|
578 |
}
|
|
579 |
|
|
580 |
@Override
|
|
581 |
public Invoke next() {
|
|
582 |
try {
|
|
583 |
return next;
|
|
584 |
} finally {
|
|
585 |
next = null;
|
|
586 |
}
|
|
587 |
}
|
|
588 |
|
|
589 |
@Override
|
|
590 |
public void remove() {
|
|
591 |
throw new UnsupportedOperationException();
|
|
592 |
}
|
|
593 |
};
|
|
594 |
}
|
|
595 |
};
|
|
596 |
}
|
|
597 |
|
|
598 |
public boolean hasLoops() {
|
|
599 |
return hasNode(LoopBeginNode.TYPE);
|
|
600 |
}
|
|
601 |
|
|
602 |
/**
|
|
603 |
* Unlinks a node from all its control flow neighbors and then removes it from its graph. The
|
|
604 |
* node must have no {@linkplain Node#usages() usages}.
|
|
605 |
*
|
|
606 |
* @param node the node to be unlinked and removed
|
|
607 |
*/
|
46344
|
608 |
@SuppressWarnings("static-method")
|
43972
|
609 |
public void removeFixed(FixedWithNextNode node) {
|
|
610 |
assert node != null;
|
|
611 |
if (node instanceof AbstractBeginNode) {
|
|
612 |
((AbstractBeginNode) node).prepareDelete();
|
|
613 |
}
|
|
614 |
assert node.hasNoUsages() : node + " " + node.usages().count() + ", " + node.usages().first();
|
|
615 |
GraphUtil.unlinkFixedNode(node);
|
|
616 |
node.safeDelete();
|
|
617 |
}
|
|
618 |
|
|
619 |
public void replaceFixed(FixedWithNextNode node, Node replacement) {
|
|
620 |
if (replacement instanceof FixedWithNextNode) {
|
|
621 |
replaceFixedWithFixed(node, (FixedWithNextNode) replacement);
|
|
622 |
} else {
|
|
623 |
assert replacement != null : "cannot replace " + node + " with null";
|
|
624 |
assert replacement instanceof FloatingNode : "cannot replace " + node + " with " + replacement;
|
|
625 |
replaceFixedWithFloating(node, (FloatingNode) replacement);
|
|
626 |
}
|
|
627 |
}
|
|
628 |
|
|
629 |
public void replaceFixedWithFixed(FixedWithNextNode node, FixedWithNextNode replacement) {
|
|
630 |
assert node != null && replacement != null && node.isAlive() && replacement.isAlive() : "cannot replace " + node + " with " + replacement;
|
|
631 |
FixedNode next = node.next();
|
|
632 |
node.setNext(null);
|
|
633 |
replacement.setNext(next);
|
|
634 |
node.replaceAndDelete(replacement);
|
|
635 |
if (node == start) {
|
|
636 |
setStart((StartNode) replacement);
|
|
637 |
}
|
|
638 |
}
|
|
639 |
|
46344
|
640 |
@SuppressWarnings("static-method")
|
|
641 |
public void replaceFixedWithFloating(FixedWithNextNode node, ValueNode replacement) {
|
43972
|
642 |
assert node != null && replacement != null && node.isAlive() && replacement.isAlive() : "cannot replace " + node + " with " + replacement;
|
|
643 |
GraphUtil.unlinkFixedNode(node);
|
|
644 |
node.replaceAtUsagesAndDelete(replacement);
|
|
645 |
}
|
|
646 |
|
46344
|
647 |
@SuppressWarnings("static-method")
|
43972
|
648 |
public void removeSplit(ControlSplitNode node, AbstractBeginNode survivingSuccessor) {
|
|
649 |
assert node != null;
|
|
650 |
assert node.hasNoUsages();
|
|
651 |
assert survivingSuccessor != null;
|
|
652 |
node.clearSuccessors();
|
|
653 |
node.replaceAtPredecessor(survivingSuccessor);
|
|
654 |
node.safeDelete();
|
|
655 |
}
|
|
656 |
|
46371
|
657 |
@SuppressWarnings("static-method")
|
43972
|
658 |
public void removeSplitPropagate(ControlSplitNode node, AbstractBeginNode survivingSuccessor) {
|
|
659 |
assert node != null;
|
|
660 |
assert node.hasNoUsages();
|
|
661 |
assert survivingSuccessor != null;
|
|
662 |
List<Node> snapshot = node.successors().snapshot();
|
|
663 |
node.clearSuccessors();
|
|
664 |
node.replaceAtPredecessor(survivingSuccessor);
|
|
665 |
node.safeDelete();
|
|
666 |
for (Node successor : snapshot) {
|
|
667 |
if (successor != null && successor.isAlive()) {
|
|
668 |
if (successor != survivingSuccessor) {
|
46371
|
669 |
GraphUtil.killCFG((FixedNode) successor);
|
43972
|
670 |
}
|
|
671 |
}
|
|
672 |
}
|
|
673 |
}
|
|
674 |
|
|
675 |
public void replaceSplit(ControlSplitNode node, Node replacement, AbstractBeginNode survivingSuccessor) {
|
|
676 |
if (replacement instanceof FixedWithNextNode) {
|
|
677 |
replaceSplitWithFixed(node, (FixedWithNextNode) replacement, survivingSuccessor);
|
|
678 |
} else {
|
|
679 |
assert replacement != null : "cannot replace " + node + " with null";
|
|
680 |
assert replacement instanceof FloatingNode : "cannot replace " + node + " with " + replacement;
|
|
681 |
replaceSplitWithFloating(node, (FloatingNode) replacement, survivingSuccessor);
|
|
682 |
}
|
|
683 |
}
|
|
684 |
|
46344
|
685 |
@SuppressWarnings("static-method")
|
43972
|
686 |
public void replaceSplitWithFixed(ControlSplitNode node, FixedWithNextNode replacement, AbstractBeginNode survivingSuccessor) {
|
|
687 |
assert node != null && replacement != null && node.isAlive() && replacement.isAlive() : "cannot replace " + node + " with " + replacement;
|
|
688 |
assert survivingSuccessor != null;
|
|
689 |
node.clearSuccessors();
|
|
690 |
replacement.setNext(survivingSuccessor);
|
|
691 |
node.replaceAndDelete(replacement);
|
|
692 |
}
|
|
693 |
|
46344
|
694 |
@SuppressWarnings("static-method")
|
43972
|
695 |
public void replaceSplitWithFloating(ControlSplitNode node, FloatingNode replacement, AbstractBeginNode survivingSuccessor) {
|
|
696 |
assert node != null && replacement != null && node.isAlive() && replacement.isAlive() : "cannot replace " + node + " with " + replacement;
|
|
697 |
assert survivingSuccessor != null;
|
|
698 |
node.clearSuccessors();
|
|
699 |
node.replaceAtPredecessor(survivingSuccessor);
|
|
700 |
node.replaceAtUsagesAndDelete(replacement);
|
|
701 |
}
|
|
702 |
|
46344
|
703 |
@SuppressWarnings("static-method")
|
43972
|
704 |
public void addAfterFixed(FixedWithNextNode node, FixedNode newNode) {
|
|
705 |
assert node != null && newNode != null && node.isAlive() && newNode.isAlive() : "cannot add " + newNode + " after " + node;
|
|
706 |
FixedNode next = node.next();
|
|
707 |
node.setNext(newNode);
|
|
708 |
if (next != null) {
|
|
709 |
assert newNode instanceof FixedWithNextNode;
|
|
710 |
FixedWithNextNode newFixedWithNext = (FixedWithNextNode) newNode;
|
|
711 |
assert newFixedWithNext.next() == null;
|
|
712 |
newFixedWithNext.setNext(next);
|
|
713 |
}
|
|
714 |
}
|
|
715 |
|
46344
|
716 |
@SuppressWarnings("static-method")
|
43972
|
717 |
public void addBeforeFixed(FixedNode node, FixedWithNextNode newNode) {
|
|
718 |
assert node != null && newNode != null && node.isAlive() && newNode.isAlive() : "cannot add " + newNode + " before " + node;
|
|
719 |
assert node.predecessor() != null && node.predecessor() instanceof FixedWithNextNode : "cannot add " + newNode + " before " + node;
|
|
720 |
assert newNode.next() == null : newNode;
|
|
721 |
assert !(node instanceof AbstractMergeNode);
|
|
722 |
FixedWithNextNode pred = (FixedWithNextNode) node.predecessor();
|
|
723 |
pred.setNext(newNode);
|
|
724 |
newNode.setNext(node);
|
|
725 |
}
|
|
726 |
|
|
727 |
public void reduceDegenerateLoopBegin(LoopBeginNode begin) {
|
|
728 |
assert begin.loopEnds().isEmpty() : "Loop begin still has backedges";
|
|
729 |
if (begin.forwardEndCount() == 1) { // bypass merge and remove
|
|
730 |
reduceTrivialMerge(begin);
|
|
731 |
} else { // convert to merge
|
|
732 |
AbstractMergeNode merge = this.add(new MergeNode());
|
|
733 |
for (EndNode end : begin.forwardEnds()) {
|
|
734 |
merge.addForwardEnd(end);
|
|
735 |
}
|
|
736 |
this.replaceFixedWithFixed(begin, merge);
|
|
737 |
}
|
|
738 |
}
|
|
739 |
|
46344
|
740 |
@SuppressWarnings("static-method")
|
43972
|
741 |
public void reduceTrivialMerge(AbstractMergeNode merge) {
|
|
742 |
assert merge.forwardEndCount() == 1;
|
|
743 |
assert !(merge instanceof LoopBeginNode) || ((LoopBeginNode) merge).loopEnds().isEmpty();
|
|
744 |
for (PhiNode phi : merge.phis().snapshot()) {
|
|
745 |
assert phi.valueCount() == 1;
|
|
746 |
ValueNode singleValue = phi.valueAt(0);
|
|
747 |
if (phi.hasUsages()) {
|
|
748 |
phi.replaceAtUsagesAndDelete(singleValue);
|
|
749 |
} else {
|
|
750 |
phi.safeDelete();
|
|
751 |
if (singleValue != null) {
|
|
752 |
GraphUtil.tryKillUnused(singleValue);
|
|
753 |
}
|
|
754 |
}
|
|
755 |
}
|
|
756 |
// remove loop exits
|
|
757 |
if (merge instanceof LoopBeginNode) {
|
|
758 |
((LoopBeginNode) merge).removeExits();
|
|
759 |
}
|
|
760 |
AbstractEndNode singleEnd = merge.forwardEndAt(0);
|
|
761 |
FixedNode sux = merge.next();
|
|
762 |
FrameState stateAfter = merge.stateAfter();
|
|
763 |
// evacuateGuards
|
|
764 |
merge.prepareDelete((FixedNode) singleEnd.predecessor());
|
|
765 |
merge.safeDelete();
|
46344
|
766 |
if (stateAfter != null) {
|
|
767 |
GraphUtil.tryKillUnused(stateAfter);
|
43972
|
768 |
}
|
|
769 |
if (sux == null) {
|
|
770 |
singleEnd.replaceAtPredecessor(null);
|
|
771 |
singleEnd.safeDelete();
|
|
772 |
} else {
|
|
773 |
singleEnd.replaceAndDelete(sux);
|
|
774 |
}
|
|
775 |
}
|
|
776 |
|
|
777 |
public GuardsStage getGuardsStage() {
|
|
778 |
return guardsStage;
|
|
779 |
}
|
|
780 |
|
|
781 |
public void setGuardsStage(GuardsStage guardsStage) {
|
|
782 |
assert guardsStage.ordinal() >= this.guardsStage.ordinal();
|
|
783 |
this.guardsStage = guardsStage;
|
|
784 |
}
|
|
785 |
|
|
786 |
public boolean isAfterFloatingReadPhase() {
|
|
787 |
return isAfterFloatingReadPhase;
|
|
788 |
}
|
|
789 |
|
46551
|
790 |
public boolean isAfterFixedReadPhase() {
|
|
791 |
return isAfterFixedReadPhase;
|
|
792 |
}
|
|
793 |
|
43972
|
794 |
public void setAfterFloatingReadPhase(boolean state) {
|
|
795 |
assert state : "cannot 'unapply' floating read phase on graph";
|
|
796 |
isAfterFloatingReadPhase = state;
|
|
797 |
}
|
|
798 |
|
46551
|
799 |
public void setAfterFixReadPhase(boolean state) {
|
|
800 |
assert state : "cannot 'unapply' fix reads phase on graph";
|
|
801 |
isAfterFixedReadPhase = state;
|
|
802 |
}
|
|
803 |
|
43972
|
804 |
public boolean hasValueProxies() {
|
|
805 |
return hasValueProxies;
|
|
806 |
}
|
|
807 |
|
|
808 |
public void setHasValueProxies(boolean state) {
|
|
809 |
assert !state : "cannot 'unapply' value proxy removal on graph";
|
|
810 |
hasValueProxies = state;
|
|
811 |
}
|
|
812 |
|
46459
|
813 |
public boolean isAfterExpandLogic() {
|
|
814 |
return isAfterExpandLogic;
|
46344
|
815 |
}
|
|
816 |
|
46459
|
817 |
public void setAfterExpandLogic() {
|
|
818 |
isAfterExpandLogic = true;
|
46344
|
819 |
}
|
|
820 |
|
43972
|
821 |
/**
|
|
822 |
* Determines if {@link ProfilingInfo} is used during construction of this graph.
|
|
823 |
*/
|
|
824 |
public boolean useProfilingInfo() {
|
|
825 |
return useProfilingInfo;
|
|
826 |
}
|
|
827 |
|
|
828 |
/**
|
|
829 |
* Gets the profiling info for the {@linkplain #method() root method} of this graph.
|
|
830 |
*/
|
|
831 |
public ProfilingInfo getProfilingInfo() {
|
|
832 |
return getProfilingInfo(method());
|
|
833 |
}
|
|
834 |
|
|
835 |
/**
|
|
836 |
* Gets the profiling info for a given method that is or will be part of this graph, taking into
|
|
837 |
* account {@link #useProfilingInfo()}.
|
|
838 |
*/
|
|
839 |
public ProfilingInfo getProfilingInfo(ResolvedJavaMethod m) {
|
|
840 |
if (useProfilingInfo && m != null) {
|
|
841 |
return m.getProfilingInfo();
|
|
842 |
} else {
|
|
843 |
return DefaultProfilingInfo.get(TriState.UNKNOWN);
|
|
844 |
}
|
|
845 |
}
|
|
846 |
|
|
847 |
/**
|
|
848 |
* Gets the object for recording assumptions while constructing of this graph.
|
|
849 |
*
|
|
850 |
* @return {@code null} if assumptions cannot be made for this graph
|
|
851 |
*/
|
|
852 |
public Assumptions getAssumptions() {
|
|
853 |
return assumptions;
|
|
854 |
}
|
|
855 |
|
|
856 |
/**
|
|
857 |
* Gets the methods that were inlined while constructing this graph.
|
|
858 |
*/
|
|
859 |
public List<ResolvedJavaMethod> getMethods() {
|
|
860 |
return methods;
|
|
861 |
}
|
|
862 |
|
|
863 |
/**
|
|
864 |
* Records that {@code method} was used to build this graph.
|
|
865 |
*/
|
|
866 |
public void recordMethod(ResolvedJavaMethod method) {
|
|
867 |
methods.add(method);
|
|
868 |
}
|
|
869 |
|
|
870 |
/**
|
|
871 |
* Updates the {@linkplain #getMethods() methods} used to build this graph with the methods used
|
|
872 |
* to build another graph.
|
|
873 |
*/
|
|
874 |
public void updateMethods(StructuredGraph other) {
|
|
875 |
assert this != other;
|
|
876 |
this.methods.addAll(other.methods);
|
|
877 |
}
|
|
878 |
|
|
879 |
/**
|
|
880 |
* Gets the fields that were accessed while constructing this graph.
|
|
881 |
*/
|
46344
|
882 |
public EconomicSet<ResolvedJavaField> getFields() {
|
43972
|
883 |
return fields;
|
|
884 |
}
|
|
885 |
|
|
886 |
/**
|
|
887 |
* Records that {@code field} was accessed in this graph.
|
|
888 |
*/
|
|
889 |
public void recordField(ResolvedJavaField field) {
|
46344
|
890 |
assert GraalOptions.GeneratePIC.getValue(getOptions());
|
|
891 |
if (this.fields == null) {
|
|
892 |
this.fields = EconomicSet.create(Equivalence.IDENTITY);
|
|
893 |
}
|
43972
|
894 |
fields.add(field);
|
|
895 |
}
|
|
896 |
|
|
897 |
/**
|
|
898 |
* Updates the {@linkplain #getFields() fields} of this graph with the accessed fields of
|
|
899 |
* another graph.
|
|
900 |
*/
|
|
901 |
public void updateFields(StructuredGraph other) {
|
|
902 |
assert this != other;
|
46344
|
903 |
assert GraalOptions.GeneratePIC.getValue(getOptions());
|
|
904 |
if (other.fields != null) {
|
|
905 |
if (this.fields == null) {
|
|
906 |
this.fields = EconomicSet.create(Equivalence.IDENTITY);
|
|
907 |
}
|
|
908 |
this.fields.addAll(other.fields);
|
|
909 |
}
|
43972
|
910 |
}
|
|
911 |
|
|
912 |
/**
|
|
913 |
* Gets the input bytecode {@linkplain ResolvedJavaMethod#getCodeSize() size} from which this
|
|
914 |
* graph is constructed. This ignores how many bytecodes in each constituent method are actually
|
|
915 |
* parsed (which may be none for methods whose IR is retrieved from a cache or less than the
|
|
916 |
* full amount for any given method due to profile guided branch pruning).
|
|
917 |
*/
|
|
918 |
public int getBytecodeSize() {
|
|
919 |
int res = 0;
|
|
920 |
for (ResolvedJavaMethod e : methods) {
|
|
921 |
res += e.getCodeSize();
|
|
922 |
}
|
|
923 |
return res;
|
|
924 |
}
|
|
925 |
|
|
926 |
/**
|
|
927 |
*
|
|
928 |
* @return true if the graph contains only a {@link StartNode} and {@link ReturnNode}
|
|
929 |
*/
|
|
930 |
public boolean isTrivial() {
|
|
931 |
return !(start.next() instanceof ReturnNode);
|
|
932 |
}
|
|
933 |
|
|
934 |
@Override
|
|
935 |
public JavaMethod asJavaMethod() {
|
|
936 |
return method();
|
|
937 |
}
|
|
938 |
|
|
939 |
public boolean hasUnsafeAccess() {
|
|
940 |
return hasUnsafeAccess == UnsafeAccessState.HAS_ACCESS;
|
|
941 |
}
|
|
942 |
|
|
943 |
public void markUnsafeAccess() {
|
|
944 |
if (hasUnsafeAccess == UnsafeAccessState.DISABLED) {
|
|
945 |
return;
|
|
946 |
}
|
|
947 |
hasUnsafeAccess = UnsafeAccessState.HAS_ACCESS;
|
|
948 |
}
|
|
949 |
|
|
950 |
public void disableUnsafeAccessTracking() {
|
|
951 |
hasUnsafeAccess = UnsafeAccessState.DISABLED;
|
|
952 |
}
|
|
953 |
|
|
954 |
public boolean isUnsafeAccessTrackingEnabled() {
|
|
955 |
return hasUnsafeAccess != UnsafeAccessState.DISABLED;
|
|
956 |
}
|
|
957 |
|
|
958 |
public SpeculationLog getSpeculationLog() {
|
|
959 |
return speculationLog;
|
|
960 |
}
|
|
961 |
|
46344
|
962 |
public void clearAllStateAfter() {
|
43972
|
963 |
for (Node node : getNodes()) {
|
|
964 |
if (node instanceof StateSplit) {
|
|
965 |
FrameState stateAfter = ((StateSplit) node).stateAfter();
|
|
966 |
if (stateAfter != null) {
|
|
967 |
((StateSplit) node).setStateAfter(null);
|
|
968 |
// 2 nodes referencing the same framestate
|
|
969 |
if (stateAfter.isAlive()) {
|
|
970 |
GraphUtil.killWithUnusedFloatingInputs(stateAfter);
|
|
971 |
}
|
|
972 |
}
|
|
973 |
}
|
|
974 |
}
|
|
975 |
}
|
|
976 |
|
46344
|
977 |
public boolean hasVirtualizableAllocation() {
|
43972
|
978 |
for (Node n : getNodes()) {
|
|
979 |
if (n instanceof VirtualizableAllocation) {
|
|
980 |
return true;
|
|
981 |
}
|
|
982 |
}
|
|
983 |
return false;
|
|
984 |
}
|
46344
|
985 |
|
|
986 |
@Override
|
|
987 |
protected void afterRegister(Node node) {
|
|
988 |
assert hasValueProxies() || !(node instanceof ValueProxyNode);
|
49451
|
989 |
if (GraalOptions.TraceInlining.getValue(getOptions())) {
|
|
990 |
if (node instanceof Invokable) {
|
|
991 |
((Invokable) node).updateInliningLogAfterRegister(this);
|
|
992 |
}
|
|
993 |
}
|
46344
|
994 |
}
|
48861
|
995 |
|
|
996 |
public NodeSourcePosition getCallerContext() {
|
|
997 |
return callerContext;
|
|
998 |
}
|
43972
|
999 |
}
|