# HG changeset patch # User twisti # Date 1304495182 25200 # Node ID 6ee92b277bc5c6c16d1d0354c70dbeed1bc938e9 # Parent eae35325e5e1ca82db1eec062b92e43ebe9ba4a8# Parent 8d944991dbf9f0b764a14d58cb5c380574308bf0 Merge diff -r 8d944991dbf9 -r 6ee92b277bc5 agent/make/Makefile --- a/agent/make/Makefile Wed May 04 00:41:48 2011 -0700 +++ b/agent/make/Makefile Wed May 04 00:46:22 2011 -0700 @@ -257,7 +257,7 @@ all: filelist @mkdir -p $(OUTPUT_DIR) @echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES) - $(JAVAC) -source 1.4 -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist + $(JAVAC) -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist $(RMIC) -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql @@ -269,7 +269,7 @@ allprof: filelist @mkdir -p $(OUTPUT_DIR) @echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES) - $(JAVAC) -source 1.4 -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist + $(JAVAC) -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist $(RMIC) -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql diff -r 8d944991dbf9 -r 6ee92b277bc5 src/share/vm/opto/library_call.cpp --- a/src/share/vm/opto/library_call.cpp Wed May 04 00:41:48 2011 -0700 +++ b/src/share/vm/opto/library_call.cpp Wed May 04 00:46:22 2011 -0700 @@ -867,12 +867,10 @@ Node* str1_offset = make_load(no_ctrl, str1_offseta, TypeInt::INT, T_INT, string_type->add_offset(offset_offset)); Node* str1_start = array_element_address(str1_value, str1_offset, T_CHAR); - // Pin loads from String::equals() argument since it could be NULL. - Node* str2_ctrl = (opcode == Op_StrEquals) ? control() : no_ctrl; Node* str2_valuea = basic_plus_adr(str2, str2, value_offset); - Node* str2_value = make_load(str2_ctrl, str2_valuea, value_type, T_OBJECT, string_type->add_offset(value_offset)); + Node* str2_value = make_load(no_ctrl, str2_valuea, value_type, T_OBJECT, string_type->add_offset(value_offset)); Node* str2_offseta = basic_plus_adr(str2, str2, offset_offset); - Node* str2_offset = make_load(str2_ctrl, str2_offseta, TypeInt::INT, T_INT, string_type->add_offset(offset_offset)); + Node* str2_offset = make_load(no_ctrl, str2_offseta, TypeInt::INT, T_INT, string_type->add_offset(offset_offset)); Node* str2_start = array_element_address(str2_value, str2_offset, T_CHAR); Node* result = NULL; @@ -1012,14 +1010,15 @@ if (!stopped()) { // Properly cast the argument to String argument = _gvn.transform(new (C, 2) CheckCastPPNode(control(), argument, string_type)); + // This path is taken only when argument's type is String:NotNull. + argument = cast_not_null(argument, false); // Get counts for string and argument Node* receiver_cnta = basic_plus_adr(receiver, receiver, count_offset); receiver_cnt = make_load(no_ctrl, receiver_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset)); - // Pin load from argument string since it could be NULL. Node* argument_cnta = basic_plus_adr(argument, argument, count_offset); - argument_cnt = make_load(control(), argument_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset)); + argument_cnt = make_load(no_ctrl, argument_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset)); // Check for receiver count != argument count Node* cmp = _gvn.transform( new(C, 3) CmpINode(receiver_cnt, argument_cnt) ); diff -r 8d944991dbf9 -r 6ee92b277bc5 src/share/vm/opto/subnode.cpp --- a/src/share/vm/opto/subnode.cpp Wed May 04 00:41:48 2011 -0700 +++ b/src/share/vm/opto/subnode.cpp Wed May 04 00:46:22 2011 -0700 @@ -1223,21 +1223,6 @@ } //============================================================================= -//------------------------------NegNode---------------------------------------- -Node *NegFNode::Ideal(PhaseGVN *phase, bool can_reshape) { - if( in(1)->Opcode() == Op_SubF ) - return new (phase->C, 3) SubFNode( in(1)->in(2), in(1)->in(1) ); - return NULL; -} - -Node *NegDNode::Ideal(PhaseGVN *phase, bool can_reshape) { - if( in(1)->Opcode() == Op_SubD ) - return new (phase->C, 3) SubDNode( in(1)->in(2), in(1)->in(1) ); - return NULL; -} - - -//============================================================================= //------------------------------Value------------------------------------------ // Compute sqrt const Type *SqrtDNode::Value( PhaseTransform *phase ) const { diff -r 8d944991dbf9 -r 6ee92b277bc5 src/share/vm/opto/subnode.hpp --- a/src/share/vm/opto/subnode.hpp Wed May 04 00:41:48 2011 -0700 +++ b/src/share/vm/opto/subnode.hpp Wed May 04 00:46:22 2011 -0700 @@ -377,7 +377,6 @@ public: NegFNode( Node *in1 ) : NegNode(in1) {} virtual int Opcode() const; - virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); const Type *bottom_type() const { return Type::FLOAT; } virtual uint ideal_reg() const { return Op_RegF; } }; @@ -391,7 +390,6 @@ public: NegDNode( Node *in1 ) : NegNode(in1) {} virtual int Opcode() const; - virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } }; diff -r 8d944991dbf9 -r 6ee92b277bc5 test/compiler/6796786/Test6796786.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/compiler/6796786/Test6796786.java Wed May 04 00:46:22 2011 -0700 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/** + * @test + * @bug 6796786 + * @summary invalid FP identity transform - (a - b) -> b - a + * + * @run main Test6796786 + */ + +public class Test6796786 { + static volatile float d1; + static volatile float d2; + static float zero; + + public static void main(String[] args) { + int total = 0; + for (int i = 0; i < 100000; i++) { + if (Float.floatToRawIntBits(- (d1 - d1)) == Float.floatToRawIntBits(0.0f)) { + total++; + } + } + if (total != 100000) { + throw new InternalError(); + } + } +} diff -r 8d944991dbf9 -r 6ee92b277bc5 test/compiler/7041100/Test7041100.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/compiler/7041100/Test7041100.java Wed May 04 00:46:22 2011 -0700 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/** + * @test + * @bug 7041100 + * @summary The load in String.equals intrinsic executed before null check + * + * @run main/othervm -Xbatch Test7041100 abc def + */ + +public class Test7041100 { + + static String n = null; + public static void main(String[] args) throws Exception { + for (int i = 0; i < 10000; i++) { + stringEQ(args[0], args[1]); + stringEQ(args[0], args[0]); + stringEQ(args[0], n); + stringEQ(n, args[0]); + } + } + + public static boolean stringEQ(String a, String b) { + if (a == b) + return true; + if (a == null || b == null) + return false; + else + return a.equals(b); + } +}