< prev index next >

test/compiler/runtime/Test8010927.java

Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke

*** 25,43 **** * @test * @bug 8010927 * @summary Kitchensink crashed with SIGSEGV, Problematic frame: v ~StubRoutines::checkcast_arraycopy * @library /test/lib /testlibrary * @modules java.base/jdk.internal.misc ! * @build Test8010927 ! * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission ! * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. -Xmx64m -XX:NewSize=20971520 -XX:MaxNewSize=32m -XX:-UseTLAB -XX:-UseAdaptiveSizePolicy Test8010927 */ import sun.hotspot.WhiteBox; import java.lang.reflect.Field; - import jdk.internal.misc.Unsafe; /** * The test creates uncommitted space between oldgen and young gen * by specifying MaxNewSize bigger than NewSize. * NewSize = 20971520 = (512*4K) * 10 for 4k pages --- 25,49 ---- * @test * @bug 8010927 * @summary Kitchensink crashed with SIGSEGV, Problematic frame: v ~StubRoutines::checkcast_arraycopy * @library /test/lib /testlibrary * @modules java.base/jdk.internal.misc ! * @build compiler.runtime.Test8010927 ! * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission ! * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions ! * -XX:+WhiteBoxAPI -Xbootclasspath/a:. -Xmx64m -XX:NewSize=20971520 ! * -XX:MaxNewSize=32m -XX:-UseTLAB -XX:-UseAdaptiveSizePolicy ! * compiler.runtime.Test8010927 */ + package compiler.runtime; + + import jdk.internal.misc.Unsafe; import sun.hotspot.WhiteBox; + import java.lang.reflect.Field; /** * The test creates uncommitted space between oldgen and young gen * by specifying MaxNewSize bigger than NewSize. * NewSize = 20971520 = (512*4K) * 10 for 4k pages
*** 70,80 **** static final WhiteBox wb = WhiteBox.getWhiteBox(); static final int obj_header_size = U.ARRAY_OBJECT_BASE_OFFSET; static final int heap_oop_size = wb.getHeapOopSize(); static final int card_size = 512; ! static final int one_card = (card_size - obj_header_size)/heap_oop_size; static final int surv_size = 2112 * 1024; // The size is big to not fit into survive space. static final Object[] cache = new Object[(surv_size / card_size)]; --- 76,86 ---- static final WhiteBox wb = WhiteBox.getWhiteBox(); static final int obj_header_size = U.ARRAY_OBJECT_BASE_OFFSET; static final int heap_oop_size = wb.getHeapOopSize(); static final int card_size = 512; ! static final int one_card = (card_size - obj_header_size) / heap_oop_size; static final int surv_size = 2112 * 1024; // The size is big to not fit into survive space. static final Object[] cache = new Object[(surv_size / card_size)];
*** 98,108 **** } // Each A[one_card] size is 512 bytes, // it will take about 40000 allocations to trigger GC. // cache[] has 8192 elements so GC should happen // each 5th iteration. ! for(long l = 0; l < 20; l++) { fill_heap(); if (debug) { System.out.println("test oop_disjoint_arraycopy"); } testA_arraycopy(); --- 104,114 ---- } // Each A[one_card] size is 512 bytes, // it will take about 40000 allocations to trigger GC. // cache[] has 8192 elements so GC should happen // each 5th iteration. ! for (long l = 0; l < 20; l++) { fill_heap(); if (debug) { System.out.println("test oop_disjoint_arraycopy"); } testA_arraycopy();
*** 118,127 **** --- 124,134 ---- System.out.println("top_addr: 0x" + Long.toHexString(addr) + ", 0x" + Long.toHexString(addr + 512)); } } } } + static void fill_heap() { for (int i = 0; i < cache.length; ++i) { o = new Test8010927[one_card]; System.arraycopy(masterA, 0, o, 0, masterA.length); cache[i] = o;
*** 128,147 **** --- 135,157 ---- } for (long j = 0; j < 256; ++j) { o = new Long[10000]; // to trigger GC } } + static void testA_arraycopy() { for (int i = 0; i < cache.length; ++i) { System.arraycopy(masterA, 0, cache[i], 0, masterA.length); } } + static void testB_arraycopy() { for (int i = 0; i < cache.length; ++i) { System.arraycopy(masterB, 0, cache[i], 0, masterB.length); } } + static int get_top_address(long min, long max) { int index = -1; long addr = min; for (int i = 0; i < cache.length; ++i) { long test = wb.getObjectAddress(cache[i]);
< prev index next >