< 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,11 +31,13 @@
/**
* Package private access to the {@link Unsafe} capability.
*/
class UnsafeAccess {
- static final Unsafe UNSAFE = initUnsafe();
+ 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,6 +50,14 @@
} 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 >