Mercurial > hg > graal-compiler
changeset 7108:fa99bf3837ec
fixed some issues that precluded compilation of Graal compiler methods
author | Christian Haeubl <haeubl@ssw.jku.at> |
---|---|
date | Thu, 29 Nov 2012 15:44:49 +0100 |
parents | 770901ff8f80 |
children | 37e75cc87c66 |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java |
diffstat | 2 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java Thu Nov 29 11:00:32 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java Thu Nov 29 15:44:49 2012 +0100 @@ -380,11 +380,16 @@ return compileMethod(method, entryBCI, blocking, priority); } + /** + * Compiles a method to machine code. + * @return true if the method is in the queue (either added to the queue or already in the queue) + */ public boolean compileMethod(final HotSpotResolvedJavaMethod method, final int entryBCI, boolean blocking, int priority) throws Throwable { + CompilationTask current = method.currentTask(); boolean osrCompilation = entryBCI != StructuredGraph.INVOCATION_ENTRY_BCI; if (osrCompilation && bootstrapRunning) { // no OSR compilations during bootstrap - the compiler is just too slow at this point, and we know that there are no endless loops - return true; + return current != null; } if (CompilationTask.withinEnqueue.get()) { @@ -392,12 +397,11 @@ // java.util.concurrent.BlockingQueue is used to implement the compilation worker // queues. If a compiler thread triggers a compilation, then it may be blocked trying // to add something to its own queue. - return false; + return current != null; } CompilationTask.withinEnqueue.set(Boolean.TRUE); try { - CompilationTask current = method.currentTask(); if (!blocking && current != null) { if (current.isInProgress()) { if (current.getEntryBCI() == entryBCI) { @@ -422,6 +426,7 @@ CompilationTask task = CompilationTask.create(graalRuntime, createPhasePlan(optimisticOpts, osrCompilation), optimisticOpts, method, entryBCI, id, queuePriority); if (blocking) { task.runCompilation(); + return false; } else { try { method.setCurrentTask(task); @@ -430,12 +435,12 @@ } else { compileQueue.execute(task); } + return task != null; } catch (RejectedExecutionException e) { // The compile queue was already shut down. return false; } } - return true; } finally { CompilationTask.withinEnqueue.set(Boolean.FALSE); }
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java Thu Nov 29 11:00:32 2012 +0100 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java Thu Nov 29 15:44:49 2012 +0100 @@ -82,7 +82,6 @@ // profiling information public static int DeoptsToDisableOptimisticOptimization = 40; - public static boolean PrintDisabledOptimisticOptimizations = true; public static int MatureExecutionsBranch = 1; public static int MatureExecutionsPerSwitchCase = 1; public static int MatureExecutionsTypeProfile = 1;