src/share/vm/prims/methodHandles.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/prims/methodHandles.cpp

src/share/vm/prims/methodHandles.cpp

Print this page

        

*** 220,230 **** if (m_klass_non_interface->is_interface()) { m_klass_non_interface = SystemDictionary::Object_klass(); #ifdef ASSERT { ResourceMark rm; Method* m2 = m_klass_non_interface->vtable()->method_at(vmindex); ! assert(m->name() == m2->name() && m->signature() == m2->signature(), err_msg("at %d, %s != %s", vmindex, m->name_and_sig_as_C_string(), m2->name_and_sig_as_C_string())); } #endif //ASSERT } --- 220,230 ---- if (m_klass_non_interface->is_interface()) { m_klass_non_interface = SystemDictionary::Object_klass(); #ifdef ASSERT { ResourceMark rm; Method* m2 = m_klass_non_interface->vtable()->method_at(vmindex); ! 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())); } #endif //ASSERT }
*** 326,336 **** if (klass == NULL) return false; // 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()) return false; Symbol* poly_sig = vmSymbols::object_array_object_signature(); Method* m = InstanceKlass::cast(klass)->find_method(name, poly_sig); if (m == NULL) return false; int required = JVM_ACC_NATIVE | JVM_ACC_VARARGS; --- 326,336 ---- if (klass == NULL) return false; // The following test will fail spuriously during bootstrap of MethodHandle itself: // if (klass != SystemDictionary::MethodHandle_klass()) // Test the name instead: ! 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); if (m == NULL) return false; int required = JVM_ACC_NATIVE | JVM_ACC_VARARGS;
*** 390,400 **** return vmIntrinsics::_none; } vmIntrinsics::ID MethodHandles::signature_polymorphic_name_id(Klass* klass, Symbol* name) { if (klass != NULL && ! klass->name() == vmSymbols::java_lang_invoke_MethodHandle()) { vmIntrinsics::ID iid = signature_polymorphic_name_id(name); if (iid != vmIntrinsics::_none) return iid; if (is_method_handle_invoke_name(klass, name)) return vmIntrinsics::_invokeGeneric; --- 390,400 ---- return vmIntrinsics::_none; } vmIntrinsics::ID MethodHandles::signature_polymorphic_name_id(Klass* klass, Symbol* name) { if (klass != NULL && ! klass->name()->equals(vmSymbols::java_lang_invoke_MethodHandle())) { vmIntrinsics::ID iid = signature_polymorphic_name_id(name); if (iid != vmIntrinsics::_none) return iid; if (is_method_handle_invoke_name(klass, name)) return vmIntrinsics::_invokeGeneric;
*** 584,598 **** return java_lang_Class::primitive_mirror(bt); } // 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()) { return object_java_mirror(); ! } else if (s == vmSymbols::class_signature()) { return SystemDictionary::Class_klass()->java_mirror(); ! } else if (s == vmSymbols::string_signature()) { return SystemDictionary::String_klass()->java_mirror(); } } return NULL; } --- 584,598 ---- return java_lang_Class::primitive_mirror(bt); } // 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->equals(vmSymbols::object_signature())) { return object_java_mirror(); ! } else if (s->equals(vmSymbols::class_signature())) { return SystemDictionary::Class_klass()->java_mirror(); ! } else if (s->equals(vmSymbols::string_signature())) { return SystemDictionary::String_klass()->java_mirror(); } } return NULL; }
*** 862,874 **** // NYI, and Core Reflection works quite well for this query } if ((match_flags & IS_FIELD) != 0) { for (FieldStream st(k(), local_only, !search_intfc); !st.eos(); st.next()) { ! if (name != NULL && st.name() != name) continue; ! if (sig != NULL && st.signature() != sig) continue; // passed the filters if (rskip > 0) { --rskip; } else if (rfill < rlimit) { --- 862,874 ---- // NYI, and Core Reflection works quite well for this query } if ((match_flags & IS_FIELD) != 0) { for (FieldStream st(k(), local_only, !search_intfc); !st.eos(); st.next()) { ! if (name != NULL && st.name()->not_equals(name)) continue; ! if (sig != NULL && st.signature()->not_equals(sig)) continue; // passed the filters if (rskip > 0) { --rskip; } else if (rfill < rlimit) {
*** 886,924 **** if ((match_flags & (IS_METHOD | IS_CONSTRUCTOR)) != 0) { // 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 <clinit> 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) { return 0; // no constructors of this method name } } else if (!(match_flags & IS_CONSTRUCTOR)) { // methods only if (name == NULL) { name = init_name; negate_name_test = true; // if we see the name, we *omit* the entry ! } else if (name == init_name) { return 0; // no methods of this constructor name } } else { // caller will accept either sort; no need to adjust name } 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) continue; ! if (name != NULL && ((m_name != name) ^ negate_name_test)) continue; ! if (sig != NULL && m->signature() != sig) continue; // passed the filters if (rskip > 0) { --rskip; } else if (rfill < rlimit) { --- 886,924 ---- if ((match_flags & (IS_METHOD | IS_CONSTRUCTOR)) != 0) { // watch out for these guys: Symbol* init_name = vmSymbols::object_initializer_name(); Symbol* clinit_name = vmSymbols::class_initializer_name(); ! if (name->equals(clinit_name)) clinit_name = NULL; // hack for exposing <clinit> 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->not_equals(init_name)) { return 0; // no constructors of this method name } } else if (!(match_flags & IS_CONSTRUCTOR)) { // methods only if (name == NULL) { name = init_name; negate_name_test = true; // if we see the name, we *omit* the entry ! } else if (name->equals(init_name)) { return 0; // no methods of this constructor name } } else { // caller will accept either sort; no need to adjust name } for (MethodStream st(k(), local_only, !search_intfc); !st.eos(); st.next()) { Method* m = st.method(); Symbol* m_name = m->name(); ! if (m_name->equals(clinit_name)) continue; ! if (name->not_equals(NULL) && ((m_name->not_equals(name)) ^ negate_name_test)) continue; ! if (sig->not_equals(NULL) && m->signature()->not_equals(sig)) continue; // passed the filters if (rskip > 0) { --rskip; } else if (rfill < rlimit) {
src/share/vm/prims/methodHandles.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File