# HG changeset patch # User Doug Simon # Date 1387316223 -3600 # Node ID 4db09b7304da2501cda023be6f7b542077f77076 # Parent 3e67710a6d0801dd447dcb2e789d619cabd3099b read DontCompileHugeMethods and HugeMethodLimit from VM diff -r 3e67710a6d08 -r 4db09b7304da graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java Tue Dec 17 21:39:01 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java Tue Dec 17 22:37:03 2013 +0100 @@ -90,7 +90,7 @@ } /** - * A mechanism for overriding Graal options that effect compilation. A {@link Config} object + * A mechanism for overriding Graal options that affect compilation. A {@link Config} object * should be used in a try-with-resources statement to ensure overriding of options is scoped * properly. For example: * @@ -272,7 +272,7 @@ String className = je.getName().substring(0, je.getName().length() - ".class".length()); classFileCounter++; - try (AutoCloseable s = config == null ? null : config.apply()) { + try (AutoCloseable s = config.apply()) { // Load and initialize class Class javaClass = Class.forName(className.replace('/', '.'), true, loader); @@ -356,7 +356,7 @@ method.reprofile(); // makes the method also not-entrant } catch (Throwable t) { // Catch everything and print a message - println("CompileTheWorldClasspath (%d) : Error compiling method: %s", classFileCounter, MetaUtil.format("%H.%n(%p):%r", method)); + println("CompileTheWorld (%d) : Error compiling method: %s", classFileCounter, MetaUtil.format("%H.%n(%p):%r", method)); t.printStackTrace(TTY.cachedOut); } } @@ -366,13 +366,12 @@ * * @return true if it can be compiled, false otherwise */ - private static boolean canBeCompiled(HotSpotResolvedJavaMethod javaMethod, int modifiers) { + private boolean canBeCompiled(HotSpotResolvedJavaMethod javaMethod, int modifiers) { if (Modifier.isAbstract(modifiers) || Modifier.isNative(modifiers)) { return false; } - // This number is from HotSpot: - final int hugeMethodLimit = 8000; - if (javaMethod.getCodeSize() > hugeMethodLimit) { + HotSpotVMConfig c = runtime.getConfig(); + if (c.dontCompileHugeMethods && javaMethod.getCodeSize() > c.hugeMethodLimit) { return false; } // Skip @Snippets for now diff -r 3e67710a6d08 -r 4db09b7304da graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java Tue Dec 17 21:39:01 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java Tue Dec 17 22:37:03 2013 +0100 @@ -662,6 +662,8 @@ @HotSpotVMFlag(name = "CompileTheWorld") @Stable public boolean compileTheWorld; @HotSpotVMFlag(name = "CompileTheWorldStartAt") @Stable public int compileTheWorldStartAt; @HotSpotVMFlag(name = "CompileTheWorldStopAt") @Stable public int compileTheWorldStopAt; + @HotSpotVMFlag(name = "DontCompileHugeMethods") @Stable public boolean dontCompileHugeMethods; + @HotSpotVMFlag(name = "HugeMethodLimit") @Stable public int hugeMethodLimit; @HotSpotVMFlag(name = "PrintCompilation") @Stable public boolean printCompilation; @HotSpotVMFlag(name = "PrintInlining") @Stable public boolean printInlining; @HotSpotVMFlag(name = "GraalUseFastLocking") @Stable public boolean useFastLocking;