src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java
Print this page
*** 31,51 ****
import org.graalvm.compiler.core.common.util.FrequencyEncoder;
import org.graalvm.compiler.core.common.util.TypeConversion;
import org.graalvm.compiler.core.common.util.TypeReader;
import org.graalvm.compiler.core.common.util.TypeWriter;
import org.graalvm.compiler.core.common.util.UnsafeArrayTypeWriter;
! import org.graalvm.compiler.debug.Debug;
import org.graalvm.compiler.graph.Edges;
import org.graalvm.compiler.graph.Node;
import org.graalvm.compiler.graph.NodeClass;
import org.graalvm.compiler.graph.NodeList;
import org.graalvm.compiler.graph.NodeMap;
import org.graalvm.compiler.graph.iterators.NodeIterable;
import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
import org.graalvm.compiler.nodes.java.ExceptionObjectNode;
- import org.graalvm.util.UnmodifiableMapCursor;
import org.graalvm.util.Pair;
import jdk.vm.ci.code.Architecture;
/**
* Encodes a {@link StructuredGraph} to a compact byte[] array. All nodes of the graph and edges
--- 31,51 ----
import org.graalvm.compiler.core.common.util.FrequencyEncoder;
import org.graalvm.compiler.core.common.util.TypeConversion;
import org.graalvm.compiler.core.common.util.TypeReader;
import org.graalvm.compiler.core.common.util.TypeWriter;
import org.graalvm.compiler.core.common.util.UnsafeArrayTypeWriter;
! import org.graalvm.compiler.debug.DebugContext;
import org.graalvm.compiler.graph.Edges;
import org.graalvm.compiler.graph.Node;
import org.graalvm.compiler.graph.NodeClass;
import org.graalvm.compiler.graph.NodeList;
import org.graalvm.compiler.graph.NodeMap;
import org.graalvm.compiler.graph.iterators.NodeIterable;
import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
import org.graalvm.compiler.nodes.java.ExceptionObjectNode;
import org.graalvm.util.Pair;
+ import org.graalvm.util.UnmodifiableMapCursor;
import jdk.vm.ci.code.Architecture;
/**
* Encodes a {@link StructuredGraph} to a compact byte[] array. All nodes of the graph and edges
*** 416,436 ****
* Verification code that checks that the decoding of an encode graph is the same as the
* original graph.
*/
@SuppressWarnings("try")
public static boolean verifyEncoding(StructuredGraph originalGraph, EncodedGraph encodedGraph, Architecture architecture) {
! StructuredGraph decodedGraph = new StructuredGraph.Builder(originalGraph.getOptions(), AllowAssumptions.YES).method(originalGraph.method()).build();
GraphDecoder decoder = new GraphDecoder(architecture, decodedGraph);
decoder.decode(encodedGraph);
decodedGraph.verify();
try {
GraphComparison.verifyGraphsEqual(originalGraph, decodedGraph);
} catch (Throwable ex) {
! try (Debug.Scope scope = Debug.scope("GraphEncoder")) {
! Debug.dump(Debug.VERBOSE_LEVEL, originalGraph, "Original Graph");
! Debug.dump(Debug.VERBOSE_LEVEL, decodedGraph, "Decoded Graph");
}
throw ex;
}
return true;
}
--- 416,438 ----
* Verification code that checks that the decoding of an encode graph is the same as the
* original graph.
*/
@SuppressWarnings("try")
public static boolean verifyEncoding(StructuredGraph originalGraph, EncodedGraph encodedGraph, Architecture architecture) {
! DebugContext debug = originalGraph.getDebug();
! StructuredGraph decodedGraph = new StructuredGraph.Builder(originalGraph.getOptions(), debug, AllowAssumptions.YES).method(originalGraph.method()).build();
GraphDecoder decoder = new GraphDecoder(architecture, decodedGraph);
decoder.decode(encodedGraph);
decodedGraph.verify();
try {
GraphComparison.verifyGraphsEqual(originalGraph, decodedGraph);
} catch (Throwable ex) {
! originalGraph.getDebug();
! try (DebugContext.Scope scope = debug.scope("GraphEncoder")) {
! debug.dump(DebugContext.VERBOSE_LEVEL, originalGraph, "Original Graph");
! debug.dump(DebugContext.VERBOSE_LEVEL, decodedGraph, "Decoded Graph");
}
throw ex;
}
return true;
}
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File