src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataBuilder.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataBuilder.java	Fri Jul  7 09:29:20 2017
--- new/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataBuilder.java	Fri Jul  7 09:29:20 2017

*** 31,42 **** --- 31,41 ---- import jdk.tools.jaotc.binformat.BinaryContainer; import jdk.tools.jaotc.binformat.ByteContainer; import jdk.tools.jaotc.binformat.HeaderContainer; import jdk.tools.jaotc.utils.Timer; import org.graalvm.compiler.code.CompilationResult; ! import org.graalvm.compiler.debug.DebugContext; import org.graalvm.compiler.debug.Debug.Scope; import org.graalvm.compiler.hotspot.HotSpotHostBackend; import org.graalvm.compiler.hotspot.meta.HotSpotForeignCallsProvider; import org.graalvm.compiler.hotspot.stubs.Stub; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
*** 122,135 **** --- 121,136 ---- } /** * Prepare data with all compiled classes and stubs. * + * @param debug + * * @throws Exception */ @SuppressWarnings("try") ! public void prepareData(DebugContext debug) throws Exception { try (Timer t = new Timer(main, "Parsing compiled code")) { /* * Copy compiled code into code section container and calls stubs (PLT trampoline). */ CodeSectionProcessor codeSectionProcessor = new CodeSectionProcessor(this);
*** 140,150 **** --- 141,151 ---- c.addAOTKlassData(binaryContainer); codeSectionProcessor.process(c); } } ! AOTCompiledClass stubCompiledCode = retrieveStubCode(debug); // Free memory! try (Timer t = main.options.verbose ? new Timer(main, "Freeing memory") : null) { main.printMemoryUsage(); System.gc();
*** 175,196 **** --- 176,199 ---- } } /** * Get all stubs from Graal and add them to the code section. + * + * @param debug */ @SuppressWarnings("try") ! private AOTCompiledClass retrieveStubCode(DebugContext debug) { ArrayList<CompiledMethodInfo> stubs = new ArrayList<>(); HotSpotForeignCallsProvider foreignCallsProvider = backend.getProviders().getForeignCalls(); for (Stub stub : foreignCallsProvider.getStubs()) { ! try (Scope scope = Debug.scope("CompileStubs")) { ! CompilationResult result = stub.getCompilationResult(backend); ! try (DebugContext.Scope scope = debug.scope("CompileStubs")) { ! CompilationResult result = stub.getCompilationResult(debug, backend); CompiledMethodInfo cm = new CompiledMethodInfo(result, new AOTStub(stub, backend)); stubs.add(cm); } catch (Throwable e) { ! throw Debug.handle(e); ! throw debug.handle(e); } } AOTCompiledClass stubCompiledCode = new AOTCompiledClass(stubs); CodeSectionProcessor codeSectionProcessor = new CodeSectionProcessor(this); codeSectionProcessor.process(stubCompiledCode);

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