src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java Fri Aug 17 11:56:59 2018 -0500
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java Fri Aug 17 13:20:53 2018 -0700
@@ -46,7 +46,6 @@
import org.graalvm.compiler.core.common.cfg.BlockMap;
import org.graalvm.compiler.core.common.type.Stamp;
import org.graalvm.compiler.debug.DebugContext;
-import org.graalvm.compiler.debug.GraalError;
import org.graalvm.compiler.debug.JavaMethodContext;
import org.graalvm.compiler.debug.TTY;
import org.graalvm.compiler.graph.Graph;
@@ -111,6 +110,10 @@
return this == FLOATING_GUARDS;
}
+ public boolean allowsGuardInsertion() {
+ return this.ordinal() <= FIXED_DEOPTS.ordinal();
+ }
+
public boolean areFrameStatesAtDeopts() {
return this == AFTER_FSA;
}
@@ -930,10 +933,9 @@
* Records that {@code method} was used to build this graph.
*/
public void recordMethod(ResolvedJavaMethod method) {
- if (methods == null) {
- throw new GraalError("inlined method recording not enabled for %s", this);
+ if (methods != null) {
+ methods.add(method);
}
- methods.add(method);
}
/**
@@ -941,14 +943,13 @@
* to build another graph.
*/
public void updateMethods(StructuredGraph other) {
- if (methods == null) {
- throw new GraalError("inlined method recording not enabled for %s", this);
- }
- if (other.rootMethod != null) {
- methods.add(other.rootMethod);
- }
- for (ResolvedJavaMethod m : other.methods) {
- methods.add(m);
+ if (methods != null) {
+ if (other.rootMethod != null) {
+ methods.add(other.rootMethod);
+ }
+ for (ResolvedJavaMethod m : other.methods) {
+ methods.add(m);
+ }
}
}
@@ -1006,14 +1007,6 @@
return res;
}
- /**
- *
- * @return true if the graph contains only a {@link StartNode} and {@link ReturnNode}
- */
- public boolean isTrivial() {
- return !(start.next() instanceof ReturnNode);
- }
-
@Override
public JavaMethod asJavaMethod() {
return method();