Mercurial > hg > graal-compiler
diff graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java @ 13452:8275a0d0c90a
create profiling info, phase plan and optimistic opts when running a CompilationTask, not when creating it (GRAAL-640)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 18 Dec 2013 11:26:37 +0100 |
parents | 4db09b7304da |
children | b1838411e896 |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java Wed Dec 18 00:00:24 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java Wed Dec 18 11:26:37 2013 +0100 @@ -43,7 +43,6 @@ import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.options.*; import com.oracle.graal.options.OptionValue.OverrideScope; -import com.oracle.graal.phases.*; import com.oracle.graal.phases.tiers.*; import com.oracle.graal.replacements.*; @@ -318,21 +317,30 @@ TTY.println("CompileTheWorld : Done (%d classes, %d methods, %d ms)", classFileCounter, compiledMethodsCounter, compileTime); } - /** - * A compilation task that creates a fresh compilation suite for its compilation. This is - * required so that a CTW compilation can be {@linkplain Config configured} differently from a - * VM triggered compilation. - */ - static class CTWCompilationTask extends CompilationTask { + class CTWCompilationTask extends CompilationTask { - CTWCompilationTask(HotSpotBackend backend, PhasePlan plan, OptimisticOptimizations optimisticOpts, ProfilingInfo profilingInfo, HotSpotResolvedJavaMethod method, int entryBCI, int id) { - super(backend, plan, optimisticOpts, profilingInfo, method, entryBCI, id); + CTWCompilationTask(HotSpotBackend backend, HotSpotResolvedJavaMethod method, int id) { + super(backend, method, INVOCATION_ENTRY_BCI, id); } + /** + * Returns a fresh compilation suite for its compilation so that the CTW option value + * overriding configuration has effect. + */ @Override protected Suites getSuites(HotSpotProviders providers) { + assert config.scope != null : "not inside a CTW option value overriding scope"; return providers.getSuites().createSuites(); } + + /** + * Returns empty profiling info to be as close to the CTW behavior of C1 and C2 as possible. + */ + @Override + protected ProfilingInfo getProfilingInfo() { + // Be optimistic and return false for exceptionSeen. + return DefaultProfilingInfo.get(TriState.FALSE); + } } /** @@ -342,13 +350,9 @@ try { long start = System.currentTimeMillis(); - // Be optimistic and return false for exceptionSeen. - final ProfilingInfo profilingInfo = DefaultProfilingInfo.get(TriState.FALSE); - final OptimisticOptimizations optimisticOpts = new OptimisticOptimizations(profilingInfo); int id = vmToCompiler.allocateCompileTaskId(); HotSpotBackend backend = runtime.getHostBackend(); - PhasePlan phasePlan = vmToCompiler.createPhasePlan(backend.getProviders(), optimisticOpts, false); - CompilationTask task = new CTWCompilationTask(backend, phasePlan, optimisticOpts, profilingInfo, method, INVOCATION_ENTRY_BCI, id); + CompilationTask task = new CTWCompilationTask(backend, method, id); task.runCompilation(false); compileTime += (System.currentTimeMillis() - start);