changeset 241:8e1914f965b4

Make more State threads public to avoid accessor costs. (These are only visible in subtypes anyway).
author shade
date Tue, 12 Nov 2013 16:42:13 +0100
parents 127ca0c87a5c
children 0b919385c073
files jmh-core/src/main/java/org/openjdk/jmh/processor/internal/StateObjectHandler.java
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/processor/internal/StateObjectHandler.java	Tue Nov 12 16:40:52 2013 +0100
+++ b/jmh-core/src/main/java/org/openjdk/jmh/processor/internal/StateObjectHandler.java	Tue Nov 12 16:42:13 2013 +0100
@@ -423,11 +423,11 @@
 
 
             for (Level level : Level.values()) {
-                result.add("    volatile int setup" + level + "Mutex;");
-                result.add("    volatile int tear" + level + "Mutex;");
-                result.add("    final static AtomicIntegerFieldUpdater setup" + level + "MutexUpdater = " +
+                result.add("    public volatile int setup" + level + "Mutex;");
+                result.add("    public volatile int tear" + level + "Mutex;");
+                result.add("    public final static AtomicIntegerFieldUpdater setup" + level + "MutexUpdater = " +
                         "AtomicIntegerFieldUpdater.newUpdater(" + so.type + "_B2.class, \"setup" + level + "Mutex\");");
-                result.add("    final static AtomicIntegerFieldUpdater tear" + level + "MutexUpdater = " +
+                result.add("    public final static AtomicIntegerFieldUpdater tear" + level + "MutexUpdater = " +
                         "AtomicIntegerFieldUpdater.newUpdater(" + so.type + "_B2.class, \"tear" + level + "Mutex\");");
                 result.add("");
             }
@@ -436,12 +436,12 @@
                 case Benchmark:
                 case Group:
                     for (Level level : Level.values()) {
-                        result.add("    volatile boolean ready" + level + ";");
+                        result.add("    public volatile boolean ready" + level + ";");
                     }
                     break;
                 case Thread:
                     for (Level level : Level.values()) {
-                        result.add("    boolean ready" + level + ";");
+                        result.add("    public boolean ready" + level + ";");
                     }
                     break;
                 default:
@@ -479,9 +479,9 @@
 
     public Collection<String> getFields() {
         Collection<String> result = new ArrayList<String>();
-        result.add("private static final java.util.concurrent.atomic.AtomicInteger threadSelector = new java.util.concurrent.atomic.AtomicInteger();");
-        result.add("private int threadId = 0;");
-        result.add("private boolean threadId_inited = false;");
+        result.add("public static final java.util.concurrent.atomic.AtomicInteger threadSelector = new java.util.concurrent.atomic.AtomicInteger();");
+        result.add("public int threadId = 0;");
+        result.add("public boolean threadId_inited = false;");
         return result;
     }