< prev index next >

test/compiler/gcbarriers/G1CrashTest.java

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


  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 /**
  26  * @test
  27  * @bug 8023472
  28  * @summary C2 optimization breaks with G1
  29  *
  30  * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -Dcount=100000 G1CrashTest

  31  *
  32  * @author pbiswal@palantir.com
  33  */
  34 


  35 public class G1CrashTest {
  36     static Object[] set = new Object[11];
  37 
  38     public static void main(String[] args) throws InterruptedException {
  39         for (int j = 0; j < Integer.getInteger("count"); j++) {
  40             Object key = new Object();
  41             insertKey(key);
  42             if (j > set.length / 2) {
  43                 Object[] oldKeys = set;
  44                 set = new Object[2 * set.length - 1];
  45                 for (Object o : oldKeys) {
  46                     if (o != null)
  47                         insertKey(o);
  48                 }
  49             }
  50         }
  51     }
  52 
  53     static void insertKey(Object key) {
  54         int hash = key.hashCode() & 0x7fffffff;




  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 /**
  26  * @test
  27  * @bug 8023472
  28  * @summary C2 optimization breaks with G1
  29  *
  30  * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation
  31  *      -Dcount=100000 compiler.gcbarriers.G1CrashTest
  32  *
  33  * @author pbiswal@palantir.com
  34  */
  35 
  36 package compiler.gcbarriers;
  37 
  38 public class G1CrashTest {
  39     static Object[] set = new Object[11];
  40 
  41     public static void main(String[] args) throws InterruptedException {
  42         for (int j = 0; j < Integer.getInteger("count"); j++) {
  43             Object key = new Object();
  44             insertKey(key);
  45             if (j > set.length / 2) {
  46                 Object[] oldKeys = set;
  47                 set = new Object[2 * set.length - 1];
  48                 for (Object o : oldKeys) {
  49                     if (o != null)
  50                         insertKey(o);
  51                 }
  52             }
  53         }
  54     }
  55 
  56     static void insertKey(Object key) {
  57         int hash = key.hashCode() & 0x7fffffff;


< prev index next >