changeset 243:13d571fe4348

Runners: fix up @Contended support for JDK 9.
author shade
date Thu, 12 May 2016 19:41:37 +0300
parents 5ce9bc3415f5
children 0b45beda9932
files jcstress-core/src/main/java/jdk/internal/vm/annotation/Contended.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/BooleanResult1.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/BooleanResult2.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/BooleanResult4.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ByteResult1.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ByteResult2.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ByteResult3.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ByteResult4.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ByteResult8.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/CharResult1.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/CharResult2.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/CharResult4.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/DoubleResult1.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/DoubleResult2.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/DoubleResult4.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/FloatResult1.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/FloatResult2.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/FloatResult4.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/IntResult1.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/IntResult2.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/IntResult3.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/IntResult4.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/IntResult8.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/LongResult1.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/LongResult2.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/LongResult3.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/LongResult4.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ShortResult1.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ShortResult2.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ShortResult4.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/StringResult1.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/StringResult2.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/StringResult4.java jcstress-core/src/main/java/org/openjdk/jcstress/util/Reflections.java jcstress-core/src/main/java/org/openjdk/jcstress/vm/ContendedTestMain.java jcstress-core/src/main/java/org/openjdk/jcstress/vm/VMSupport.java jcstress-test-gen/src/main/java/org/openjdk/jcstress/generator/ResultGenerator.java
diffstat 37 files changed, 282 insertions(+), 178 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jcstress-core/src/main/java/jdk/internal/vm/annotation/Contended.java	Thu May 12 19:41:37 2016 +0300
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.internal.vm.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.FIELD, ElementType.TYPE})
+public @interface Contended {
+}
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/BooleanResult1.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/BooleanResult1.java	Thu May 12 19:41:37 2016 +0300
@@ -25,14 +25,14 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class BooleanResult1 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public boolean r1;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/BooleanResult2.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/BooleanResult2.java	Thu May 12 19:41:37 2016 +0300
@@ -25,17 +25,18 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class BooleanResult2 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public boolean r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public boolean r2;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/BooleanResult4.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/BooleanResult4.java	Thu May 12 19:41:37 2016 +0300
@@ -25,23 +25,26 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class BooleanResult4 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public boolean r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public boolean r2;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public boolean r3;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public boolean r4;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ByteResult1.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ByteResult1.java	Thu May 12 19:41:37 2016 +0300
@@ -25,14 +25,14 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class ByteResult1 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r1;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ByteResult2.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ByteResult2.java	Thu May 12 19:41:37 2016 +0300
@@ -25,17 +25,18 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class ByteResult2 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r2;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ByteResult3.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ByteResult3.java	Thu May 12 19:41:37 2016 +0300
@@ -25,20 +25,22 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class ByteResult3 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r2;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r3;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ByteResult4.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ByteResult4.java	Thu May 12 19:41:37 2016 +0300
@@ -25,23 +25,26 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class ByteResult4 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r2;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r3;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r4;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ByteResult8.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ByteResult8.java	Thu May 12 19:41:37 2016 +0300
@@ -25,35 +25,42 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class ByteResult8 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r2;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r3;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r4;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r5;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r6;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r7;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public byte r8;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/CharResult1.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/CharResult1.java	Thu May 12 19:41:37 2016 +0300
@@ -25,14 +25,14 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class CharResult1 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public char r1;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/CharResult2.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/CharResult2.java	Thu May 12 19:41:37 2016 +0300
@@ -25,17 +25,18 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class CharResult2 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public char r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public char r2;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/CharResult4.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/CharResult4.java	Thu May 12 19:41:37 2016 +0300
@@ -25,23 +25,26 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class CharResult4 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public char r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public char r2;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public char r3;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public char r4;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/DoubleResult1.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/DoubleResult1.java	Thu May 12 19:41:37 2016 +0300
@@ -25,14 +25,14 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class DoubleResult1 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public double r1;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/DoubleResult2.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/DoubleResult2.java	Thu May 12 19:41:37 2016 +0300
@@ -25,17 +25,18 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class DoubleResult2 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public double r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public double r2;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/DoubleResult4.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/DoubleResult4.java	Thu May 12 19:41:37 2016 +0300
@@ -25,23 +25,26 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class DoubleResult4 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public double r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public double r2;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public double r3;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public double r4;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/FloatResult1.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/FloatResult1.java	Thu May 12 19:41:37 2016 +0300
@@ -25,14 +25,14 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class FloatResult1 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public float r1;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/FloatResult2.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/FloatResult2.java	Thu May 12 19:41:37 2016 +0300
@@ -25,17 +25,18 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class FloatResult2 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public float r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public float r2;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/FloatResult4.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/FloatResult4.java	Thu May 12 19:41:37 2016 +0300
@@ -25,23 +25,26 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class FloatResult4 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public float r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public float r2;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public float r3;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public float r4;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/IntResult1.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/IntResult1.java	Thu May 12 19:41:37 2016 +0300
@@ -25,14 +25,14 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class IntResult1 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r1;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/IntResult2.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/IntResult2.java	Thu May 12 19:41:37 2016 +0300
@@ -25,17 +25,18 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class IntResult2 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r2;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/IntResult3.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/IntResult3.java	Thu May 12 19:41:37 2016 +0300
@@ -25,20 +25,22 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class IntResult3 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r2;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r3;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/IntResult4.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/IntResult4.java	Thu May 12 19:41:37 2016 +0300
@@ -25,23 +25,26 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class IntResult4 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r2;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r3;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r4;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/IntResult8.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/IntResult8.java	Thu May 12 19:41:37 2016 +0300
@@ -25,35 +25,42 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class IntResult8 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r2;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r3;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r4;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r5;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r6;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r7;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public int r8;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/LongResult1.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/LongResult1.java	Thu May 12 19:41:37 2016 +0300
@@ -25,14 +25,14 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class LongResult1 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public long r1;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/LongResult2.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/LongResult2.java	Thu May 12 19:41:37 2016 +0300
@@ -25,17 +25,18 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class LongResult2 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public long r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public long r2;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/LongResult3.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/LongResult3.java	Thu May 12 19:41:37 2016 +0300
@@ -25,20 +25,22 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class LongResult3 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public long r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public long r2;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public long r3;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/LongResult4.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/LongResult4.java	Thu May 12 19:41:37 2016 +0300
@@ -25,23 +25,26 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class LongResult4 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public long r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public long r2;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public long r3;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public long r4;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ShortResult1.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ShortResult1.java	Thu May 12 19:41:37 2016 +0300
@@ -25,14 +25,14 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class ShortResult1 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public short r1;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ShortResult2.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ShortResult2.java	Thu May 12 19:41:37 2016 +0300
@@ -25,17 +25,18 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class ShortResult2 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public short r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public short r2;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ShortResult4.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/ShortResult4.java	Thu May 12 19:41:37 2016 +0300
@@ -25,23 +25,26 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class ShortResult4 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public short r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public short r2;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public short r3;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public short r4;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/StringResult1.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/StringResult1.java	Thu May 12 19:41:37 2016 +0300
@@ -25,15 +25,14 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
-import java.util.Objects;
 
 @Result
 public class StringResult1 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public String r1;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/StringResult2.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/StringResult2.java	Thu May 12 19:41:37 2016 +0300
@@ -25,17 +25,18 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class StringResult2 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public String r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public String r2;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/StringResult4.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/results/StringResult4.java	Thu May 12 19:41:37 2016 +0300
@@ -25,23 +25,26 @@
 package org.openjdk.jcstress.infra.results;
 
 import org.openjdk.jcstress.annotations.Result;
-import sun.misc.Contended;
 
 import java.io.Serializable;
 
 @Result
 public class StringResult4 implements Serializable {
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public String r1;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public String r2;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public String r3;
 
-    @Contended
+    @sun.misc.Contended
+    @jdk.internal.vm.annotation.Contended
     public String r4;
 
     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/util/Reflections.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/util/Reflections.java	Thu May 12 19:41:37 2016 +0300
@@ -48,23 +48,6 @@
     private static volatile boolean RESOURCE_INITED;
     private static Set<String> RESOURCES;
 
-    public static Collection<String> getResources(String filter, String postfix) {
-        try {
-            ensureResourceInited();
-
-            List<String> res = new ArrayList<>();
-            for (String name : RESOURCES) {
-                if (!name.contains(filter)) continue;
-                if (!name.endsWith(postfix)) continue;
-                res.add(name);
-            }
-
-            return res;
-        } catch (IOException e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
     private static void ensureResourceInited() throws IOException {
         if (!RESOURCE_INITED) {
             final SortedSet<String> newResources = new TreeSet<>();
@@ -82,7 +65,8 @@
         final List<Class> newClasses = new ArrayList<>();
         for (String name : getClassNames(filter)) {
             try {
-                if (name.contains("VMSupport")) continue;
+                if (name.contains("sun.misc")) continue;
+                if (name.contains("jdk.internal")) continue;
                 newClasses.add(Class.forName(name));
             } catch (ClassNotFoundException e) {
                 throw new IllegalStateException(e.getMessage(), e);
@@ -94,12 +78,12 @@
     public static Collection<String> getClassNames(final String filter) throws IOException {
         ensureResourceInited();
 
+        Pattern p = Pattern.compile("[\\\\|/]");
         final List<String> newClasses = new ArrayList<>();
         for (String name : RESOURCES) {
-            name = name.replaceAll("\\\\", ".");
-            name = name.replaceAll("/", ".");
+            name = p.matcher(name).replaceAll(".");
             if (name.contains(filter) && name.endsWith(".class")) {
-                newClasses.add(name.substring(name.indexOf(filter), name.length() - 6));
+                newClasses.add(name.substring(0, name.length() - 6));
             }
         }
 
@@ -156,35 +140,6 @@
 
     }
 
-    public static void copy(InputStream input, OutputStream output) throws IOException {
-        if (input == null) {
-            throw new IOException("inputstream is null");
-        }
-
-        byte[] buffer = new byte[8192];
-        while (true) {
-            int read = input.read(buffer);
-            if (read == -1) {
-                break;
-            }
-            output.write(buffer, 0, read);
-        }
-    }
-
-    public static byte[] readAll(File file) throws IOException {
-        FileInputStream fos = new FileInputStream(file);
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        copy(fos, baos);
-        fos.close();
-        return baos.toByteArray();
-    }
-
-    public static byte[] readAll(InputStream input) throws IOException {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        copy(input, baos);
-        return baos.toByteArray();
-    }
-
 
     public interface ResultCallback {
         void accept(String name);
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/vm/ContendedTestMain.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/vm/ContendedTestMain.java	Thu May 12 19:41:37 2016 +0300
@@ -24,17 +24,75 @@
  */
 package org.openjdk.jcstress.vm;
 
-import org.openjdk.jcstress.infra.results.IntResult2;
+import org.openjdk.jcstress.annotations.Result;
+import org.openjdk.jcstress.util.Reflections;
 import org.openjdk.jcstress.util.UnsafeHolder;
 
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
 public class ContendedTestMain {
 
-    public static void main(String... args) throws NoSuchFieldException {
-        long o1 = UnsafeHolder.U.objectFieldOffset(IntResult2.class.getField("r1"));
-        long o2 = UnsafeHolder.U.objectFieldOffset(IntResult2.class.getField("r2"));
+    private static final int PADDING_WIDTH = 64;
 
-        if (Math.abs(o2 - o1) < 64) {
-            throw new IllegalStateException("@Contended does not seem to be working.");
+    public static void main(String... args) throws NoSuchFieldException, IOException {
+        List<String> msgs = new ArrayList<>();
+
+        Collection<Class> classes = Reflections.getClasses("class");
+        if (classes.isEmpty()) {
+            throw new IllegalStateException("Classes not found");
+        }
+
+        for (Class<?> cl : classes) {
+            if (cl.getAnnotation(Result.class) == null) continue;
+
+            List<FieldDef> fdefs = new ArrayList<>();
+            for (Field f : cl.getDeclaredFields()) {
+                fdefs.add(new FieldDef(f));
+            }
+
+            Collections.sort(fdefs);
+
+            FieldDef last = null;
+            for (FieldDef fd : fdefs) {
+                if (fd.offset < PADDING_WIDTH) {
+                    msgs.add("Class " + cl + ": field " + fd.field.getName() + " is not padded");
+                }
+
+                if (last != null) {
+                    if (Math.abs(fd.offset - last.offset) < PADDING_WIDTH) {
+                        msgs.add("Class " + cl + ": fields " + fd.field.getName() + " and " + last.field.getName() + " are not padded pairwise");
+                    }
+                }
+
+                last = fd;
+            }
+        }
+
+        if (!msgs.isEmpty()) {
+            for (String msg : msgs) {
+                System.out.println(msg);
+            }
+            throw new IllegalStateException("@Contended does not seem to work properly");
+        }
+    }
+
+    static class FieldDef implements Comparable<FieldDef> {
+        final Field field;
+        final long offset;
+
+        FieldDef(Field f) {
+            field = f;
+            offset = UnsafeHolder.U.objectFieldOffset(f);
+        }
+
+        @Override
+        public int compareTo(FieldDef o) {
+            return Long.compare(offset, o.offset);
         }
     }
 
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/vm/VMSupport.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/vm/VMSupport.java	Thu May 12 19:41:37 2016 +0300
@@ -53,7 +53,7 @@
                 "-XX:+UnlockDiagnosticVMOptions",
                 SimpleTestMain.class);
 
-        detect("Testing @Contended support for avoiding false sharing",
+        detect("Testing @Contended works on all results",
                 "-XX:-RestrictContended",
                 ContendedTestMain.class);
 
--- a/jcstress-test-gen/src/main/java/org/openjdk/jcstress/generator/ResultGenerator.java	Thu May 12 18:29:36 2016 +0300
+++ b/jcstress-test-gen/src/main/java/org/openjdk/jcstress/generator/ResultGenerator.java	Thu May 12 19:41:37 2016 +0300
@@ -76,6 +76,7 @@
             int n = 1;
             for (Class k : types.all()) {
                 pw.println("    @sun.misc.Contended");
+                pw.println("    @jdk.internal.vm.annotation.Contended");
                 pw.println("    public " + k.getSimpleName() + " r" + n + ";");
                 pw.println();
                 n++;