< prev index next >
test/compiler/c2/cr8004867/TestIntUnsafeVolatile.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2013, 2015, 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.
--- 1,7 ----
/*
! * Copyright (c) 2013, 2016, 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.
*** 48,65 ****
private static final int OFFSET = 3;
private static final int SCALE = 2;
private static final int ALIGN_OFF = 8;
private static final int UNALIGN_OFF = 5;
! private static final Unsafe unsafe;
private static final int BASE;
static {
try {
- Class c = TestIntUnsafeVolatile.class.getClassLoader().loadClass("jdk.internal.misc.Unsafe");
- Field f = c.getDeclaredField("theUnsafe");
- f.setAccessible(true);
- unsafe = (Unsafe)f.get(c);
BASE = unsafe.arrayBaseOffset(int[].class);
} catch (Exception e) {
InternalError err = new InternalError();
err.initCause(e);
throw err;
--- 48,61 ----
private static final int OFFSET = 3;
private static final int SCALE = 2;
private static final int ALIGN_OFF = 8;
private static final int UNALIGN_OFF = 5;
! private static final Unsafe unsafe = Unsafe.getUnsafe();
private static final int BASE;
static {
try {
BASE = unsafe.arrayBaseOffset(int[].class);
} catch (Exception e) {
InternalError err = new InternalError();
err.initCause(e);
throw err;
< prev index next >