< prev index next >
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java
Print this page
*** 26,37 ****
import static jdk.vm.ci.meta.DeoptimizationAction.None;
import static jdk.vm.ci.meta.DeoptimizationReason.TransferToInterpreter;
import static org.graalvm.compiler.core.common.GraalOptions.ImmutableCode;
- import java.lang.reflect.Field;
-
import org.graalvm.compiler.core.common.CompilationIdentifier;
import org.graalvm.compiler.core.common.type.StampFactory;
import org.graalvm.compiler.core.common.type.StampPair;
import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
import org.graalvm.compiler.hotspot.HotSpotCompilationIdentifier;
--- 26,35 ----
*** 54,63 ****
--- 52,62 ----
import org.graalvm.compiler.nodes.memory.HeapAccess.BarrierType;
import org.graalvm.compiler.nodes.memory.ReadNode;
import org.graalvm.compiler.nodes.memory.address.AddressNode;
import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode;
import org.graalvm.compiler.nodes.util.ConstantFoldUtil;
+ import org.graalvm.compiler.serviceprovider.GraalUnsafeAccess;
import org.graalvm.compiler.word.Word;
import org.graalvm.compiler.word.WordOperationPlugin;
import jdk.internal.vm.compiler.word.LocationIdentity;
import jdk.vm.ci.hotspot.HotSpotCompilationRequest;
*** 81,90 ****
--- 80,90 ----
* i.e., there are never non-inlined invokes that involve the {@link Word} type.</li>
* <li>Constant folding of field loads.</li>
* </ul>
*/
public final class HotSpotNodePlugin implements NodePlugin, TypePlugin {
+ private static final Unsafe UNSAFE = GraalUnsafeAccess.getUnsafe();
protected final WordOperationPlugin wordOperationPlugin;
private final GraalHotSpotVMConfig config;
private final HotSpotWordTypes wordTypes;
public HotSpotNodePlugin(WordOperationPlugin wordOperationPlugin, GraalHotSpotVMConfig config, HotSpotWordTypes wordTypes) {
*** 241,263 ****
}
return afterExceptionLoaded;
}
private static final LocationIdentity JAVA_THREAD_SHOULD_POST_ON_EXCEPTIONS_FLAG_LOCATION = NamedLocationIdentity.mutable("JavaThread::_should_post_on_exceptions_flag");
- static final Unsafe UNSAFE = initUnsafe();
-
- static Unsafe initUnsafe() {
- try {
- // Fast path when we are trusted.
- return Unsafe.getUnsafe();
- } catch (SecurityException se) {
- // Slow path when we are not trusted.
- try {
- Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
- theUnsafe.setAccessible(true);
- return (Unsafe) theUnsafe.get(Unsafe.class);
- } catch (Exception e) {
- throw new RuntimeException("exception while trying to get Unsafe", e);
- }
- }
- }
}
--- 241,247 ----
}
return afterExceptionLoaded;
}
private static final LocationIdentity JAVA_THREAD_SHOULD_POST_ON_EXCEPTIONS_FLAG_LOCATION = NamedLocationIdentity.mutable("JavaThread::_should_post_on_exceptions_flag");
}
+
< prev index next >