1.1 --- a/src/share/vm/ci/ciMethod.cpp Fri Jul 16 08:29:42 2010 -0700 1.2 +++ b/src/share/vm/ci/ciMethod.cpp Fri Jul 16 18:14:19 2010 -0700 1.3 @@ -694,30 +694,21 @@ 1.4 // ------------------------------------------------------------------ 1.5 // ciMethod::is_method_handle_invoke 1.6 // 1.7 -// Return true if the method is a MethodHandle target. 1.8 +// Return true if the method is an instance of one of the two 1.9 +// signature-polymorphic MethodHandle methods, invokeExact or invokeGeneric. 1.10 bool ciMethod::is_method_handle_invoke() const { 1.11 - bool flag = (holder()->name() == ciSymbol::java_dyn_MethodHandle() && 1.12 - methodOopDesc::is_method_handle_invoke_name(name()->sid())); 1.13 -#ifdef ASSERT 1.14 - if (is_loaded()) { 1.15 - bool flag2 = ((flags().as_int() & JVM_MH_INVOKE_BITS) == JVM_MH_INVOKE_BITS); 1.16 - { 1.17 - VM_ENTRY_MARK; 1.18 - bool flag3 = get_methodOop()->is_method_handle_invoke(); 1.19 - assert(flag2 == flag3, "consistent"); 1.20 - assert(flag == flag3, "consistent"); 1.21 - } 1.22 - } 1.23 -#endif //ASSERT 1.24 - return flag; 1.25 + if (!is_loaded()) return false; 1.26 + VM_ENTRY_MARK; 1.27 + return get_methodOop()->is_method_handle_invoke(); 1.28 } 1.29 1.30 // ------------------------------------------------------------------ 1.31 // ciMethod::is_method_handle_adapter 1.32 // 1.33 // Return true if the method is a generated MethodHandle adapter. 1.34 +// These are built by MethodHandleCompiler. 1.35 bool ciMethod::is_method_handle_adapter() const { 1.36 - check_is_loaded(); 1.37 + if (!is_loaded()) return false; 1.38 VM_ENTRY_MARK; 1.39 return get_methodOop()->is_method_handle_adapter(); 1.40 }