hotspot/src/share/vm/ci/ciMethodData.hpp
changeset 20709 034be898bf04
parent 20702 bbe0fcde6e13
child 21095 1a04f7b3946e
equal deleted inserted replaced
20708:d150e1293886 20709:034be898bf04
   102 #ifndef PRODUCT
   102 #ifndef PRODUCT
   103   void print_data_on(outputStream* st) const;
   103   void print_data_on(outputStream* st) const;
   104 #endif
   104 #endif
   105 };
   105 };
   106 
   106 
       
   107 class ciReturnTypeEntry : public ReturnTypeEntry, ciTypeEntries {
       
   108 public:
       
   109   void translate_type_data_from(const ReturnTypeEntry* ret);
       
   110 
       
   111   ciKlass* valid_type() const {
       
   112     return valid_ciklass(type());
       
   113   }
       
   114 
       
   115 #ifndef PRODUCT
       
   116   void print_data_on(outputStream* st) const;
       
   117 #endif
       
   118 };
       
   119 
   107 class ciCallTypeData : public CallTypeData {
   120 class ciCallTypeData : public CallTypeData {
   108 public:
   121 public:
   109   ciCallTypeData(DataLayout* layout) : CallTypeData(layout) {}
   122   ciCallTypeData(DataLayout* layout) : CallTypeData(layout) {}
   110 
   123 
   111   ciTypeStackSlotEntries* args() const { return (ciTypeStackSlotEntries*)CallTypeData::args(); }
   124   ciTypeStackSlotEntries* args() const { return (ciTypeStackSlotEntries*)CallTypeData::args(); }
   112 
   125   ciReturnTypeEntry* ret() const { return (ciReturnTypeEntry*)CallTypeData::ret(); }
   113   virtual void translate_from(const ProfileData* data) {
   126 
   114     args()->translate_type_data_from(data->as_CallTypeData()->args());
   127   void translate_type_data_from(const ProfileData* data) {
       
   128     if (has_arguments()) {
       
   129       args()->translate_type_data_from(data->as_CallTypeData()->args());
       
   130     }
       
   131     if (has_return()) {
       
   132       ret()->translate_type_data_from(data->as_CallTypeData()->ret());
       
   133     }
       
   134   }
       
   135 
       
   136   intptr_t argument_type(int i) const {
       
   137     assert(has_arguments(), "no arg type profiling data");
       
   138     return args()->type(i);
   115   }
   139   }
   116 
   140 
   117   ciKlass* valid_argument_type(int i) const {
   141   ciKlass* valid_argument_type(int i) const {
       
   142     assert(has_arguments(), "no arg type profiling data");
   118     return args()->valid_type(i);
   143     return args()->valid_type(i);
       
   144   }
       
   145 
       
   146   intptr_t return_type() const {
       
   147     assert(has_return(), "no ret type profiling data");
       
   148     return ret()->type();
       
   149   }
       
   150 
       
   151   ciKlass* valid_return_type() const {
       
   152     assert(has_return(), "no ret type profiling data");
       
   153     return ret()->valid_type();
   119   }
   154   }
   120 
   155 
   121 #ifndef PRODUCT
   156 #ifndef PRODUCT
   122   void print_data_on(outputStream* st) const;
   157   void print_data_on(outputStream* st) const;
   123 #endif
   158 #endif
   177 
   212 
   178 class ciVirtualCallTypeData : public VirtualCallTypeData {
   213 class ciVirtualCallTypeData : public VirtualCallTypeData {
   179 private:
   214 private:
   180   // Fake multiple inheritance...  It's a ciReceiverTypeData also.
   215   // Fake multiple inheritance...  It's a ciReceiverTypeData also.
   181   ciReceiverTypeData* rtd_super() const { return (ciReceiverTypeData*) this; }
   216   ciReceiverTypeData* rtd_super() const { return (ciReceiverTypeData*) this; }
   182 
       
   183 public:
   217 public:
   184   ciVirtualCallTypeData(DataLayout* layout) : VirtualCallTypeData(layout) {}
   218   ciVirtualCallTypeData(DataLayout* layout) : VirtualCallTypeData(layout) {}
   185 
       
   186   ciTypeStackSlotEntries* args() const { return (ciTypeStackSlotEntries*)VirtualCallTypeData::args(); }
       
   187 
   219 
   188   void set_receiver(uint row, ciKlass* recv) {
   220   void set_receiver(uint row, ciKlass* recv) {
   189     rtd_super()->set_receiver(row, recv);
   221     rtd_super()->set_receiver(row, recv);
   190   }
   222   }
   191 
   223 
   192   ciKlass* receiver(uint row) const {
   224   ciKlass* receiver(uint row) const {
   193     return rtd_super()->receiver(row);
   225     return rtd_super()->receiver(row);
   194   }
   226   }
       
   227 
       
   228   ciTypeStackSlotEntries* args() const { return (ciTypeStackSlotEntries*)VirtualCallTypeData::args(); }
       
   229   ciReturnTypeEntry* ret() const { return (ciReturnTypeEntry*)VirtualCallTypeData::ret(); }
   195 
   230 
   196   // Copy & translate from oop based VirtualCallData
   231   // Copy & translate from oop based VirtualCallData
   197   virtual void translate_from(const ProfileData* data) {
   232   virtual void translate_from(const ProfileData* data) {
   198     rtd_super()->translate_receiver_data_from(data);
   233     rtd_super()->translate_receiver_data_from(data);
   199     args()->translate_type_data_from(data->as_VirtualCallTypeData()->args());
   234     if (has_arguments()) {
       
   235       args()->translate_type_data_from(data->as_VirtualCallTypeData()->args());
       
   236     }
       
   237     if (has_return()) {
       
   238       ret()->translate_type_data_from(data->as_VirtualCallTypeData()->ret());
       
   239     }
       
   240   }
       
   241 
       
   242   intptr_t argument_type(int i) const {
       
   243     assert(has_arguments(), "no arg type profiling data");
       
   244     return args()->type(i);
   200   }
   245   }
   201 
   246 
   202   ciKlass* valid_argument_type(int i) const {
   247   ciKlass* valid_argument_type(int i) const {
       
   248     assert(has_arguments(), "no arg type profiling data");
   203     return args()->valid_type(i);
   249     return args()->valid_type(i);
       
   250   }
       
   251 
       
   252   intptr_t return_type() const {
       
   253     assert(has_return(), "no ret type profiling data");
       
   254     return ret()->type();
       
   255   }
       
   256 
       
   257   ciKlass* valid_return_type() const {
       
   258     assert(has_return(), "no ret type profiling data");
       
   259     return ret()->valid_type();
   204   }
   260   }
   205 
   261 
   206 #ifndef PRODUCT
   262 #ifndef PRODUCT
   207   void print_data_on(outputStream* st) const;
   263   void print_data_on(outputStream* st) const;
   208 #endif
   264 #endif
   345   // Again, this is used to determine if a method is trivial.
   401   // Again, this is used to determine if a method is trivial.
   346   void set_compilation_stats(short loops, short blocks);
   402   void set_compilation_stats(short loops, short blocks);
   347   // If the compiler finds a profiled type that is known statically
   403   // If the compiler finds a profiled type that is known statically
   348   // for sure, set it in the MethodData
   404   // for sure, set it in the MethodData
   349   void set_argument_type(int bci, int i, ciKlass* k);
   405   void set_argument_type(int bci, int i, ciKlass* k);
       
   406   void set_return_type(int bci, ciKlass* k);
   350 
   407 
   351   void load_data();
   408   void load_data();
   352 
   409 
   353   // Convert a dp (data pointer) to a di (data index).
   410   // Convert a dp (data pointer) to a di (data index).
   354   int dp_to_di(address dp) {
   411   int dp_to_di(address dp) {