< prev index next >

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

Print this page




 149             log.flush();
 150         }
 151     }
 152 
 153     @SuppressWarnings("try")
 154     private boolean run() throws Exception {
 155         LogPrinter.openLog();
 156 
 157         try {
 158 
 159             final Linker linker = new Linker(this);
 160             final String objectFileName = linker.objFile();
 161             final Collector collector = new Collector(this);
 162             Set<Class<?>> classesToCompile;
 163 
 164             try (Timer t = new Timer(this, "")) {
 165                 classesToCompile = collector.collectClassesToCompile();
 166                 printer.printInfo(classesToCompile.size() + " classes found");
 167             }
 168 
 169             OptionValues graalOptions = HotSpotGraalOptionValues.HOTSPOT_OPTIONS;
 170             // Setting -Dgraal.TieredAOT overrides --compile-for-tiered
 171             if (!TieredAOT.hasBeenSet(graalOptions)) {
 172                 graalOptions = new OptionValues(graalOptions, TieredAOT, options.tiered);
 173             }
 174             graalOptions = new OptionValues(graalOptions, GeneratePIC, true, ImmutableCode, true);
 175             GraalJVMCICompiler graalCompiler = HotSpotGraalCompilerFactory.createCompiler("JAOTC", JVMCI.getRuntime(), graalOptions, CompilerConfigurationFactory.selectFactory(null, graalOptions));
 176             HotSpotGraalRuntime runtime = (HotSpotGraalRuntime) graalCompiler.getGraalRuntime();
 177             HotSpotHostBackend backend = (HotSpotHostBackend) runtime.getCapability(RuntimeProvider.class).getHostBackend();
 178             MetaAccessProvider metaAccess = backend.getProviders().getMetaAccess();
 179             filters = new GraalFilters(metaAccess);
 180 
 181             List<AOTCompiledClass> classes;
 182 
 183             try (Timer t = new Timer(this, "")) {
 184                 classes = collector.collectMethodsToCompile(classesToCompile, metaAccess);
 185             }
 186 
 187             // Free memory!
 188             try (Timer t = options.verbose ? new Timer(this, "Freeing memory") : null) {
 189                 printer.printMemoryUsage();




 149             log.flush();
 150         }
 151     }
 152 
 153     @SuppressWarnings("try")
 154     private boolean run() throws Exception {
 155         LogPrinter.openLog();
 156 
 157         try {
 158 
 159             final Linker linker = new Linker(this);
 160             final String objectFileName = linker.objFile();
 161             final Collector collector = new Collector(this);
 162             Set<Class<?>> classesToCompile;
 163 
 164             try (Timer t = new Timer(this, "")) {
 165                 classesToCompile = collector.collectClassesToCompile();
 166                 printer.printInfo(classesToCompile.size() + " classes found");
 167             }
 168 
 169             OptionValues graalOptions = HotSpotGraalOptionValues.defaultOptions();
 170             // Setting -Dgraal.TieredAOT overrides --compile-for-tiered
 171             if (!TieredAOT.hasBeenSet(graalOptions)) {
 172                 graalOptions = new OptionValues(graalOptions, TieredAOT, options.tiered);
 173             }
 174             graalOptions = new OptionValues(graalOptions, GeneratePIC, true, ImmutableCode, true);
 175             GraalJVMCICompiler graalCompiler = HotSpotGraalCompilerFactory.createCompiler("JAOTC", JVMCI.getRuntime(), graalOptions, CompilerConfigurationFactory.selectFactory(null, graalOptions));
 176             HotSpotGraalRuntime runtime = (HotSpotGraalRuntime) graalCompiler.getGraalRuntime();
 177             HotSpotHostBackend backend = (HotSpotHostBackend) runtime.getCapability(RuntimeProvider.class).getHostBackend();
 178             MetaAccessProvider metaAccess = backend.getProviders().getMetaAccess();
 179             filters = new GraalFilters(metaAccess);
 180 
 181             List<AOTCompiledClass> classes;
 182 
 183             try (Timer t = new Timer(this, "")) {
 184                 classes = collector.collectMethodsToCompile(classesToCompile, metaAccess);
 185             }
 186 
 187             // Free memory!
 188             try (Timer t = options.verbose ? new Timer(this, "Freeing memory") : null) {
 189                 printer.printMemoryUsage();


< prev index next >