diff -r 5435e77aa3df -r b862d1f189bd hotspot/src/share/vm/ci/ciMethod.cpp --- a/hotspot/src/share/vm/ci/ciMethod.cpp Thu May 20 06:34:23 2010 -0700 +++ b/hotspot/src/share/vm/ci/ciMethod.cpp Fri May 21 02:59:24 2010 -0700 @@ -690,20 +690,32 @@ // ------------------------------------------------------------------ // invokedynamic support + +// ------------------------------------------------------------------ +// ciMethod::is_method_handle_invoke // +// Return true if the method is a MethodHandle target. bool ciMethod::is_method_handle_invoke() const { - check_is_loaded(); - bool flag = ((flags().as_int() & JVM_MH_INVOKE_BITS) == JVM_MH_INVOKE_BITS); + bool flag = (holder()->name() == ciSymbol::java_dyn_MethodHandle() && + methodOopDesc::is_method_handle_invoke_name(name()->sid())); #ifdef ASSERT - { - VM_ENTRY_MARK; - bool flag2 = get_methodOop()->is_method_handle_invoke(); - assert(flag == flag2, "consistent"); + if (is_loaded()) { + bool flag2 = ((flags().as_int() & JVM_MH_INVOKE_BITS) == JVM_MH_INVOKE_BITS); + { + VM_ENTRY_MARK; + bool flag3 = get_methodOop()->is_method_handle_invoke(); + assert(flag2 == flag3, "consistent"); + assert(flag == flag3, "consistent"); + } } #endif //ASSERT return flag; } +// ------------------------------------------------------------------ +// ciMethod::is_method_handle_adapter +// +// Return true if the method is a generated MethodHandle adapter. bool ciMethod::is_method_handle_adapter() const { check_is_loaded(); VM_ENTRY_MARK;