< prev index next >

test/compiler/uncommontrap/TestUnstableIfTrap.java

Print this page




  47  * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  48  *                   -XX:+WhiteBoxAPI -XX:+LogCompilation
  49  *                   -XX:CompileCommand=compileonly,UnstableIfExecutable.test
  50  *                   -XX:LogFile=always_taken_not_fired.xml
  51  *                   TestUnstableIfTrap ALWAYS_TAKEN false
  52  * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  53  *                   -XX:+WhiteBoxAPI -XX:+LogCompilation
  54  *                   -XX:CompileCommand=compileonly,UnstableIfExecutable.test
  55  *                   -XX:LogFile=always_taken_fired.xml
  56  *                   TestUnstableIfTrap ALWAYS_TAKEN true
  57  * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  58  *                   -XX:+WhiteBoxAPI -XX:+LogCompilation
  59  *                   -XX:CompileCommand=compileonly,UnstableIfExecutable.test
  60  *                   -XX:LogFile=never_taken_not_fired.xml
  61  *                   TestUnstableIfTrap NEVER_TAKEN false
  62  * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  63  *                   -XX:+WhiteBoxAPI -XX:+LogCompilation
  64  *                   -XX:CompileCommand=compileonly,UnstableIfExecutable.test
  65  *                   -XX:LogFile=never_taken_fired.xml
  66  *                   TestUnstableIfTrap NEVER_TAKEN true
  67  * @run main uncommontrap.Verifier always_taken_not_fired.xml
  68  *                                 always_taken_fired.xml
  69  *                                 never_taken_not_fired.xml
  70  *                                 never_taken_fired.xml
  71  */
  72 public class TestUnstableIfTrap {
  73     private static final WhiteBox WB = WhiteBox.getWhiteBox();
  74     private static final String CLASS_NAME = "UnstableIfExecutable";
  75     private static final String METHOD_NAME = "test";
  76     private static final String FIELD_NAME = "field";
  77     private static final int ITERATIONS = 1_000_000;
  78     // There is no dependency on particular class file version, so it could be
  79     // set to any version (if you're updating this test for Java 42).
  80     private static final int CLASS_FILE_VERSION = 49;
  81     private static final int MAX_TIER = 4;
  82     // This test aimed to verify that uncommon trap with reason "unstable_if"
  83     // is emitted when method that contain control-flow divergence such that
  84     // one of two branches is never taken (and other one is taken always).
  85     // C2 will made a decision whether or not the branch was ever taken
  86     // depending on method's profile.
  87     // If profile was collected for a few method's invocations, then C2 will not




  47  * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  48  *                   -XX:+WhiteBoxAPI -XX:+LogCompilation
  49  *                   -XX:CompileCommand=compileonly,UnstableIfExecutable.test
  50  *                   -XX:LogFile=always_taken_not_fired.xml
  51  *                   TestUnstableIfTrap ALWAYS_TAKEN false
  52  * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  53  *                   -XX:+WhiteBoxAPI -XX:+LogCompilation
  54  *                   -XX:CompileCommand=compileonly,UnstableIfExecutable.test
  55  *                   -XX:LogFile=always_taken_fired.xml
  56  *                   TestUnstableIfTrap ALWAYS_TAKEN true
  57  * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  58  *                   -XX:+WhiteBoxAPI -XX:+LogCompilation
  59  *                   -XX:CompileCommand=compileonly,UnstableIfExecutable.test
  60  *                   -XX:LogFile=never_taken_not_fired.xml
  61  *                   TestUnstableIfTrap NEVER_TAKEN false
  62  * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  63  *                   -XX:+WhiteBoxAPI -XX:+LogCompilation
  64  *                   -XX:CompileCommand=compileonly,UnstableIfExecutable.test
  65  *                   -XX:LogFile=never_taken_fired.xml
  66  *                   TestUnstableIfTrap NEVER_TAKEN true
  67  * @run main/othervm uncommontrap.Verifier always_taken_not_fired.xml
  68  *                                 always_taken_fired.xml
  69  *                                 never_taken_not_fired.xml
  70  *                                 never_taken_fired.xml
  71  */
  72 public class TestUnstableIfTrap {
  73     private static final WhiteBox WB = WhiteBox.getWhiteBox();
  74     private static final String CLASS_NAME = "UnstableIfExecutable";
  75     private static final String METHOD_NAME = "test";
  76     private static final String FIELD_NAME = "field";
  77     private static final int ITERATIONS = 1_000_000;
  78     // There is no dependency on particular class file version, so it could be
  79     // set to any version (if you're updating this test for Java 42).
  80     private static final int CLASS_FILE_VERSION = 49;
  81     private static final int MAX_TIER = 4;
  82     // This test aimed to verify that uncommon trap with reason "unstable_if"
  83     // is emitted when method that contain control-flow divergence such that
  84     // one of two branches is never taken (and other one is taken always).
  85     // C2 will made a decision whether or not the branch was ever taken
  86     // depending on method's profile.
  87     // If profile was collected for a few method's invocations, then C2 will not


< prev index next >