sf = reader.getPrevious(sf);
sfEnum.next();
    public static void checkPermission(Permission perm)            throws AccessControlException {        if (!Unsafe.getCurrentProcessor().isThreadSwitchActive()) {            // getContext().checkPermission(perm);            // This is an optimized version of            // getContext().checkPermission()            // that does not require any memory allocations.            final VmStackReader reader = Unsafe.getCurrentProcessor()                    .getArchitecture().getStackReader();            Address sf = VmMagic.getCurrentFrame();            int recursionCount = 0;            while (reader.isValid(sf)) {                final VmMethod method = reader.getMethod(sf);                if (method.hasDoPrivilegedPragma()) {                    // Stop here with the current thread's stacktrace.                    break;                } else if (method.hasCheckPermissionPragma()) {                    // Be paranoia for now, let's check for recursive                    // checkPermission calls.                    recursionCount++;                    if (recursionCount > 2) {                        reader.debugStackTrace();                        Unsafe.die("Recursive checkPermission");                    }                } else {                    final VmType<?> declClass = method.getDeclaringClass();                    final ProtectionDomain pd = declClass.getProtectionDomain();                    if (pd != null) {                        // Unsafe.debug(":pd");                        if (!pd.implies(perm)) {                            // Unsafe.debug("Permission denied");                            throw new AccessControlException("Permission \""                                    + perm + "\" not granted due to "                                    + declClass.getName());                        }                    }                }                if (method.hasPrivilegedActionPragma()) {                    // Break here, do not include inherited thread context                    return;                }                sf = reader.getPrevious(sf);            }            final VmThread thread = VmThread.currentThread();            final VmAccessControlContext inheritedCtx = thread.getContext();            if (inheritedCtx != null) {                inheritedCtx.checkPermission(perm);            }        }    }