< prev index next >

test/gc/g1/TestHumongousCodeCacheRoots.java

Print this page




  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @key regression
  27  * @key gc
  28  * @bug 8027756
  29  * @library /testlibrary /../../test/lib
  30  * @modules java.base/sun.misc
  31  *          java.management
  32  * @build TestHumongousCodeCacheRoots
  33  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  34  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  35  * @summary Humongous objects may have references from the code cache
  36  * @run main TestHumongousCodeCacheRoots
  37 */
  38 
  39 import com.oracle.java.testlibrary.*;
  40 import sun.hotspot.WhiteBox;
  41 
  42 import java.util.ArrayList;
  43 import java.util.Arrays;
  44 
  45 class TestHumongousCodeCacheRootsHelper {
  46 
  47     static final int n = 1000000;
  48     static final int[] AA = new int[n];
  49     static final int[] BB = new int[n];
  50 
  51     public static void main(String args[]) throws Exception {
  52         // do some work so that the compiler compiles this method, inlining the
  53         // reference to the integer array (which is a humonguous object) into
  54         // the code cache.
  55         for(int i = 0; i < n; i++) {
  56             AA[i] = 0;
  57             BB[i] = 0;
  58         }
  59         // trigger a GC that checks that the verification code allows humongous




  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @key regression
  27  * @key gc
  28  * @bug 8027756
  29  * @library /testlibrary /../../test/lib
  30  * @modules java.base/sun.misc
  31  *          java.management
  32  * @build TestHumongousCodeCacheRoots
  33  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  34  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  35  * @summary Humongous objects may have references from the code cache
  36  * @run main TestHumongousCodeCacheRoots
  37 */
  38 
  39 import jdk.test.lib.*;
  40 import sun.hotspot.WhiteBox;
  41 
  42 import java.util.ArrayList;
  43 import java.util.Arrays;
  44 
  45 class TestHumongousCodeCacheRootsHelper {
  46 
  47     static final int n = 1000000;
  48     static final int[] AA = new int[n];
  49     static final int[] BB = new int[n];
  50 
  51     public static void main(String args[]) throws Exception {
  52         // do some work so that the compiler compiles this method, inlining the
  53         // reference to the integer array (which is a humonguous object) into
  54         // the code cache.
  55         for(int i = 0; i < n; i++) {
  56             AA[i] = 0;
  57             BB[i] = 0;
  58         }
  59         // trigger a GC that checks that the verification code allows humongous


< prev index next >