--- 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) {