--- old/src/share/vm/ci/ciEnv.cpp 2015-04-15 12:03:01.144289051 -0700 +++ new/src/share/vm/ci/ciEnv.cpp 2015-04-15 12:03:00.997278773 -0700 @@ -467,7 +467,7 @@ for (int i = cpool->length() - 1; i >= 1; i--) { if (cpool->tag_at(i).is_klass()) { Klass* kls = cpool->resolved_klass_at(i); - if (kls->name() == sym) { + if (kls->name()->equals(sym)) { found_klass = KlassHandle(THREAD, kls); break; } --- old/src/share/vm/ci/ciObjectFactory.cpp 2015-04-15 12:03:01.773333042 -0700 +++ new/src/share/vm/ci/ciObjectFactory.cpp 2015-04-15 12:03:01.630323042 -0700 @@ -140,9 +140,9 @@ for (i = vmSymbols::FIRST_SID; i < vmSymbols::SID_LIMIT; i++) { Symbol* vmsym = vmSymbols::symbol_at((vmSymbols::SID) i); ciSymbol* sym = vm_symbol_at((vmSymbols::SID) i); - assert(sym->get_symbol() == vmsym, "oop must match"); + assert(sym->get_symbol()->equals(vmsym), "oop must match"); } - assert(ciSymbol::void_class_signature()->get_symbol() == vmSymbols::void_class_signature(), "spot check"); + assert(ciSymbol::void_class_signature()->get_symbol()->equals(vmSymbols::void_class_signature()), "spot check"); #endif } --- old/src/share/vm/ci/ciSymbol.hpp 2015-04-15 12:03:02.319371227 -0700 +++ new/src/share/vm/ci/ciSymbol.hpp 2015-04-15 12:03:02.170360807 -0700 @@ -109,7 +109,7 @@ virtual bool is_symbol() const { return true; } // Are two ciSymbols equal? - bool equals(ciSymbol* obj) { return this->_symbol == obj->get_symbol(); } + bool equals(ciSymbol* obj) { return this->_symbol->equals(obj->get_symbol()); } bool is_signature_polymorphic_name() const; }; --- old/src/share/vm/classfile/classFileParser.cpp 2015-04-15 12:03:02.850408362 -0700 +++ new/src/share/vm/classfile/classFileParser.cpp 2015-04-15 12:03:02.704398152 -0700 @@ -530,7 +530,7 @@ jbyte tag = cp->tag_at(index).value(); switch (tag) { case JVM_CONSTANT_UnresolvedClass: { - Symbol* class_name = cp->klass_name_at(index); + Symbol* class_name = cp->klass_name_at(index); // check the name, even if _cp_patches will overwrite it verify_legal_class_name(class_name, CHECK_(nullHandle)); break; @@ -539,8 +539,8 @@ if (_need_verify && _major_version >= JAVA_7_VERSION) { int sig_index = cp->signature_ref_index_at(index); int name_index = cp->name_ref_index_at(index); - Symbol* name = cp->symbol_at(name_index); - Symbol* sig = cp->symbol_at(sig_index); + Symbol* name = cp->symbol_at(name_index); + Symbol* sig = cp->symbol_at(sig_index); if (sig->byte_at(0) == JVM_SIGNATURE_FUNC) { verify_legal_method_signature(name, sig, CHECK_(nullHandle)); } else { @@ -558,8 +558,8 @@ int name_ref_index = cp->name_ref_index_at(name_and_type_ref_index); // already verified to be utf8 int signature_ref_index = cp->signature_ref_index_at(name_and_type_ref_index); - Symbol* name = cp->symbol_at(name_ref_index); - Symbol* signature = cp->symbol_at(signature_ref_index); + Symbol* name = cp->symbol_at(name_ref_index); + Symbol* signature = cp->symbol_at(signature_ref_index); if (tag == JVM_CONSTANT_Fieldref) { verify_legal_field_name(name, CHECK_(nullHandle)); if (_need_verify && _major_version >= JAVA_7_VERSION) { @@ -590,7 +590,7 @@ unsigned int name_len = name->utf8_length(); assert(name_len > 0, "bad method name"); // already verified as legal name if (name->byte_at(0) == '<') { - if (name != vmSymbols::object_initializer_name()) { + if (name->not_equals(vmSymbols::object_initializer_name())) { classfile_parse_error( "Bad method name at constant pool index %u in class file %s", name_ref_index, CHECK_(nullHandle)); @@ -611,15 +611,15 @@ { int name_and_type_ref_index = cp->name_and_type_ref_index_at(ref_index); int name_ref_index = cp->name_ref_index_at(name_and_type_ref_index); - Symbol* name = cp->symbol_at(name_ref_index); + Symbol* name = cp->symbol_at(name_ref_index); if (ref_kind == JVM_REF_newInvokeSpecial) { - if (name != vmSymbols::object_initializer_name()) { + if (name->not_equals(vmSymbols::object_initializer_name())) { classfile_parse_error( "Bad constructor name at constant pool index %u in class file %s", name_ref_index, CHECK_(nullHandle)); } } else { - if (name == vmSymbols::object_initializer_name()) { + if (name->equals(vmSymbols::object_initializer_name())) { classfile_parse_error( "Bad method name at constant pool index %u in class file %s", name_ref_index, CHECK_(nullHandle)); @@ -633,7 +633,7 @@ } case JVM_CONSTANT_MethodType: { Symbol* no_name = vmSymbols::type_name(); // place holder - Symbol* signature = cp->method_type_signature_at(index); + Symbol* signature = cp->method_type_signature_at(index); verify_legal_method_signature(no_name, signature, CHECK_(nullHandle)); break; } @@ -743,7 +743,7 @@ int index = hash(name, sig); NameSigHash* entry = table[index]; while (entry != NULL) { - if (entry->_name == name && entry->_sig == sig) { + if (entry->_name->equals(name) && entry->_sig->equals(sig)) { return false; } entry = entry->_next; @@ -785,7 +785,7 @@ if (_cp->tag_at(interface_index).is_klass()) { interf = KlassHandle(THREAD, _cp->resolved_klass_at(interface_index)); } else { - Symbol* unresolved_klass = _cp->klass_name_at(interface_index); + Symbol* unresolved_klass = _cp->klass_name_at(interface_index); // Don't need to check legal name because it's checked when parsing constant pool. // But need to make sure it's not an array type. @@ -905,7 +905,7 @@ attribute_name_index, CHECK); Symbol* attribute_name = _cp->symbol_at(attribute_name_index); - if (is_static && attribute_name == vmSymbols::tag_constant_value()) { + if (is_static && attribute_name->equals(vmSymbols::tag_constant_value())) { // ignore if non-static if (constantvalue_index != 0) { classfile_parse_error("Duplicate ConstantValue attribute in class file %s", CHECK); @@ -918,28 +918,28 @@ if (_need_verify) { verify_constantvalue(constantvalue_index, signature_index, CHECK); } - } else if (attribute_name == vmSymbols::tag_synthetic()) { + } else if (attribute_name->equals(vmSymbols::tag_synthetic())) { if (attribute_length != 0) { classfile_parse_error( "Invalid Synthetic field attribute length %u in class file %s", attribute_length, CHECK); } is_synthetic = true; - } else if (attribute_name == vmSymbols::tag_deprecated()) { // 4276120 + } else if (attribute_name->equals(vmSymbols::tag_deprecated())) { // 4276120 if (attribute_length != 0) { classfile_parse_error( "Invalid Deprecated field attribute length %u in class file %s", attribute_length, CHECK); } } else if (_major_version >= JAVA_1_5_VERSION) { - if (attribute_name == vmSymbols::tag_signature()) { + if (attribute_name->equals(vmSymbols::tag_signature())) { if (attribute_length != 2) { classfile_parse_error( "Wrong size %u for field's Signature attribute in class file %s", attribute_length, CHECK); } generic_signature_index = parse_generic_signature_attribute(CHECK); - } else if (attribute_name == vmSymbols::tag_runtime_visible_annotations()) { + } else if (attribute_name->equals(vmSymbols::tag_runtime_visible_annotations())) { if (runtime_visible_annotations != NULL) { classfile_parse_error( "Multiple RuntimeVisibleAnnotations attributes for field in class file %s", CHECK); @@ -952,7 +952,7 @@ parsed_annotations, CHECK); cfs->skip_u1(runtime_visible_annotations_length, CHECK); - } else if (attribute_name == vmSymbols::tag_runtime_invisible_annotations()) { + } else if (attribute_name->equals(vmSymbols::tag_runtime_invisible_annotations())) { if (runtime_invisible_annotations_exists) { classfile_parse_error( "Multiple RuntimeInvisibleAnnotations attributes for field in class file %s", CHECK); @@ -964,7 +964,7 @@ assert(runtime_invisible_annotations != NULL, "null invisible annotations"); } cfs->skip_u1(attribute_length, CHECK); - } else if (attribute_name == vmSymbols::tag_runtime_visible_type_annotations()) { + } else if (attribute_name->equals(vmSymbols::tag_runtime_visible_type_annotations())) { if (runtime_visible_type_annotations != NULL) { classfile_parse_error( "Multiple RuntimeVisibleTypeAnnotations attributes for field in class file %s", CHECK); @@ -973,7 +973,7 @@ runtime_visible_type_annotations = cfs->get_u1_buffer(); assert(runtime_visible_type_annotations != NULL, "null visible type annotations"); cfs->skip_u1(runtime_visible_type_annotations_length, CHECK); - } else if (attribute_name == vmSymbols::tag_runtime_invisible_type_annotations()) { + } else if (attribute_name->equals(vmSymbols::tag_runtime_invisible_type_annotations())) { if (runtime_invisible_type_annotations_exists) { classfile_parse_error( "Multiple RuntimeInvisibleTypeAnnotations attributes for field in class file %s", CHECK); @@ -1153,14 +1153,14 @@ "Invalid constant pool index %u for field name in class file %s", name_index, CHECK_NULL); - Symbol* name = _cp->symbol_at(name_index); + Symbol* name = _cp->symbol_at(name_index); verify_legal_field_name(name, CHECK_NULL); u2 signature_index = cfs->get_u2_fast(); check_property(valid_symbol_at(signature_index), "Invalid constant pool index %u for field signature in class file %s", signature_index, CHECK_NULL); - Symbol* sig = _cp->symbol_at(signature_index); + Symbol* sig = _cp->symbol_at(signature_index); verify_legal_field_signature(name, sig, CHECK_NULL); u2 constantvalue_index = 0; @@ -1231,8 +1231,8 @@ bool duplicate = false; for (int i = 0; i < length; i++) { FieldInfo* f = FieldInfo::from_field_array(fa, i); - if (name == _cp->symbol_at(f->name_index()) && - signature == _cp->symbol_at(f->signature_index())) { + if (name->equals(_cp->symbol_at(f->name_index())) && + signature->equals(_cp->symbol_at(f->signature_index()))) { // Symbol is desclared in Java so skip this one duplicate = true; break; @@ -1480,16 +1480,16 @@ "Signature index %u in %s has bad constant type in class file %s", descriptor_index, tbl_name, CHECK_NULL); - Symbol* name = _cp->symbol_at(name_index); - Symbol* sig = _cp->symbol_at(descriptor_index); + Symbol* name = _cp->symbol_at(name_index); + Symbol* sig = _cp->symbol_at(descriptor_index); verify_legal_field_name(name, CHECK_NULL); u2 extra_slot = 0; if (!isLVTT) { verify_legal_field_signature(name, sig, CHECK_NULL); // 4894874: check special cases for double and long local variables - if (sig == vmSymbols::type_signature(T_DOUBLE) || - sig == vmSymbols::type_signature(T_LONG)) { + if (sig->equals(vmSymbols::type_signature(T_DOUBLE)) || + sig->equals(vmSymbols::type_signature(T_LONG))) { extra_slot = 1; } } @@ -1710,7 +1710,7 @@ if (count == 1 && s_size == (index - index0) // match size && s_tag_val == *(abase + tag_off) - && member == vmSymbols::value_name()) { + && member->equals(vmSymbols::value_name())) { group_index = Bytes::get_Java_u2(abase + s_con_off); if (_cp->symbol_at(group_index)->utf8_length() == 0) { group_index = 0; // default contended group @@ -1962,7 +1962,7 @@ valid_symbol_at(name_index), "Illegal constant pool index %u for method name in class file %s", name_index, CHECK_(nullHandle)); - Symbol* name = _cp->symbol_at(name_index); + Symbol* name = _cp->symbol_at(name_index); verify_legal_method_name(name, CHECK_(nullHandle)); u2 signature_index = cfs->get_u2_fast(); @@ -1970,10 +1970,10 @@ valid_symbol_at(signature_index), "Illegal constant pool index %u for method signature in class file %s", signature_index, CHECK_(nullHandle)); - Symbol* signature = _cp->symbol_at(signature_index); + Symbol* signature = _cp->symbol_at(signature_index); AccessFlags access_flags; - if (name == vmSymbols::class_initializer_name()) { + if (name->equals(vmSymbols::class_initializer_name())) { // We ignore the other access flags for a valid class initializer. // (JVM Spec 2nd ed., chapter 4.6) if (_major_version < 51) { // backward compatibility @@ -2059,7 +2059,7 @@ method_attribute_name_index, CHECK_(nullHandle)); Symbol* method_attribute_name = _cp->symbol_at(method_attribute_name_index); - if (method_attribute_name == vmSymbols::tag_code()) { + if (method_attribute_name->equals(vmSymbols::tag_code())) { // Parse Code attribute if (_need_verify) { guarantee_property( @@ -2140,13 +2140,13 @@ code_attribute_name_index, CHECK_(nullHandle)); if (LoadLineNumberTables && - _cp->symbol_at(code_attribute_name_index) == vmSymbols::tag_line_number_table()) { + _cp->symbol_at(code_attribute_name_index)->equals(vmSymbols::tag_line_number_table())) { // Parse and compress line number table parse_linenumber_table(code_attribute_length, code_length, &linenumber_table, CHECK_(nullHandle)); } else if (LoadLocalVariableTables && - _cp->symbol_at(code_attribute_name_index) == vmSymbols::tag_local_variable_table()) { + _cp->symbol_at(code_attribute_name_index)->equals(vmSymbols::tag_local_variable_table())) { // Parse local variable table if (!lvt_allocated) { localvariable_table_length = NEW_RESOURCE_ARRAY_IN_THREAD( @@ -2175,7 +2175,7 @@ lvt_cnt++; } else if (LoadLocalVariableTypeTables && _major_version >= JAVA_1_5_VERSION && - _cp->symbol_at(code_attribute_name_index) == vmSymbols::tag_local_variable_type_table()) { + _cp->symbol_at(code_attribute_name_index)->equals(vmSymbols::tag_local_variable_type_table())) { if (!lvt_allocated) { localvariable_table_length = NEW_RESOURCE_ARRAY_IN_THREAD( THREAD, u2, INITIAL_MAX_LVT_NUMBER); @@ -2202,7 +2202,7 @@ CHECK_(nullHandle)); lvtt_cnt++; } else if (_major_version >= Verifier::STACKMAP_ATTRIBUTE_MAJOR_VERSION && - _cp->symbol_at(code_attribute_name_index) == vmSymbols::tag_stack_map_table()) { + _cp->symbol_at(code_attribute_name_index)->equals(vmSymbols::tag_stack_map_table())) { // Stack map is only needed by the new verifier in JDK1.5. if (parsed_stackmap_attribute) { classfile_parse_error("Multiple StackMapTable attributes in class file %s", CHECK_(nullHandle)); @@ -2220,7 +2220,7 @@ guarantee_property(method_attribute_length == calculated_attribute_length, "Code segment has wrong length in class file %s", CHECK_(nullHandle)); } - } else if (method_attribute_name == vmSymbols::tag_exceptions()) { + } else if (method_attribute_name->equals(vmSymbols::tag_exceptions())) { // Parse Exceptions attribute if (parsed_checked_exceptions_attribute) { classfile_parse_error("Multiple Exceptions attributes in class file %s", CHECK_(nullHandle)); @@ -2230,7 +2230,7 @@ parse_checked_exceptions(&checked_exceptions_length, method_attribute_length, CHECK_(nullHandle)); - } else if (method_attribute_name == vmSymbols::tag_method_parameters()) { + } else if (method_attribute_name->equals(vmSymbols::tag_method_parameters())) { // reject multiple method parameters if (method_parameters_seen) { classfile_parse_error("Multiple MethodParameters attributes in class file %s", CHECK_(nullHandle)); @@ -2249,7 +2249,7 @@ // ignore this attribute if it cannot be reflected if (!SystemDictionary::Parameter_klass_loaded()) method_parameters_length = -1; - } else if (method_attribute_name == vmSymbols::tag_synthetic()) { + } else if (method_attribute_name->equals(vmSymbols::tag_synthetic())) { if (method_attribute_length != 0) { classfile_parse_error( "Invalid Synthetic method attribute length %u in class file %s", @@ -2257,21 +2257,21 @@ } // Should we check that there hasn't already been a synthetic attribute? access_flags.set_is_synthetic(); - } else if (method_attribute_name == vmSymbols::tag_deprecated()) { // 4276120 + } else if (method_attribute_name->equals(vmSymbols::tag_deprecated())) { // 4276120 if (method_attribute_length != 0) { classfile_parse_error( "Invalid Deprecated method attribute length %u in class file %s", method_attribute_length, CHECK_(nullHandle)); } } else if (_major_version >= JAVA_1_5_VERSION) { - if (method_attribute_name == vmSymbols::tag_signature()) { + if (method_attribute_name->equals(vmSymbols::tag_signature())) { if (method_attribute_length != 2) { classfile_parse_error( "Invalid Signature attribute length %u in class file %s", method_attribute_length, CHECK_(nullHandle)); } generic_signature_index = parse_generic_signature_attribute(CHECK_(nullHandle)); - } else if (method_attribute_name == vmSymbols::tag_runtime_visible_annotations()) { + } else if (method_attribute_name->equals(vmSymbols::tag_runtime_visible_annotations())) { if (runtime_visible_annotations != NULL) { classfile_parse_error( "Multiple RuntimeVisibleAnnotations attributes for method in class file %s", CHECK_(nullHandle)); @@ -2283,7 +2283,7 @@ runtime_visible_annotations_length, &parsed_annotations, CHECK_(nullHandle)); cfs->skip_u1(runtime_visible_annotations_length, CHECK_(nullHandle)); - } else if (method_attribute_name == vmSymbols::tag_runtime_invisible_annotations()) { + } else if (method_attribute_name->equals(vmSymbols::tag_runtime_invisible_annotations())) { if (runtime_invisible_annotations_exists) { classfile_parse_error( "Multiple RuntimeInvisibleAnnotations attributes for method in class file %s", CHECK_(nullHandle)); @@ -2295,7 +2295,7 @@ assert(runtime_invisible_annotations != NULL, "null invisible annotations"); } cfs->skip_u1(method_attribute_length, CHECK_(nullHandle)); - } else if (method_attribute_name == vmSymbols::tag_runtime_visible_parameter_annotations()) { + } else if (method_attribute_name->equals(vmSymbols::tag_runtime_visible_parameter_annotations())) { if (runtime_visible_parameter_annotations != NULL) { classfile_parse_error( "Multiple RuntimeVisibleParameterAnnotations attributes for method in class file %s", CHECK_(nullHandle)); @@ -2304,7 +2304,7 @@ runtime_visible_parameter_annotations = cfs->get_u1_buffer(); assert(runtime_visible_parameter_annotations != NULL, "null visible parameter annotations"); cfs->skip_u1(runtime_visible_parameter_annotations_length, CHECK_(nullHandle)); - } else if (method_attribute_name == vmSymbols::tag_runtime_invisible_parameter_annotations()) { + } else if (method_attribute_name->equals(vmSymbols::tag_runtime_invisible_parameter_annotations())) { if (runtime_invisible_parameter_annotations_exists) { classfile_parse_error( "Multiple RuntimeInvisibleParameterAnnotations attributes for method in class file %s", CHECK_(nullHandle)); @@ -2316,7 +2316,7 @@ assert(runtime_invisible_parameter_annotations != NULL, "null invisible parameter annotations"); } cfs->skip_u1(method_attribute_length, CHECK_(nullHandle)); - } else if (method_attribute_name == vmSymbols::tag_annotation_default()) { + } else if (method_attribute_name->equals(vmSymbols::tag_annotation_default())) { if (annotation_default != NULL) { classfile_parse_error( "Multiple AnnotationDefault attributes for method in class file %s", @@ -2326,7 +2326,7 @@ annotation_default = cfs->get_u1_buffer(); assert(annotation_default != NULL, "null annotation default"); cfs->skip_u1(annotation_default_length, CHECK_(nullHandle)); - } else if (method_attribute_name == vmSymbols::tag_runtime_visible_type_annotations()) { + } else if (method_attribute_name->equals(vmSymbols::tag_runtime_visible_type_annotations())) { if (runtime_visible_type_annotations != NULL) { classfile_parse_error( "Multiple RuntimeVisibleTypeAnnotations attributes for method in class file %s", @@ -2337,7 +2337,7 @@ assert(runtime_visible_type_annotations != NULL, "null visible type annotations"); // No need for the VM to parse Type annotations cfs->skip_u1(runtime_visible_type_annotations_length, CHECK_(nullHandle)); - } else if (method_attribute_name == vmSymbols::tag_runtime_invisible_type_annotations()) { + } else if (method_attribute_name->equals(vmSymbols::tag_runtime_invisible_type_annotations())) { if (runtime_invisible_type_annotations_exists) { classfile_parse_error( "Multiple RuntimeInvisibleTypeAnnotations attributes for method in class file %s", @@ -2491,16 +2491,16 @@ annotation_default_length, CHECK_NULL); - if (name == vmSymbols::finalize_method_name() && - signature == vmSymbols::void_method_signature()) { + if (name->equals(vmSymbols::finalize_method_name()) && + signature->equals(vmSymbols::void_method_signature())) { if (m->is_empty_method()) { _has_empty_finalizer = true; } else { _has_finalizer = true; } } - if (name == vmSymbols::object_initializer_name() && - signature == vmSymbols::void_method_signature() && + if (name->equals(vmSymbols::object_initializer_name()) && + signature->equals(vmSymbols::void_method_signature()) && m->is_vanilla_constructor()) { _has_vanilla_constructor = true; } @@ -2882,7 +2882,7 @@ "Attribute name has bad constant pool index %u in class file %s", attribute_name_index, CHECK); Symbol* tag = _cp->symbol_at(attribute_name_index); - if (tag == vmSymbols::tag_source_file()) { + if (tag->equals(vmSymbols::tag_source_file())) { // Check for SourceFile tag if (_need_verify) { guarantee_property(attribute_length == 2, "Wrong SourceFile attribute length in class file %s", CHECK); @@ -2893,7 +2893,7 @@ parsed_sourcefile_attribute = true; } parse_classfile_sourcefile_attribute(CHECK); - } else if (tag == vmSymbols::tag_source_debug_extension()) { + } else if (tag->equals(vmSymbols::tag_source_debug_extension())) { // Check for SourceDebugExtension tag if (parsed_source_debug_ext_annotations_exist) { classfile_parse_error( @@ -2901,7 +2901,7 @@ } parsed_source_debug_ext_annotations_exist = true; parse_classfile_source_debug_extension_attribute((int)attribute_length, CHECK); - } else if (tag == vmSymbols::tag_inner_classes()) { + } else if (tag->equals(vmSymbols::tag_inner_classes())) { // Check for InnerClasses tag if (parsed_innerclasses_attribute) { classfile_parse_error("Multiple InnerClasses attributes in class file %s", CHECK); @@ -2911,7 +2911,7 @@ inner_classes_attribute_start = cfs->get_u1_buffer(); inner_classes_attribute_length = attribute_length; cfs->skip_u1(inner_classes_attribute_length, CHECK); - } else if (tag == vmSymbols::tag_synthetic()) { + } else if (tag->equals(vmSymbols::tag_synthetic())) { // Check for Synthetic tag // Shouldn't we check that the synthetic flags wasn't already set? - not required in spec if (attribute_length != 0) { @@ -2920,7 +2920,7 @@ attribute_length, CHECK); } parse_classfile_synthetic_attribute(CHECK); - } else if (tag == vmSymbols::tag_deprecated()) { + } else if (tag->equals(vmSymbols::tag_deprecated())) { // Check for Deprecatd tag - 4276120 if (attribute_length != 0) { classfile_parse_error( @@ -2928,14 +2928,14 @@ attribute_length, CHECK); } } else if (_major_version >= JAVA_1_5_VERSION) { - if (tag == vmSymbols::tag_signature()) { + if (tag->equals(vmSymbols::tag_signature())) { if (attribute_length != 2) { classfile_parse_error( "Wrong Signature attribute length %u in class file %s", attribute_length, CHECK); } parse_classfile_signature_attribute(CHECK); - } else if (tag == vmSymbols::tag_runtime_visible_annotations()) { + } else if (tag->equals(vmSymbols::tag_runtime_visible_annotations())) { if (runtime_visible_annotations != NULL) { classfile_parse_error( "Multiple RuntimeVisibleAnnotations attributes in class file %s", CHECK); @@ -2948,7 +2948,7 @@ parsed_annotations, CHECK); cfs->skip_u1(runtime_visible_annotations_length, CHECK); - } else if (tag == vmSymbols::tag_runtime_invisible_annotations()) { + } else if (tag->equals(vmSymbols::tag_runtime_invisible_annotations())) { if (runtime_invisible_annotations_exists) { classfile_parse_error( "Multiple RuntimeInvisibleAnnotations attributes in class file %s", CHECK); @@ -2960,7 +2960,7 @@ assert(runtime_invisible_annotations != NULL, "null invisible annotations"); } cfs->skip_u1(attribute_length, CHECK); - } else if (tag == vmSymbols::tag_enclosing_method()) { + } else if (tag->equals(vmSymbols::tag_enclosing_method())) { if (parsed_enclosingmethod_attribute) { classfile_parse_error("Multiple EnclosingMethod attributes in class file %s", CHECK); } else { @@ -2983,13 +2983,13 @@ !_cp->tag_at(enclosing_method_method_index).is_name_and_type())) { classfile_parse_error("Invalid or out-of-bounds method index in EnclosingMethod attribute in class file %s", CHECK); } - } else if (tag == vmSymbols::tag_bootstrap_methods() && + } else if (tag->equals(vmSymbols::tag_bootstrap_methods()) && _major_version >= Verifier::INVOKEDYNAMIC_MAJOR_VERSION) { if (parsed_bootstrap_methods_attribute) classfile_parse_error("Multiple BootstrapMethods attributes in class file %s", CHECK); parsed_bootstrap_methods_attribute = true; parse_classfile_bootstrap_methods_attribute(attribute_length, CHECK); - } else if (tag == vmSymbols::tag_runtime_visible_type_annotations()) { + } else if (tag->equals(vmSymbols::tag_runtime_visible_type_annotations())) { if (runtime_visible_type_annotations != NULL) { classfile_parse_error( "Multiple RuntimeVisibleTypeAnnotations attributes in class file %s", CHECK); @@ -2999,7 +2999,7 @@ assert(runtime_visible_type_annotations != NULL, "null visible type annotations"); // No need for the VM to parse Type annotations cfs->skip_u1(runtime_visible_type_annotations_length, CHECK); - } else if (tag == vmSymbols::tag_runtime_invisible_type_annotations()) { + } else if (tag->equals(vmSymbols::tag_runtime_invisible_type_annotations())) { if (runtime_invisible_type_annotations_exists) { classfile_parse_error( "Multiple RuntimeInvisibleTypeAnnotations attributes in class file %s", CHECK); @@ -3142,7 +3142,7 @@ TRAPS) { instanceKlassHandle super_klass; if (super_class_index == 0) { - check_property(_class_name == vmSymbols::java_lang_Object(), + check_property(_class_name->equals(vmSymbols::java_lang_Object()), "Invalid superclass index %u in class file %s", super_class_index, CHECK_NULL); @@ -3305,22 +3305,22 @@ // (see in JavaClasses::compute_hard_coded_offsets()). // Use default fields allocation order for them. if( (allocation_style != 0 || compact_fields ) && class_loader.is_null() && - (_class_name == vmSymbols::java_lang_AssertionStatusDirectives() || - _class_name == vmSymbols::java_lang_Class() || - _class_name == vmSymbols::java_lang_ClassLoader() || - _class_name == vmSymbols::java_lang_ref_Reference() || - _class_name == vmSymbols::java_lang_ref_SoftReference() || - _class_name == vmSymbols::java_lang_StackTraceElement() || - _class_name == vmSymbols::java_lang_String() || - _class_name == vmSymbols::java_lang_Throwable() || - _class_name == vmSymbols::java_lang_Boolean() || - _class_name == vmSymbols::java_lang_Character() || - _class_name == vmSymbols::java_lang_Float() || - _class_name == vmSymbols::java_lang_Double() || - _class_name == vmSymbols::java_lang_Byte() || - _class_name == vmSymbols::java_lang_Short() || - _class_name == vmSymbols::java_lang_Integer() || - _class_name == vmSymbols::java_lang_Long())) { + (_class_name->equals(vmSymbols::java_lang_AssertionStatusDirectives()) || + _class_name->equals(vmSymbols::java_lang_Class()) || + _class_name->equals(vmSymbols::java_lang_ClassLoader()) || + _class_name->equals(vmSymbols::java_lang_ref_Reference()) || + _class_name->equals(vmSymbols::java_lang_ref_SoftReference()) || + _class_name->equals(vmSymbols::java_lang_StackTraceElement()) || + _class_name->equals(vmSymbols::java_lang_String()) || + _class_name->equals(vmSymbols::java_lang_Throwable()) || + _class_name->equals(vmSymbols::java_lang_Boolean()) || + _class_name->equals(vmSymbols::java_lang_Character()) || + _class_name->equals(vmSymbols::java_lang_Float()) || + _class_name->equals(vmSymbols::java_lang_Double()) || + _class_name->equals(vmSymbols::java_lang_Byte()) || + _class_name->equals(vmSymbols::java_lang_Short()) || + _class_name->equals(vmSymbols::java_lang_Integer()) || + _class_name->equals(vmSymbols::java_lang_Long()))) { allocation_style = 0; // Allocate oops first compact_fields = false; // Don't compact fields } @@ -3886,7 +3886,7 @@ "Invalid this class index %u in constant pool in class file %s", this_class_index, CHECK_(nullHandle)); - Symbol* class_name = cp->klass_name_at(this_class_index); + Symbol* class_name = cp->klass_name_at(this_class_index); assert(class_name != NULL, "class_name can't be null"); // It's important to set parsed_name *before* resolving the super class. @@ -3914,7 +3914,7 @@ { HandleMark hm(THREAD); // Checks if name in class file matches requested name - if (name != NULL && class_name != name) { + if (name->not_equals(NULL) && class_name->not_equals(name)) { ResourceMark rm(THREAD); Exceptions::fthrow( THREAD_AND_LOCATION, @@ -3988,11 +3988,11 @@ // We check super class after class file is parsed and format is checked if (super_class_index > 0 && super_klass.is_null()) { - Symbol* sk = cp->klass_name_at(super_class_index); + Symbol* sk = cp->klass_name_at(super_class_index); if (access_flags.is_interface()) { // Before attempting to resolve the superclass, check for class format // errors not checked yet. - guarantee_property(sk == vmSymbols::java_lang_Object(), + guarantee_property(sk->equals(vmSymbols::java_lang_Object()), "Interfaces must have java.lang.Object as superclass in class file %s", CHECK_(nullHandle)); } @@ -4481,7 +4481,7 @@ assert(k->size_helper() > 0, "layout_helper is initialized"); if ((!RegisterFinalizersAtInit && k->has_finalizer()) || k->is_abstract() || k->is_interface() - || (k->name() == vmSymbols::java_lang_Class() && k->class_loader() == NULL) + || (k->name()->equals(vmSymbols::java_lang_Class()) && k->class_loader() == NULL) || k->size_helper() >= FastAllocateSizeLimit) { // Forbid fast-path allocation. jint lh = Klass::instance_layout_helper(k->size_helper(), true); @@ -4632,7 +4632,7 @@ // skip private, static, and methods if ((!m->is_private() && !m->is_static()) && - (m->name() != vmSymbols::object_initializer_name())) { + (m->name()->not_equals(vmSymbols::object_initializer_name()))) { Symbol* name = m->name(); Symbol* signature = m->signature(); @@ -4689,7 +4689,7 @@ for (int index = 0; index < num_methods; index++) { Method* m = methods->at(index); // if m is static and not the init method, throw a verify error - if ((m->is_static()) && (m->name() != vmSymbols::class_initializer_name())) { + if ((m->is_static()) && (m->name()->not_equals(vmSymbols::class_initializer_name()))) { ResourceMark rm(THREAD); Exceptions::fthrow( THREAD_AND_LOCATION, @@ -4804,7 +4804,7 @@ const bool is_protected = (flags & JVM_ACC_PROTECTED) != 0; const bool major_gte_15 = _major_version >= JAVA_1_5_VERSION; const bool major_gte_8 = _major_version >= JAVA_8_VERSION; - const bool is_initializer = (name == vmSymbols::object_initializer_name()); + const bool is_initializer = (name->equals(vmSymbols::object_initializer_name())); bool is_illegal = false; @@ -5015,7 +5015,7 @@ if (length > 0) { if (bytes[0] == '<') { - if (name == vmSymbols::object_initializer_name() || name == vmSymbols::class_initializer_name()) { + if (name->equals(vmSymbols::object_initializer_name()) || name->equals(vmSymbols::class_initializer_name())) { legal = true; } } else if (_major_version < JAVA_1_5_VERSION) { --- old/src/share/vm/classfile/defaultMethods.cpp 2015-04-15 12:03:03.591460184 -0700 +++ new/src/share/vm/classfile/defaultMethods.cpp 2015-04-15 12:03:03.450450321 -0700 @@ -349,7 +349,7 @@ } Symbol* generate_no_defaults_message(TRAPS) const; - Symbol* generate_method_message(Symbol *klass_name, Method* method, TRAPS) const; + Symbol* generate_method_message(Symbol* klass_name, Method* method, TRAPS) const; Symbol* generate_conflicts_message(GrowableArray* methods, TRAPS) const; public: @@ -496,7 +496,7 @@ return SymbolTable::new_symbol("No qualifying defaults found", THREAD); } -Symbol* MethodFamily::generate_method_message(Symbol *klass_name, Method* method, TRAPS) const { +Symbol* MethodFamily::generate_method_message(Symbol* klass_name, Method* method, TRAPS) const { stringStream ss; ss.print("Method "); Symbol* name = method->name(); @@ -618,8 +618,8 @@ static bool already_in_vtable_slots(GrowableArray* slots, Method* m) { bool found = false; for (int j = 0; j < slots->length(); ++j) { - if (slots->at(j)->name() == m->name() && - slots->at(j)->signature() == m->signature() ) { + if (slots->at(j)->name()->equals(m->name()) && + slots->at(j)->signature()->equals(m->signature()) ) { found = true; break; } --- old/src/share/vm/classfile/dictionary.cpp 2015-04-15 12:03:04.184501654 -0700 +++ new/src/share/vm/classfile/dictionary.cpp 2015-04-15 12:03:04.046492003 -0700 @@ -361,7 +361,7 @@ KlassHandle obj) { assert_locked_or_safepoint(SystemDictionary_lock); assert(obj() != NULL, "adding NULL obj"); - assert(obj()->name() == class_name, "sanity check on name"); + assert(obj()->name()->equals(class_name), "sanity check on name"); assert(loader_data != NULL, "Must be non-NULL"); unsigned int hash = compute_hash(class_name, loader_data); @@ -663,7 +663,7 @@ intptr_t sym_mode) { assert(index == index_for(sym, sym_mode), "incorrect index?"); for (SymbolPropertyEntry* p = bucket(index); p != NULL; p = p->next()) { - if (p->hash() == hash && p->symbol() == sym && p->symbol_mode() == sym_mode) { + if (p->hash() == hash && p->symbol()->equals(sym) && p->symbol_mode() == sym_mode) { return p; } } --- old/src/share/vm/classfile/dictionary.hpp 2015-04-15 12:03:04.736540258 -0700 +++ new/src/share/vm/classfile/dictionary.hpp 2015-04-15 12:03:04.595530398 -0700 @@ -323,7 +323,7 @@ bool equals(Symbol* class_name, ClassLoaderData* loader_data) const { Klass* klass = (Klass*)literal(); - return (InstanceKlass::cast(klass)->name() == class_name && + return (InstanceKlass::cast(klass)->name()->equals(class_name) && _loader_data == loader_data); } @@ -348,7 +348,7 @@ oop _method_type; public: - Symbol* symbol() const { return literal(); } + Symbol* symbol() const { return literal(); } intptr_t symbol_mode() const { return _symbol_mode; } void set_symbol_mode(intptr_t m) { _symbol_mode = m; } --- old/src/share/vm/classfile/javaClasses.cpp 2015-04-15 12:03:05.277578094 -0700 +++ new/src/share/vm/classfile/javaClasses.cpp 2015-04-15 12:03:05.129567743 -0700 @@ -534,7 +534,7 @@ { #ifdef ASSERT TempNewSymbol sym = SymbolTable::new_symbol("Ljava/lang/String;", CHECK); - assert(fd->signature() == sym, "just checking"); + assert(fd->signature()->equals(sym), "just checking"); #endif oop string = fd->string_initial_value(CHECK); mirror()->obj_field_put(fd->offset(), string); @@ -1706,8 +1706,8 @@ // - rest of the stack if (!skip_fillInStackTrace_check) { - if ((method->name() == vmSymbols::fillInStackTrace_name() || - method->name() == vmSymbols::fillInStackTrace0_name()) && + if ((method->name()->equals(vmSymbols::fillInStackTrace_name()) || + method->name()->equals(vmSymbols::fillInStackTrace0_name())) && throwable->is_a(method->method_holder())) { continue; } @@ -1720,7 +1720,7 @@ // skip methods of the exception class and superclasses // This is simlar to classic VM. - if (method->name() == vmSymbols::object_initializer_name() && + if (method->name()->equals(vmSymbols::object_initializer_name()) && throwable->is_a(method->method_holder())) { continue; } else { @@ -2931,7 +2931,7 @@ print_signature(mt, &buffer); const char* sigstr = buffer.base(); int siglen = (int) buffer.size(); - Symbol *name; + Symbol* name; if (!intern_if_not_found) { name = SymbolTable::probe(sigstr, siglen); } else { @@ -3475,7 +3475,7 @@ Klass* k = SystemDictionary::resolve_or_fail(klass_sym, true, CATCH); instanceKlassHandle h_klass (THREAD, k); TempNewSymbol f_name = SymbolTable::new_symbol(field_name, CATCH); - TempNewSymbol f_sig = SymbolTable::new_symbol(field_sig, CATCH); + TempNewSymbol f_sig = SymbolTable::new_symbol(field_sig, CATCH); if (!h_klass->find_local_field(f_name, f_sig, &fd)) { tty->print_cr("Static field %s.%s not found", klass_name, field_name); return false; @@ -3613,7 +3613,7 @@ // Only look at injected fields continue; } - if (fs.name() == name() && fs.signature() == signature()) { + if (fs.name()->equals(name()) && fs.signature()->equals(signature())) { return fs.offset(); } } --- old/src/share/vm/classfile/loaderConstraints.cpp 2015-04-15 12:03:05.844617746 -0700 +++ new/src/share/vm/classfile/loaderConstraints.cpp 2015-04-15 12:03:05.705608025 -0700 @@ -85,7 +85,7 @@ while (*pp) { LoaderConstraintEntry* p = *pp; if (p->hash() == hash) { - if (p->name() == name) { + if (p->name()->equals(name)) { for (int i = p->num_loaders() - 1; i >= 0; i--) { if (p->loader_data(i) == loader_data) { return pp; @@ -437,7 +437,7 @@ probe = probe->next()) { if (probe->klass() != NULL) { InstanceKlass* ik = InstanceKlass::cast(probe->klass()); - guarantee(ik->name() == probe->name(), "name should match"); + guarantee(ik->name()->equals(probe->name()), "name should match"); Symbol* name = ik->name(); ClassLoaderData* loader_data = ik->class_loader_data(); unsigned int d_hash = dictionary->compute_hash(name, loader_data); --- old/src/share/vm/classfile/placeholders.hpp 2015-04-15 12:03:06.365654180 -0700 +++ new/src/share/vm/classfile/placeholders.hpp 2015-04-15 12:03:06.227644530 -0700 @@ -216,7 +216,7 @@ // Test for equality // Entries are unique for class/classloader name pair bool equals(Symbol* class_name, ClassLoaderData* loader) const { - return (klassname() == class_name && loader_data() == loader); + return (klassname()->equals(class_name) && loader_data() == loader); } SeenThread* actionToQueue(PlaceholderTable::classloadAction action) { --- old/src/share/vm/classfile/stackMapFrame.cpp 2015-04-15 12:03:06.968696352 -0700 +++ new/src/share/vm/classfile/stackMapFrame.cpp 2015-04-15 12:03:06.825686352 -0700 @@ -80,8 +80,8 @@ if (!m->is_static()) { init_local_num++; // add one extra argument for instance method - if (m->name() == vmSymbols::object_initializer_name() && - thisKlass.name() != vmSymbols::java_lang_Object()) { + if (m->name()->equals(vmSymbols::object_initializer_name()) && + thisKlass.name()->not_equals(vmSymbols::java_lang_Object())) { _locals[0] = VerificationType::uninitialized_this_type(); _flags |= FLAG_THIS_UNINIT; } else { @@ -108,7 +108,7 @@ Symbol* sig_copy = verifier()->create_temporary_symbol(sig, 0, sig->utf8_length(), CHECK_(VerificationType::bogus_type())); - assert(sig_copy == sig, "symbols don't match"); + assert(sig_copy->equals(sig), "symbols don't match"); return VerificationType::reference_type(sig_copy); } case T_INT: return VerificationType::integer_type(); --- old/src/share/vm/classfile/systemDictionary.cpp 2015-04-15 12:03:07.501733626 -0700 +++ new/src/share/vm/classfile/systemDictionary.cpp 2015-04-15 12:03:07.357723556 -0700 @@ -169,7 +169,7 @@ if (class_loader.is_null()) { return false; } - return (class_loader->klass()->name() == vmSymbols::sun_misc_Launcher_ExtClassLoader()); + return (class_loader->klass()->name()->equals(vmSymbols::sun_misc_Launcher_ExtClassLoader())); } // ---------------------------------------------------------------------------- @@ -356,7 +356,7 @@ if ((childk != NULL ) && (is_superclass) && ((quicksuperk = InstanceKlass::cast(childk)->super()) != NULL) && - ((quicksuperk->name() == class_name) && + ((quicksuperk->name()->equals(class_name)) && (quicksuperk->class_loader() == class_loader()))) { return quicksuperk; } else { @@ -1106,8 +1106,8 @@ } if (!HAS_PENDING_EXCEPTION) { - assert(parsed_name != NULL, "Sanity"); - assert(class_name == NULL || class_name == parsed_name, "name mismatch"); + assert(parsed_name->not_equals(NULL), "Sanity"); + assert(class_name == NULL || class_name->equals(parsed_name), "name mismatch"); // Verification prevents us from creating names with dots in them, this // asserts that that's the case. assert(is_internal_format(parsed_name), @@ -1127,7 +1127,7 @@ debug_only( { if (!HAS_PENDING_EXCEPTION) { assert(parsed_name != NULL, "parsed_name is still null?"); - Symbol* h_name = k->name(); + Symbol* h_name = k->name(); ClassLoaderData *defining_loader_data = k->class_loader_data(); MutexLocker mu(SystemDictionary_lock, THREAD); @@ -1211,7 +1211,7 @@ // interfaces' InstanceKlass's C++ vtbls haven't been // reinitialized yet (they will be once the interface classes // are loaded) - Symbol* name = k->name(); + Symbol* name = k->name(); resolve_super_or_fail(class_name, name, class_loader, protection_domain, false, CHECK_(nh)); } @@ -1354,7 +1354,7 @@ // For user defined Java class loaders, check that the name returned is // the same as that requested. This check is done for the bootstrap // loader when parsing the class file. - if (class_name == k->name()) { + if (class_name->equals(k->name())) { return k; } } @@ -1388,7 +1388,7 @@ // classloader lock held // Parallel classloaders will call find_or_define_instance_class // which will require a token to perform the define class - Symbol* name_h = k->name(); + Symbol* name_h = k->name(); unsigned int d_hash = dictionary()->compute_hash(name_h, loader_data); int d_index = dictionary()->hash_to_index(d_hash); check_constraints(d_index, d_hash, k, class_loader_h, true, CHECK); @@ -1989,7 +1989,7 @@ #ifdef ASSERT Symbol* ph_check = find_placeholder(name, loader_data); - assert(ph_check == NULL || ph_check == name, "invalid symbol"); + assert(ph_check == NULL || ph_check->equals(name), "invalid symbol"); #endif if (linkage_error == NULL) { @@ -2025,7 +2025,7 @@ TRAPS) { // Compile_lock prevents systemDictionary updates during compilations assert_locked_or_safepoint(Compile_lock); - Symbol* name = k->name(); + Symbol* name = k->name(); ClassLoaderData *loader_data = class_loader_data(class_loader); { --- old/src/share/vm/classfile/verificationType.cpp 2015-04-15 12:03:08.117776706 -0700 +++ new/src/share/vm/classfile/verificationType.cpp 2015-04-15 12:03:07.926763348 -0700 @@ -50,11 +50,11 @@ return true; } else if (is_null()) { return false; - } else if (name() == from.name()) { + } else if (name()->equals(from.name())) { return true; } else if (is_object()) { // We need check the class hierarchy to check assignability - if (name() == vmSymbols::java_lang_Object()) { + if (name()->equals(vmSymbols::java_lang_Object())) { // any object or array is assignable to java.lang.Object return true; } @@ -64,7 +64,7 @@ KlassHandle this_class(THREAD, obj); if (this_class->is_interface() && (!from_field_is_protected || - from.name() != vmSymbols::java_lang_Object())) { + from.name()->not_equals(vmSymbols::java_lang_Object()))) { // If we are not trying to access a protected field or method in // java.lang.Object then we treat interfaces as java.lang.Object, // including java.lang.Cloneable and java.io.Serializable. --- old/src/share/vm/classfile/verificationType.hpp 2015-04-15 12:03:08.637813071 -0700 +++ new/src/share/vm/classfile/verificationType.hpp 2015-04-15 12:03:08.497803281 -0700 @@ -250,7 +250,7 @@ bool equals(const VerificationType& t) const { return (_u._data == t._u._data || (is_reference() && t.is_reference() && !is_null() && !t.is_null() && - name() == t.name())); + name()->equals(t.name()))); } bool operator ==(const VerificationType& t) const { --- old/src/share/vm/classfile/verifier.cpp 2015-04-15 12:03:09.158849506 -0700 +++ new/src/share/vm/classfile/verifier.cpp 2015-04-15 12:03:09.017839647 -0700 @@ -136,8 +136,8 @@ split_verifier.verify_class(THREAD); exception_name = split_verifier.result(); if (can_failover && !HAS_PENDING_EXCEPTION && - (exception_name == vmSymbols::java_lang_VerifyError() || - exception_name == vmSymbols::java_lang_ClassFormatError())) { + (exception_name->equals(vmSymbols::java_lang_VerifyError()) || + exception_name->equals(vmSymbols::java_lang_ClassFormatError()))) { if (TraceClassInitialization || VerboseVerification) { tty->print_cr( "Fail over class verification to old verifier for: %s", klassName); @@ -197,10 +197,10 @@ // return if the class is a bootstrapping class // or defineClass specified not to verify by default (flags override passed arg) // We need to skip the following four for bootstraping - name != vmSymbols::java_lang_Object() && - name != vmSymbols::java_lang_Class() && - name != vmSymbols::java_lang_String() && - name != vmSymbols::java_lang_Throwable() && + name->not_equals(vmSymbols::java_lang_Object()) && + name->not_equals(vmSymbols::java_lang_Class()) && + name->not_equals(vmSymbols::java_lang_String()) && + name->not_equals(vmSymbols::java_lang_Throwable()) && // Can not verify the bytecodes for shared classes because they have // already been rewritten to contain constant pool cache indices, @@ -1549,7 +1549,7 @@ } // Make sure "this" has been initialized if current method is an // - if (_method->name() == vmSymbols::object_initializer_name() && + if (_method->name()->equals(vmSymbols::object_initializer_name()) && current_frame.flag_this_uninit()) { verify_error(ErrorContext::bad_code(bci), "Constructor must call super() or this() " @@ -2118,7 +2118,7 @@ Symbol* ref_name, instanceKlassHandle current) { Klass* super = current->super(); while (super != NULL) { - if (super->name() == ref_name) { + if (super->name()->equals(ref_name)) { return true; } super = super->super(); @@ -2448,8 +2448,8 @@ if (type == VerificationType::uninitialized_this_type()) { // The method must be an method of this class or its superclass Klass* superk = current_class()->super(); - if (ref_class_type.name() != current_class()->name() && - ref_class_type.name() != superk->name()) { + if (ref_class_type.name()->not_equals(current_class()->name()) && + ref_class_type.name()->not_equals(superk->name())) { verify_error(ErrorContext::bad_type(bci, TypeOrigin::implicit(ref_class_type), TypeOrigin::implicit(current_type())), @@ -2694,7 +2694,7 @@ if (method_name->byte_at(0) == '<') { // Make sure can only be invoked by invokespecial if (opcode != Bytecodes::_invokespecial || - method_name != vmSymbols::object_initializer_name()) { + method_name->not_equals(vmSymbols::object_initializer_name())) { verify_error(ErrorContext::bad_code(bci), "Illegal call to internal method"); return; @@ -2740,7 +2740,7 @@ // Check objectref on operand stack if (opcode != Bytecodes::_invokestatic && opcode != Bytecodes::_invokedynamic) { - if (method_name == vmSymbols::object_initializer_name()) { // method + if (method_name->equals(vmSymbols::object_initializer_name())) { // method verify_invoke_init(bcs, index, ref_class_type, current_frame, code_length, in_try_block, this_uninit, cp, stackmap_table, CHECK_VERIFY(this)); @@ -2783,9 +2783,9 @@ bool is_assignable = current_type().is_assignable_from( stack_object_type, this, true, CHECK_VERIFY(this)); if (!is_assignable) { - if (ref_class_type.name() == vmSymbols::java_lang_Object() + if (ref_class_type.name()->equals(vmSymbols::java_lang_Object()) && stack_object_type.is_array() - && method_name == vmSymbols::clone_name()) { + && method_name->equals(vmSymbols::clone_name())) { // Special case: arrays pretend to implement public Object // clone(). } else { @@ -2807,7 +2807,7 @@ } // Push the result type. if (sig_stream.type() != T_VOID) { - if (method_name == vmSymbols::object_initializer_name()) { + if (method_name->equals(vmSymbols::object_initializer_name())) { // method must have a void return type /* Unreachable? Class file parser verifies that methods with '<' have * void return */ @@ -2976,7 +2976,7 @@ // The verifier creates symbols which are substrings of Symbols. // These are stored in the verifier until the end of verification so that // they can be reference counted. -Symbol* ClassVerifier::create_temporary_symbol(const Symbol *s, int begin, +Symbol* ClassVerifier::create_temporary_symbol(const Symbol* s, int begin, int end, TRAPS) { Symbol* sym = SymbolTable::new_symbol(s, begin, end, CHECK_NULL); _symbols->push(sym); --- old/src/share/vm/classfile/verifier.hpp 2015-04-15 12:03:09.712888250 -0700 +++ new/src/share/vm/classfile/verifier.hpp 2015-04-15 12:03:09.567878109 -0700 @@ -436,7 +436,7 @@ Symbol* name = sig_type->as_symbol(CHECK_0); // Create another symbol to save as signature stream unreferences this symbol. Symbol* name_copy = create_temporary_symbol(name); - assert(name_copy == name, "symbols don't match"); + assert(name_copy->equals(name), "symbols don't match"); *inference_type = VerificationType::reference_type(name_copy); return 1; --- old/src/share/vm/classfile/vmSymbols.cpp 2015-04-15 12:03:10.243925384 -0700 +++ new/src/share/vm/classfile/vmSymbols.cpp 2015-04-15 12:03:10.104915664 -0700 @@ -35,7 +35,7 @@ Symbol* vmSymbols::_type_signatures[T_VOID+1] = { NULL /*, NULL...*/ }; inline int compare_symbol(Symbol* a, Symbol* b) { - if (a == b) return 0; + if (a->equals(b)) return 0; // follow the natural address order: return (address)a > (address)b ? +1 : -1; } @@ -102,7 +102,7 @@ for (int i1 = (int)FIRST_SID; i1 < (int)SID_LIMIT; i1++) { Symbol* sym = symbol_at((SID)i1); for (int i2 = (int)FIRST_SID; i2 < i1; i2++) { - if (symbol_at((SID)i2) == sym) { + if (symbol_at((SID)i2)->equals(sym)) { tty->print("*** Duplicate VM symbol SIDs %s(%d) and %s(%d): \"", vm_symbol_enum_name((SID)i2), i2, vm_symbol_enum_name((SID)i1), i1); @@ -191,7 +191,7 @@ BasicType vmSymbols::signature_type(Symbol* s) { assert(s != NULL, "checking"); for (int i = T_BOOLEAN; i < T_VOID+1; i++) { - if (s == _type_signatures[i]) { + if (s->equals(_type_signatures[i])) { return (BasicType)i; } } @@ -262,13 +262,13 @@ SID sid2 = NO_SID; for (int index = (int)FIRST_SID; index < (int)SID_LIMIT; index++) { Symbol* sym2 = symbol_at((SID)index); - if (sym2 == symbol) { + if (sym2->equals(symbol)) { sid2 = (SID)index; break; } } // Unless it's a duplicate, assert that the sids are the same. - if (_symbols[sid] != _symbols[sid2]) { + if (_symbols[sid]->not_equals(_symbols[sid2])) { assert(sid == sid2, "binary same as linear search"); } } @@ -487,14 +487,14 @@ // verify_method performs an extra check on a matched intrinsic method static bool match_method(Method* m, Symbol* n, Symbol* s) { - return (m->name() == n && - m->signature() == s); + return (m->name()->equals(n) && + m->signature()->equals(s)); } static vmIntrinsics::ID match_method_with_klass(Method* m, Symbol* mk) { #define VM_INTRINSIC_MATCH(id, klassname, namepart, sigpart, flags) \ { Symbol* k = vmSymbols::klassname(); \ - if (mk == k) { \ + if (mk->equals(k)) { \ Symbol* n = vmSymbols::namepart(); \ Symbol* s = vmSymbols::sigpart(); \ if (match_method(m, n, s)) \ @@ -512,7 +512,7 @@ if (declared_id == actual_id) return; // success - if (declared_id == _none && actual_id != _none && mk == vmSymbols::java_lang_StrictMath()) { + if (declared_id == _none && actual_id != _none && mk->equals(vmSymbols::java_lang_StrictMath())) { // Here are a few special cases in StrictMath not declared in vmSymbols.hpp. switch (actual_id) { case _min: --- old/src/share/vm/classfile/vmSymbols.hpp 2015-04-15 12:03:11.000978323 -0700 +++ new/src/share/vm/classfile/vmSymbols.hpp 2015-04-15 12:03:10.857968324 -0700 @@ -1166,7 +1166,7 @@ static Symbol* symbol_at(SID id) { assert(id >= FIRST_SID && id < SID_LIMIT, "oob"); - assert(_symbols[id] != NULL, "init"); + assert(_symbols[id]->not_equals(NULL), "init"); return _symbols[id]; } --- old/src/share/vm/compiler/compilerOracle.cpp 2015-04-15 12:03:11.557017207 -0700 +++ new/src/share/vm/compiler/compilerOracle.cpp 2015-04-15 12:03:11.388005387 -0700 @@ -73,7 +73,7 @@ for (MethodMatcher* current = this; current != NULL; current = current->_next) { if (match(class_name, current->class_name(), current->_class_mode) && match(method_name, current->method_name(), current->_method_mode) && - (current->signature() == NULL || current->signature() == method->signature())) { + (current->signature() == NULL || current->signature()->equals(method->signature()))) { return current; } } @@ -142,7 +142,7 @@ } if (match_mode == Exact) { - return candidate == match; + return candidate->equals(match); } ResourceMark rm; --- old/src/share/vm/interpreter/linkResolver.cpp 2015-04-15 12:03:12.112056020 -0700 +++ new/src/share/vm/interpreter/linkResolver.cpp 2015-04-15 12:03:11.970046088 -0700 @@ -98,7 +98,7 @@ CallKind kind, int index, TRAPS) { - assert(resolved_method->signature() == selected_method->signature(), "signatures must correspond"); + assert(resolved_method->signature()->equals(selected_method->signature()), "signatures must correspond"); _resolved_klass = resolved_klass; _selected_klass = selected_klass; _resolved_method = resolved_method; @@ -168,10 +168,10 @@ // Ensure that this is really the case. KlassHandle object_klass = SystemDictionary::Object_klass(); Method * object_resolved_method = object_klass()->vtable()->method_at(index); - assert(object_resolved_method->name() == resolved_method->name(), + assert(object_resolved_method->name()->equals(resolved_method->name()), err_msg("Object and interface method names should match at vtable index %d, %s != %s", index, object_resolved_method->name()->as_C_string(), resolved_method->name()->as_C_string())); - assert(object_resolved_method->signature() == resolved_method->signature(), + assert(object_resolved_method->signature()->equals(resolved_method->signature()), err_msg("Object and interface method signatures should match at vtable index %d, %s != %s", index, object_resolved_method->signature()->as_C_string(), resolved_method->signature()->as_C_string())); #endif // ASSERT @@ -462,7 +462,7 @@ // // We'll check for the method name first, as that's most likely // to be false (so we'll short-circuit out of these tests). - if (sel_method->name() == vmSymbols::clone_name() && + if (sel_method->name()->equals(vmSymbols::clone_name()) && sel_klass() == SystemDictionary::Object_klass() && resolved_klass->oop_is_array()) { // We need to change "protected" to "public". @@ -900,7 +900,7 @@ } else { resolve_interface_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, false, CHECK); } - assert(resolved_method->name() != vmSymbols::class_initializer_name(), "should have been checked in verifier"); + assert(resolved_method->name()->not_equals(vmSymbols::class_initializer_name()), "should have been checked in verifier"); // check if static if (!resolved_method->is_static()) { @@ -940,7 +940,7 @@ } // check if method name is , that it is found in same klass as static type - if (resolved_method->name() == vmSymbols::object_initializer_name() && + if (resolved_method->name()->equals(vmSymbols::object_initializer_name()) && resolved_method->method_holder() != resolved_klass()) { ResourceMark rm(THREAD); Exceptions::fthrow( @@ -1034,7 +1034,7 @@ current_klass->is_subclass_of(resolved_klass()) && current_klass() != resolved_klass() && // c) check if the method is not - resolved_method->name() != vmSymbols::object_initializer_name()) { + resolved_method->name()->not_equals(vmSymbols::object_initializer_name())) { // Lookup super method KlassHandle super_klass(THREAD, current_klass->super()); lookup_instance_method_in_klasses(sel_method, super_klass, @@ -1108,8 +1108,8 @@ // normal method resolution resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, true, CHECK); - assert(resolved_method->name() != vmSymbols::object_initializer_name(), "should have been checked in verifier"); - assert(resolved_method->name() != vmSymbols::class_initializer_name (), "should have been checked in verifier"); + assert(resolved_method->name()->not_equals(vmSymbols::object_initializer_name()), "should have been checked in verifier"); + assert(resolved_method->name()->not_equals(vmSymbols::class_initializer_name ()), "should have been checked in verifier"); // check if private interface method if (resolved_klass->is_interface() && resolved_method->is_private()) { @@ -1264,8 +1264,8 @@ // normal interface method resolution resolve_interface_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, true, CHECK); - assert(resolved_method->name() != vmSymbols::object_initializer_name(), "should have been checked in verifier"); - assert(resolved_method->name() != vmSymbols::class_initializer_name (), "should have been checked in verifier"); + assert(resolved_method->name()->not_equals(vmSymbols::object_initializer_name()), "should have been checked in verifier"); + assert(resolved_method->name()->not_equals(vmSymbols::class_initializer_name ()), "should have been checked in verifier"); } // throws runtime exceptions --- old/src/share/vm/interpreter/rewriter.cpp 2015-04-15 12:03:12.717098329 -0700 +++ new/src/share/vm/interpreter/rewriter.cpp 2015-04-15 12:03:12.576088467 -0700 @@ -54,7 +54,7 @@ add_resolved_references_entry(i); break; case JVM_CONSTANT_Utf8: - if (_pool->symbol_at(i) == vmSymbols::java_lang_invoke_MethodHandle()) + if (_pool->symbol_at(i)->equals(vmSymbols::java_lang_invoke_MethodHandle())) saw_mh_symbol = true; break; } @@ -194,7 +194,7 @@ int status = _method_handle_invokers[cp_index]; assert(status >= -1 && status <= 1, "oob tri-state"); if (status == 0) { - if (_pool->klass_ref_at_noresolve(cp_index) == vmSymbols::java_lang_invoke_MethodHandle() && + if (_pool->klass_ref_at_noresolve(cp_index)->equals(vmSymbols::java_lang_invoke_MethodHandle()) && MethodHandles::is_signature_polymorphic_name(SystemDictionary::MethodHandle_klass(), _pool->name_ref_at(cp_index))) { // we may need a resolved_refs entry for the appendix @@ -460,7 +460,7 @@ // determine index maps for Method* rewriting compute_index_maps(); - if (RegisterFinalizersAtInit && _klass->name() == vmSymbols::java_lang_Object()) { + if (RegisterFinalizersAtInit && _klass->name()->equals(vmSymbols::java_lang_Object())) { bool did_rewrite = false; int i = _methods->length(); while (i-- > 0) { --- old/src/share/vm/memory/universe.cpp 2015-04-15 12:03:13.242135043 -0700 +++ new/src/share/vm/memory/universe.cpp 2015-04-15 12:03:13.102125253 -0700 @@ -978,7 +978,7 @@ // Setup the array of errors that have preallocated backtrace k = Universe::_out_of_memory_error_java_heap->klass(); - assert(k->name() == vmSymbols::java_lang_OutOfMemoryError(), "should be out of memory error"); + assert(k->name()->equals(vmSymbols::java_lang_OutOfMemoryError()), "should be out of memory error"); k_h = instanceKlassHandle(THREAD, k); int len = (StackTraceInThrowable) ? (int)PreallocatedOutOfMemoryErrorCount : 0; --- old/src/share/vm/oops/constantPool.cpp 2015-04-15 12:03:13.784172946 -0700 +++ new/src/share/vm/oops/constantPool.cpp 2015-04-15 12:03:13.643163086 -0700 @@ -812,7 +812,7 @@ int which) { // Names are interned, so we can compare Symbol*s directly Symbol* cp_name = klass_name_at(which); - return (cp_name == k->name()); + return (cp_name->equals(k->name())); } @@ -951,7 +951,7 @@ { Symbol* k1 = klass_name_at(index1); Symbol* k2 = cp2->klass_name_at(index2); - if (k1 == k2) { + if (k1->equals(k2)) { return true; } } break; @@ -996,7 +996,7 @@ { Symbol* s1 = unresolved_string_at(index1); Symbol* s2 = cp2->unresolved_string_at(index2); - if (s1 == s2) { + if (s1->equals(s2)) { return true; } } break; @@ -1005,7 +1005,7 @@ { Symbol* s1 = symbol_at(index1); Symbol* s2 = cp2->symbol_at(index2); - if (s1 == s2) { + if (s1->equals(s2)) { return true; } } break; @@ -1660,7 +1660,7 @@ break; } case JVM_CONSTANT_Utf8: { - Symbol* sym = symbol_at(idx); + Symbol* sym = symbol_at(idx); char* str = sym->as_utf8(); // Warning! It's crashing on x86 with len = sym->utf8_length() int len = (int) strlen(str); @@ -2050,7 +2050,7 @@ // the class file for (SymbolHashMapEntry *en = bucket(index); en != NULL; en = en->next()) { assert(en->symbol() != NULL, "SymbolHashMapEntry symbol is NULL"); - if (en->hash() == hash && en->symbol() == sym) { + if (en->hash() == hash && en->symbol()->equals(sym)) { return; // already there } } @@ -2069,7 +2069,7 @@ unsigned int index = hash % table_size(); for (SymbolHashMapEntry *en = bucket(index); en != NULL; en = en->next()) { assert(en->symbol() != NULL, "SymbolHashMapEntry symbol is NULL"); - if (en->hash() == hash && en->symbol() == sym) { + if (en->hash() == hash && en->symbol()->equals(sym)) { return en; } } --- old/src/share/vm/oops/instanceKlass.cpp 2015-04-15 12:03:14.358213088 -0700 +++ new/src/share/vm/oops/instanceKlass.cpp 2015-04-15 12:03:14.212202876 -0700 @@ -96,7 +96,7 @@ { \ char* data = NULL; \ int len = 0; \ - Symbol* name = (clss)->name(); \ + Symbol* name = (clss)->name(); \ if (name != NULL) { \ data = (char*)name->bytes(); \ len = name->utf8_length(); \ @@ -109,7 +109,7 @@ { \ char* data = NULL; \ int len = 0; \ - Symbol* name = (clss)->name(); \ + Symbol* name = (clss)->name(); \ if (name != NULL) { \ data = (char*)name->bytes(); \ len = name->utf8_length(); \ @@ -146,11 +146,11 @@ // Allocation InstanceKlass* ik; if (rt == REF_NONE) { - if (name == vmSymbols::java_lang_Class()) { + if (name->equals(vmSymbols::java_lang_Class())) { ik = new (loader_data, size, THREAD) InstanceMirrorKlass( vtable_len, itable_len, static_field_size, nonstatic_oop_map_size, rt, access_flags, is_anonymous); - } else if (name == vmSymbols::java_lang_ClassLoader() || + } else if (name->equals(vmSymbols::java_lang_ClassLoader()) || (SystemDictionary::ClassLoader_klass_loaded() && super_klass != NULL && super_klass->is_subtype_of(SystemDictionary::ClassLoader_klass()))) { @@ -1183,7 +1183,7 @@ for (JavaFieldStream fs(this); !fs.done(); fs.next()) { Symbol* f_name = fs.name(); Symbol* f_sig = fs.signature(); - if (f_name == name && f_sig == sig) { + if (f_name->equals(name) && f_sig->equals(sig)) { fd->reinitialize(const_cast(this), fs.index()); return true; } @@ -1368,7 +1368,7 @@ for (int index = 0; index < len; index++) { Method* m = methods->at(index); assert(m->is_method(), "must be method"); - if (m->signature() == signature && m->name() == name) { + if (m->signature()->equals(signature) && m->name()->equals(name)) { return index; } } @@ -1436,7 +1436,7 @@ } bool InstanceKlass::method_matches(Method* m, Symbol* signature, bool skipping_overpass, bool skipping_static) { - return (m->signature() == signature) && + return (m->signature()->equals(signature)) && (!skipping_overpass || !m->is_overpass()) && (!skipping_static || !m->is_static()); } @@ -1465,14 +1465,14 @@ for (i = hit - 1; i >= 0; --i) { Method* m = methods->at(i); assert(m->is_method(), "must be method"); - if (m->name() != name) break; + if (m->name()->not_equals(name)) break; if (method_matches(m, signature, skipping_overpass, skipping_static)) return i; } // search upwards for (i = hit + 1; i < methods->length(); ++i) { Method* m = methods->at(i); assert(m->is_method(), "must be method"); - if (m->name() != name) break; + if (m->name()->not_equals(name)) break; if (method_matches(m, signature, skipping_overpass, skipping_static)) return i; } // not found @@ -1493,8 +1493,8 @@ int start = binary_search(methods, name); int end = start + 1; if (start != -1) { - while (start - 1 >= 0 && (methods->at(start - 1))->name() == name) --start; - while (end < methods->length() && (methods->at(end))->name() == name) ++end; + while (start - 1 >= 0 && (methods->at(start - 1))->name()->equals(name)) --start; + while (end < methods->length() && (methods->at(end))->name()->equals(name)) ++end; *end_ptr = end; return start; } @@ -2576,7 +2576,7 @@ oop class_loader2, Symbol* class_name2) { if (class_loader1 != class_loader2) { return false; - } else if (class_name1 == class_name2) { + } else if (class_name1->equals(class_name2)) { return true; // skip painful bytewise comparison } else { ResourceMark rm; @@ -2711,7 +2711,7 @@ // only look at classes that are already loaded // since we are looking for the flags for our self. Symbol* inner_name = ik->constants()->klass_name_at(ioff); - if ((ik->name() == inner_name)) { + if ((ik->name()->equals(inner_name))) { // This is really a member class. access = iter.inner_access_flags(); break; @@ -3585,8 +3585,8 @@ Method* method = method_refs->at(k); if (!method->is_obsolete() && - method->name() == m_name && - method->signature() == m_signature) { + method->name()->equals(m_name) && + method->signature()->equals(m_signature)) { // The current RedefineClasses() call has made all EMCP // versions of this method obsolete so mark it as obsolete RC_TRACE(0x00000400, --- old/src/share/vm/oops/klassVtable.cpp 2015-04-15 12:03:14.960255187 -0700 +++ new/src/share/vm/oops/klassVtable.cpp 2015-04-15 12:03:14.818245257 -0700 @@ -276,7 +276,7 @@ #ifndef PRODUCT Symbol* name= target_method()->name(); Symbol* signature = target_method()->signature(); - assert(super_method->name() == name && super_method->signature() == signature, "vtable entry name/sig mismatch"); + assert(super_method->name()->equals(name) && super_method->signature()->equals(signature), "vtable entry name/sig mismatch"); #endif if (supersuperklass->is_override(super_method, target_loader, target_classname, THREAD)) { #ifndef PRODUCT @@ -342,7 +342,7 @@ } // Static and methods are never in - if (target_method()->is_static() || target_method()->name() == vmSymbols::object_initializer_name()) { + if (target_method()->is_static() || target_method()->name()->equals(vmSymbols::object_initializer_name())) { return false; } @@ -399,7 +399,7 @@ for(int i = 0; i < super_vtable_len; i++) { Method* super_method = method_at(i); // Check if method name matches - if (super_method->name() == name && super_method->signature() == signature) { + if (super_method->name()->equals(name) && super_method->signature()->equals(signature)) { // get super_klass for method_holder for the found method InstanceKlass* super_klass = super_method->method_holder(); @@ -573,7 +573,7 @@ // a super's method, in which case they re-use its entry (target_method()->is_static()) || // static methods don't need to be in vtable - (target_method()->name() == vmSymbols::object_initializer_name()) + (target_method()->name()->equals(vmSymbols::object_initializer_name())) // is never called dynamically-bound ) { return false; @@ -663,7 +663,7 @@ for (int i = (length() - 1); i >= 0; i--) { Method* m = table()[i].method(); if (is_miranda_entry_at(i) && - m->name() == name && m->signature() == signature) { + m->name()->equals(name) && m->signature()->equals(signature)) { return i; } } @@ -758,8 +758,8 @@ // check for duplicate mirandas in different interfaces we implement for (int j = 0; j < num_of_current_mirandas; j++) { Method* miranda = new_mirandas->at(j); - if ((im->name() == miranda->name()) && - (im->signature() == miranda->signature())) { + if ((im->name()->equals(miranda->name())) && + (im->signature()->equals(miranda->signature()))) { is_duplicate = true; break; } @@ -1432,8 +1432,8 @@ void klassVtable::verify_against(outputStream* st, klassVtable* vt, int index) { vtableEntry* vte = &vt->table()[index]; - if (vte->method()->name() != table()[index].method()->name() || - vte->method()->signature() != table()[index].method()->signature()) { + if (vte->method()->name()->not_equals(table()[index].method()->name()) || + vte->method()->signature()->not_equals(table()[index].method()->signature())) { fatal("mismatched name/signature of vtable entries"); } } --- old/src/share/vm/oops/method.cpp 2015-04-15 12:03:15.533295258 -0700 +++ new/src/share/vm/oops/method.cpp 2015-04-15 12:03:15.379284489 -0700 @@ -481,8 +481,8 @@ // // return - assert(name() == vmSymbols::object_initializer_name(), "Should only be called for default constructors"); - assert(signature() == vmSymbols::void_method_signature(), "Should only be called for default constructors"); + assert(name()->equals(vmSymbols::object_initializer_name()), "Should only be called for default constructors"); + assert(signature()->equals(vmSymbols::void_method_signature()), "Should only be called for default constructors"); int size = code_size(); // Check if size match if (size == 0 || size % 5 != 0) return false; @@ -599,7 +599,7 @@ } bool Method::is_initializer() const { - return name() == vmSymbols::object_initializer_name() || is_static_initializer(); + return name()->equals(vmSymbols::object_initializer_name()) || is_static_initializer(); } bool Method::has_valid_initializer_flags() const { @@ -611,7 +611,7 @@ // For classfiles version 51 or greater, ensure that the clinit method is // static. Non-static methods with the name "" are not static // initializers. (older classfiles exempted for backward compatibility) - return name() == vmSymbols::class_initializer_name() && + return name()->equals(vmSymbols::class_initializer_name()) && has_valid_initializer_flags(); } @@ -1148,7 +1148,7 @@ m->set_name_index(_imcp_invoke_name); m->set_signature_index(_imcp_invoke_signature); assert(MethodHandles::is_signature_polymorphic_name(m->name()), ""); - assert(m->signature() == signature, ""); + assert(m->signature()->equals(signature), ""); #ifdef CC_INTERP ResultTypeFinder rtf(signature); m->set_result_index(rtf.type()); --- old/src/share/vm/oops/symbol.hpp 2015-04-15 12:03:16.097334698 -0700 +++ new/src/share/vm/oops/symbol.hpp 2015-04-15 12:03:15.954324700 -0700 @@ -223,6 +223,28 @@ void print() { print_on(tty); } void print_value() { print_value_on(tty); } + // Allows two distinct Symbol objects to be considered equal as long as + // they contain the same string. However, no two Symbol objects stored in the same + // SymbolTable would contain the same string. Therefore, if two distinct Symbol + // objects contain the same string, they must belong to different SymbolTables. + inline bool equals(const Symbol* other) const { + if (this && other) { + int len = this->utf8_length(); + if (len != other->utf8_length()) { + return false; + } + if (this->_identity_hash != other->_identity_hash) { + return false; + } + return (strncmp((const char*)(this->base()), (const char*)(other->base()), len) == 0); + } else { + return (this == other); + } + } + inline bool not_equals(const Symbol* other) const { + return !(this->equals(other)); + } + #ifndef PRODUCT // Empty constructor to create a dummy symbol object on stack // only for getting its vtable pointer. --- old/src/share/vm/prims/jni.cpp 2015-04-15 12:03:16.642372812 -0700 +++ new/src/share/vm/prims/jni.cpp 2015-04-15 12:03:16.500362883 -0700 @@ -395,7 +395,7 @@ // Special handling to make sure JNI_OnLoad and JNI_OnUnload are executed // in the correct class context. if (loader.is_null() && - k->name() == vmSymbols::java_lang_ClassLoader_NativeLibrary()) { + k->name()->equals(vmSymbols::java_lang_ClassLoader_NativeLibrary())) { JavaValue result(T_OBJECT); JavaCalls::call_static(&result, k, vmSymbols::getFromClass_name(), @@ -3021,8 +3021,8 @@ // The class should have been loaded (we have an instance of the class // passed in) so the method and signature should already be in the symbol // table. If they're not there, the method doesn't exist. - TempNewSymbol name = SymbolTable::probe(meth_name, meth_name_len); - TempNewSymbol signature = SymbolTable::probe(meth_sig, (int)strlen(meth_sig)); + TempNewSymbol name = SymbolTable::probe(meth_name, meth_name_len); + TempNewSymbol signature = SymbolTable::probe(meth_sig, (int)strlen(meth_sig)); if (name == NULL || signature == NULL) { ResourceMark rm; --- old/src/share/vm/prims/jvm.cpp 2015-04-15 12:03:17.202411975 -0700 +++ new/src/share/vm/prims/jvm.cpp 2015-04-15 12:03:17.060402044 -0700 @@ -163,20 +163,20 @@ // that caller, otherwise keep quiet since this should be picked up elsewhere. bool found_it = false; if (!vfst.at_end() && - vfst.method()->method_holder()->name() == vmSymbols::java_lang_Class() && - vfst.method()->name() == vmSymbols::forName0_name()) { + vfst.method()->method_holder()->name()->equals(vmSymbols::java_lang_Class()) && + vfst.method()->name()->equals(vmSymbols::forName0_name())) { vfst.next(); if (!vfst.at_end() && - vfst.method()->method_holder()->name() == vmSymbols::java_lang_Class() && - vfst.method()->name() == vmSymbols::forName_name()) { + vfst.method()->method_holder()->name()->equals(vmSymbols::java_lang_Class()) && + vfst.method()->name()->equals(vmSymbols::forName_name())) { vfst.next(); found_it = true; } } else if (last_caller != NULL && - last_caller->method_holder()->name() == - vmSymbols::java_lang_ClassLoader() && - (last_caller->name() == vmSymbols::loadClassInternal_name() || - last_caller->name() == vmSymbols::loadClass_name())) { + last_caller->method_holder()->name()->equals( + vmSymbols::java_lang_ClassLoader()) && + (last_caller->name()->equals(vmSymbols::loadClassInternal_name()) || + last_caller->name()->equals(vmSymbols::loadClass_name()))) { found_it = true; } else if (!vfst.at_end()) { if (vfst.method()->is_native()) { @@ -2376,7 +2376,7 @@ Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls)); k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread); Method* method = InstanceKlass::cast(k)->methods()->at(method_index); - return method->name() == vmSymbols::object_initializer_name(); + return method->name()->equals(vmSymbols::object_initializer_name()); JVM_END @@ -2544,7 +2544,7 @@ Symbol* name = cp->uncached_name_ref_at(cp_index); Symbol* signature = cp->uncached_signature_ref_at(cp_index); for (JavaFieldStream fs(k_called); !fs.done(); fs.next()) { - if (fs.name() == name && fs.signature() == signature) { + if (fs.name()->equals(name) && fs.signature()->equals(signature)) { return fs.access_flags().as_short() & JVM_RECOGNIZED_FIELD_MODIFIERS; } } @@ -2574,7 +2574,7 @@ int methods_count = methods->length(); for (int i = 0; i < methods_count; i++) { Method* method = methods->at(i); - if (method->name() == name && method->signature() == signature) { + if (method->name()->equals(name) && method->signature()->equals(signature)) { return method->access_flags().as_int() & JVM_RECOGNIZED_METHOD_MODIFIERS; } } @@ -3164,8 +3164,8 @@ // This must only be called from SecurityManager.getClassContext Method* m = vfst.method(); if (!(m->method_holder() == SystemDictionary::SecurityManager_klass() && - m->name() == vmSymbols::getClassContext_name() && - m->signature() == vmSymbols::void_class_array_signature())) { + m->name()->equals(vmSymbols::getClassContext_name()) && + m->signature()->equals(vmSymbols::void_class_array_signature()))) { THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), "JVM_GetClassContext must only be called from SecurityManager.getClassContext"); } } @@ -3211,7 +3211,7 @@ if (!vfst.method()->is_native()) { InstanceKlass* holder = vfst.method()->method_holder(); assert(holder->is_klass(), "just checking"); - if (holder->name() == class_name_sym) { + if (holder->name()->equals(class_name_sym)) { return depth; } depth++; --- old/src/share/vm/prims/jvmtiEnv.cpp 2015-04-15 12:03:17.779452325 -0700 +++ new/src/share/vm/prims/jvmtiEnv.cpp 2015-04-15 12:03:17.639442535 -0700 @@ -542,7 +542,7 @@ Symbol* ex_name = PENDING_EXCEPTION->klass()->name(); CLEAR_PENDING_EXCEPTION; - if (ex_name == vmSymbols::java_lang_NoSuchMethodError()) { + if (ex_name->equals(vmSymbols::java_lang_NoSuchMethodError())) { return JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED; } else { return JVMTI_ERROR_INTERNAL; --- old/src/share/vm/prims/jvmtiImpl.cpp 2015-04-15 12:03:18.376494074 -0700 +++ new/src/share/vm/prims/jvmtiImpl.cpp 2015-04-15 12:03:18.227483654 -0700 @@ -299,8 +299,8 @@ Method* method = methods->at(i); // Only set breakpoints in running EMCP methods. if (method->is_running_emcp() && - method->name() == m_name && - method->signature() == m_signature) { + method->name()->equals(m_name) && + method->signature()->equals(m_signature)) { RC_TRACE(0x00000800, ("%sing breakpoint in %s(%s)", meth_act == &Method::set_breakpoint ? "sett" : "clear", method->name()->as_C_string(), @@ -605,21 +605,21 @@ len -= 2; } TempNewSymbol ty_sym = SymbolTable::new_symbol(ty_sign, len, thread); - if (klass->name() == ty_sym) { + if (klass->name()->equals(ty_sym)) { return true; } // Compare primary supers int super_depth = klass->super_depth(); int idx; for (idx = 0; idx < super_depth; idx++) { - if (klass->primary_super_of_depth(idx)->name() == ty_sym) { + if (klass->primary_super_of_depth(idx)->name()->equals(ty_sym)) { return true; } } // Compare secondary supers Array* sec_supers = klass->secondary_supers(); for (idx = 0; idx < sec_supers->length(); idx++) { - if (((Klass*) sec_supers->at(idx))->name() == ty_sym) { + if (((Klass*) sec_supers->at(idx))->name()->equals(ty_sym)) { return true; } } --- old/src/share/vm/prims/jvmtiRedefineClasses.cpp 2015-04-15 12:03:18.913531627 -0700 +++ new/src/share/vm/prims/jvmtiRedefineClasses.cpp 2015-04-15 12:03:18.773521837 -0700 @@ -611,8 +611,8 @@ // Check for NULL superclass first since this might be java.lang.Object if (the_class->super() != scratch_class->super() && (the_class->super() == NULL || scratch_class->super() == NULL || - the_class->super()->name() != - scratch_class->super()->name())) { + the_class->super()->name()->not_equals( + scratch_class->super()->name()))) { return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED; } @@ -630,8 +630,8 @@ return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED; } for (i = 0; i < n_intfs; i++) { - if (k_interfaces->at(i)->name() != - k_new_interfaces->at(i)->name()) { + if (k_interfaces->at(i)->name()->not_equals( + k_new_interfaces->at(i)->name())) { return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED; } } @@ -669,7 +669,7 @@ Symbol* sig_sym1 = the_class->constants()->symbol_at(old_fs.signature_index()); Symbol* name_sym2 = scratch_class->constants()->symbol_at(new_fs.name_index()); Symbol* sig_sym2 = scratch_class->constants()->symbol_at(new_fs.signature_index()); - if (name_sym1 != name_sym2 || sig_sym1 != sig_sym2) { + if (name_sym1->not_equals(name_sym2) || sig_sym1->not_equals(sig_sym2)) { return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED; } } @@ -725,7 +725,7 @@ // There are more methods in both the old and new lists k_old_method = k_old_methods->at(oi); k_new_method = k_new_methods->at(ni); - if (k_old_method->name() != k_new_method->name()) { + if (k_old_method->name()->not_equals(k_new_method->name())) { // Methods are sorted by method name, so a mismatch means added // or deleted if (k_old_method->name()->fast_compare(k_new_method->name()) > 0) { @@ -733,7 +733,7 @@ } else { method_was = deleted; } - } else if (k_old_method->signature() == k_new_method->signature()) { + } else if (k_old_method->signature()->equals(k_new_method->signature())) { // Both the name and signature match method_was = matched; } else { @@ -742,12 +742,12 @@ int nj; // outside the loop for post-loop check for (nj = ni + 1; nj < n_new_methods; nj++) { Method* m = k_new_methods->at(nj); - if (k_old_method->name() != m->name()) { + if (k_old_method->name()->not_equals(m->name())) { // reached another method name so no more overloaded methods method_was = deleted; break; } - if (k_old_method->signature() == m->signature()) { + if (k_old_method->signature()->equals(m->signature())) { // found a match so swap the methods k_new_methods->at_put(ni, m); k_new_methods->at_put(nj, k_new_method); @@ -1010,16 +1010,16 @@ ex_name->as_C_string())); CLEAR_PENDING_EXCEPTION; - if (ex_name == vmSymbols::java_lang_UnsupportedClassVersionError()) { + if (ex_name->equals(vmSymbols::java_lang_UnsupportedClassVersionError())) { return JVMTI_ERROR_UNSUPPORTED_VERSION; - } else if (ex_name == vmSymbols::java_lang_ClassFormatError()) { + } else if (ex_name->equals(vmSymbols::java_lang_ClassFormatError())) { return JVMTI_ERROR_INVALID_CLASS_FORMAT; - } else if (ex_name == vmSymbols::java_lang_ClassCircularityError()) { + } else if (ex_name->equals(vmSymbols::java_lang_ClassCircularityError())) { return JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION; - } else if (ex_name == vmSymbols::java_lang_NoClassDefFoundError()) { + } else if (ex_name->equals(vmSymbols::java_lang_NoClassDefFoundError())) { // The message will be "XXX (wrong name: YYY)" return JVMTI_ERROR_NAMES_DONT_MATCH; - } else if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) { + } else if (ex_name->equals(vmSymbols::java_lang_OutOfMemoryError())) { return JVMTI_ERROR_OUT_OF_MEMORY; } else { // Just in case more exceptions can be thrown.. return JVMTI_ERROR_FAILS_VERIFICATION; @@ -1035,7 +1035,7 @@ RC_TRACE_WITH_THREAD(0x00000002, THREAD, ("link_class exception: '%s'", ex_name->as_C_string())); CLEAR_PENDING_EXCEPTION; - if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) { + if (ex_name->equals(vmSymbols::java_lang_OutOfMemoryError())) { return JVMTI_ERROR_OUT_OF_MEMORY; } else { return JVMTI_ERROR_INTERNAL; @@ -1073,7 +1073,7 @@ RC_TRACE_WITH_THREAD(0x00000002, THREAD, ("verify_byte_codes exception: '%s'", ex_name->as_C_string())); CLEAR_PENDING_EXCEPTION; - if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) { + if (ex_name->equals(vmSymbols::java_lang_OutOfMemoryError())) { return JVMTI_ERROR_OUT_OF_MEMORY; } else { // tell the caller the bytecodes are bad @@ -1088,7 +1088,7 @@ RC_TRACE_WITH_THREAD(0x00000002, THREAD, ("merge_cp_and_rewrite exception: '%s'", ex_name->as_C_string())); CLEAR_PENDING_EXCEPTION; - if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) { + if (ex_name->equals(vmSymbols::java_lang_OutOfMemoryError())) { return JVMTI_ERROR_OUT_OF_MEMORY; } else { return JVMTI_ERROR_INTERNAL; @@ -1109,7 +1109,7 @@ ("verify_byte_codes post merge-CP exception: '%s'", ex_name->as_C_string())); CLEAR_PENDING_EXCEPTION; - if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) { + if (ex_name->equals(vmSymbols::java_lang_OutOfMemoryError())) { return JVMTI_ERROR_OUT_OF_MEMORY; } else { // tell the caller that constant pool merging screwed up @@ -1128,7 +1128,7 @@ RC_TRACE_WITH_THREAD(0x00000002, THREAD, ("Rewriter::rewrite or link_methods exception: '%s'", ex_name->as_C_string())); CLEAR_PENDING_EXCEPTION; - if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) { + if (ex_name->equals(vmSymbols::java_lang_OutOfMemoryError())) { return JVMTI_ERROR_OUT_OF_MEMORY; } else { return JVMTI_ERROR_INTERNAL; @@ -3810,8 +3810,8 @@ } else { old_method = _old_methods->at(oj); new_method = _new_methods->at(nj); - if (old_method->name() == new_method->name()) { - if (old_method->signature() == new_method->signature()) { + if (old_method->name()->equals(new_method->name())) { + if (old_method->signature()->equals(new_method->signature())) { _matching_old_methods[_matching_methods_length ] = old_method; _matching_new_methods[_matching_methods_length++] = new_method; ++nj; --- old/src/share/vm/prims/methodComparator.cpp 2015-04-15 12:03:19.482571417 -0700 +++ new/src/share/vm/prims/methodComparator.cpp 2015-04-15 12:03:19.342561626 -0700 @@ -137,7 +137,7 @@ case Bytecodes::_instanceof : { u2 cpi_old = _s_old->get_index_u2(); u2 cpi_new = _s_new->get_index_u2(); - if ((_old_cp->klass_at_noresolve(cpi_old) != _new_cp->klass_at_noresolve(cpi_new))) + if ((_old_cp->klass_at_noresolve(cpi_old)->not_equals(_new_cp->klass_at_noresolve(cpi_new)))) return false; if (c_old == Bytecodes::_multianewarray && *(jbyte*)(_s_old->bcp() + 3) != *(jbyte*)(_s_new->bcp() + 3)) @@ -158,9 +158,9 @@ // Check if the names of classes, field/method names and signatures at these indexes // are the same. Indices which are really into constantpool cache (rather than constant // pool itself) are accepted by the constantpool query routines below. - if ((_old_cp->klass_ref_at_noresolve(cpci_old) != _new_cp->klass_ref_at_noresolve(cpci_new)) || - (_old_cp->name_ref_at(cpci_old) != _new_cp->name_ref_at(cpci_new)) || - (_old_cp->signature_ref_at(cpci_old) != _new_cp->signature_ref_at(cpci_new))) + if ((_old_cp->klass_ref_at_noresolve(cpci_old)->not_equals(_new_cp->klass_ref_at_noresolve(cpci_new))) || + (_old_cp->name_ref_at(cpci_old)->not_equals(_new_cp->name_ref_at(cpci_new))) || + (_old_cp->signature_ref_at(cpci_old)->not_equals(_new_cp->signature_ref_at(cpci_new)))) return false; break; } @@ -171,8 +171,8 @@ // Check if the names of classes, field/method names and signatures at these indexes // are the same. Indices which are really into constantpool cache (rather than constant // pool itself) are accepted by the constantpool query routines below. - if ((_old_cp->name_ref_at(cpci_old) != _new_cp->name_ref_at(cpci_new)) || - (_old_cp->signature_ref_at(cpci_old) != _new_cp->signature_ref_at(cpci_new))) + if ((_old_cp->name_ref_at(cpci_old)->not_equals(_new_cp->name_ref_at(cpci_new))) || + (_old_cp->signature_ref_at(cpci_old)->not_equals(_new_cp->signature_ref_at(cpci_new)))) return false; // Translate object indexes to constant pool cache indexes. @@ -411,13 +411,13 @@ // tag_old should be klass - 4881222 if (! (tag_new.is_unresolved_klass() || tag_new.is_klass())) return false; - if (_old_cp->klass_at_noresolve(cpi_old) != - _new_cp->klass_at_noresolve(cpi_new)) + if (_old_cp->klass_at_noresolve(cpi_old)->not_equals( + _new_cp->klass_at_noresolve(cpi_new))) return false; } else if (tag_old.is_method_type() && tag_new.is_method_type()) { int mti_old = _old_cp->method_type_index_at(cpi_old); int mti_new = _new_cp->method_type_index_at(cpi_new); - if ((_old_cp->symbol_at(mti_old) != _new_cp->symbol_at(mti_new))) + if ((_old_cp->symbol_at(mti_old)->not_equals(_new_cp->symbol_at(mti_new)))) return false; } else if (tag_old.is_method_handle() && tag_new.is_method_handle()) { if (_old_cp->method_handle_ref_kind_at(cpi_old) != @@ -425,9 +425,9 @@ return false; int mhi_old = _old_cp->method_handle_index_at(cpi_old); int mhi_new = _new_cp->method_handle_index_at(cpi_new); - if ((_old_cp->uncached_klass_ref_at_noresolve(mhi_old) != _new_cp->uncached_klass_ref_at_noresolve(mhi_new)) || - (_old_cp->uncached_name_ref_at(mhi_old) != _new_cp->uncached_name_ref_at(mhi_new)) || - (_old_cp->uncached_signature_ref_at(mhi_old) != _new_cp->uncached_signature_ref_at(mhi_new))) + if ((_old_cp->uncached_klass_ref_at_noresolve(mhi_old)->not_equals(_new_cp->uncached_klass_ref_at_noresolve(mhi_new))) || + (_old_cp->uncached_name_ref_at(mhi_old)->not_equals(_new_cp->uncached_name_ref_at(mhi_new))) || + (_old_cp->uncached_signature_ref_at(mhi_old)->not_equals(_new_cp->uncached_signature_ref_at(mhi_new)))) return false; } else { return false; // unknown tag --- old/src/share/vm/prims/methodHandles.cpp 2015-04-15 12:03:20.028609601 -0700 +++ new/src/share/vm/prims/methodHandles.cpp 2015-04-15 12:03:19.886599670 -0700 @@ -222,7 +222,7 @@ #ifdef ASSERT { ResourceMark rm; Method* m2 = m_klass_non_interface->vtable()->method_at(vmindex); - assert(m->name() == m2->name() && m->signature() == m2->signature(), + assert(m->name()->equals(m2->name()) && m->signature()->equals(m2->signature()), err_msg("at %d, %s != %s", vmindex, m->name_and_sig_as_C_string(), m2->name_and_sig_as_C_string())); } @@ -328,7 +328,7 @@ // The following test will fail spuriously during bootstrap of MethodHandle itself: // if (klass != SystemDictionary::MethodHandle_klass()) // Test the name instead: - if (klass->name() != vmSymbols::java_lang_invoke_MethodHandle()) + if (klass->name()->not_equals(vmSymbols::java_lang_invoke_MethodHandle())) return false; Symbol* poly_sig = vmSymbols::object_array_object_signature(); Method* m = InstanceKlass::cast(klass)->find_method(name, poly_sig); @@ -392,7 +392,7 @@ vmIntrinsics::ID MethodHandles::signature_polymorphic_name_id(Klass* klass, Symbol* name) { if (klass != NULL && - klass->name() == vmSymbols::java_lang_invoke_MethodHandle()) { + klass->name()->equals(vmSymbols::java_lang_invoke_MethodHandle())) { vmIntrinsics::ID iid = signature_polymorphic_name_id(name); if (iid != vmIntrinsics::_none) return iid; @@ -586,11 +586,11 @@ // Here are some more short cuts for common types. // They are optional, since reference types can be resolved lazily. if (bt == T_OBJECT) { - if (s == vmSymbols::object_signature()) { + if (s->equals(vmSymbols::object_signature())) { return object_java_mirror(); - } else if (s == vmSymbols::class_signature()) { + } else if (s->equals(vmSymbols::class_signature())) { return SystemDictionary::Class_klass()->java_mirror(); - } else if (s == vmSymbols::string_signature()) { + } else if (s->equals(vmSymbols::string_signature())) { return SystemDictionary::String_klass()->java_mirror(); } } @@ -864,9 +864,9 @@ if ((match_flags & IS_FIELD) != 0) { for (FieldStream st(k(), local_only, !search_intfc); !st.eos(); st.next()) { - if (name != NULL && st.name() != name) + if (name != NULL && st.name()->not_equals(name)) continue; - if (sig != NULL && st.signature() != sig) + if (sig != NULL && st.signature()->not_equals(sig)) continue; // passed the filters if (rskip > 0) { @@ -888,14 +888,14 @@ // watch out for these guys: Symbol* init_name = vmSymbols::object_initializer_name(); Symbol* clinit_name = vmSymbols::class_initializer_name(); - if (name == clinit_name) clinit_name = NULL; // hack for exposing + if (name->equals(clinit_name)) clinit_name = NULL; // hack for exposing bool negate_name_test = false; // fix name so that it captures the intention of IS_CONSTRUCTOR if (!(match_flags & IS_METHOD)) { // constructors only if (name == NULL) { name = init_name; - } else if (name != init_name) { + } else if (name->not_equals(init_name)) { return 0; // no constructors of this method name } } else if (!(match_flags & IS_CONSTRUCTOR)) { @@ -903,7 +903,7 @@ if (name == NULL) { name = init_name; negate_name_test = true; // if we see the name, we *omit* the entry - } else if (name == init_name) { + } else if (name->equals(init_name)) { return 0; // no methods of this constructor name } } else { @@ -912,11 +912,11 @@ for (MethodStream st(k(), local_only, !search_intfc); !st.eos(); st.next()) { Method* m = st.method(); Symbol* m_name = m->name(); - if (m_name == clinit_name) + if (m_name->equals(clinit_name)) continue; - if (name != NULL && ((m_name != name) ^ negate_name_test)) + if (name->not_equals(NULL) && ((m_name->not_equals(name)) ^ negate_name_test)) continue; - if (sig != NULL && m->signature() != sig) + if (sig->not_equals(NULL) && m->signature()->not_equals(sig)) continue; // passed the filters if (rskip > 0) { --- old/src/share/vm/prims/methodHandles.hpp 2015-04-15 12:03:20.565647153 -0700 +++ new/src/share/vm/prims/methodHandles.hpp 2015-04-15 12:03:20.416636732 -0700 @@ -104,7 +104,7 @@ iid <= vmIntrinsics::_linkToInterface); } static bool has_member_arg(Symbol* klass, Symbol* name) { - if ((klass == vmSymbols::java_lang_invoke_MethodHandle()) && + if ((klass->equals(vmSymbols::java_lang_invoke_MethodHandle())) && is_signature_polymorphic_name(name)) { vmIntrinsics::ID iid = signature_polymorphic_name_id(name); return has_member_arg(iid); --- old/src/share/vm/runtime/compilationPolicy.cpp 2015-04-15 12:03:21.108685125 -0700 +++ new/src/share/vm/runtime/compilationPolicy.cpp 2015-04-15 12:03:20.960674776 -0700 @@ -636,7 +636,7 @@ break; } - if( next_m->name() == vmSymbols::class_initializer_name() ) { + if( next_m->name()->equals(vmSymbols::class_initializer_name()) ) { msg = "do not compile class initializer (OSR ok)"; break; } --- old/src/share/vm/runtime/reflection.cpp 2015-04-15 12:03:21.665724077 -0700 +++ new/src/share/vm/runtime/reflection.cpp 2015-04-15 12:03:21.525714286 -0700 @@ -56,7 +56,7 @@ vframeStream vfst(jthread); // skip over any frames belonging to java.lang.Class while (!vfst.at_end() && - vfst.method()->method_holder()->name() == vmSymbols::java_lang_Class()) { + vfst.method()->method_holder()->name()->equals(vmSymbols::java_lang_Class())) { vfst.next(); } if (!vfst.at_end()) { @@ -867,7 +867,7 @@ // target klass is receiver's klass target_klass = KlassHandle(THREAD, receiver->klass()); // no need to resolve if method is private or - if (reflected_method->is_private() || reflected_method->name() == vmSymbols::object_initializer_name()) { + if (reflected_method->is_private() || reflected_method->name()->equals(vmSymbols::object_initializer_name())) { method = reflected_method; } else { // resolve based on the receiver @@ -1075,7 +1075,7 @@ THROW_MSG_0(vmSymbols::java_lang_InternalError(), "invoke"); } methodHandle method(THREAD, m); - assert(method->name() == vmSymbols::object_initializer_name(), "invalid constructor"); + assert(method->name()->equals(vmSymbols::object_initializer_name()), "invalid constructor"); // Make sure klass gets initialize klass->initialize(CHECK_NULL); --- old/src/share/vm/runtime/vframe.cpp 2015-04-15 12:03:22.214762468 -0700 +++ new/src/share/vm/runtime/vframe.cpp 2015-04-15 12:03:22.073752609 -0700 @@ -162,8 +162,8 @@ // If this is the first frame, and java.lang.Object.wait(...) then print out the receiver. if (frame_count == 0) { - if (method()->name() == vmSymbols::wait_name() && - method()->method_holder()->name() == vmSymbols::java_lang_Object()) { + if (method()->name()->equals(vmSymbols::wait_name()) && + method()->method_holder()->name()->equals(vmSymbols::java_lang_Object())) { StackValueCollection* locs = locals(); if (!locs->is_empty()) { StackValue* sv = locs->at(0);