src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/InvokeGraal.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/InvokeGraal.java

Print this page




 106             /*
 107              * The optimization phases that are applied to the graph. This is the main configuration
 108              * point for Graal. Add or remove phases to customize your compilation.
 109              */
 110             Suites suites = backend.getSuites().getDefaultSuites(options);
 111 
 112             /*
 113              * The low-level phases that are applied to the low-level representation.
 114              */
 115             LIRSuites lirSuites = backend.getSuites().getDefaultLIRSuites(options);
 116 
 117             /*
 118              * We want Graal to perform all speculative optimistic optimizations, using the
 119              * profiling information that comes with the method (collected by the interpreter) for
 120              * speculation.
 121              */
 122             OptimisticOptimizations optimisticOpts = OptimisticOptimizations.ALL;
 123             ProfilingInfo profilingInfo = graph.getProfilingInfo(method);
 124 
 125             /* The default class and configuration for compilation results. */
 126             CompilationResult compilationResult = new CompilationResult();
 127             CompilationResultBuilderFactory factory = CompilationResultBuilderFactory.Default;
 128 
 129             /* Invoke the whole Graal compilation pipeline. */
 130             GraalCompiler.compileGraph(graph, method, providers, backend, graphBuilderSuite, optimisticOpts, profilingInfo, suites, lirSuites, compilationResult, factory);
 131 
 132             /*
 133              * Install the compilation result into the VM, i.e., copy the byte[] array that contains
 134              * the machine code into an actual executable memory location.
 135              */
 136             return backend.addInstalledCode(debug, method, asCompilationRequest(compilationId), compilationResult);
 137         } catch (Throwable ex) {
 138             throw debug.handle(ex);
 139         }
 140     }
 141 
 142     /**
 143      * Look up a method using Java reflection and convert it to the Graal API method object.
 144      */
 145     protected ResolvedJavaMethod findMethod(Class<?> declaringClass, String name) {
 146         Method reflectionMethod = null;


 106             /*
 107              * The optimization phases that are applied to the graph. This is the main configuration
 108              * point for Graal. Add or remove phases to customize your compilation.
 109              */
 110             Suites suites = backend.getSuites().getDefaultSuites(options);
 111 
 112             /*
 113              * The low-level phases that are applied to the low-level representation.
 114              */
 115             LIRSuites lirSuites = backend.getSuites().getDefaultLIRSuites(options);
 116 
 117             /*
 118              * We want Graal to perform all speculative optimistic optimizations, using the
 119              * profiling information that comes with the method (collected by the interpreter) for
 120              * speculation.
 121              */
 122             OptimisticOptimizations optimisticOpts = OptimisticOptimizations.ALL;
 123             ProfilingInfo profilingInfo = graph.getProfilingInfo(method);
 124 
 125             /* The default class and configuration for compilation results. */
 126             CompilationResult compilationResult = new CompilationResult(graph.compilationId());
 127             CompilationResultBuilderFactory factory = CompilationResultBuilderFactory.Default;
 128 
 129             /* Invoke the whole Graal compilation pipeline. */
 130             GraalCompiler.compileGraph(graph, method, providers, backend, graphBuilderSuite, optimisticOpts, profilingInfo, suites, lirSuites, compilationResult, factory);
 131 
 132             /*
 133              * Install the compilation result into the VM, i.e., copy the byte[] array that contains
 134              * the machine code into an actual executable memory location.
 135              */
 136             return backend.addInstalledCode(debug, method, asCompilationRequest(compilationId), compilationResult);
 137         } catch (Throwable ex) {
 138             throw debug.handle(ex);
 139         }
 140     }
 141 
 142     /**
 143      * Look up a method using Java reflection and convert it to the Graal API method object.
 144      */
 145     protected ResolvedJavaMethod findMethod(Class<?> declaringClass, String name) {
 146         Method reflectionMethod = null;
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/InvokeGraal.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File