comparison src/share/vm/ci/ciMethod.cpp @ 1662:e0ba4e04c839

6969574: invokedynamic call sites deoptimize instead of executing Reviewed-by: kvn
author jrose
date Fri, 16 Jul 2010 18:14:19 -0700
parents 8099e71601df
children d2ede61b7a12
comparison
equal deleted inserted replaced
1661:01b172b8cd7c 1662:e0ba4e04c839
692 // invokedynamic support 692 // invokedynamic support
693 693
694 // ------------------------------------------------------------------ 694 // ------------------------------------------------------------------
695 // ciMethod::is_method_handle_invoke 695 // ciMethod::is_method_handle_invoke
696 // 696 //
697 // Return true if the method is a MethodHandle target. 697 // Return true if the method is an instance of one of the two
698 // signature-polymorphic MethodHandle methods, invokeExact or invokeGeneric.
698 bool ciMethod::is_method_handle_invoke() const { 699 bool ciMethod::is_method_handle_invoke() const {
699 bool flag = (holder()->name() == ciSymbol::java_dyn_MethodHandle() && 700 if (!is_loaded()) return false;
700 methodOopDesc::is_method_handle_invoke_name(name()->sid())); 701 VM_ENTRY_MARK;
701 #ifdef ASSERT 702 return get_methodOop()->is_method_handle_invoke();
702 if (is_loaded()) {
703 bool flag2 = ((flags().as_int() & JVM_MH_INVOKE_BITS) == JVM_MH_INVOKE_BITS);
704 {
705 VM_ENTRY_MARK;
706 bool flag3 = get_methodOop()->is_method_handle_invoke();
707 assert(flag2 == flag3, "consistent");
708 assert(flag == flag3, "consistent");
709 }
710 }
711 #endif //ASSERT
712 return flag;
713 } 703 }
714 704
715 // ------------------------------------------------------------------ 705 // ------------------------------------------------------------------
716 // ciMethod::is_method_handle_adapter 706 // ciMethod::is_method_handle_adapter
717 // 707 //
718 // Return true if the method is a generated MethodHandle adapter. 708 // Return true if the method is a generated MethodHandle adapter.
709 // These are built by MethodHandleCompiler.
719 bool ciMethod::is_method_handle_adapter() const { 710 bool ciMethod::is_method_handle_adapter() const {
720 check_is_loaded(); 711 if (!is_loaded()) return false;
721 VM_ENTRY_MARK; 712 VM_ENTRY_MARK;
722 return get_methodOop()->is_method_handle_adapter(); 713 return get_methodOop()->is_method_handle_adapter();
723 } 714 }
724 715
725 ciInstance* ciMethod::method_handle_type() { 716 ciInstance* ciMethod::method_handle_type() {