583 public: 584 JumpData(DataLayout* layout) : ProfileData(layout) { 585 assert(layout->tag() == DataLayout::jump_data_tag || 586 layout->tag() == DataLayout::branch_data_tag, "wrong type"); 587 } 588 589 virtual bool is_JumpData() { return true; } 590 591 static int static_cell_count() { 592 return jump_cell_count; 593 } 594 595 virtual int cell_count() { 596 return static_cell_count(); 597 } 598 599 // Direct accessor 600 uint taken() { 601 return uint_at(taken_off_set); 602 } 603 // Saturating counter 604 uint inc_taken() { 605 uint cnt = taken() + 1; 606 // Did we wrap? Will compiler screw us?? 607 if (cnt == 0) cnt--; 608 set_uint_at(taken_off_set, cnt); 609 return cnt; 610 } 611 612 int displacement() { 613 return int_at(displacement_off_set); 614 } 615 616 // Code generation support 617 static ByteSize taken_offset() { 618 return cell_offset(taken_off_set); 619 } 620 621 static ByteSize displacement_offset() { 622 return cell_offset(displacement_off_set); 909 public: 910 BranchData(DataLayout* layout) : JumpData(layout) { 911 assert(layout->tag() == DataLayout::branch_data_tag, "wrong type"); 912 } 913 914 virtual bool is_BranchData() { return true; } 915 916 static int static_cell_count() { 917 return branch_cell_count; 918 } 919 920 virtual int cell_count() { 921 return static_cell_count(); 922 } 923 924 // Direct accessor 925 uint not_taken() { 926 return uint_at(not_taken_off_set); 927 } 928 929 uint inc_not_taken() { 930 uint cnt = not_taken() + 1; 931 // Did we wrap? Will compiler screw us?? 932 if (cnt == 0) cnt--; 933 set_uint_at(not_taken_off_set, cnt); 934 return cnt; 935 } 936 937 // Code generation support 938 static ByteSize not_taken_offset() { 939 return cell_offset(not_taken_off_set); 940 } 941 static ByteSize branch_data_size() { 942 return cell_offset(branch_cell_count); 943 } 944 945 // Specific initialization. 946 void post_initialize(BytecodeStream* stream, methodDataOop mdo); 947 948 #ifndef PRODUCT | 583 public: 584 JumpData(DataLayout* layout) : ProfileData(layout) { 585 assert(layout->tag() == DataLayout::jump_data_tag || 586 layout->tag() == DataLayout::branch_data_tag, "wrong type"); 587 } 588 589 virtual bool is_JumpData() { return true; } 590 591 static int static_cell_count() { 592 return jump_cell_count; 593 } 594 595 virtual int cell_count() { 596 return static_cell_count(); 597 } 598 599 // Direct accessor 600 uint taken() { 601 return uint_at(taken_off_set); 602 } 603 604 void set_taken(uint cnt) { 605 set_uint_at(taken_off_set, cnt); 606 } 607 608 // Saturating counter 609 uint inc_taken() { 610 uint cnt = taken() + 1; 611 // Did we wrap? Will compiler screw us?? 612 if (cnt == 0) cnt--; 613 set_uint_at(taken_off_set, cnt); 614 return cnt; 615 } 616 617 int displacement() { 618 return int_at(displacement_off_set); 619 } 620 621 // Code generation support 622 static ByteSize taken_offset() { 623 return cell_offset(taken_off_set); 624 } 625 626 static ByteSize displacement_offset() { 627 return cell_offset(displacement_off_set); 914 public: 915 BranchData(DataLayout* layout) : JumpData(layout) { 916 assert(layout->tag() == DataLayout::branch_data_tag, "wrong type"); 917 } 918 919 virtual bool is_BranchData() { return true; } 920 921 static int static_cell_count() { 922 return branch_cell_count; 923 } 924 925 virtual int cell_count() { 926 return static_cell_count(); 927 } 928 929 // Direct accessor 930 uint not_taken() { 931 return uint_at(not_taken_off_set); 932 } 933 934 void set_not_taken(uint cnt) { 935 set_uint_at(not_taken_off_set, cnt); 936 } 937 938 uint inc_not_taken() { 939 uint cnt = not_taken() + 1; 940 // Did we wrap? Will compiler screw us?? 941 if (cnt == 0) cnt--; 942 set_uint_at(not_taken_off_set, cnt); 943 return cnt; 944 } 945 946 // Code generation support 947 static ByteSize not_taken_offset() { 948 return cell_offset(not_taken_off_set); 949 } 950 static ByteSize branch_data_size() { 951 return cell_offset(branch_cell_count); 952 } 953 954 // Specific initialization. 955 void post_initialize(BytecodeStream* stream, methodDataOop mdo); 956 957 #ifndef PRODUCT |