src/share/vm/ci/ciMethod.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6930772 Sdiff src/share/vm/ci

src/share/vm/ci/ciMethod.cpp

Print this page




 675   if (count > 0 && method_data() != NULL) {
 676     int current_mileage = method_data()->current_mileage();
 677     int creation_mileage = method_data()->creation_mileage();
 678     int counter_life = current_mileage - creation_mileage;
 679     int method_life = interpreter_invocation_count();
 680     // counter_life due to backedge_counter could be > method_life
 681     if (counter_life > method_life)
 682       counter_life = method_life;
 683     if (0 < counter_life && counter_life <= method_life) {
 684       count = (int)((double)count * prof_factor * method_life / counter_life + 0.5);
 685       count = (count > 0) ? count : 1;
 686     }
 687   }
 688   return count;
 689 }
 690 
 691 // ------------------------------------------------------------------
 692 // invokedynamic support
 693 //
 694 bool ciMethod::is_method_handle_invoke() const {
 695   check_is_loaded();
 696   bool flag = ((flags().as_int() & JVM_MH_INVOKE_BITS) == JVM_MH_INVOKE_BITS);

 697 #ifdef ASSERT


 698   {
 699     VM_ENTRY_MARK;
 700     bool flag2 = get_methodOop()->is_method_handle_invoke();
 701     assert(flag == flag2, "consistent");


 702   }
 703 #endif //ASSERT
 704   return flag;
 705 }
 706 
 707 bool ciMethod::is_method_handle_adapter() const {
 708   check_is_loaded();
 709   VM_ENTRY_MARK;
 710   return get_methodOop()->is_method_handle_adapter();
 711 }
 712 
 713 ciInstance* ciMethod::method_handle_type() {
 714   check_is_loaded();
 715   VM_ENTRY_MARK;
 716   oop mtype = get_methodOop()->method_handle_type();
 717   return CURRENT_THREAD_ENV->get_object(mtype)->as_instance();
 718 }
 719 
 720 
 721 // ------------------------------------------------------------------




 675   if (count > 0 && method_data() != NULL) {
 676     int current_mileage = method_data()->current_mileage();
 677     int creation_mileage = method_data()->creation_mileage();
 678     int counter_life = current_mileage - creation_mileage;
 679     int method_life = interpreter_invocation_count();
 680     // counter_life due to backedge_counter could be > method_life
 681     if (counter_life > method_life)
 682       counter_life = method_life;
 683     if (0 < counter_life && counter_life <= method_life) {
 684       count = (int)((double)count * prof_factor * method_life / counter_life + 0.5);
 685       count = (count > 0) ? count : 1;
 686     }
 687   }
 688   return count;
 689 }
 690 
 691 // ------------------------------------------------------------------
 692 // invokedynamic support
 693 //
 694 bool ciMethod::is_method_handle_invoke() const {
 695   bool flag = ((holder()->name() == ciSymbol::java_dyn_MethodHandle() &&
 696                 name()           == ciSymbol::invoke_name()) ||
 697                holder()->name() == ciSymbol::java_dyn_InvokeDynamic());
 698 #ifdef ASSERT
 699   if (is_loaded()) {
 700     bool flag2 = ((flags().as_int() & JVM_MH_INVOKE_BITS) == JVM_MH_INVOKE_BITS);
 701     {
 702       VM_ENTRY_MARK;
 703       bool flag3 = get_methodOop()->is_method_handle_invoke();
 704       assert(flag2 == flag3, "consistent");
 705       assert(flag  == flag3, "consistent");
 706     }
 707   }
 708 #endif //ASSERT
 709   return flag;
 710 }
 711 
 712 bool ciMethod::is_method_handle_adapter() const {
 713   check_is_loaded();
 714   VM_ENTRY_MARK;
 715   return get_methodOop()->is_method_handle_adapter();
 716 }
 717 
 718 ciInstance* ciMethod::method_handle_type() {
 719   check_is_loaded();
 720   VM_ENTRY_MARK;
 721   oop mtype = get_methodOop()->method_handle_type();
 722   return CURRENT_THREAD_ENV->get_object(mtype)->as_instance();
 723 }
 724 
 725 
 726 // ------------------------------------------------------------------


src/share/vm/ci/ciMethod.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File