< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/UnsafeAccess.java

Print this page
rev 52509 : [mq]: graal2

*** 31,41 **** /** * Package private access to the {@link Unsafe} capability. */ class UnsafeAccess { ! static final Unsafe UNSAFE = initUnsafe(); private static Unsafe initUnsafe() { try { // Fast path when we are trusted. return Unsafe.getUnsafe(); --- 31,43 ---- /** * Package private access to the {@link Unsafe} capability. */ class UnsafeAccess { ! private static final Unsafe THE_UNSAFE = initUnsafe(); ! ! static final UnsafeAccess UNSAFE = new UnsafeAccess(); private static Unsafe initUnsafe() { try { // Fast path when we are trusted. return Unsafe.getUnsafe();
*** 48,53 **** --- 50,63 ---- } catch (Exception e) { throw new RuntimeException("exception while trying to get Unsafe", e); } } } + + public char getChar(Object target, long l) { + return THE_UNSAFE.getChar(target, l); + } + + public byte getByte(Object target, long l) { + return THE_UNSAFE.getByte(target, l); + } }
< prev index next >