changeset 1277:9afedbf3784c

7901499: Blackhole inlining should be optional for testing
author shade
date Tue, 08 Sep 2015 22:32:50 +0300
parents 0879b862a1a3
children 1bbe29bb4639
files jmh-core/src/main/java/org/openjdk/jmh/runner/CompilerHints.java
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/CompilerHints.java	Fri Aug 28 23:43:03 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/CompilerHints.java	Tue Sep 08 22:32:50 2015 +0300
@@ -41,6 +41,9 @@
     // Zing is only compatible from post 5.10.*.* releases
     static final String JVM_ZING = "Zing";
 
+    // Force blackhole inline, useful for testing.
+    public static final boolean INLINE_BLACKHOLE = Boolean.getBoolean("jmh.blackhole.forceInline");
+
     private static volatile CompilerHints defaultList;
     private static volatile String hintsFile;
 
@@ -62,7 +65,11 @@
                 final Set<String> defaultHints = defaultList().get();
                 List<String> hints = new ArrayList<String>(defaultHints.size() + 2);
                 hints.add("quiet");
-                hints.add("dontinline,org/openjdk/jmh/infra/Blackhole.*");
+                if (INLINE_BLACKHOLE) {
+                    hints.add("inline,org/openjdk/jmh/infra/Blackhole.*");
+                } else {
+                    hints.add("dontinline,org/openjdk/jmh/infra/Blackhole.*");
+                }
                 hints.addAll(defaultHints);
                 hintsFile = FileUtils.createTempFileWithLines("compilecommand", hints);
             } catch (IOException e) {