< prev index next >

test/compiler/c2/cr8004867/TestIntUnsafeOrdered.java

Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke


   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 /**
  26  * @test
  27  * @bug 8004867
  28  * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob"
  29  *
  30  * @modules java.base/jdk.internal.misc
  31  * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntUnsafeOrdered
  32  * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntUnsafeOrdered





  33  */
  34 


  35 import jdk.internal.misc.Unsafe;

  36 import java.lang.reflect.Field;
  37 
  38 public class TestIntUnsafeOrdered {
  39   private static final int ARRLEN = 97;
  40   private static final int ITERS  = 11000;
  41   private static final int OFFSET = 3;
  42   private static final int SCALE = 2;
  43   private static final int ALIGN_OFF = 8;
  44   private static final int UNALIGN_OFF = 5;
  45 
  46   private static final Unsafe unsafe;
  47   private static final int BASE;
  48   static {
  49     try {
  50       Class<?> c = Unsafe.class;
  51       Field f = c.getDeclaredField("theUnsafe");
  52       f.setAccessible(true);
  53       unsafe = (Unsafe) f.get(c);
  54       BASE = unsafe.arrayBaseOffset(int[].class);
  55     } catch (Exception e) {




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 /**
  26  * @test
  27  * @bug 8004867
  28  * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob"

  29  * @modules java.base/jdk.internal.misc
  30  *
  31  * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
  32  *    -XX:-OptimizeFill
  33  *    compiler.c2.cr8004867.TestIntUnsafeOrdered
  34  * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
  35  *    -XX:+OptimizeFill
  36  *    compiler.c2.cr8004867.TestIntUnsafeOrdered
  37  */
  38 
  39 package compiler.c2.cr8004867;
  40 
  41 import jdk.internal.misc.Unsafe;
  42 
  43 import java.lang.reflect.Field;
  44 
  45 public class TestIntUnsafeOrdered {
  46   private static final int ARRLEN = 97;
  47   private static final int ITERS  = 11000;
  48   private static final int OFFSET = 3;
  49   private static final int SCALE = 2;
  50   private static final int ALIGN_OFF = 8;
  51   private static final int UNALIGN_OFF = 5;
  52 
  53   private static final Unsafe unsafe;
  54   private static final int BASE;
  55   static {
  56     try {
  57       Class<?> c = Unsafe.class;
  58       Field f = c.getDeclaredField("theUnsafe");
  59       f.setAccessible(true);
  60       unsafe = (Unsafe) f.get(c);
  61       BASE = unsafe.arrayBaseOffset(int[].class);
  62     } catch (Exception e) {


< prev index next >