Mon, 07 Jun 2010 14:17:01 -0700
6958485: fix for 6879921 was insufficient
Reviewed-by: kvn
src/share/vm/opto/superword.cpp | file | annotate | diff | comparison | revisions | |
test/compiler/6958485/Test.java | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/opto/superword.cpp Fri Jun 04 11:18:04 2010 -0700 1.2 +++ b/src/share/vm/opto/superword.cpp Mon Jun 07 14:17:01 2010 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -514,6 +514,13 @@ 1.11 bool SuperWord::are_adjacent_refs(Node* s1, Node* s2) { 1.12 if (!s1->is_Mem() || !s2->is_Mem()) return false; 1.13 if (!in_bb(s1) || !in_bb(s2)) return false; 1.14 + 1.15 + // Do not use superword for non-primitives 1.16 + if (!is_java_primitive(s1->as_Mem()->memory_type()) || 1.17 + !is_java_primitive(s2->as_Mem()->memory_type())) { 1.18 + return false; 1.19 + } 1.20 + 1.21 // FIXME - co_locate_pack fails on Stores in different mem-slices, so 1.22 // only pack memops that are in the same alias set until that's fixed. 1.23 if (_phase->C->get_alias_index(s1->as_Mem()->adr_type()) !=
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/test/compiler/6958485/Test.java Mon Jun 07 14:17:01 2010 -0700 2.3 @@ -0,0 +1,53 @@ 2.4 +/* 2.5 + * Copyright (c) 2010, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2.23 + * or visit www.oracle.com if you need additional information or have any 2.24 + * questions. 2.25 + */ 2.26 + 2.27 +/** 2.28 + * @test 2.29 + * @bug 6958485 2.30 + * @summary fix for 6879921 was insufficient 2.31 + * 2.32 + * @run main/othervm -Xbatch -XX:CompileOnly=Test.init Test 2.33 + */ 2.34 + 2.35 +public class Test { 2.36 + 2.37 + public static void init(Object src[], boolean[] dst) { 2.38 + // initialize the arrays 2.39 + for (int i =0; i<src.length; i++) { 2.40 + dst[i] = src[i] != null ? false : true; 2.41 + } 2.42 + } 2.43 + 2.44 + public static void test() { 2.45 + Object[] src = new Object[34]; 2.46 + boolean[] dst = new boolean[34]; 2.47 + 2.48 + init(src, dst); 2.49 + } 2.50 + 2.51 + public static void main(String[] args) { 2.52 + for (int i=0; i< 2000; i++) { 2.53 + test(); 2.54 + } 2.55 + } 2.56 +}