< prev index next >

src/java.base/share/classes/jdk/internal/reflect/Reflection.java

Print this page
@@ -30,10 +30,11 @@
  import java.util.Map;
  import java.util.Objects;
  import java.util.Set;
  import jdk.internal.access.SharedSecrets;
  import jdk.internal.misc.VM;
+ import jdk.internal.vm.annotation.ForceInline;
  import jdk.internal.vm.annotation.IntrinsicCandidate;
  
  /** Common utility routines used by both java.lang and
      java.lang.reflect */
  

@@ -104,10 +105,11 @@
          if (!verifyMemberAccess(currentClass, memberClass, targetClass, modifiers)) {
              throw newIllegalAccessException(currentClass, memberClass, targetClass, modifiers);
          }
      }
  
+     @ForceInline
      public static void ensureNativeAccess(Class<?> currentClass) {
          Module module = currentClass.getModule();
          if (!SharedSecrets.getJavaLangAccess().isEnableNativeAccess(module)) {
              throw new IllegalCallerException("Illegal native access from: " + module);
          }
< prev index next >