< prev index next >

src/java.base/share/classes/java/lang/Runtime.java

Print this page

        

@@ -33,10 +33,12 @@
 import java.util.stream.Collectors;
 import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
 import java.util.StringTokenizer;
+
+import jdk.internal.misc.SharedSecrets;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
 
 /**
  * Every Java application has a single instance of class

@@ -700,13 +702,10 @@
      * The method {@link System#gc()} is the conventional and convenient
      * means of invoking this method.
      */
     public native void gc();
 
-    /* Wormhole for calling java.lang.ref.Finalizer.runFinalization */
-    private static native void runFinalization0();
-
     /**
      * Runs the finalization methods of any objects pending finalization.
      * Calling this method suggests that the Java virtual machine expend
      * effort toward running the {@code finalize} methods of objects
      * that have been found to be discarded but whose {@code finalize}

@@ -722,11 +721,11 @@
      * and convenient means of invoking this method.
      *
      * @see     java.lang.Object#finalize()
      */
     public void runFinalization() {
-        runFinalization0();
+        SharedSecrets.getJavaLangRefAccess().runFinalization();
     }
 
     /**
      * Not implemented, does nothing.
      *
< prev index next >