kvn@598: /* trims@1907: * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. kvn@688: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. kvn@598: * kvn@688: * This code is free software; you can redistribute it and/or modify it kvn@688: * under the terms of the GNU General Public License version 2 only, as kvn@688: * published by the Free Software Foundation. kvn@598: * kvn@688: * This code is distributed in the hope that it will be useful, but WITHOUT kvn@688: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or kvn@688: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License kvn@688: * version 2 for more details (a copy is included in the LICENSE file that kvn@688: * accompanied this code). kvn@598: * kvn@688: * You should have received a copy of the GNU General Public License version kvn@688: * 2 along with this work; if not, write to the Free Software Foundation, kvn@688: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. kvn@598: * trims@1907: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA trims@1907: * or visit www.oracle.com if you need additional information or have any trims@1907: * questions. kvn@598: */ kvn@598: kvn@598: /* kvn@598: * @test kvn@598: * @bug 6695810 kvn@598: * @summary null oop passed to encode_heap_oop_not_null kvn@598: * @run main/othervm -Xbatch Test kvn@598: */ kvn@598: kvn@598: public class Test { kvn@598: Test _t; kvn@598: kvn@598: static void test(Test t1, Test t2) { kvn@598: if (t2 != null) kvn@598: t1._t = t2; kvn@598: kvn@598: if (t2 != null) kvn@598: t1._t = t2; kvn@598: } kvn@598: kvn@598: public static void main(String[] args) { kvn@598: Test t = new Test(); kvn@598: for (int i = 0; i < 50; i++) { kvn@598: for (int j = 0; j < 100; j++) { kvn@598: test(t, t); kvn@598: } kvn@598: test(t, null); kvn@598: } kvn@598: for (int i = 0; i < 10000; i++) { kvn@598: test(t, t); kvn@598: } kvn@598: test(t, null); kvn@598: } kvn@598: }