Fri, 30 Oct 2009 10:12:52 -0700
6852078: HSX 14/16 in jdk 5.0: api/javax_management api/org_omg jck tests crashes or make tnameserv crash
Summary: Disable SuperWord optimization for unsafe read/write
Reviewed-by: kvn, phh
src/share/vm/opto/superword.cpp | file | annotate | diff | comparison | revisions | |
test/compiler/6852078/Test6852078.java | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/opto/superword.cpp Thu Oct 29 16:57:55 2009 -0700 1.2 +++ b/src/share/vm/opto/superword.cpp Fri Oct 30 10:12:52 2009 -0700 1.3 @@ -1921,6 +1921,11 @@ 1.4 } 1.5 // Match AddP(base, AddP(ptr, k*iv [+ invariant]), constant) 1.6 Node* base = adr->in(AddPNode::Base); 1.7 + //unsafe reference could not be aligned appropriately without runtime checking 1.8 + if (base == NULL || base->bottom_type() == Type::TOP) { 1.9 + assert(!valid(), "unsafe access"); 1.10 + return; 1.11 + } 1.12 for (int i = 0; i < 3; i++) { 1.13 if (!scaled_iv_plus_offset(adr->in(AddPNode::Offset))) { 1.14 assert(!valid(), "too complex");
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/test/compiler/6852078/Test6852078.java Fri Oct 30 10:12:52 2009 -0700 2.3 @@ -0,0 +1,57 @@ 2.4 +/* 2.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 2.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.7 + * 2.8 + * This code is free software; you can redistribute it and/or modify it 2.9 + * under the terms of the GNU General Public License version 2 only, as 2.10 + * published by the Free Software Foundation. 2.11 + * 2.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 2.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2.15 + * version 2 for more details (a copy is included in the LICENSE file that 2.16 + * accompanied this code). 2.17 + * 2.18 + * You should have received a copy of the GNU General Public License version 2.19 + * 2 along with this work; if not, write to the Free Software Foundation, 2.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2.21 + * 2.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 2.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 2.24 + * have any questions. 2.25 + * 2.26 + */ 2.27 + 2.28 +/** 2.29 + * @test 2.30 + * @bug 6852078 2.31 + * @summary Disable SuperWord optimization for unsafe read/write 2.32 + * 2.33 + * @run main/othervm Test6852078 2.34 + */ 2.35 + 2.36 +import java.util.*; 2.37 +import java.nio.ByteBuffer; 2.38 +import com.sun.corba.se.impl.encoding.ByteBufferWithInfo; 2.39 +import com.sun.jndi.toolkit.corba.CorbaUtils; 2.40 + 2.41 +public class Test6852078 { 2.42 + 2.43 + public Test6852078(String [] args) { 2.44 + 2.45 + int capacity = 128; 2.46 + ByteBuffer bb = ByteBuffer.allocateDirect(capacity); 2.47 + ByteBufferWithInfo bbwi = new ByteBufferWithInfo( CorbaUtils.getOrb(null, -1, new Hashtable()), bb); 2.48 + byte[] tmpBuf; 2.49 + tmpBuf = new byte[bbwi.buflen]; 2.50 + 2.51 + for (int i = 0; i < capacity; i++) 2.52 + tmpBuf[i] = bbwi.byteBuffer.get(i); 2.53 + } 2.54 + 2.55 + public static void main(String [] args) { 2.56 + for (int i=0; i<2000; i++) { 2.57 + Test6852078 t = new Test6852078(args); 2.58 + } 2.59 + } 2.60 +}