# HG changeset patch # User Doug Simon # Date 1404407264 -7200 # Node ID 9ca36e4e31377a6a16cc135222102b7b6bcc1e3e # Parent 5c0f2b338874286bfcbaf6652bf91a8b69d15a1d removed use of SecurityManager and hiding fields from reflection (made redundant by -XX:+UseGraalClassLoader option) diff -r 5c0f2b338874 -r 9ca36e4e3137 graal/com.oracle.graal.api.runtime/src/com/oracle/graal/api/runtime/Graal.java --- a/graal/com.oracle.graal.api.runtime/src/com/oracle/graal/api/runtime/Graal.java Thu Jul 03 18:57:20 2014 +0200 +++ b/graal/com.oracle.graal.api.runtime/src/com/oracle/graal/api/runtime/Graal.java Thu Jul 03 19:07:44 2014 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.api.runtime; -import java.lang.reflect.*; - import sun.reflect.*; public class Graal { @@ -32,17 +30,7 @@ private static native GraalRuntime initializeRuntime(); - public static final java.security.Permission ACCESS_PERMISSION = new ReflectPermission("allowGraalAccess"); - - @CallerSensitive public static GraalRuntime getRuntime() { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - Class cc = Reflection.getCallerClass(); - if (cc.getClassLoader() != null) { - sm.checkPermission(ACCESS_PERMISSION); - } - } return runtime; } @@ -54,18 +42,10 @@ rt = new InvalidGraalRuntime(); } runtime = rt; - Reflection.registerFieldsToFilter(Graal.class, "runtime"); } @CallerSensitive public static T getRequiredCapability(Class clazz) { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - Class cc = Reflection.getCallerClass(); - if (cc.getClassLoader() != null) { - sm.checkPermission(ACCESS_PERMISSION); - } - } T t = getRuntime().getCapability(clazz); if (t == null) { String javaHome = System.getProperty("java.home"); diff -r 5c0f2b338874 -r 9ca36e4e3137 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Thu Jul 03 18:57:20 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Thu Jul 03 19:07:44 2014 +0200 @@ -28,13 +28,11 @@ import static com.oracle.graal.hotspot.CompileTheWorld.Options.*; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.Options.*; import static com.oracle.graal.hotspot.InitTimer.*; -import static sun.reflect.Reflection.*; import java.lang.reflect.*; import java.util.*; import sun.misc.*; -import sun.reflect.*; import com.oracle.graal.api.code.*; import com.oracle.graal.api.code.stack.*; @@ -79,22 +77,12 @@ // Why deferred initialization? See comment in completeInitialization(). instance.completeInitialization(); } - - registerFieldsToFilter(HotSpotGraalRuntime.class, "instance"); } /** * Gets the singleton {@link HotSpotGraalRuntime} object. */ - @CallerSensitive public static HotSpotGraalRuntime runtime() { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - Class cc = Reflection.getCallerClass(); - if (cc != null && cc.getClassLoader() != null) { - sm.checkPermission(Graal.ACCESS_PERMISSION); - } - } assert instance != null; return instance; }