comparison src/share/vm/oops/methodData.hpp @ 22572:c3b49e9d0f48

HotSpotMethodData shouldn't hardcode constants
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Thu, 17 Sep 2015 12:10:17 -0700
parents c28cb37b2e1d
children 5796b1867b68
comparison
equal deleted inserted replaced
22571:8dddd3b5ff37 22572:c3b49e9d0f48
535 535
536 // BitData 536 // BitData
537 // 537 //
538 // A BitData holds a flag or two in its header. 538 // A BitData holds a flag or two in its header.
539 class BitData : public ProfileData { 539 class BitData : public ProfileData {
540 friend class VMStructs;
540 protected: 541 protected:
541 enum { 542 enum {
542 // null_seen: 543 // null_seen:
543 // saw a null operand (cast/aastore/instanceof) 544 // saw a null operand (cast/aastore/instanceof)
544 null_seen_flag = DataLayout::first_flag + 0 545 null_seen_flag = DataLayout::first_flag + 0
606 607
607 // CounterData 608 // CounterData
608 // 609 //
609 // A CounterData corresponds to a simple counter. 610 // A CounterData corresponds to a simple counter.
610 class CounterData : public BitData { 611 class CounterData : public BitData {
612 friend class VMStructs;
611 protected: 613 protected:
612 enum { 614 enum {
613 count_off, 615 count_off,
614 counter_cell_count 616 counter_cell_count
615 }; 617 };
672 // A JumpData is used to access profiling information for a direct 674 // A JumpData is used to access profiling information for a direct
673 // branch. It is a counter, used for counting the number of branches, 675 // branch. It is a counter, used for counting the number of branches,
674 // plus a data displacement, used for realigning the data pointer to 676 // plus a data displacement, used for realigning the data pointer to
675 // the corresponding target bci. 677 // the corresponding target bci.
676 class JumpData : public ProfileData { 678 class JumpData : public ProfileData {
679 friend class VMStructs;
677 protected: 680 protected:
678 enum { 681 enum {
679 taken_off_set, 682 taken_off_set,
680 displacement_off_set, 683 displacement_off_set,
681 jump_cell_count 684 jump_cell_count
1175 // A ReceiverTypeData is used to access profiling information about a 1178 // A ReceiverTypeData is used to access profiling information about a
1176 // dynamic type check. It consists of a counter which counts the total times 1179 // dynamic type check. It consists of a counter which counts the total times
1177 // that the check is reached, and a series of (Klass*, count) pairs 1180 // that the check is reached, and a series of (Klass*, count) pairs
1178 // which are used to store a type profile for the receiver of the check. 1181 // which are used to store a type profile for the receiver of the check.
1179 class ReceiverTypeData : public CounterData { 1182 class ReceiverTypeData : public CounterData {
1183 friend class VMStructs;
1180 protected: 1184 protected:
1181 enum { 1185 enum {
1182 #if INCLUDE_JVMCI 1186 #if INCLUDE_JVMCI
1183 // Description of the different counters 1187 // Description of the different counters
1184 // ReceiverTypeData for instanceof/checkcast/aastore: 1188 // ReceiverTypeData for instanceof/checkcast/aastore:
1351 // VirtualCallData 1355 // VirtualCallData
1352 // 1356 //
1353 // A VirtualCallData is used to access profiling information about a 1357 // A VirtualCallData is used to access profiling information about a
1354 // virtual call. For now, it has nothing more than a ReceiverTypeData. 1358 // virtual call. For now, it has nothing more than a ReceiverTypeData.
1355 class VirtualCallData : public ReceiverTypeData { 1359 class VirtualCallData : public ReceiverTypeData {
1360 friend class VMStructs;
1356 public: 1361 public:
1357 VirtualCallData(DataLayout* layout) : ReceiverTypeData(layout) { 1362 VirtualCallData(DataLayout* layout) : ReceiverTypeData(layout) {
1358 assert(layout->tag() == DataLayout::virtual_call_data_tag || 1363 assert(layout->tag() == DataLayout::virtual_call_data_tag ||
1359 layout->tag() == DataLayout::virtual_call_type_data_tag, "wrong type"); 1364 layout->tag() == DataLayout::virtual_call_type_data_tag, "wrong type");
1360 } 1365 }
1453 // 1458 //
1454 // A VirtualCallTypeData is used to access profiling information about 1459 // A VirtualCallTypeData is used to access profiling information about
1455 // a virtual call for which we collect type information about 1460 // a virtual call for which we collect type information about
1456 // arguments and return value. 1461 // arguments and return value.
1457 class VirtualCallTypeData : public VirtualCallData { 1462 class VirtualCallTypeData : public VirtualCallData {
1463 friend class VMStructs;
1458 private: 1464 private:
1459 // entries for arguments if any 1465 // entries for arguments if any
1460 TypeStackSlotEntries _args; 1466 TypeStackSlotEntries _args;
1461 // entry for return type if any 1467 // entry for return type if any
1462 ReturnTypeEntry _ret; 1468 ReturnTypeEntry _ret;
1682 // 1688 //
1683 // A BranchData is used to access profiling data for a two-way branch. 1689 // A BranchData is used to access profiling data for a two-way branch.
1684 // It consists of taken and not_taken counts as well as a data displacement 1690 // It consists of taken and not_taken counts as well as a data displacement
1685 // for the taken case. 1691 // for the taken case.
1686 class BranchData : public JumpData { 1692 class BranchData : public JumpData {
1693 friend class VMStructs;
1687 protected: 1694 protected:
1688 enum { 1695 enum {
1689 not_taken_off_set = jump_cell_count, 1696 not_taken_off_set = jump_cell_count,
1690 branch_cell_count 1697 branch_cell_count
1691 }; 1698 };
1760 // 1767 //
1761 // A ArrayData is a base class for accessing profiling data which does 1768 // A ArrayData is a base class for accessing profiling data which does
1762 // not have a statically known size. It consists of an array length 1769 // not have a statically known size. It consists of an array length
1763 // and an array start. 1770 // and an array start.
1764 class ArrayData : public ProfileData { 1771 class ArrayData : public ProfileData {
1772 friend class VMStructs;
1765 protected: 1773 protected:
1766 friend class DataLayout; 1774 friend class DataLayout;
1767 1775
1768 enum { 1776 enum {
1769 array_len_off_set, 1777 array_len_off_set,
1837 // A MultiBranchData is used to access profiling information for 1845 // A MultiBranchData is used to access profiling information for
1838 // a multi-way branch (*switch bytecodes). It consists of a series 1846 // a multi-way branch (*switch bytecodes). It consists of a series
1839 // of (count, displacement) pairs, which count the number of times each 1847 // of (count, displacement) pairs, which count the number of times each
1840 // case was taken and specify the data displacment for each branch target. 1848 // case was taken and specify the data displacment for each branch target.
1841 class MultiBranchData : public ArrayData { 1849 class MultiBranchData : public ArrayData {
1850 friend class VMStructs;
1842 protected: 1851 protected:
1843 enum { 1852 enum {
1844 default_count_off_set, 1853 default_count_off_set,
1845 default_disaplacement_off_set, 1854 default_disaplacement_off_set,
1846 case_array_start 1855 case_array_start