src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTBackend.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTBackend.java

src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTBackend.java

Print this page

        

*** 25,36 **** import java.util.ListIterator; import org.graalvm.compiler.code.CompilationResult; import org.graalvm.compiler.core.GraalCompiler; ! import org.graalvm.compiler.debug.Debug; ! import org.graalvm.compiler.debug.Debug.Scope; import org.graalvm.compiler.hotspot.HotSpotBackend; import org.graalvm.compiler.hotspot.HotSpotCompiledCodeBuilder; import org.graalvm.compiler.hotspot.meta.HotSpotProviders; import org.graalvm.compiler.java.GraphBuilderPhase; import org.graalvm.compiler.lir.asm.CompilationResultBuilderFactory; --- 25,35 ---- import java.util.ListIterator; import org.graalvm.compiler.code.CompilationResult; import org.graalvm.compiler.core.GraalCompiler; ! import org.graalvm.compiler.debug.DebugContext; import org.graalvm.compiler.hotspot.HotSpotBackend; import org.graalvm.compiler.hotspot.HotSpotCompiledCodeBuilder; import org.graalvm.compiler.hotspot.meta.HotSpotProviders; import org.graalvm.compiler.java.GraphBuilderPhase; import org.graalvm.compiler.lir.asm.CompilationResultBuilderFactory;
*** 80,89 **** --- 79,92 ---- public HotSpotBackend getBackend() { return backend; } + public HotSpotProviders getProviders() { + return providers; + } + private Suites getSuites() { // create suites every time, as we modify options for the compiler return backend.getSuites().getDefaultSuites(graalOptions); }
*** 91,129 **** // create suites every time, as we modify options for the compiler return backend.getSuites().getDefaultLIRSuites(graalOptions); } @SuppressWarnings("try") ! public CompilationResult compileMethod(ResolvedJavaMethod resolvedMethod) { ! StructuredGraph graph = buildStructuredGraph(resolvedMethod); if (graph != null) { ! return compileGraph(resolvedMethod, graph); } return null; } /** * Build a structured graph for the member. * * @param javaMethod method for whose code the graph is to be created * @return structured graph */ @SuppressWarnings("try") ! private StructuredGraph buildStructuredGraph(ResolvedJavaMethod javaMethod) { ! try (Scope s = Debug.scope("AOTParseMethod")) { ! StructuredGraph graph = new StructuredGraph.Builder(graalOptions).method(javaMethod).useProfilingInfo(false).build(); graphBuilderSuite.apply(graph, highTierContext); return graph; } catch (Throwable e) { handleError(javaMethod, e, " (building graph)"); } return null; } @SuppressWarnings("try") ! private CompilationResult compileGraph(ResolvedJavaMethod resolvedMethod, StructuredGraph graph) { ! try (Scope s = Debug.scope("AOTCompileMethod")) { ProfilingInfo profilingInfo = DefaultProfilingInfo.get(TriState.FALSE); final boolean isImmutablePIC = true; CompilationResult compilationResult = new CompilationResult(resolvedMethod.getName(), isImmutablePIC); --- 94,133 ---- // create suites every time, as we modify options for the compiler return backend.getSuites().getDefaultLIRSuites(graalOptions); } @SuppressWarnings("try") ! public CompilationResult compileMethod(ResolvedJavaMethod resolvedMethod, DebugContext debug) { ! StructuredGraph graph = buildStructuredGraph(resolvedMethod, debug); if (graph != null) { ! return compileGraph(resolvedMethod, graph, debug); } return null; } /** * Build a structured graph for the member. * * @param javaMethod method for whose code the graph is to be created + * @param debug * @return structured graph */ @SuppressWarnings("try") ! private StructuredGraph buildStructuredGraph(ResolvedJavaMethod javaMethod, DebugContext debug) { ! try (DebugContext.Scope s = debug.scope("AOTParseMethod")) { ! StructuredGraph graph = new StructuredGraph.Builder(graalOptions, debug).method(javaMethod).useProfilingInfo(false).build(); graphBuilderSuite.apply(graph, highTierContext); return graph; } catch (Throwable e) { handleError(javaMethod, e, " (building graph)"); } return null; } @SuppressWarnings("try") ! private CompilationResult compileGraph(ResolvedJavaMethod resolvedMethod, StructuredGraph graph, DebugContext debug) { ! try (DebugContext.Scope s = debug.scope("AOTCompileMethod")) { ProfilingInfo profilingInfo = DefaultProfilingInfo.get(TriState.FALSE); final boolean isImmutablePIC = true; CompilationResult compilationResult = new CompilationResult(resolvedMethod.getName(), isImmutablePIC);
src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTBackend.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File