< prev index next >

test/runtime/valhalla/valuetypes/ValueOops.java

Print this page




  25 
  26 import java.lang.invoke.*;
  27 import java.lang.ref.*;
  28 import java.util.concurrent.*;
  29 import jdk.experimental.value.*;
  30 
  31 import static jdk.test.lib.Asserts.*;
  32 import jdk.test.lib.Utils;
  33 import sun.hotspot.WhiteBox;
  34 
  35 /**
  36  * @test ValueOops
  37  * @summary Test embedding oops into Value types
  38  * @library /test/lib
  39  * @compile PersonVcc.java
  40  * @compile -XDenableValueTypes Person.java
  41  * @compile -XDenableValueTypes ValueOops.java
  42  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  43  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  44  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  45  * @run main/othervm -Xint -noverify -XX:+UseSerialGC -Xmx128m -XX:+EnableMVT
  46  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  47  *                   runtime.valhalla.valuetypes.ValueOops
  48  * @run main/othervm -Xint -noverify -XX:+UseG1GC -Xmx128m -XX:+EnableMVT
  49  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  50  *                   runtime.valhalla.valuetypes.ValueOops
  51  * @run main/othervm -Xint -noverify -XX:+UseParallelGC -Xmx128m -XX:+EnableMVT
  52  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  53  *                   runtime.valhalla.valuetypes.ValueOops
  54  * @run main/othervm -Xint -noverify -XX:+UseConcMarkSweepGC -Xmx128m -XX:+EnableMVT
  55  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  56  *                   runtime.valhalla.valuetypes.ValueOops
  57  * @run main/othervm -Xcomp -noverify -XX:+UseSerialGC -Xmx128m -XX:+EnableMVT
  58  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  59  *                   runtime.valhalla.valuetypes.ValueOops
  60  * @run main/othervm -Xcomp -noverify -XX:+UseG1GC -Xmx128m -XX:+EnableMVT
  61  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  62  *                   runtime.valhalla.valuetypes.ValueOops
  63  * @run main/othervm -Xcomp -noverify -XX:+UseParallelGC -Xmx128m -XX:+EnableMVT
  64  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  65  *                   runtime.valhalla.valuetypes.ValueOops
  66  * @run main/othervm -Xcomp -noverify -XX:+UseConcMarkSweepGC -Xmx128m -XX:+EnableMVT
  67  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  68  *                   runtime.valhalla.valuetypes.ValueOops
  69  */
  70 public class ValueOops {
  71 




  72     // Extra debug: -XX:+VerifyOops -XX:+VerifyStack -XX:+VerifyLastFrame -XX:+VerifyBeforeGC -XX:+VerifyAfterGC -XX:+VerifyDuringGC -XX:VerifySubSet=threads,heap
  73     // Even more debugging: -XX:+TraceNewOopMapGeneration -Xlog:gc*=info
  74 
  75     static final int NOF_PEOPLE = 1000; // Exercise arrays of this size
  76 
  77     static int MIN_ACTIVE_GC_COUNT = 10; // Run active workload for this number of GC passes
  78 
  79     static int MED_ACTIVE_GC_COUNT = 4;  // Medium life span in terms of GC passes
  80 
  81     static final String TEST_STRING1 = "Test String 1";
  82     static final String TEST_STRING2 = "Test String 2";
  83 
  84     static boolean USE_COMPILER = WhiteBox.getWhiteBox().getBooleanVMFlag("UseCompiler");
  85 
  86     public static void main(String[] args) {
  87         if (args.length > 0) {
  88             MIN_ACTIVE_GC_COUNT = Integer.parseInt(args[0]);
  89         }
  90         testClassLoad();
  91         testBytecodes();




  25 
  26 import java.lang.invoke.*;
  27 import java.lang.ref.*;
  28 import java.util.concurrent.*;
  29 import jdk.experimental.value.*;
  30 
  31 import static jdk.test.lib.Asserts.*;
  32 import jdk.test.lib.Utils;
  33 import sun.hotspot.WhiteBox;
  34 
  35 /**
  36  * @test ValueOops
  37  * @summary Test embedding oops into Value types
  38  * @library /test/lib
  39  * @compile PersonVcc.java
  40  * @compile -XDenableValueTypes Person.java
  41  * @compile -XDenableValueTypes ValueOops.java
  42  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  43  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  44  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  45  * @run main/othervm -Xint -noverify -XX:+UseSerialGC -Xmx128m -XX:+EnableMVT -XX:+EnableValhalla
  46  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  47  *                   runtime.valhalla.valuetypes.ValueOops
  48  * @run main/othervm -Xint -noverify -XX:+UseG1GC -Xmx128m -XX:+EnableMVT -XX:+EnableValhalla
  49  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  50  *                   runtime.valhalla.valuetypes.ValueOops
  51  * @run main/othervm -Xint -noverify -XX:+UseParallelGC -Xmx128m -XX:+EnableMVT -XX:+EnableValhalla
  52  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  53  *                   runtime.valhalla.valuetypes.ValueOops
  54  * @run main/othervm -Xint -noverify -XX:+UseConcMarkSweepGC -Xmx128m -XX:+EnableMVT -XX:+EnableValhalla
  55  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  56  *                   runtime.valhalla.valuetypes.ValueOops
  57  * @run main/othervm -Xcomp -noverify -XX:+UseSerialGC -Xmx128m -XX:+EnableMVT -XX:+EnableValhalla
  58  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  59  *                   runtime.valhalla.valuetypes.ValueOops
  60  * @run main/othervm -Xcomp -noverify -XX:+UseG1GC -Xmx128m -XX:+EnableMVT -XX:+EnableValhalla
  61  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  62  *                   runtime.valhalla.valuetypes.ValueOops
  63  * @run main/othervm -Xcomp -noverify -XX:+UseParallelGC -Xmx128m -XX:+EnableMVT -XX:+EnableValhalla
  64  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  65  *                   runtime.valhalla.valuetypes.ValueOops
  66  * @run main/othervm -Xcomp -noverify -XX:+UseConcMarkSweepGC -Xmx128m -XX:+EnableMVT -XX:+EnableValhalla
  67  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  68  *                   runtime.valhalla.valuetypes.ValueOops
  69  */
  70 public class ValueOops {
  71 
  72     // Note: -noverify can not be eliminated. Possible issue with ValueType::mhName(),
  73     //       does not translate '.' to '/' for JVM.
  74     //       java.lang.ClassFormatError: Illegal method name "runtime.valhalla.valuetypes.PersonVcc_default"
  75     //
  76     // Extra debug: -XX:+VerifyOops -XX:+VerifyStack -XX:+VerifyLastFrame -XX:+VerifyBeforeGC -XX:+VerifyAfterGC -XX:+VerifyDuringGC -XX:VerifySubSet=threads,heap
  77     // Even more debugging: -XX:+TraceNewOopMapGeneration -Xlog:gc*=info
  78 
  79     static final int NOF_PEOPLE = 1000; // Exercise arrays of this size
  80 
  81     static int MIN_ACTIVE_GC_COUNT = 10; // Run active workload for this number of GC passes
  82 
  83     static int MED_ACTIVE_GC_COUNT = 4;  // Medium life span in terms of GC passes
  84 
  85     static final String TEST_STRING1 = "Test String 1";
  86     static final String TEST_STRING2 = "Test String 2";
  87 
  88     static boolean USE_COMPILER = WhiteBox.getWhiteBox().getBooleanVMFlag("UseCompiler");
  89 
  90     public static void main(String[] args) {
  91         if (args.length > 0) {
  92             MIN_ACTIVE_GC_COUNT = Integer.parseInt(args[0]);
  93         }
  94         testClassLoad();
  95         testBytecodes();


< prev index next >