# HG changeset patch # User Christian Haeubl # Date 1354200289 -3600 # Node ID fa99bf3837ec3207e3d649a4fd094ff87bcfd03f # Parent 770901ff8f802ab8a446d250e10495319eaa5f53 fixed some issues that precluded compilation of Graal compiler methods diff -r 770901ff8f80 -r fa99bf3837ec graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java --- 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); } diff -r 770901ff8f80 -r fa99bf3837ec graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java --- 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;