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
|
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 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 uint(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(uint count) {
580 set_uint_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
|