< prev index next >

src/hotspot/share/oops/methodData.hpp

Print this page




 541   friend class JVMCIVMStructs;
 542 protected:
 543   enum {
 544     count_off,
 545     counter_cell_count
 546   };
 547 public:
 548   CounterData(DataLayout* layout) : BitData(layout) {}
 549 
 550   virtual bool is_CounterData() const { return true; }
 551 
 552   static int static_cell_count() {
 553     return counter_cell_count;
 554   }
 555 
 556   virtual int cell_count() const {
 557     return static_cell_count();
 558   }
 559 
 560   // Direct accessor
 561   uint count() const {
 562     return uint_at(count_off);






 563   }
 564 
 565   // Code generation support
 566   static ByteSize count_offset() {
 567     return cell_offset(count_off);
 568   }
 569   static ByteSize counter_data_size() {
 570     return cell_offset(counter_cell_count);
 571   }
 572 
 573   void set_count(uint count) {
 574     set_uint_at(count_off, count);
 575   }
 576 
 577   void print_data_on(outputStream* st, const char* extra = NULL) const;
 578 };
 579 
 580 // JumpData
 581 //
 582 // A JumpData is used to access profiling information for a direct
 583 // branch.  It is a counter, used for counting the number of branches,
 584 // plus a data displacement, used for realigning the data pointer to
 585 // the corresponding target bci.
 586 class JumpData : public ProfileData {
 587   friend class VMStructs;
 588   friend class JVMCIVMStructs;
 589 protected:
 590   enum {
 591     taken_off_set,
 592     displacement_off_set,
 593     jump_cell_count
 594   };




 541   friend class JVMCIVMStructs;
 542 protected:
 543   enum {
 544     count_off,
 545     counter_cell_count
 546   };
 547 public:
 548   CounterData(DataLayout* layout) : BitData(layout) {}
 549 
 550   virtual bool is_CounterData() const { return true; }
 551 
 552   static int static_cell_count() {
 553     return counter_cell_count;
 554   }
 555 
 556   virtual int cell_count() const {
 557     return static_cell_count();
 558   }
 559 
 560   // Direct accessor
 561   int count() const {
 562     intptr_t raw_data = intptr_at(count_off);
 563     if (raw_data > max_jint) {
 564       raw_data = max_jint;
 565     } else if (raw_data < min_jint) {
 566       raw_data = min_jint;
 567     }
 568     return int(raw_data);
 569   }
 570 
 571   // Code generation support
 572   static ByteSize count_offset() {
 573     return cell_offset(count_off);
 574   }
 575   static ByteSize counter_data_size() {
 576     return cell_offset(counter_cell_count);
 577   }
 578 
 579   void set_count(int count) {
 580     set_int_at(count_off, count);
 581   }
 582 
 583   void print_data_on(outputStream* st, const char* extra = NULL) const;
 584 };
 585 
 586 // JumpData
 587 //
 588 // A JumpData is used to access profiling information for a direct
 589 // branch.  It is a counter, used for counting the number of branches,
 590 // plus a data displacement, used for realigning the data pointer to
 591 // the corresponding target bci.
 592 class JumpData : public ProfileData {
 593   friend class VMStructs;
 594   friend class JVMCIVMStructs;
 595 protected:
 596   enum {
 597     taken_off_set,
 598     displacement_off_set,
 599     jump_cell_count
 600   };


< prev index next >