735 profile_taken_branch(jsr_bci); 736 737 // The way we do things now, there is only one successor block 738 // for the jsr, because the target code is cloned by ciTypeFlow. 739 Block* target = successor_for_bci(jsr_bci); 740 741 // What got pushed? 742 const Type* ret_addr = target->peek(); 743 assert(ret_addr->singleton(), "must be a constant (cloned jsr body)"); 744 745 // Effect on jsr on stack 746 push(_gvn.makecon(ret_addr)); 747 748 // Flow to the jsr. 749 merge(jsr_bci); 750 } 751 752 // Handle ret bytecode 753 void Parse::do_ret() { 754 // Find to whom we return. 755 #if 0 // %%%% MAKE THIS WORK 756 Node* con = local(); 757 const TypePtr* tp = con->bottom_type()->isa_ptr(); 758 assert(tp && tp->singleton(), ""); 759 int return_bci = (int) tp->get_con(); 760 merge(return_bci); 761 #else 762 assert(block()->num_successors() == 1, "a ret can only go one place now"); 763 Block* target = block()->successor_at(0); 764 assert(!target->is_ready(), "our arrival must be expected"); 765 profile_ret(target->flow()->start()); 766 int pnum = target->next_path_num(); 767 merge_common(target, pnum); 768 #endif 769 } 770 771 //--------------------------dynamic_branch_prediction-------------------------- 772 // Try to gather dynamic branch prediction behavior. Return a probability 773 // of the branch being taken and set the "cnt" field. Returns a -1.0 774 // if we need to use static prediction for some reason. 775 float Parse::dynamic_branch_prediction(float &cnt) { 776 ResourceMark rm; 777 778 cnt = COUNT_UNKNOWN; 779 780 // Use MethodData information if it is available 781 // FIXME: free the ProfileData structure 782 ciMethodData* methodData = method()->method_data(); 783 if (!methodData->is_mature()) return PROB_UNKNOWN; 784 ciProfileData* data = methodData->bci_to_data(bci()); 785 if (!data->is_JumpData()) return PROB_UNKNOWN; 786 787 // get taken and not taken values 788 int taken = data->as_JumpData()->taken(); | 735 profile_taken_branch(jsr_bci); 736 737 // The way we do things now, there is only one successor block 738 // for the jsr, because the target code is cloned by ciTypeFlow. 739 Block* target = successor_for_bci(jsr_bci); 740 741 // What got pushed? 742 const Type* ret_addr = target->peek(); 743 assert(ret_addr->singleton(), "must be a constant (cloned jsr body)"); 744 745 // Effect on jsr on stack 746 push(_gvn.makecon(ret_addr)); 747 748 // Flow to the jsr. 749 merge(jsr_bci); 750 } 751 752 // Handle ret bytecode 753 void Parse::do_ret() { 754 // Find to whom we return. 755 assert(block()->num_successors() == 1, "a ret can only go one place now"); 756 Block* target = block()->successor_at(0); 757 assert(!target->is_ready(), "our arrival must be expected"); 758 profile_ret(target->flow()->start()); 759 int pnum = target->next_path_num(); 760 merge_common(target, pnum); 761 } 762 763 //--------------------------dynamic_branch_prediction-------------------------- 764 // Try to gather dynamic branch prediction behavior. Return a probability 765 // of the branch being taken and set the "cnt" field. Returns a -1.0 766 // if we need to use static prediction for some reason. 767 float Parse::dynamic_branch_prediction(float &cnt) { 768 ResourceMark rm; 769 770 cnt = COUNT_UNKNOWN; 771 772 // Use MethodData information if it is available 773 // FIXME: free the ProfileData structure 774 ciMethodData* methodData = method()->method_data(); 775 if (!methodData->is_mature()) return PROB_UNKNOWN; 776 ciProfileData* data = methodData->bci_to_data(bci()); 777 if (!data->is_JumpData()) return PROB_UNKNOWN; 778 779 // get taken and not taken values 780 int taken = data->as_JumpData()->taken(); |