test/compiler/6695810/Test.java

Wed, 21 May 2008 10:45:07 -0700

author
kvn
date
Wed, 21 May 2008 10:45:07 -0700
changeset 598
885ed790ecf0
child 688
b0fe4deeb9fb
child 720
51ae48d8072f
permissions
-rw-r--r--

6695810: null oop passed to encode_heap_oop_not_null
Summary: fix several problems in C2 related to Escape Analysis and Compressed Oops.
Reviewed-by: never, jrose

     1 /*
     2  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
     3  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
     4  *
     5  *
     6  *
     7  *
     8  *
     9  *
    10  *
    11  *
    12  *
    13  *
    14  *
    15  *
    16  *
    17  *
    18  *
    19  *
    20  *
    21  *
    22  *
    23  */
    25 /*
    26  * @test
    27  * @bug 6695810
    28  * @summary null oop passed to encode_heap_oop_not_null
    29  * @run main/othervm -Xbatch Test
    30  */
    32 public class Test {
    33     Test _t;
    35     static void test(Test t1, Test t2) {
    36         if (t2 != null)
    37             t1._t = t2;
    39         if (t2 != null)
    40             t1._t = t2;
    41     }
    43     public static void main(String[] args) {
    44         Test t = new Test();
    45         for (int i = 0; i < 50; i++) {
    46             for (int j = 0; j < 100; j++) {
    47                 test(t, t);
    48             }
    49             test(t, null);
    50         }
    51         for (int i = 0; i < 10000; i++) {
    52             test(t, t);
    53         }
    54         test(t, null);
    55     }
    56 }

mercurial