< prev index next >

test/hotspot/jtreg/compiler/loopopts/TestRangeCheckPredicatesControl.java

Print this page
rev 59879 : [mq]: 8249000


   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  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  * @requires vm.gc.Z & !vm.graal.enabled
  27  * @bug 8237859
  28  * @summary A LoadP node has a wrong control input (too early) which results in an out-of-bounds read of an object array with ZGC.
  29  *
  30  * @run main/othervm -XX:+UseZGC compiler.loopopts.TestRangeCheckPredicatesControl
  31  * @run main/othervm -XX:+UseZGC -XX:+UnlockDiagnosticVMOptions -XX:+StressGCM compiler.loopopts.TestRangeCheckPredicatesControl
  32  */
  33 
  34 package compiler.loopopts;
  35 
  36 public class TestRangeCheckPredicatesControl {
  37     static Wrapper w1 = new Wrapper();
  38     static Wrapper w2 = new Wrapper();
  39     static Wrapper w3 = new Wrapper();
  40 
  41     public static void main(String[] args) {
  42         for (int x = 0; x < 10000000; x++) {
  43             test(x % 2 == 0);
  44             test2(x % 2 == 0, x % 3 == 0);
  45             test3(x % 2 == 0);
  46             test4(x % 2 == 0);




   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  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  * @requires vm.gc.Z
  27  * @bug 8237859
  28  * @summary A LoadP node has a wrong control input (too early) which results in an out-of-bounds read of an object array with ZGC.
  29  *
  30  * @run main/othervm -XX:+UseZGC compiler.loopopts.TestRangeCheckPredicatesControl
  31  * @run main/othervm -XX:+UseZGC -XX:+UnlockDiagnosticVMOptions -XX:+StressGCM compiler.loopopts.TestRangeCheckPredicatesControl
  32  */
  33 
  34 package compiler.loopopts;
  35 
  36 public class TestRangeCheckPredicatesControl {
  37     static Wrapper w1 = new Wrapper();
  38     static Wrapper w2 = new Wrapper();
  39     static Wrapper w3 = new Wrapper();
  40 
  41     public static void main(String[] args) {
  42         for (int x = 0; x < 10000000; x++) {
  43             test(x % 2 == 0);
  44             test2(x % 2 == 0, x % 3 == 0);
  45             test3(x % 2 == 0);
  46             test4(x % 2 == 0);


< prev index next >