670 int ciMethod::scale_count(int count, float prof_factor) {
671 if (count > 0 && method_data() != NULL) {
672 int current_mileage = method_data()->current_mileage();
673 int creation_mileage = method_data()->creation_mileage();
674 int counter_life = current_mileage - creation_mileage;
675 int method_life = interpreter_invocation_count();
676 // counter_life due to backedge_counter could be > method_life
677 if (counter_life > method_life)
678 counter_life = method_life;
679 if (0 < counter_life && counter_life <= method_life) {
680 count = (int)((double)count * prof_factor * method_life / counter_life + 0.5);
681 count = (count > 0) ? count : 1;
682 }
683 }
684 return count;
685 }
686
687 // ------------------------------------------------------------------
688 // invokedynamic support
689 //
690 bool ciMethod::is_method_handle_invoke() {
691 check_is_loaded();
692 bool flag = ((flags().as_int() & JVM_MH_INVOKE_BITS) == JVM_MH_INVOKE_BITS);
693 #ifdef ASSERT
694 {
695 VM_ENTRY_MARK;
696 bool flag2 = get_methodOop()->is_method_handle_invoke();
697 assert(flag == flag2, "consistent");
698 }
699 #endif //ASSERT
700 return flag;
701 }
702
703 ciInstance* ciMethod::method_handle_type() {
704 check_is_loaded();
705 VM_ENTRY_MARK;
706 oop mtype = get_methodOop()->method_handle_type();
707 return CURRENT_THREAD_ENV->get_object(mtype)->as_instance();
708 }
709
710
|
670 int ciMethod::scale_count(int count, float prof_factor) {
671 if (count > 0 && method_data() != NULL) {
672 int current_mileage = method_data()->current_mileage();
673 int creation_mileage = method_data()->creation_mileage();
674 int counter_life = current_mileage - creation_mileage;
675 int method_life = interpreter_invocation_count();
676 // counter_life due to backedge_counter could be > method_life
677 if (counter_life > method_life)
678 counter_life = method_life;
679 if (0 < counter_life && counter_life <= method_life) {
680 count = (int)((double)count * prof_factor * method_life / counter_life + 0.5);
681 count = (count > 0) ? count : 1;
682 }
683 }
684 return count;
685 }
686
687 // ------------------------------------------------------------------
688 // invokedynamic support
689 //
690 bool ciMethod::is_method_handle_invoke() const {
691 check_is_loaded();
692 bool flag = ((flags().as_int() & JVM_MH_INVOKE_BITS) == JVM_MH_INVOKE_BITS);
693 #ifdef ASSERT
694 {
695 VM_ENTRY_MARK;
696 bool flag2 = get_methodOop()->is_method_handle_invoke();
697 assert(flag == flag2, "consistent");
698 }
699 #endif //ASSERT
700 return flag;
701 }
702
703 ciInstance* ciMethod::method_handle_type() {
704 check_is_loaded();
705 VM_ENTRY_MARK;
706 oop mtype = get_methodOop()->method_handle_type();
707 return CURRENT_THREAD_ENV->get_object(mtype)->as_instance();
708 }
709
710
|