# HG changeset patch # User Lukas Stadler # Date 1334927530 -7200 # Node ID e7f3f05414291e5b4f10b39e1f03011808c8e23b # Parent 6b2d030d01ff3d57e655a8833d85d90e39181579# Parent a6632d6e2753b2a431add9836fd92ef819fcc4e3 Merge diff -r a6632d6e2753 -r e7f3f0541429 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java Fri Apr 20 14:45:58 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java Fri Apr 20 15:12:10 2012 +0200 @@ -85,13 +85,13 @@ // comilation queue public static int TimedBootstrap = -1; - public static boolean PriorityCompileQueue = ____; + public static boolean PriorityCompileQueue = true; public static int SlowQueueCutoff = 100000; public static boolean SlowCompileThreads = ____; public static boolean DynamicCompilePriority = ____; // graph caching - public static boolean CacheGraphs = ____; + public static boolean CacheGraphs = true; public static int GraphCacheSize = 1000; public static boolean PrintGraphCache = ____; @@ -127,6 +127,7 @@ public static String Meter = null; public static String Time = null; public static String Log = null; + public static String LogFile = null; public static String MethodFilter = null; public static boolean DumpOnError = ____; diff -r a6632d6e2753 -r e7f3f0541429 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Fri Apr 20 14:45:58 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Fri Apr 20 15:12:10 2012 +0200 @@ -846,7 +846,7 @@ TTY.println("startBlock-ID: " + startBlock.getId()); // bailout of if this occurs in product mode. - throw new CiBailout("liveIn set of first block must be empty"); + throw new GraalInternalError("liveIn set of first block must be empty"); } } diff -r a6632d6e2753 -r e7f3f0541429 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 Fri Apr 20 14:45:58 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java Fri Apr 20 15:12:10 2012 +0200 @@ -178,23 +178,28 @@ // Compile until the queue is empty. int z = 0; - if (slowCompileQueue == null) { - while (compileQueue.getCompletedTaskCount() < Math.max(3, compileQueue.getTaskCount())) { - Thread.sleep(100); - while (z < compileQueue.getCompletedTaskCount() / 100) { - ++z; - TTY.print("."); - TTY.flush(); + while (true) { + try { + assert !CompilationTask.withinEnqueue.get(); + CompilationTask.withinEnqueue.set(Boolean.TRUE); + if (slowCompileQueue == null) { + if (compileQueue.getCompletedTaskCount() >= Math.max(3, compileQueue.getTaskCount())) { + break; + } + } else { + if (compileQueue.getCompletedTaskCount() + slowCompileQueue.getCompletedTaskCount() >= Math.max(3, compileQueue.getTaskCount() + slowCompileQueue.getTaskCount())) { + break; + } } + } finally { + CompilationTask.withinEnqueue.set(Boolean.FALSE); } - } else { - while (compileQueue.getCompletedTaskCount() + slowCompileQueue.getCompletedTaskCount() < Math.max(3, compileQueue.getTaskCount() + slowCompileQueue.getTaskCount())) { - Thread.sleep(100); - while (z < (compileQueue.getCompletedTaskCount() + slowCompileQueue.getCompletedTaskCount()) / 100) { - ++z; - TTY.print("."); - TTY.flush(); - } + + Thread.sleep(100); + while (z < compileQueue.getCompletedTaskCount() / 100) { + ++z; + TTY.print("."); + TTY.flush(); } } } while ((System.currentTimeMillis() - startTime) <= GraalOptions.TimedBootstrap); @@ -216,9 +221,15 @@ } public void shutdownCompiler() throws Throwable { - compileQueue.shutdown(); - if (slowCompileQueue != null) { - slowCompileQueue.shutdown(); + try { + assert !CompilationTask.withinEnqueue.get(); + CompilationTask.withinEnqueue.set(Boolean.TRUE); + compileQueue.shutdown(); + if (slowCompileQueue != null) { + slowCompileQueue.shutdown(); + } + } finally { + CompilationTask.withinEnqueue.set(Boolean.FALSE); } if (Debug.isEnabled()) { diff -r a6632d6e2753 -r e7f3f0541429 mx/commands.py --- a/mx/commands.py Fri Apr 20 14:45:58 2012 +0200 +++ b/mx/commands.py Fri Apr 20 15:12:10 2012 +0200 @@ -240,7 +240,7 @@ mx.log('Waiting 5 seconds for visualizer to start') time.sleep(5) - vm(['-G:Dump=HelloWorld', '-G:MethodFilter=main', '-Xcomp', '-XX:CompileOnly=HelloWorld::main', '-cp', mx.classpath('com.oracle.graal.examples')] + args + ['examples.HelloWorld']) + vm(['-G:Dump=', '-G:MethodFilter=greet', '-Xcomp', '-XX:CompileOnly=HelloWorld::greet', '-cp', mx.classpath('com.oracle.graal.examples')] + args + ['examples.HelloWorld']) def scaladacapo(args): """run one or all Scala DaCapo benchmarks diff -r a6632d6e2753 -r e7f3f0541429 src/cpu/x86/vm/c1_globals_x86.hpp --- a/src/cpu/x86/vm/c1_globals_x86.hpp Fri Apr 20 14:45:58 2012 +0200 +++ b/src/cpu/x86/vm/c1_globals_x86.hpp Fri Apr 20 15:12:10 2012 +0200 @@ -52,7 +52,7 @@ #ifdef GRAAL define_pd_global(bool, ProfileTraps, true ); define_pd_global(bool, UseOnStackReplacement, false); -define_pd_global(intx, CompileThreshold, 4500 ); +define_pd_global(intx, CompileThreshold, 2500 ); define_pd_global(intx, InitialCodeCacheSize, 4*M ); define_pd_global(intx, ReservedCodeCacheSize, 48*M ); define_pd_global(bool, ProfileInterpreter, true ); diff -r a6632d6e2753 -r e7f3f0541429 src/share/vm/runtime/compilationPolicy.cpp --- a/src/share/vm/runtime/compilationPolicy.cpp Fri Apr 20 14:45:58 2012 +0200 +++ b/src/share/vm/runtime/compilationPolicy.cpp Fri Apr 20 15:12:10 2012 +0200 @@ -443,10 +443,16 @@ jlong current_time = os::javaTimeNanos(); int time_per_call = (int) ((current_time - hot_time) / hot_count); m->set_graal_invocation_time(current_time); - if (m->queued_for_compilation()) { - if (time_per_call < (m->graal_priority() / 5)) { - m->set_graal_priority(time_per_call); - m->clear_queued_for_compilation(); + if (UseNewCode) { + if (m->queued_for_compilation()) { + if (time_per_call < (m->graal_priority() / 5)) { + m->set_graal_priority(time_per_call); + m->clear_queued_for_compilation(); + } + } else { + if (time_per_call < m->graal_priority()) { + m->set_graal_priority(time_per_call); + } } } else { if (time_per_call < m->graal_priority()) { @@ -458,7 +464,6 @@ CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_highest_tier, m, hot_count, "count", thread); } } - } else { } } diff -r a6632d6e2753 -r e7f3f0541429 src/share/vm/runtime/globals.hpp --- a/src/share/vm/runtime/globals.hpp Fri Apr 20 14:45:58 2012 +0200 +++ b/src/share/vm/runtime/globals.hpp Fri Apr 20 15:12:10 2012 +0200 @@ -2507,7 +2507,7 @@ product(intx, CICompilerCount, CI_COMPILER_COUNT, \ "Number of compiler threads to run") \ \ - product(intx, CompilationPolicyChoice, NOT_GRAAL(0) GRAAL_ONLY(0), \ + product(intx, CompilationPolicyChoice, NOT_GRAAL(0) GRAAL_ONLY(4), \ "which compilation policy (0/1)") \ \ develop(bool, UseStackBanging, true, \